// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:helper.rs
// no-prefer-dynamic
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:custom.rs
// aux-build:helper.rs
// no-prefer-dynamic
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:custom.rs
// aux-build:custom-as-global.rs
// aux-build:helper.rs
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// pretty-expanded FIXME #23616
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
trait Nat {
const VALUE: usize;
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(core_intrinsics)]
use std::intrinsics;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/34997
pub const CST_1: u32 = 0;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(const_let)]
type Array = [u32; { let x = 2; 5 }];
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(const_let)]
enum Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// test that certain things are disallowed in constant functions
#![feature(const_fn, const_let)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/25574
const A: [u8; 4] = *b"fooo";
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/48279
#![feature(min_const_fn)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(const_fn, const_let)]
const fn x() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/27918
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/48821
#![feature(const_fn, const_let)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/46114
#![feature(min_const_fn)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
struct CustomAutoRooterVFTable {
trace: unsafe extern "C" fn(this: *mut i32, trc: *mut u32),
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/37448
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags: -O
fn foo(_: &'static [&'static str]) {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
const FOO: &[u8] = b"foo";
const BAR: &[u8] = &[1, 2, 3];
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/45044
const X: [u8; 1] = [0; 1];
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/43754
#![feature(min_const_fn)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/49181
#[derive(Eq, PartialEq)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(const_transmute)]
use std::mem;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// https://github.com/rust-lang/rust/issues/41898
use std::num::NonZeroU64;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::Generator;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::{GeneratorState, Generator};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::Generator;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::{ Generator, GeneratorState };
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
use std::cell::RefCell;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::{GeneratorState, Generator};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::Generator;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
enum Enum {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
#![feature(generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// ignore-wasm32-bare compiled as panic=abort by default
#![feature(generators, generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
fn _run(bar: &mut i32) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// ignore-emscripten no threads support
// compile-flags: --test
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators, generator_trait)]
use std::ops::{Generator, GeneratorState};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:xcrate-reachable.rs
#![feature(generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:xcrate.rs
#![feature(generators, generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that a borrow that occurs after a yield in the same
// argument list is not treated as live across the yield by
// type-checking.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that box-statements with yields in them work.
#![feature(generators, box_syntax)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(generators)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// revisions:lexical nll
//[nll]compile-flags: -Z disable-nll-user-type-assert
#![cfg_attr(nll, feature(nll))]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Fast path, main can see the concrete type returned.
fn before() -> impl FnMut(i32) {
let mut p = Box::new(0);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
pub trait FakeGenerator {
type Yield;
type Return;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
trait Foo: std::fmt::Debug + Eq {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// revisions: normal nll
//[nll] compile-flags:-Zborrowck=mir
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
struct State;
type Error = ();
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
fn main() {}
fn foo() -> impl std::fmt::Debug { "cake" }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
use std::iter::once;
struct Foo {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Tests for nested self-reference which caused a stack overflow.
use std::fmt::Debug;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![allow(warnings)]
use std::fmt::Debug;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
fn foo<T>(t: T) -> impl Into<[T; { const FOO: usize = 1; FOO }]> {
[t]
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
fn hrtb(f: impl Fn(&u32) -> u32) -> u32 {
f(&22) + f(&44)
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
fn hrtb(f: impl for<'a> Fn(&'a u32) -> &'a u32) -> u32 {
f(&22) + f(&44)
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
use std::fmt::Display;
fn check_display_eq(iter: &Vec<impl Display>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
use std::fmt::Display;
fn check_display_eq(iter: impl IntoIterator<Item = impl Display>) {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
use std::fmt::Debug;
trait InTraitDefnParameters {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
use std::fmt::Display;
fn foo(f: impl Display + Clone) -> String {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:xcrate.rs
extern crate xcrate;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:xcrate.rs
extern crate xcrate;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Regression test for #47153: constants in a generic context (such as
// a trait) used to ICE.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
pub struct DescriptorSet<'a> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
struct WithDrop;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
#![feature(generators, generator_trait)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
#![deny(unused_mut)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
#![deny(unused_mut)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
#![allow(unused_variables)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
struct List<T> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(nll)]
use std::collections::HashMap;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// A test for something that NLL enables. It sometimes happens that
// the `while let` pattern makes some borrows from a variable (in this
// case, `x`) that you need in order to compute the next value for
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+
+// run-pass
//
// ignore-pretty issue #37195
#![feature(non_modrs_mods)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags:-C panic=abort
// aux-build:exit-success-if-unwind.rs
// no-prefer-dynamic
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags:-C panic=abort
// no-prefer-dynamic
// ignore-cloudabi no processes
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags:-C panic=abort
// no-prefer-dynamic
// ignore-macos
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// no-prefer-dynamic
#![feature(panic_unwind)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags:-C lto -C panic=abort
// no-prefer-dynamic
// ignore-cloudabi no processes
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags:-C lto -C panic=unwind
// no-prefer-dynamic
// ignore-cloudabi no processes
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Make sure we don't crash with a cycle error during coherence.
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:cross_crates_defaults.rs
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:go_trait.rs
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that you can list the more specific impl before the more general one.
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that impls on projected self types can resolve overlap, even when the
// projections involve specialization, so long as the associated type is
// provided by the most specialized impl.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Make sure we *can* project non-defaulted associated types
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Tests that we can combine a default impl that supplies one method with a
// full impl that supplies the other, and they can invoke one another.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:go_trait.rs
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that non-method associated functions can be specialized
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Tests a variety of basic specialization scenarios and method
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that specialization works even if only the upstream crate enables it
// aux-build:specialization_cross_crate.rs
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:specialization_cross_crate.rs
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Test that default methods are cascaded correctly
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Ensure that specialization works for impls defined directly on a projection
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that you can list the more specific impl before the more general one.
#![feature(specialization)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Test that impls on projected self types can resolve overlap, even when the
// projections involve specialization, so long as the associated type is
// provided by the most specialized impl.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Regression test for ICE when combining specialized associated types and type
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Make sure we *can* project non-defaulted associated types
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
// Test that you can specialize via an explicit trait hierarchy
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(specialization)]
trait Iterator {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Ensure that provided items are inherited properly even when impls vary in
// type parameters *and* rely on projections, and the type parameters are input
// types on the trait.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Ensure that provided items are inherited properly even when impls vary in
// type parameters *and* rely on projections.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags: -Clto=thin
// no-prefer-dynamic
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:dylib.rs
extern crate dylib;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:msvc-imp-present.rs
// compile-flags: -Z thinlto -C codegen-units=8
// no-prefer-dynamic
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags: -Z thinlto -C codegen-units=8 -O
// ignore-emscripten can't inspect instructions on emscripten
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags: -C codegen-units=8 -O -C lto=thin
// aux-build:thin-lto-inlines-aux.rs
// no-prefer-dynamic
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// compile-flags: -C codegen-units=8 -Z thinlto
// ignore-windows
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// edition:2018
#![feature(decl_macro, uniform_paths)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// edition:2018
#![feature(uniform_paths)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// edition:2018
#![feature(uniform_paths)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// edition:2018
#![feature(uniform_paths)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// edition:2018
#![feature(uniform_paths)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(untagged_unions)]
use std::mem::{size_of, size_of_val, align_of, align_of_val};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
macro_rules! union {
() => (struct S;)
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// aux-build:union.rs
extern crate union;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// ignore-wasm32-bare no libc to test ffi with
#[derive(Clone, Copy)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
union U {
a: u64,
b: u64,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(const_fn)]
type Field1 = (i32, u32);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Some traits can be derived for unions.
#![feature(untagged_unions)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Drop works for union itself.
#![feature(untagged_unions)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
// Drop works for union itself.
#![feature(untagged_unions)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(untagged_unions)]
union MaybeItem<T: Iterator> {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
union U {
a: u8,
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
macro_rules! duplicate {
($i: item) => {
mod m1 {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(core_intrinsics)]
#![feature(untagged_unions)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(untagged_unions)]
#[repr(C)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(untagged_unions)]
#![feature(repr_packed)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#[repr(u32)]
enum Tag { I, F }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
use std::fmt;
union U {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
extern crate core;
use core::f32;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(untagged_unions)]
#![allow(dead_code)]
#![allow(unions_with_drop_fields)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(unsized_locals)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(unsized_locals)]
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(unsized_tuple_coercion, unsized_locals)]
struct A<X: ?Sized>(X);
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// run-pass
+
#![feature(unsized_locals)]
pub fn f0(_f: dyn FnOnce()) {}