// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" }
+#![feature(no_core)]
+#![no_core]
+
pub fn position_dependent_outlives<'a>(x: &'a mut i32, cond: bool) -> &'a mut i32 {
let y = &mut *x;
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
pub fn return_ref_to_local() -> &'static i32 {
let x = 0;
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 {
// { dg-error "subset error, some lifetime constraints need to be added" "" { target *-*-* } .-1 }
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
fn test_move() {
struct A {
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" }
+#![feature(no_core)]
+#![no_core]
+
fn test_move_behind_reference() {
// { dg-error "Cannot move from behind a reference." "" { target *-*-* } .-1 }
struct A {
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
fn test_move_conditional(b1: bool, b2:bool) {
struct A {
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
pub fn use_while_mut() {
let mut x = 0;
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
pub fn use_while_mut_fr(x: &mut i32) -> &mut i32 {
let y = &mut *x;
let z = x; //~ ERROR
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" }
// { dg-enable-nn-line-numbers "" }
+#![feature(no_core)]
+#![no_core]
+
fn foo<'a, 'b>(p: &'b &'a mut usize) -> &'b&'a mut usize {
p
+#![feature(no_core)]
+#![no_core]
+
extern "foobar" {
// { dg-error "invalid ABI: found .foobar." "" { target *-*-* } .-1 }
fn printf(s: *const i8, ...);
// https://doc.rust-lang.org/error_codes/E0045.html
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
extern "Rust" {
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits, lang_items)]
pub unsafe auto trait Send {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits, lang_items)]
pub unsafe auto trait Send {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits, lang_items)]
pub unsafe auto trait Send {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = 5;
let x_is_nonzero = x as bool; // { dg-error "cannot cast .<integer>. as .bool." }
+#![feature(no_core)]
+#![no_core]
+
fn foo(state: &mut [u32; 16], a: usize) {
// { dg-warning "function is never used: .foo." "" { target *-*-* } .-1 }
state[a] = 1;
+#![feature(no_core)]
+#![no_core]
+
pub fn foo() {
[0, 1, 2][1];
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let arr = [];
// { dg-error "type annotations needed" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let xs: [i32; 5] = [1, 2, 3, 4, 5];
let a: bool = xs[0]; // { dg-error "mismatched types, expected .bool. but got .i32." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let array: [i32; 5] = [1, 2, 3];
// { dg-error "mismatched types, expected ..i32; 5.. but got ...integer.; 3.. .E0308." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
mod intrinsics {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
() => { #[cfg(all())] 12 }
}
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
#![crate_name = "specified_name"]
// { dg-final { scan-tree-dump-times {specified_name::main} 1 gimple } }
fn main() {}
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
#[cold]
fn cold_function() -> i32 {
42
+#![feature(no_core)]
+#![no_core]
+
#[deprecated(since="1.0", note="do not use this function")]
fn test1() {}
+#![feature(no_core)]
+#![no_core]
+
#[deprecated(since="1.0")]
fn test1() {}
+#![feature(no_core)]
+#![no_core]
+
// { dg-error "valid forms for the attribute are ...doc.hidden.inline....... and ...doc = . string ..." "" { target *-*-* } .+1 }
#[doc]
trait MyTrait {}
+#![feature(no_core)]
+#![no_core]
+
#[cfg_attr(target_arch = "x86_64", path = (target_arch = "x86", path = "x86.rs"))]
mod imp {}
// { dg-error "malformed .path. attribute input" "" { target *-*-* } .-2 }
+#![feature(no_core)]
+#![no_core]
+
auto trait Valid {} // { dg-error "auto traits are experimental and possibly buggy" }
// #![feature(auto_traits)] // not present in Rust 1.49 yet
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits)]
trait Cold {}
// #![feature(auto_traits)] // not present in Rust 1.49 yet
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits)]
// { dg-additional-options "-frust-compile-until=typecheck" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits, lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits, lang_items)]
pub unsafe auto trait Send {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits)]
unsafe auto trait Send {}
// { dg-additional-options "-frust-crate=bad+name" }
// { dg-excess-errors "invalid crate name: ...." }
// { dg-excess-errors "unrecognized command-line option ...." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {}
+#![feature(no_core)]
+#![no_core]
+
#![crate_name = "😅"] // { dg-error "invalid character ...." "" }
fn main() {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
// { dg-additional-options "-fdump-tree-gimple -frust-crate=good_name" }
+#![feature(no_core)]
+#![no_core]
+
pub fn does_nothing() {}
fn main() {
does_nothing()
+#![feature(no_core)]
+#![no_core]
+
pub fn main ()
{
let t = true;
// { dg-excess-errors "invalid crate name: ...." }
// { dg-bogus "unrecognized command-line option ...." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {}
+#![feature(no_core)]
+#![no_core]
+
pub fn main ()
{
//! inner doc allowed
+#![feature(no_core)]
+#![no_core]
+
pub enum E
{
pub A { a: i32 }, // { dg-error "visibility qualifier" }
+#![feature(no_core)]
+#![no_core]
+
fn main ()
{
enum EE
+#![feature(no_core)]
+#![no_core]
+
pub enum E
{
pub A { a: i32 },
+#![feature(no_core)]
+#![no_core]
+
fn main()
{
// tuples
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let logical: bool = 123; // { dg-error "mismatched types, expected .bool. but got .<integer>." }
}
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
return x + 1;
}
// { dg-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[lang = "sized"]
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
type Bar;
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(box_syntax)]
fn main() {
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "owned_box"]
pub struct Box<T>;
// Braced macro invocations are not allowed as match arms without a semicolon,
// even though they are allowed as statements without a semicolon.
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
() => { 1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
() => { bar() }
}
// Output of statement macros is always parsed as a statement, so no semicolon
// is needed on the inner macro.
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
(macro) => { m!(stmts) };
+#![feature(no_core)]
+#![no_core]
+
macro_rules! unroll {
{} => {}
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let rust = "crab";
let res = loop {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
break (rust);
// { dg-error "cannot find value .rust. in this scope" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
break rust;
// { dg-ice "are you trying to break rust? how dare you?" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a;
a = 1;
// ErrorCode::E0571
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
// https://doc.rust-lang.org/error_codes/E0268.html
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn boo() {
continue; // { dg-error ".continue. outside of a loop" }
// https://doc.rust-lang.org/error_codes/E0571.html
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
let mut i = 1;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main ()
{
let _bc = b'\x80';
// { dg-additional-options "-w -fdump-tree-gimple -frust-crate=example" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = 123;
let b = a as char;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = 123;
let u = a as bool;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
const A: char = 0x1F888 as char;
// { dg-error "cannot cast .<integer>. as .char., only .u8. can be cast as .char." "" { target *-*-* } .-1 }
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn main(){
let foo:f64 = 13.37;
let _ = foo as i64;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w -frust-cfg=A" }
+#![feature(no_core)]
+#![no_core]
+
#![cfg_attr(not(B), allow(dead_code))]
#![cfg_attr(A, allow(while_true))]
// { dg-additional-options "-frust-cfg=A -frust-cfg=B" }
+#![feature(no_core)]
+#![no_core]
+
#[cfg_attr(A, cfg(B))]
struct Foo0;
// { dg-additional-options "-frust-cfg=B" }
+#![feature(no_core)]
+#![no_core]
+
#[cfg(not(any(A, B)))]
struct Foo0;
+#![feature(no_core)]
+#![no_core]
+
#[test]
fn foo() {
some_function_which_doesnt_exist();
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo;
impl Foo {
#[cfg(not(A))]
// { dg-additional-options "-w -frust-cfg=A -frust-cfg=B" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo;
impl Foo {
#[cfg(all(A, B))]
// { dg-additional-options "-w -frust-cfg=A" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo;
impl Foo {
#[cfg(any(A, B))]
// { dg-additional-options "-w -frust-cfg=A=\"B\"" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo;
impl Foo {
#[cfg(A = "B")]
// { dg-additional-options "-frust-cfg=A=\"B\"" }
+#![feature(no_core)]
+#![no_core]
+
#[cfg(A)]
pub fn foo() {}
pub fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
extern "rust-intrinsic" { // { dg-error "intrinsics are subject to change." "" { target *-*-* } }
fn foo();
}
//
// Do not reformat this test! The default rust format settings will insert a
// space between closure parameter lists.
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let f = |_||x, y| x+y;
assert_eq!(f(())(1, 2), 3);
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
move |l: u32, r: u32| l + r
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
// taken from https://github.com/rust-lang/rust/blob/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/cmp.rs#L98
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod a {
pub fn foo() {}
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
fn bar() {}
const fn foo() {
+#![feature(no_core)]
+#![no_core]
+
const fn foo (a: &mut i32) { // { dg-error "mutable references are not allowed in constant functions" }
*a = 1;
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
const fn foo() {
const fn bar() {}
+#![feature(no_core)]
+#![no_core]
+
fn size() -> usize {
15
}
// { dg-options "-w -O0 -fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
const A: i32 = 1;
const fn test(a: i32) -> i32 {
// { dg-options "-w -O0 -fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
const A: usize = 123;
const B: [i32; 5] = [1, 2, 3, 4, 5];
const C: i32 = B[A];
+#![feature(no_core)]
+#![no_core]
+
fn main() {
const array:[i32; 1] = [1];
const slice:&[i32] = &array;
// { dg-options "-w -O0 -fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo(usize, usize);
const A:Foo = Foo(123, 4546);
// { dg-options "-w -O0 -fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
First: i32,
Second: f32
// { dg-options "-w -O0 -fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
const fn test(mut x: i32) -> i32 {
loop {
if x == 10 {
// { dg-additional-options "-frust-edition=2018" }
+#![feature(no_core)]
+#![no_core]
+
const async fn weird_function() {}
// { dg-error "functions cannot be both .const. and .async." "" { target *-*-* } .-1 }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
// There are errors about unused generic parameters, but we can't handle that yet.
// Still, this code is invalid Rust.
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo<const N: u32 = 1, const O: bool>; // { dg-error "invalid order for generic parameters: generic parameters with a default must be trailing" }
impl<const N: u32> Foo<N> {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo<const N>; // { dg-error "expecting .:. but .>. found" }
struct Bar<const N: >; // { dg-error "unrecognised token .>. in type" }
struct Baz<const N: usize = >; // { dg-error "invalid token for start of default value for const generic parameter" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
const P: usize = 14;
+#![feature(no_core)]
+#![no_core]
+
struct Foo<const N: usize = { 14 }>;
const M: usize = 15;
+#![feature(no_core)]
+#![no_core]
+
struct Foo<const N: usize>;
struct Bar<const N: usize = { 15i32 }>; // { dg-error "mismatched types, expected .usize. but got .i32." }
+#![feature(no_core)]
+#![no_core]
+
struct S<const N: usize>;
pub fn foo<const N: FooBar>() {} // { dg-error "could not resolve" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
trait Osterkz {
const fn x();
// { dg-error "functions in traits cannot be declared .const." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
() => {
$crate::inner::bar()
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
return 1;
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
return 1;
return 1.5; // { dg-error "mismatched types, expected .i32. but got .<float>." }
// Make sure we don't see any 'note's:
// { dg-bogus {note: } "" { target *-*-* } 0 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
}
// { dg-additional-options "-fno-rust-debug" }
+#![feature(no_core)]
+#![no_core]
+
// Make sure we don't see any 'note's:
// { dg-bogus {note: } "" { target *-*-* } 0 }
// { dg-additional-options "-frust-debug" }
+#![feature(no_core)]
+#![no_core]
+
// Just scan for one of the Rust front end debug diagnostics:
// { dg-message {note: Attempting to parse file: .+/gcc/testsuite/rust/compile/debug-diagnostics-on\.rs} "" { target *-*-* } 0 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro m() {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
pub macro m($e: expr) { $e + $e }
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro foo {
() => {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro foo {
() => { 0 },
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro foo {
() => [],
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro m {}
// { dg-error "unexpected token .\}. - expecting delimiters .for a macro matcher." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
pub macro hello() [ "Hello" ]
// { dg-error "only braces can be used for a macro transcriber in declarative macro definition" "" { target *-*-* } .-1 }
// allowed
+#![feature(no_core)]
+#![no_core]
+
pub fn default() {}
// { dg-additional-options "-frust-compile-until=typecheck" }
+#![feature(no_core)]
+#![no_core]
+
// #![feature(generic_arg_infer)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_deprecated(since = "right now", reason = "a whim")]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "clone"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "clone"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "clone"]
+#![feature(no_core)]
+#![no_core]
+
#[derive()]
struct UnderivedStruct;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#![feature(decl_macro)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
// { dg-additional-options "-quiet" }
+#![feature(no_core)]
+#![no_core]
+
/* { dg-options "-fdiagnostics-show-caret" } */
+#![feature(no_core)]
+#![no_core]
+
// { dg-error "Isolated CR" "" { target *-*-* } .+1 }
/** doc cr\r comment */
pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+
pub fn main ()
{
// { dg-error "Isolated CR" "" { target *-*-* } .+1 }
+#![feature(no_core)]
+#![no_core]
+
pub fn main ()
{
// { dg-error "Isolated CR" "" { target *-*-* } .+1 }
+#![feature(no_core)]
+#![no_core]
+
// { dg-error "Isolated CR" "" { target *-*-* } .+1 }
/// doc cr\r comment
pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+
#![doc = concat!("AB")]
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
struct Test<T> {
_inner: T,
}
+#![feature(no_core)]
+#![no_core]
+
struct S { a: i32, b: i32, c: u8, a: i128 }
// { dg-error "field .a. is already declared" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
fn main() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn foo (x: i8) -> i32 { // { dg-warning "function is never used" }
//
match x {
+#![feature(no_core)]
+#![no_core]
+
#[repr(C)]
union MyUnion {} // { dg-error "unions cannot have zero fields" }
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
Bar = 3 + 12,
}
+#![feature(no_core)]
+#![no_core]
+
fn test() -> isize {
1
}
+#![feature(no_core)]
+#![no_core]
+
const x: isize = 1;
// { dg-warning "unused name" "" { target *-*-* } .-1 }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
struct E1;
enum Test {
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
const TEN: usize = 10;
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
fn test(n: usize) {
match n {
+#![feature(no_core)]
+#![no_core]
+
struct S {
a: i32,
}
+#![feature(no_core)]
+#![no_core]
+
enum E1 {
E2(E2),
None,
+#![feature(no_core)]
+#![no_core]
+
struct S {
e1: E1,
e2: E2,
// this SEGVs in lowering for now
// { dg-additional-options "-frust-compile-until=nameresolution" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
macro_rules! forward_ref_binop {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#[export_name = "other_name"]
fn func() {}
// { dg-final { scan-assembler "other_name" } }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn variadic(x: isize, args: ...);
}
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn myfun0(a:i32,...) {}
// { dg-error "cannot have a body" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
type F;
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
type F;
// ErrorCode - E0635
+#![feature(no_core)]
+#![no_core]
+
#![feature(AA)] //{ dg-error "unknown feature .AA." }
#![feature(iamcrabby)] // { dg-error "unknown feature .iamcrabby." }
#![feature(nonexistent_gccrs_feature)] // { dg-error "unknown feature .nonexistent_gccrs_feature." }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
type F; //{ dg-error "extern types are experimental." "" { target *-*-* } }
}
+#![feature(no_core)]
+#![no_core]
+
extern "rust-intrinsic" { //{ dg-error "intrinsics are subject to change." "" { target *-*-* } }
pub fn sqrtf32(x: f32) -> f32;
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
pub struct NotI8(i8);
// { dg-output "loop\r*\nloop\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
// { dg-output "1\r*\n2\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
for a in 0..10 {}
// { dg-additional-options "-frust-compile-until=typecheck" }
+#![feature(no_core)]
+#![no_core]
+
fn function_pointer_as_argument(f: for<'a> fn(&'a i32) -> &'a i32) -> i32 {
0
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[rustc_builtin_macro]
// https://doc.rust-lang.org/error_codes/E0423.html
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
struct Foo {
// { dg-additional-options "-frust-compile-until=unsafety" }
+#![feature(no_core)]
+#![no_core]
+
unsafe fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
pub const unsafe fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> bool {
return x + 1; // { dg-error "mismatched types, expected .bool. but got .i32." }
}
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32, b: i32) -> i32 {
a + b
}
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32, b: i32) -> i32 {
a + b
}
+#![feature(no_core)]
+#![no_core]
+
fn func() -> i32 { // { dg-error "mismatched types, expected .i32. but got ...." }
}
+#![feature(no_core)]
+#![no_core]
+
fn func() -> i32 {
return; // { dg-error "mismatched types, expected .i32. but got ...." }
}
// { dg-additional-options "-frust-compile-until=nameresolution" }
+#![feature(no_core)]
+#![no_core]
+
struct MyStruct;
trait X {}
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
type Bar<T>;
type Baz<'a>;
+#![feature(no_core)]
+#![no_core]
+
struct Foo<A = i321>(A);
// { dg-error "could not resolve type path .i321." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(optin_builtin_traits)]
auto trait IsCooler<G> {}
// { dg-error "auto traits cannot have generic parameters .E0567." "" { target *-*-* } .-1 }
// { dg-error "mismatched types, expected .i32. but got .i8." "" { target *-*-* } 0 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
struct Foo<A, B>(A, B);
impl<X = i32> Foo<X, f32> { // { dg-error "defaults for type parameters are only allowed in .struct., .enum., .type., or .trait. definitions" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo<A, 'a>; // { dg-error "invalid order for generic parameters: lifetime parameters must be declared prior to type and const parameters" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo<const N: i32, 'a>; // { dg-error "invalid order for generic parameters: lifetime parameters must be declared prior to type and const parameters" }
// { dg-error "mismatched types, expected .i32. but got .i8." "" { target *-*-* } 0 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-error "mismatched types, expected .i32. but got .i8." "" { target *-*-* } 0 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct GenericStruct<T>(T, usize);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo<A, B = (A, B)>(A, B);
// { dg-error "type parameters with a default cannot use forward declared identifiers" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
use self::Ordering::*;
use Ordering::*;
+#![feature(no_core)]
+#![no_core]
+
const X: i32 = 1;
pub fn foo() -> [i32; 1] {
+#![feature(no_core)]
+#![no_core]
+
fn foo(pred: bool) -> u8 {
if pred { // { dg-error "mismatched types" }
1
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
enum MyOption {
Some(i32),
None,
+#![feature(no_core)]
+#![no_core]
+
pub fn simple_iflet() -> i32 {
let mut res = 0;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
if x > 1 { // { dg-error "mismatched types, expected .... but got .<integer>." }
1
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
// { dg-error "mismatched types, expected .i32. but got .bool." "" { target *-*-* } .-1 }
return 1;
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 { // { dg-error "mismatched types, expected .i32. but got ...." }
if x > 1 {
return 1;
+#![feature(no_core)]
+#![no_core]
+
fn test(x: bool) -> bool {
// { dg-error "mismatched types, expected .bool. but got ...." "" { target *-*-*} .-1 }
return x;
+#![feature(no_core)]
+#![no_core]
+
mod x {}
mod y {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
pub fn does_nothing() {}
fn main() {
does_nothing()
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
#[inline]
fn test_a() {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[inline(A)] // { dg-error "invalid argument, .inline. attribute only accepts .always. or .never." }
fn test_a() {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
pub fn function() {
'continue: loop {
// { dg-error "invalid label name .'continue." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
pub fn dog(b: i32, a: ..., c: i32);
// { dg-error "..... must be the last argument of a C-variadic function" "" { target *-*-* } .-1 }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
union B {
a: A,
b: f32,
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn foo(e: &str) -> &str {
&""
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! maybe_return { ($e:expr) => ($e); }
fn frob(x: i32) -> i32{
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
type A = B;
struct B;
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
pub mod test_mod;
fn main() {
//! test_mod inner doc comment
//!
//! foo bar baz cake pizza carbs
+#![feature(no_core)]
+#![no_core]
+
pub struct Test(pub i32);
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn write_u8(i: u8) {
let x: &[u8] = &[i];
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
fn test() {
let f = [0; -4_isize];
// { dg-error "mismatched types, expected .usize. but got .isize." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
+#![feature(no_core)]
+#![no_core]
+
enum E {
One,
Two,
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
const TEST: *mut u8 = 123 as *mut u8;
fn test() {
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> u8 {
// { dg-warning "function is never used" "" { target *-*-* } .-1 }
1u8 << 2u32
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod a {
pub mod b {
pub mod a {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn test() {
let a: &str = "TEST 1";
let b: &str = &"TEST 2";
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
enum E {
X(u8),
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut x = [1, 2, 3];
let y: i32 = x[0];
+#![feature(no_core)]
+#![no_core]
+
fn print_int(value: i32) {
let s = "%d\n\0";
let s_p = s as *const str;
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> S {
S { a: 15 }
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn tst() {
let a = 123;
let b = 0;
+#![feature(no_core)]
+#![no_core]
+
macro_rules! test {
() => { unsafe {} };
}
// fake function
+#![feature(no_core)]
+#![no_core]
+
pub fn swap_bytes(this: u32) -> u32 {
(((this) & 0xff000000) >> 24)
| (((this) & 0x00ff0000) >> 8)
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-w -frust-compile-until=nameresolution" }
// https://github.com/Rust-GCC/gccrs/issues/1524
// https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/src/test/ui/methods/method-normalize-bounds-issue-20604.rs
+#![feature(no_core)]
+#![no_core]
+
trait Hasher {
type Output;
fn finish(&self) -> Self::Output;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
const slice: &[i32] = &[1, 2, 3];
let _slice2: &[i32] = slice;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
type A;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let is_zero = &|&&d: &&u8| -> bool { d == b'0' };
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 15u8;
let a = &a;
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo(bool);
fn foo(_: usize) -> Foo {
Foo(false)
+#![feature(no_core)]
+#![no_core]
+
fn func(i: i32) {
i();
// { dg-error "expected function, found .i32. .E0618." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
pub struct Lexer<'a> {
input: &'a str,
}
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
fn f() -> u32;
}
+#![feature(no_core)]
+#![no_core]
+
fn f<'r>(p: &'r mut fn(p: &mut ())) {
(*p)(())
// { dg-error "expected .&mut ()." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct Foo<'a> {
// { dg-warning "struct is never constructed: .Foo." "" { target *-*-* } .-1 }
data: &'a [u8],
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-timeout 5 }
+#![feature(no_core)]
+#![no_core]
+
struct S<$>; // { dg-error ".*" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
const A: usize = {
// { dg-warning "unused name" "" { target *-*-* } .-1 }
let x = 23;
+#![feature(no_core)]
+#![no_core]
+
const A: &'static u8 = b"
";
const B: &'static str = b"
+#![feature(no_core)]
+#![no_core]
+
static _V: () = {};
+#![feature(no_core)]
+#![no_core]
+
#[allow(unused_unsafe)]
pub fn foo() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
trait A {}
impl A for () {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! finish {
(+ - + * + /) => {}
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($_:tt) => {};
() => {foo!($);};
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
enum State {
Succeeded,
Failed(u32),
+#![feature(no_core)]
+#![no_core]
+
enum State {
Succeeded,
Failed { x: u32 },
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
const SOME_CONST: i32 = 12;
+#![feature(no_core)]
+#![no_core]
+
const A: i32 = (1 / 0);
// { dg-error "division by zero" "" { target *-*-* } .-1 }
// { dg-error "is not a constant expression" "" { target *-*-* } .-2 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
impl NonExistant {
// { dg-error "could not resolve" "" { target *-*-* } .-1 }
fn test() {}
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
match 12 {
12 | 13 | 14 => {}
+#![feature(no_core)]
+#![no_core]
+
const FOO: u32 = return 0;
// { dg-error "return statement outside of function body" "" { target *-*-* } .-1 }
// { dg-error "mismatched types, expected .u32. but got" "" { target *-*-* } .-2 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
enum Dragon {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct First {
i: usize,
}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
enum Empty {}
fn foo(x: Empty) {
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
enum Empty {}
fn foo(x: Empty) {
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
enum Empty {}
fn foo(x: Empty) {
// { dg-additional-options "-frust-compile-until=ast" }
+#![feature(no_core)]
+#![no_core]
+
pub fn struct_tuple(A { 0: a, 1: ref b }: A) -> i32 {
a
}
// { dg-additional-options "-frust-edition=2018" }
+#![feature(no_core)]
+#![no_core]
+
pub async fn a() -> u32 {
1
// { dg-additional-options "-frust-edition=2015" }
+#![feature(no_core)]
+#![no_core]
+
pub async fn a() -> u32 { // { dg-error "'async fn' is not permitted in Rust 2015" }
1
+#![feature(no_core)]
+#![no_core]
+
fn main() {
'label: while break 'label {}
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {}
#[cfg(FALSE)]
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
pub fn test_cast() {
let i = 1;
// { dg-final { scan-tree-dump-times {const i32 i;} 1 gimple } }
+#![feature(no_core)]
+#![no_core]
+
fn main() {}
struct S;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-frust-edition=2018" }
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
fn f() -> u32;
}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-frust-edition=2018" }
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
async fn foo(){}
// { dg-error "functions in traits cannot be declared .async." "" { target *-*-* } .-1 }
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
arg_1: u32,
arg_2: i32,
// { dg-additional-options "-frust-compile-until=astvalidation" }
+#![feature(no_core)]
+#![no_core]
+
fn foo_1(&self);
fn foo_2(&mut self);
fn foo_3(self);
+#![feature(no_core)]
+#![no_core]
+
pub fn test() -> i32 {
let (a, _) = (1, 2);
a
+#![feature(no_core)]
+#![no_core]
+
pub fn myfun1((x, _): (i32, i32)) -> i32 {
x
}
+#![feature(no_core)]
+#![no_core]
+
fn myfun0(...,_:i32) {}
// { dg-error "only foreign or .unsafe extern \"C\". functions may be C-variadic" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(no_core)]
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-warning "field is never read: .a." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct Foo { a: i32 }
fn main() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-options "-w" } Currently there are a lot of warnings produced from inside clone/copy
// builtins
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "copy"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(negative_impls)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(negative_impls, lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(negative_impls, lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(negative_impls, lang_items)]
#[lang = "copy"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(dropck_eyepatch, lang_items)]
#[allow(dead_code)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(dropck_eyepatch, lang_items)]
#[allow(dead_code)]
+#![feature(no_core)]
+#![no_core]
+
enum Res {
OK,
BAD,
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
trait Hello {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "clone"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "clone"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "copy"]
+#![feature(no_core)]
+#![no_core]
+
enum State {
Succeeded,
Failed,
+#![feature(no_core)]
+#![no_core]
+
fn main() {
// Signed integers
let _i8_min: i8 = -128;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
pub enum X {}
pub fn foo(x: X) {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i8 = 50;
let b = a as f32;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
//You should be able to create a module of the same name as a builtin type
+#![feature(no_core)]
+#![no_core]
+
mod i32 {
}
+#![feature(no_core)]
+#![no_core]
+
mod i32 {
}
+#![feature(no_core)]
+#![no_core]
+
static FOO: i32 = 0;
pub fn bar() -> i32 {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
pub struct Bar(i32);
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct A {}
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo(usize);
+#![feature(no_core)]
+#![no_core]
+
#[repr(i32)]
enum NightsWatch {} // { dg-error "unsupported representation for zero-variant enum" }
+#![feature(no_core)]
+#![no_core]
+
#[repr(C)]
enum NightsWatch {} // { dg-error "unsupported representation for zero-variant enum" }
+#![feature(no_core)]
+#![no_core]
+
enum A {
Value(()),
}
+#![feature(no_core)]
+#![no_core]
+
impl B for u32 {
const BAR: i32; // { dg-error "associated constant in .impl." }
}
+#![feature(no_core)]
+#![no_core]
+
trait B {
const BAR: i32;
}
+#![feature(no_core)]
+#![no_core]
+
const L: usize = 3;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
r#""#;
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
const BAR: u32;
}
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
fn f(&self) -> isize;
}
+#![feature(no_core)]
+#![no_core]
+
trait Tr {
fn foo();
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let ref mut a @ (ref mut b,);
// { dg-error "expected T\\?, found tuple" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub struct AA {
pub data: [u8; 10],
}
+#![feature(no_core)]
+#![no_core]
+
mod a {
pub mod b {
// run-pass
+#![feature(no_core)]
+#![no_core]
+
#![allow(H8)]
#![allow(dead_code)]
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _: &[i8] = &[i8];
// { dg-error "expected value .E0423." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub type T = ();
mod foo {
pub use super::T;
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
Bar,
}
+#![feature(no_core)]
+#![no_core]
+
enum A {
X { inner: i32 },
Y,
+#![feature(no_core)]
+#![no_core]
+
const FOO: i32 = if true { [1, 2, 3] } else { [2, 3, 4] }[0];
pub fn test() -> i32 {
+#![feature(no_core)]
+#![no_core]
+
pub trait X {
fn x() {
fn f(&mut self) {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
enum Foo<'a> {}
enum Bar<'a> {
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[repr()]
pub struct Coord {
x: u32,
+#![feature(no_core)]
+#![no_core]
+
trait _St1 {
pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
// { dg-error "no method named .as_ptr. found in the current scope .E0599." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
mod m1 {
pub enum Baz4 {
foo1,
+#![feature(no_core)]
+#![no_core]
+
#[repr] // { dg-error "malformed .repr. attribute" }
struct _B {}
+#![feature(no_core)]
+#![no_core]
+
pub trait Trait {
pub fn nrvo(init: fn()) -> [u8; 4096] {
let mut buf = [0; 4096];
+#![feature(no_core)]
+#![no_core]
+
macro_rules! quote_tokens {
() => {
#[macro_export]
+#![feature(no_core)]
+#![no_core]
+
static _X : ()
= loop{}; // { dg-error "'loop' is not allowed in const context" }
+#![feature(no_core)]
+#![no_core]
+
type A = crate::A;
-// { dg-error "failed to resolve type path segment: .A." "" { target *-*-* } .-2 }
+// { dg-error "failed to resolve type path segment: .A." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub enum Enum {
Variant1(isize),
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
let x: usize<foo>;
// { dg-error "generic arguments are not allowed for this type .E0109." "" { target *-*-* } .-1 }
-// { dg-warning "unused name 'y'" "" { target *-*-* } 5 }
-// { dg-warning "unused name 'z'" "" { target *-*-* } 5 }
+// { dg-warning "unused name 'y'" "" { target *-*-* } 7 }
+// { dg-warning "unused name 'z'" "" { target *-*-* } 7 }
+#![feature(no_core)]
+#![no_core]
fn main() {
- let (ref y,z) = (1i32, 2u32);
-}
\ No newline at end of file
+ let (ref y, z) = (1i32, 2u32);
+}
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
type T;
fn foo() -> Foo<main>;
+#![feature(no_core)]
+#![no_core]
+
#![allow(dead_code)]
type A = fn();
+#![feature(no_core)]
+#![no_core]
+
struct B; // { dg-warning "struct is never constructed" }
impl B {
+#![feature(no_core)]
+#![no_core]
+
struct T(Box<>);
// { dg-error "could not resolve type path .Box. .E0412." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
type T;
fn foo() -> T<<Self as Foo>::T>;
+#![feature(no_core)]
+#![no_core]
+
type Meeshka = Mow<!>;
// { dg-error "generic arguments are not allowed for this type .E0109." "" { target *-*-* } .-1 }
type Mow = &'static fn(!) -> !;
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
Bar(isize),
}
+#![feature(no_core)]
+#![no_core]
+
struct Foo<'_>(&'_ u8);
impl Foo<'a> {
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
fn main() {
+#![feature(no_core)]
+#![no_core]
+
pub static A: [u32; 2] = [1, 2];
pub static B: [u8; 2] = [3, 4];
+#![feature(no_core)]
+#![no_core]
+
pub macro m($inner_str:expr) {
#[m = $inner_str]
// { dg-error "macro not found" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub fn rlib() {
let _ = ((-1 as i8) << 8 - 1) as f32;
let _ = 0u8 as char;
+#![feature(no_core)]
+#![no_core]
+
pub trait TypeFn {}
impl TypeFn for Output<{ 42 }> {
+#![feature(no_core)]
+#![no_core]
+
const ARR: [usize; 1] = [2];
pub fn l8() {
+#![feature(no_core)]
+#![no_core]
+
pub const uint_val: usize = 1;
pub const uint_expr: usize = 1 << uint_val;
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(raw_ref_op)]
const pq1: () = {
+#![feature(no_core)]
+#![no_core]
+
impl Foo<0> {}
// { dg-error "could not resolve type path" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
pub enum TypeCtor {
Slice,
Array,
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
mod core {
+#![feature(no_core)]
+#![no_core]
+
fn wow(){
&#[serde]
} // { dg-error "found unexpected token .\}. in null denotation" "" { target *-*-* } . }
+#![feature(no_core)]
+#![no_core]
+
enum test {
A(i32),
}
+#![feature(no_core)]
+#![no_core]
+
pub fn test() {
let _u: [_; _] = [15u32];
let _v: [u8; _] = [1, 2, 3];
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
static STATIC_1: dyn = *#[serde()]; // { dg-error "found unexpected token .;. in null denotation" "" { target *-*-* } 0 }
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
struct S(
[u8; {
{
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
const S: usize = 23 as i64;
// { dg-error {mismatched types, expected .usize. but got .i64.} "" { target *-*-* } .-1 }
// { dg-do compile }
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
struct S();
fn main() {
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
struct S {
x: i32,
y: i32,
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let (a, .., b) = (2, 3);
}
+#![feature(no_core)]
+#![no_core]
+
enum _Enum {
A(),
}
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
trait A {
fn a(&self) -> <Self as A>::X;
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct G {
g: (),
+#![feature(no_core)]
+#![no_core]
+
fn main() {
[(); { continue }];
// { dg-error ".continue. outside of a loop .E0268." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
loop { continue }
+#![feature(no_core)]
+#![no_core]
+
struct S {
#[cfg_attr()]
field: u8,
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#[lang = "copy"]
trait Copy {}
+#![feature(no_core)]
+#![no_core]
+
impl<'a, F> RunUntil<'a, F> {
// { dg-error "could not resolve type path" "" { target *-*-* } .-1 }
fn project<'pin>() -> Projection<'pin, 'a, F> {
// Test for issue #3977 - ICE with continue/break/return in while condition
+#![feature(no_core)]
+#![no_core]
+
fn diverge() -> ! {
loop {}
+#![feature(no_core)]
+#![no_core]
+
type Dimension = usize;
pub fn main() {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// #407
+#![feature(no_core)]
+#![no_core]
+
pub fn loopy() {
let mut a = 1;
loop {
// This already worked before the #409 code changes.
+#![feature(no_core)]
+#![no_core]
+
fn test() {
let mut a = 1;
a + = 1; // { dg-error "found unexpected token '=' in null denotation" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
mod core {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
mod core {
// { dg-skip-if "" { *-*-* } { "-m32" } { "" } }
+#![feature(no_core)]
+#![no_core]
+
const X: i32 = const {
let a = 0x736f6d6570736575;
// { dg-error "integer overflows the respective type" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub enum TypeCtor {
Slice,
Array,
+#![feature(no_core)]
+#![no_core]
+
macro_rules! ty_app {
($_a:pat) => {
($ctor)
// { dg-excess-errors "warnings" }
+#![feature(no_core)]
+#![no_core]
+
struct S {
field: [u8; {
+#![feature(no_core)]
+#![no_core]
+
const _NISIZE_DIV_P: &isize = &(1isize / 0);
// { dg-error "division by zero" "" { target *-*-* } .-1 }
// { dg-error "is not a constant expression" "" { target *-*-* } .-2 }
// TODO: all `xfail` conditions should be changed to `target` once the ICE in #4148 is resolved
+#![feature(no_core)]
+#![no_core]
+
pub fn ret_parens(x: i32) -> i32 {
// { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 }
+#![feature(no_core)]
+#![no_core]
+
struct Bug {
inner: [(); match Vec::new {
f @ |n() => 1
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
while let = 5
// { dg-error "should be at least 1 pattern" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
enum Enum {
NotEmpty {x: i32},
Struct {},
+#![feature(no_core)]
+#![no_core]
+
enum Enum {
Unit,
Tuple(i32),
+#![feature(no_core)]
+#![no_core]
+
const N: usize = 2;
const ARR: [i32; N] = [42; X];
// { dg-error {cannot find value .X. in this scope \[E0425\]} "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub trait Foo {
type Bar;
+#![feature(no_core)]
+#![no_core]
+
const fn add(x: usize, y: usize) -> i32 {
add + y
// { dg-error "cannot apply operator .+. to types fn .x usize,y usize,. -> i32 and usize" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
trait MemoryUnit {
extern "C" fn read_dword(&'s self) -> u16 {}
// { dg-error {failed to resolve lifetime} "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![derive(PartialOrd, PartialEq)]
// { dg-error "attribute cannot be used at crate level" "" { target *-*-* } .-1 }
pub fn check_ge(a: i32, b: i32) -> bool {
// Test for issue #4213 - rogue macro detected during Lowering.
+#![feature(no_core)]
+#![no_core]
+
macro_rules! inner {
() => {
+#![feature(no_core)]
+#![no_core]
+
#![inline]
// { dg-error "attribute cannot be used at crate level" "" { target *-*-* } .-1 }
pub fn check_ge(a: i32, b: i32) -> bool {
+#![feature(no_core)]
+#![no_core]
+
#![cfg(false)]
// { dg-error ".false. predicate key cannot be a literal" "" { target *-*-* } .-1 }
fn a() {}
+#![feature(no_core)]
+#![no_core]
+
#[doc]
// { dg-error "attribute must be of the form ...doc.hidden.inline....... or ...doc = string.." "" { target *-*-* } .-1 }
pub fn a(){}
+#![feature(no_core)]
+#![no_core]
+
#[repr = ""] // { dg-error "malformed .repr. attribute" }
struct ThreeInts {
first: i16,
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[repr(C)] // { dg-error "the ...repr.. attribute may only be applied to structs, enums and unions" }
fn a() {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[target_feature(sse)] // { dg-error "attribute can only be applied" }
fn foo() {}
\ No newline at end of file
+#![feature(no_core)]
+#![no_core]
+
#[target_feature(enable = "sse")] // { dg-error "the ...target_feature.. attribute may only be applied to functions" }
struct _Test {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
fn main() {
+#![feature(no_core)]
+#![no_core]
+
#![cfg_attr(not(cg_gcc), feature(intrinsics))]
#![feature(lang_items)]
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
pub fn a()->i32 {
let mut a = 1;
a = 2;
+#![feature(no_core)]
+#![no_core]
+
#[cfg()]
// { dg-error "malformed .cfg. attribute input" "" { target *-*-* } .-1 }
fn a() {}
+#![feature(no_core)]
+#![no_core]
+
#[cfg]
// { dg-error ".cfg. is not followed by parentheses" "" { target *-*-* } .-1 }
fn a() {}
+#![feature(no_core)]
+#![no_core]
+
#[cfg(a,a)]
// { dg-error "multiple .cfg. predicates are specified" "" { target *-*-* } .-1 }
fn a(){}
+#![feature(no_core)]
+#![no_core]
+
#![feature(unused_variables, server = b"\0")]
// { dg-error {unknown feature .server = .} "" { target *-*-* } .-1 }
// { dg-error {unknown feature .unused_variables.} "" { target *-*-* } .-2 }
+#![feature(no_core)]
+#![no_core]
+
fn get_forty_two() -> i32 {
return 42;
}
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
1
}
+#![feature(no_core)]
+#![no_core]
+
fn get_tuple() -> (i32, i32) {
(5, 10)
}
+#![feature(no_core)]
+#![no_core]
+
#[export_name] // { dg-error "malformed" }
fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
#[export_name] // { dg-error "malformed" }
static A: i32 = 0;
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32, _: i32) {
let _ = 42 + a;
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn test() -> i32 {
return 10000000000000000000000000000000000000000000;
// { dg-error "integer overflows the respective type .i32." "" { target *-*-* } .-1 }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
fn test() -> f32 {
return 10000000000000000000000000000000000000000000.0f32;
// { dg-error "decimal overflows the respective type .f32." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
pub use result::Result::{self, Err, Ok};
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _ = 42;
let a = _ + 123; // { dg-error "use of '_' is not allowed on the right-side of an assignment" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
+#![feature(no_core)]
+#![no_core]
+
#[lang = "i8"]
impl i32 {}
+#![feature(no_core)]
+#![no_core]
+
#[lang = "sized"] // { dg-error "lang items are subject to change. add .#!.feature.lang_items... to the crate attributes to enable" }
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _a | _a = 12;
// { dg-error "top level or-patterns are not allowed for .let. bindings" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub fn one<'continue>() {} // { dg-error "lifetimes cannot use keyword names" }
pub fn two<'_>() {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[link_name] // { dg-error "malformed .link_name. attribute input" }
fn foo() {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[link_section] // { dg-error "malformed .link_section. attribute input" }
pub static VAR1: u32 = 1;
+#![feature(no_core)]
+#![no_core]
+
fn test() {
fn nested() {}
}
+#![feature(no_core)]
+#![no_core]
+
// { dg-error "'loop' is not allowed in const context" "" { target *-*-* } .+1 }
const CONST_LOOP : () = loop{};
// { dg-error "'loop' is not allowed in const context" "" { target *-*-* } .+1 }
-static STATIC_LOOP : () = loop{};
\ No newline at end of file
+static STATIC_LOOP : () = loop{};
+#![feature(no_core)]
+#![no_core]
+
# Copyright (C) 2021-2026 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
ÿ
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
#[rustc_builtin_macro]
// { dg-additional-options "-fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
([]) => {struct Foo;};
(()) => {struct _A;};
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($a:ident, $a:ident) => {0} // { dg-error "duplicate matcher binding" }
}
+#![feature(no_core)]
+#![no_core]
+
mod foo {
macro_rules! bar {
() => ()
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($e:expr $(forbidden)*) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" }
// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($e:expr $(,)*) => {{}};
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! impl_uint {
($($ty:ident),*) => {
impl $ty {} // { dg-error "metavariable is still repeating at this depth" }
// { dg-additional-options "-frust-cfg=A -w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! impl_uint {
($($ty:ident = $lang:literal),*) => {
// { dg-additional-options "-frust-edition=2018" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! try {
// { dg-error "expecting .identifier. but .try. found" "" { target *-*-* } .-1 }
// Default edition is 2015 - this is valid
+#![feature(no_core)]
+#![no_core]
+
macro_rules! try {
() => {};
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
( ( $( $Trait: ident ),+ ) for $($Ty: ident)* ) => {
$(
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
// { dg-error "does not take a separator" "#2092" { target *-*-*} .+1 }
($(a),?) => {};
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($a:ident) => {}
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {($type:ident) => {
let $type = 12;
}}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($(+)+) => {e};
() => {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! a {
(1) => {x};
(2) => {};
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($(+ $($a:ident)*)*) => {$($($a)*)*}
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! mac {
() => {();} // { dg-warning "trailing semicolon" }
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($p:path $b:block) => {};
}
+#![feature(no_core)]
+#![no_core]
+
pub struct ReadDir {
pub inner: i32,
#[cfg(not(A))]
+#![feature(no_core)]
+#![no_core]
+
include!(;
struct Baz {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! generate_pattern_iterators {
{
$(#[$forward_iterator_attribute:meta])*
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
macro_rules! impl_fn_for_zst {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! doc_comment {
(#[ $attr: meta ]) => {
#[$attr]
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
macro_rules! impl_fn_for_zst {
+#![feature(no_core)]
+#![no_core]
+
#[allow(path_statements)]
macro_rules! array_impl_default {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! empty_parens {
() => ();
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
{} => {
15
+#![feature(no_core)]
+#![no_core]
+
macro_rules! call_f {
($($f:ident)*) => { $($f();)* }
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! define_vars {
($($v:ident)*) => { $(let $v = 15;)* }
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! create_type {
($s:ident) => {
struct $s;
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! define_vars {
($($v:ident)*) => { $(let $v = 15;)* }
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! create_type {
($s:ident) => {
struct $s;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
macro_rules! create_type {
($s:ident) => {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! rep {
($a:literal) => { $a };
($a:literal $(, $e:literal)*) => {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! take_stmt {
($s:stmt) => {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! call_without_semi {
() => {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! empty_brackets {
[] => [];
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! c_fn {
{$name:ident ($($arg_name:ident $arg_ty:ty),*) -> $ret_ty:ty} => {
fn $name($($arg_name: $arg_ty)*) -> $ret_ty;
+#![feature(no_core)]
+#![no_core]
+
macro_rules! print {
() => {
fn puts(s: *const i8);
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! valid {
($($a:literal)* $i:ident) => {{}};
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! repeat {
( $( $i:literal ),* ; $( $j:literal ),* ) => (( $( ($i,$j) ),* ))
// { dg-error "different amount of matches used in merged repetitions" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($a:expr tok) => {
// { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($a:expr $(tok $es:expr)*) => {
// { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($($es:expr)* tok) => {
// { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! empty_curlies {
{} => {};
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($e:expr $f:expr) => {
// { dg-error "fragment is not allowed after .expr. fragment" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($($e:expr)* $($f:expr)*) => {
// { dg-error "fragment is not allowed after .expr. fragment" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! s {
($s:stmt) => {{}};
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! forbidden_frag {
($t:ty $not_block:ident) => {{}}; // { dg-error "fragment specifier .ident. is not allowed after .ty. fragments" }
// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! allowed_after_expr_matcher {
(($t:expr) bok) => {{}}; // follow-set restrictions do not apply after a matcher, but they do apply inside the matcher
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! inside_matcher {
(($e:expr tok) tok) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" }
// { dg-error "failed to parse macro matcher" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! ty_allowed {
($t:ty $b:block) => {{}};
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! invalid_after_zeroable {
($e:expr $(,)* forbidden) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" }
// { dg-error "required first macro rule" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! invalid_after_zeroable_multi {
($e:expr $(,)? $(;)* $(=>)? forbidden) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" }
// { dg-error "required first macro rule" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! m {
($e:expr (, parenthesis_forbidden)) => {{}}; // { dg-error "token .\\(. at start of matcher is not allowed after .expr. fragment" }
// { dg-error "required first macro rule" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! one_keyword {
(kw) => {};
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
macro_rules! empty {
($($t:tt)*) => {};
}
// { dg-additional-options "-w -frust-cfg=A" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
use Option::{None, Some};
enum Option<T> {
+#![feature(no_core)]
+#![no_core]
+
mod foo {
mod bar {
mod baz {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! empty {
() => {}; // { dg-error "found unexpected token '\}' in null denotation" }
}
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
fn main() {
// Check the follow-set of :vis in macro rules.
+#![feature(no_core)]
+#![no_core]
+
macro_rules! my_mac {
($v:vis async) => {
// Check that "priv" is not in the follow set of :vis.
+#![feature(no_core)]
+#![no_core]
+
// { dg-error "token .priv. is not allowed after .vis. fragment" "#359" { target *-*-* } .+3 }
// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .+2 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! rust_keyword {
(fn) => {};
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
() => {
u32
+#![feature(no_core)]
+#![no_core]
+
macro_rules! test {
($_:ident) => {""}
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! multi {
($( $a:ident )? $( + $b:ident )?) => {
{
+#![feature(no_core)]
+#![no_core]
+
macro_rules! numbers {
{} => { 1 2 }
// { dg-error "expecting .;. but .integer literal. found" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! id {
($i:ident) => { $i }
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! check {
(a, b, c ; x, y, z; e, r; a) => {}
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! macro_rules {
() => {};
}
+#![feature(no_core)]
+#![no_core]
+
pub fn print(a: *const u8) {}
#[macro_export]
macro_rules! pr_warn (
+#![feature(no_core)]
+#![no_core]
+
macro_rules! zero_or_one {
($($a:literal)?) => {
1 + 2;
+#![feature(no_core)]
+#![no_core]
+
fn f() {}
macro_rules! one_or_more {
+#![feature(no_core)]
+#![no_core]
+
fn f() {}
macro_rules! expr {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($e:expr, $($es:expr),*) => {
$e + add!($($es),*)
+#![feature(no_core)]
+#![no_core]
+
fn f() {}
macro_rules! panic {
+#![feature(no_core)]
+#![no_core]
+
#[macro_use]
mod foo {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($a:expr) => { $a };
+#![feature(no_core)]
+#![no_core]
+
macro_rules! macro_rules {
() => {
struct S;
+#![feature(no_core)]
+#![no_core]
+
#[macro_use]
mod foo {
macro_rules! a {
+#![feature(no_core)]
+#![no_core]
+
# Copyright (C) 2021-2026 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
($x:meta) => {0}
}
// { dg-additional-options "-frust-crate-type=lib" }
+#![feature(no_core)]
+#![no_core]
+
#[proc_macro_attribute] // { dg-error "the .#.proc_macro_attribute.. attribute is only usable with crates of the .proc-macro. crate type" }
pub fn my_invalid_macro() {}
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
mod inner {
struct InnerStruct;
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
fn outer_function() {
#[proc_macro_attribute]
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
struct DummyStruct;
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
mod test_module {
#[proc_macro_attribute]
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
#[proc_macro_attribute]
fn my_macro() {} // { dg-error "functions tagged with .#.proc_macro_attribute.. must be .pub." }
// { dg-additional-options "-frust-crate-type=lib" }
+#![feature(no_core)]
+#![no_core]
+
#[proc_macro] // { dg-error "the .#.proc_macro.. attribute is only usable with crates of the .proc-macro. crate type" }
pub fn my_invalid_macro() {}
// { dg-additional-options "-frust-crate-type=lib" }
+#![feature(no_core)]
+#![no_core]
+
trait Dungeness {}
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
#[proc_macro_derive] // { dg-excess-errors "malformed 'proc_macro_derive' attribute input" }
pub fn my_invalid_macro() {}
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
trait ToDerive {}
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
fn outer_function() {
#[proc_macro_derive(SomeTrait)]
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
mod test_module {
#[proc_macro_derive(SomeTrait)]
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
trait Chesapeake {}
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
mod inner {
struct InnerStruct;
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
fn outer_function() {
#[proc_macro]
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
struct DummyStruct;
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
mod test_module {
#[proc_macro]
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
trait SomeTrait {}
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
#[proc_macro]
fn my_macro() {} // { dg-error "functions tagged with .#.proc_macro.. must be .pub." }
+#![feature(no_core)]
+#![no_core]
+
# Copyright (C) 2021-2026 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
pub fn wild_pub_function() {} // { dg-error ".proc-macro. crate types currently cannot export any items other than functions tagged with .#.proc_macro.., .#.proc_macro_derive.. or .#.proc_macro_attribute.." }
// { dg-additional-options "-frust-crate-type=proc-macro" }
+#![feature(no_core)]
+#![no_core]
+
pub fn wild_pub_module() {} // { dg-error ".proc-macro. crate types currently cannot export any items other than functions tagged with .#.proc_macro.., .#.proc_macro_derive.. or .#.proc_macro_attribute.." }
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
I(i32),
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = 1;
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
enum Foo {
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
enum Foo {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = (1, 2, 3, 4);
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = (1, 2, 3, 4);
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = [0, 1];
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let arr = [1, 2];
let slice: &[i32] = &arr;
+#![feature(no_core)]
+#![no_core]
+
pub struct S;
pub fn foo(v: S) {
+#![feature(no_core)]
+#![no_core]
+
pub struct TupStruct (i32, i32);
pub fn main() {
+#![feature(no_core)]
+#![no_core]
+
pub struct TupStruct (i32, i32);
pub fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct A (i32, i32);
let a = A (0, 1);
+#![feature(no_core)]
+#![no_core]
+
enum Empty {}
enum NonEmpty {
Foo(i32),
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct A (i32, i32);
let a = A (0, 1);
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct A (i32, i32);
let a = A (0, 1);
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> bool {
true
}
+#![feature(no_core)]
+#![no_core]
+
fn bar (x: u8, y: u8) -> i32 {
match (x, y) {
(1, 1) => { return 1; }
+#![feature(no_core)]
+#![no_core]
+
union MyUnion {
f1: u32,
f2: f32,
+#![feature(no_core)]
+#![no_core]
+
enum E {
A(),
B,
// { dg-additional-options "-frust-compile-until=ast" }
+#![feature(no_core)]
+#![no_core]
+
enum Nat {
S(Box<Nat>),
Z,
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(dropck_eyepatch)]
struct Test<T> {
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32);
impl Foo {
fn test() {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo<A, B>(A, B);
impl Foo<i32, f32> {
+#![feature(no_core)]
+#![no_core]
+
#![feature(min_specialization)]
pub trait Foo {
// { dg-additional-options "-frust-crate=another_name" }
+#![feature(no_core)]
+#![no_core]
+
#![crate_name = "legit_name"]
// { dg-error ".-frust-crate-name. and .#.crate_name.. are required to match, but .another_name. does not match .legit_name." "" { target *-*-* } .-1 }
fn main() {}
// ErrorCode::E0308
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
fn plus_one(x: i32) -> i32 {
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
(""; // { dg-error "unexpected token .*" }
}
// https://doc.rust-lang.org/error_codes/E0063.html
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
x: i32,
y: i32,
// { dg-error "expected .* got .*" "" { target *-*-* } 0 }
+#![feature(no_core)]
+#![no_core]
+
fn test1() -> i32 {}
fn main() {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod missing_middle {
mod sub;
+#![feature(no_core)]
+#![no_core]
+
pub fn f() -> u32 {
5
}
+#![feature(no_core)]
+#![no_core]
+
mod other;
+#![feature(no_core)]
+#![no_core]
+
pub fn f() -> u32 {
2
}
+#![feature(no_core)]
+#![no_core]
+
pub fn f() -> u32 {
4
}
+#![feature(no_core)]
+#![no_core]
+
pub fn f() -> u32 {
3
}
+#![feature(no_core)]
+#![no_core]
+
pub fn f() -> u32 {
1
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 15u8;
let a: &u8 = &a;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _a = "gcc
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main()
{
match (1, 2) {
+#![feature(no_core)]
+#![no_core]
+
pub fn test() {
let a;
a = 1;
+#![feature(no_core)]
+#![no_core]
+
fn outer() {
inner();
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
let b = 10;
fn bar() {
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
const TOTO: i32 = 10;
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub macro bar() {}
}
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub macro bar() {}
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
pub mod foo {
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
pub mod foo {
+#![feature(no_core)]
+#![no_core]
+
struct Foo;
fn Foo() {} // { dg-error ".Foo. defined multiple times" }
#![feature(no_core)]
#![no_core]
+#![feature(no_core)]
+#![no_core]
+
struct Marker;
struct Foo {
+#![feature(no_core)]
+#![no_core]
+
struct Marker;
fn foo(a: Marker, b: Marker) -> Marker {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub macro bar() {}
}
+#![feature(no_core)]
+#![no_core]
+
struct Marker;
struct Foo(Marker);
+#![feature(no_core)]
+#![no_core]
+
mod a {
pub mod b {
pub fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
mod a {
pub mod b {
pub fn baz() {}
+#![feature(no_core)]
+#![no_core]
+
struct Test; // { dg-warning "struct is never constructed: .Test." }
impl Test {}
+#![feature(no_core)]
+#![no_core]
+
pub const BAR: u32 = { // { dg-warning "unused name" }
let ret = outer();
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn bar() {
foo();
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub mod bar {
// check that macros by example do not get inserted in ribs like regular items
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub mod bar {
pub mod baz {
// check that macros by example get exported to the crate's root with #[macro_export]
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub mod bar {
pub mod baz {
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub mod bar {
fn f() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(negative_impls)]
trait ExampleTrait {}
// | ^^^^^^^^^^^^^
// |
// = note: see issue #68318 <https://github.com/rust-lang/rust/issues/68318> for more information
+#![feature(no_core)]
+#![no_core]
+
// For more information about this error, try `rustc --explain E0658`.
// error: could not compile `playground` (bin "playground") due to 1 previous error
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! toto {
() => {
macro_rules! tata {
+#![feature(no_core)]
+#![no_core]
+
#[macro_use]
mod foo {
#[macro_use]
+#![feature(no_core)]
+#![no_core]
+
#[macro_use]
mod foo {
fn bar() {
+#![feature(no_core)]
+#![no_core]
+
#[macro_use]
mod num {
#[macro_use]
+#![feature(no_core)]
+#![no_core]
+
fn test() {
let a;
+#![feature(no_core)]
+#![no_core]
+
#![cold] // { dg-error "attribute cannot be used at crate level" }
pub fn test() {}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[no_mangle(foo)] // { dg-error "malformed .no_mangle. attribute input" }
fn foo() {}
// { dg-note "must be of the form" "" { target *-*-* } .-2 }
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
pub fn MyFunction() {
// { dg-warning "function .MyFunction. should have a snake case name" "" { target *-*-* } .-1 }
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
static _my_static : i32 = 0;
// { dg-warning "static variable ._my_static. should have an upper case name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub fn toto(a: i32, ...) {}
// { dg-error "only foreign or .unsafe extern .C.. functions may be C-variadic" "" { target *-*-* } .-1 }
// https://doc.rust-lang.org/error_codes/E0323.html
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
trait Foo {
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
struct StructWithFields {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
(1, (2, 3)).1.1;
}
// https://doc.rust-lang.org/error_codes/E0425.html
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let f = x * x * 3; // { dg-error "cannot find value .x. in this scope" }
let a = f(); // invalid, too few parameters
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
pub struct Toto {
u: usize,
}
// { dg-additional-options "-frust-compile-until=lowering -frust-assume-builtin-offset-of" }
+#![feature(no_core)]
+#![no_core]
+
pub struct Foo {
a: i32,
// { dg-additional-options "-frust-compile-until=compilation -frust-assume-builtin-offset-of" }
+#![feature(no_core)]
+#![no_core]
+
pub struct Foo {
a: i32,
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-frust-compile-until=typecheck" }
// TODO: this should typecheck
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let () = ();
}
// floating point literals can't start with a '.'
// TODO: improve the error message emitted here
+#![feature(no_core)]
+#![no_core]
+
const X: f32 = .5; // { dg-error ".*" }
// { dg-additional-options "-frust-compile-until=ast" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
only_foo::<<i32 as Bar>::Item>();
}
// { dg-additional-options "-frust-compile-until=ast" }
+#![feature(no_core)]
+#![no_core]
+
pub fn foo<D: ::std::fmt::Debug>(_d: D) -> u32 {
0
}
+#![feature(no_core)]
+#![no_core]
+
default fn f() {
// { dg-error ".default. is only allowed on items within .impl. blocks" "" { target *-*-* } .-1 }
}
// { dg-additional-options "-frust-compile-until=ast" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! default {
($($x:tt)*) => { $($x)* }
}
+#![feature(no_core)]
+#![no_core]
+
pub struct Foo(pub ());
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = [1, 2, 3, 4];
+#![feature(no_core)]
+#![no_core]
+
pub(in crate::) struct S;
// { dg-error "expecting ... but .::. found" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
mod A {
struct B;
}
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
trait Foo {
fn bar();
+#![feature(no_core)]
+#![no_core]
+
fn main() {}
#[cfg(FALSE)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
match ((12, 13)) {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
enum A {
B,
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(fmt: *const i8, _: ...);
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(prelude_import)]
mod core {
+#![feature(no_core)]
+#![no_core]
+
mod primitive {
pub use i32;
}
+#![feature(no_core)]
+#![no_core]
+
mod orange {
mod green {
fn sain() {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod orange {
fn tangerine() {}
+#![feature(no_core)]
+#![no_core]
+
mod orange {
mod green {
fn sain_void() {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
mod orange {
mod green {
struct Foo;
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
pub struct Foo(i8);
struct Bar(pub i8); // { dg-warning "struct is never constructed: .Bar." }
pub struct Baz {
+#![feature(no_core)]
+#![no_core]
+
pub(crate) struct Foo; // { dg-warning "struct is never constructed" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _arr0: [i32; 5] = [1, 2, 3, 4, 5];
let _arr1: [i32; 5] = [1, 2, 3, 4, 5];
+#![feature(no_core)]
+#![no_core]
+
fn main(){
let foo = 1337;
let bar_ptr = &foo as *const i32;
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub mod bar {
pub fn baz() {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod foo {
mod bar {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod foo {
mod bar {
// { dg-additional-options "-frust-compile-until=ast" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
for _ in 1.. {
break;
+#![feature(no_core)]
+#![no_core]
+
const X: &'static u8 = br#"12
12"#;
+#![feature(no_core)]
+#![no_core]
+
const X: &'static str = r#"12
12"#;
+#![feature(no_core)]
+#![no_core]
+
pub fn plus(n: i32, m: i32) -> i32 {
r#crate /* { dg-error "forbidden raw identifier" } */
}
+#![feature(no_core)]
+#![no_core]
+
pub fn s(num: i32) -> i32 {
r#_ * num /* { dg-error "not a valid raw identifier" } */
}
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(raw_ref_op)]
pub struct Toto {
// { dg-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
pub struct Toto {
u: usize,
}
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(raw_ref_op)]
pub struct Toto {
+#![feature(no_core)]
+#![no_core]
+
struct S1 {
x: f64,
y: f64,
+#![feature(no_core)]
+#![no_core]
+
const TEST: i32 = 2;
const TEST: f32 = 3.0; // { dg-error "defined multiple times" }
+#![feature(no_core)]
+#![no_core]
+
fn test() -> bool {
true
}
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
struct Foo<T>(T, usize);
impl Foo<i32> {
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
pub fn foo() -> i32
{
+#![feature(no_core)]
+#![no_core]
+
fn f(&b: i32) {} // { dg-error "expected i32, found reference" }
+#![feature(no_core)]
+#![no_core]
+
fn foo(&b: &i32) -> bool {
b == 0
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = &123;
let b: &mut i32 = a;
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
x: i32,
}
// { dg-excess-errors "accessing value of" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
mod mem {
+#![feature(no_core)]
+#![no_core]
+
pub fn f(_: extern "Rust" fn()) {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")]
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_const_unstable(feature = "const_ascii_ctype_on_intrinsics", issue = "1234")]
// https://doc.rust-lang.org/error_codes/E0124.html
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct Foo {
field1: i32,
// since we aren't trying to match error messages too closely
// and the >=1.66 error message is nicer
// we may as well mimic that
+#![feature(no_core)]
+#![no_core]
+
impl ((Self, i32)) {}
// { dg-error ".Self. is not valid in the self" "" { target *-*-* } .-1 }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
struct foo;
fn bar() -> self::foo {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
struct foo;
fn bar() -> self::foo {
+#![feature(no_core)]
+#![no_core]
+
struct MyStruct;
impl MyStruct {
+#![feature(no_core)]
+#![no_core]
+
mod bar {
pub mod foo {}
pub fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
struct MyStruct;
impl MyStruct {
+#![feature(no_core)]
+#![no_core]
+
struct MyStruct;
impl MyStruct {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut x = 5;
let mut x;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
pub fn foo(a: &[u32]) {
match a {
[first, ..] => {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let arr = [0, 1];
// { dg-additional-options "-frust-crate=fancy_crate_name -fdump-tree-gimple" }
+#![feature(no_core)]
+#![no_core]
+
pub fn does_nothing() {}
fn main() {
does_nothing()
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
static TEST: usize = 1;
// { dg-warning "unused variable .TEST." "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
static x = 3; // { dg-error "expecting ':' but '=' found" }
fn main() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
if x > 1 { // { dg-error "mismatched types, expected .... but got .<integer>." }
1
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
struct A { // { dg-warning "struct is never constructed" }
a: u32
}
+#![feature(no_core)]
+#![no_core]
+
#[repr(align(8))]
struct Foo {
x: i16,
+#![feature(no_core)]
+#![no_core]
+
fn main () {
+#![feature(no_core)]
+#![no_core]
+
pub struct Test {
#[cfg(not(any(
target_os = "solaris",
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: f32,
b: f32,
+#![feature(no_core)]
+#![no_core]
+
#[repr(packed(2))]
struct Foo {
x: i16,
+#![feature(no_core)]
+#![no_core]
+
fn main () {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "structural_peq"]
// { dg-additional-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 15;
// { dg-options "-w" }
// Test for issue #4233 - malformed #[target_feature] attribute input
+#![feature(no_core)]
+#![no_core]
+
#[target_feature] // { dg-error "malformed .target_feature. attribute input" }
unsafe fn foo_sse() {}
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// comment line not a doc
/* comment block not a doc */
+#![feature(no_core)]
+#![no_core]
+
//! inner line comment for most outer crate
/*! inner block comment for most outer crate */
// comment line not a doc\r
/* comment block not a doc */\r
+#![feature(no_core)]
+#![no_core]
+
\r
//! inner line comment for most outer crate\r
/*! inner block comment for most outer crate */\r
+#![feature(no_core)]
+#![no_core]
+
enum E {
A(i32),
B(i32, i32),
// { dg-prune-output "warning: unused name" } as there are many of these expected.
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = 1;
+#![feature(no_core)]
+#![no_core]
+
const TEST: [i32; 16] = [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8];
// { dg-warning "unused name" "" { target *-*-* } .-1 }
\ No newline at end of file
+#![feature(no_core)]
+#![no_core]
+
const SIZE: usize = 14 + 2;
const TEST: [i32; SIZE] = [2; SIZE];
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
1
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let arr: [_; 5] = [1, 2, 3, 4, 5];
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let arr = ["Hello"; 0];
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let xs: [i32; 5] = [1, 2, 3, 4, 5];
let xy = [6, 7, 8];
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut array: [i32; 3] = [0; 3];
+#![feature(no_core)]
+#![no_core]
+
const TEST: usize = 6;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
const TEST: usize = 4;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
// Checks that we don't try to allocate a 4TB array during compilation
fn main () {
+#![feature(no_core)]
+#![no_core]
+
// Checks that we don't try to allocate a 4TB array during compilation
fn foo() -> [u8; 4 * 1024 * 1024 * 1024 * 1024] {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut array: [i32; 3] = [0; 3];
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut array: [i32; 3] = [0; 3];
array[0] = 1;
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> usize {
1
}
+#![feature(no_core)]
+#![no_core]
+
extern "C" { fn abort (); }
pub fn main ()
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
struct Bar {
a: i32,
+#![feature(no_core)]
+#![no_core]
+
fn test3(x: i32) -> i32 {
if x > 1 {
5
+#![feature(no_core)]
+#![no_core]
+
fn test() -> i32 {
123
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = 111;
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> isize {
0
}
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
0
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 123;
let b = if a > 10 { a - 1 } else { a + 1 };
+#![feature(no_core)]
+#![no_core]
+
pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+
// UTF8 BOM
pub fn main () { }
#!/usr/bin/cat
-pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+pub fn main() {}
+#![feature(no_core)]
+#![no_core]
+
pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+
extern "C"
{
fn abort ();
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32;
a = 123;
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
1
}
// { dg-options "-fdump-tree-original" }
+#![feature(no_core)]
+#![no_core]
+
// { dg-final { scan-assembler-not "__builtin_abort\[^\"\]" } }
// { dg-final { scan-tree-dump "__builtin_abort" "original" } }
+#![feature(no_core)]
+#![no_core]
+
pub fn main ()
{
let _c = 'x';
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
let a: &[u8; 4];
a = b"test";
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: *const i32 = &123;
let b: *mut i32 = (a as *mut i32);
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = 123i32;
let b: u8 = a as u8;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = "foo\0";
let b = a as *const str;
+#![feature(no_core)]
+#![no_core]
+
mod fake {} // Add one line so gccrs doesn't believe we're parsing a shebang
#[cfg_attr(feature = "somefeature", attribute = "someattr")]
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a;
a = 'c';
+#![feature(no_core)]
+#![no_core]
+
#![crate_type = "lib"]
#[doc(alias = "foo")] // ok!
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
let a: &i32 = &123;
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
let a: *const i32 = &123;
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn is_zero(x: i32) -> bool {
x == 0
}
+#![feature(no_core)]
+#![no_core]
+
# Copyright (C) 2021-2026 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 2;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut x = 5;
+#![feature(no_core)]
+#![no_core]
+
const TEST_CONST:i32 = 10;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
const C: usize = 42;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
const A: [i32; 3] = [1, 2, 3];
const B: i32 = A[1];
+#![feature(no_core)]
+#![no_core]
+
fn test1() -> i32 {
return 2;
// { dg-warning "unreachable expression" "" { target *-*-* } .+1 }
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
return 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 123;
let b = &a;
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
/// doc comment 1
/// doc comment 2
/// `blah blah` markdown
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod modules;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
pub fn return_12() -> i32 {
12
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#[path = "modules/valid_path.rs"]
mod not_a_valid_path;
+#![feature(no_core)]
+#![no_core]
+
fn test(x: f32) -> f32 {
return x + 1.0;
}
// { dg-prune-output "warning: unused name" } as there are many of these expected.
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a1: f32 = 1.0f32;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut an_integer = 5;
an_integer = test(1) + 3;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let y = x + 1;
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
unsafe {
let struct_test = Foo { one: 1, two: 2 };
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let struct_test = Foo { one: 1, two: 2 };
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut x = TEST_CONST;
x = x + 1;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn not_void() -> i32 {
8
}
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
8;
8;
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32) -> i32 {
a + 1
}
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32) -> i32 {
a + 1
}
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: fn(i32) -> i32,
b: i32,
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32) -> i32 {
a + 1
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
struct I();
impl I {
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> bool {
true
}
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> bool {
true
}
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
if x == 10 {
123
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> bool {
true
}
+#![feature(no_core)]
+#![no_core]
+
extern "C"
{
pub fn abort ();
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
struct Point {
x: f64,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
fn test1() -> i32 {
1
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let array: [_; 2] = [111, 222];
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#![allow(dead_code)]
#![allow(unused_variables)]
pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+
const TEST_CONST: i32 = 10;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 1u32;
+#![feature(no_core)]
+#![no_core]
+
fn test(a: u32) -> u32 {
a + 1
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a;
a = 1;
+#![feature(no_core)]
+#![no_core]
+
const TEST_CONST: i32 = 10;
fn test(x: u32) -> u32 {
// { dg-prune-output "warning: unused name" } as there are many of these expected.
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a1: i8 = 1i8;
// { dg-additional-options -fdump-tree-original }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
extern "rust-intrinsic" {
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options -fdump-tree-original }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
extern "rust-intrinsic" {
/* comment cr\r is allowed */
+#![feature(no_core)]
+#![no_core]
+
pub fn main () { }
// comment cr\r is allowed
+#![feature(no_core)]
+#![no_core]
+
pub fn main () { }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
const BLOCK_LEN: usize = 64;
const IV: [u32; 8] = [
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
let _: &i32 = &&&&1;
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> bool {
return true;
}
+#![feature(no_core)]
+#![no_core]
+
fn foo<'a>(t: &'a str) -> &'a str {
t
}
// { dg-prune-output "warning: unused name" } as there are many of these expected.
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let hex: i32 = 0xFF;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
'outer: loop {
'inner: loop {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut a = 1;
let mut b = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
('outer: loop {
'inner: loop {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! stmt {
($s:stmt) => {
$s
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($a:expr) => { $a };
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B,
+#![feature(no_core)]
+#![no_core]
+
struct Point {
x: f64,
y: f64,
+#![feature(no_core)]
+#![no_core]
+
struct Point {
x: f64,
y: f64,
+#![feature(no_core)]
+#![no_core]
+
struct Point {
x: f64,
y: f64,
+#![feature(no_core)]
+#![no_core]
+
mod foo {
struct A; // { dg-warning "struct is never constructed" }
}
// This is testing name resolution
+#![feature(no_core)]
+#![no_core]
+
mod _foo {
struct _A;
+#![feature(no_core)]
+#![no_core]
+
mod foomod {
pub struct Foo {}
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
mod A {
pub mod B {
pub mod C {
+#![feature(no_core)]
+#![no_core]
+
fn unused() {}
+#![feature(no_core)]
+#![no_core]
+
#[must_use = "TEST 1"]
fn test1() -> i32 {
123
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
fn ret1() -> i32 {
return 1;
}
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
let a = 123;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
struct Point {
x: f64,
y: f64,
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
let c;
let d;
#!
[allow(unused)]
+#![feature(no_core)]
+#![no_core]
fn main () { }
+#![feature(no_core)]
+#![no_core]
+
#!/*/this/is/a/comment*/[allow(unused)] fn main () { }
+#![feature(no_core)]
+#![no_core]
+
#!//this/is/a/comment
[allow(unused)]
fn main () { }
+#![feature(no_core)]
+#![no_core]
+
#!//this/is/a/comment
/* Also a /* nested */
+#![feature(no_core)]
+#![no_core]
+
#!
[allow(unused)]
+#![feature(no_core)]
+#![no_core]
+
fn test(a: i32, b: i32) -> i32 {
a + b
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 123;
let b = a + (a * 2);
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
let mut num = 2;
let r1: *const i32 = #
+#![feature(no_core)]
+#![no_core]
+
const TRUE: bool = true;
const FALSE: bool = !TRUE;
+#![feature(no_core)]
+#![no_core]
+
extern "C"
{
fn abort ();
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
pub fn square(num: i32) -> i32 {
r#num * num
}
+#![feature(no_core)]
+#![no_core]
+
pub fn plus(r#break: i32, r#unsafe: i32) -> i32 {
r#break + r#unsafe
}
+#![feature(no_core)]
+#![no_core]
+
fn gcd(x: i32, y: i32) -> i32 {
if y == 0 {
x
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = 1;
{
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
impl Foo {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let mut x = 5;
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let x = 1;
let x = x + 1;
-#!/usr/bin/env cat
+#!/usr/bin/env cat
-fn main () { }
+#![feature(no_core)]
+#![no_core]
+fn main() {}
-#!/usr/bin/env cat
+#!/usr/bin/env cat
+#![feature(no_core)]
+#![no_core]
#![allow(unused)]
-fn main () { }
+fn main() {}
#!//usr/bin/env cat
#![allow(unused)]
+#![feature(no_core)]
+#![no_core]
fn main () { }
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
return x + 1;
}
+#![feature(no_core)]
+#![no_core]
+
static x:i32 = 3;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
if x > 1 { 1 } else { 2 };
if x > 1 { 1; } else { 2; }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a;
a = "hello world infer";
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
one: i32,
two: i32,
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
// { dg-additional-options "-fdump-tree-gimple -frust-crate=example" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: u16,
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
one: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct foo {
a: i32,
+#![feature(no_core)]
+#![no_core]
+
pub fn main() {
struct O(i32);
struct T(i32, i32);
+#![feature(no_core)]
+#![no_core]
+
struct Foo(f32, f32);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
b: i32,
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
b: f32,
+#![feature(no_core)]
+#![no_core]
+
struct Foo(f32, i32);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
struct foo(i32, f32);
+#![feature(no_core)]
+#![no_core]
+
#![crate_name = "name"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: (i32, bool) = (123, true);
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = 123;
let b = (a,);
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = (1, true);
+#![feature(no_core)]
+#![no_core]
+
enum E {
T0(),
T1(i32),
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, i32);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
return 1;
}
+#![feature(no_core)]
+#![no_core]
+
fn main()
{
// tuples
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, i32, bool);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, bool);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct E();
struct T(E,E,());
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, i32);
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
type TypeAlias = (i32, u32);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
type x = u32;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
one: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
return x + 1;
}
+#![feature(no_core)]
+#![no_core]
+
fn test(x: i32) -> i32 {
return x + 1;
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let xs: [i32; 5] = [1, 2, 3, 4, 5];
let xy = [6, 7, 8];
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
a: i32,
b: i32,
+#![feature(no_core)]
+#![no_core]
+
fn test(x: u32) -> u32 {
return x + 1;
}
// { dg-prune-output "warning: unused name" } as there are many of these expected.
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = -1;
// { dg-excess-errors "...." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
// { dg-error "unended string literal" "" { target *-*-* } .+1 }
let s = "123
// { dg-excess-errors "...." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
// { dg-error "unended byte string literal" "" { target *-*-* } .+1 }
let s = b"123
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _unused_but_fine = 12;
let unused = 12; // { dg-warning "unused name" }
// { dg-excess-errors "...." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
// { dg-error "unended raw byte string literal" "" { target *-*-* } .+1 }
let s = br##"123"#
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
union U
{
f1: u8
+#![feature(no_core)]
+#![no_core]
+
union union
{
union: u32,
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: () = ();
// { dg-warning "unused name" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn test(a: ()) -> () {
a
}
+#![feature(no_core)]
+#![no_core]
+
struct S;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct S;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct Foo;
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn test() -> i32 {
unsafe {
let a;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
unsafe {}
()
+#![feature(no_core)]
+#![no_core]
+
pub fn test() -> i32 {
let a = unsafe { 123 };
a
+#![feature(no_core)]
+#![no_core]
+
struct SS {
one: i32,
two: i32,
+#![feature(no_core)]
+#![no_core]
+
// { dg-warning "function is never used: 'bar'" "" { target *-*-* } .+1 }
fn bar() {
foo();
+#![feature(no_core)]
+#![no_core]
+
fn test() -> i32 {
1
}
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
one: i32,
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
one: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = [1, 2, 3];
let b: usize = 1;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
// FORM FEED
\f
+#![feature(no_core)]
+#![no_core]
+
fn foo() {}
fn bar() -> i32 { return 10; }
+#![feature(no_core)]
+#![no_core]
+
#[track_caller]
fn foo() {}
+#![feature(no_core)]
+#![no_core]
+
pub trait FirstTrait: SecondTrait {}
// { dg-error "cycle detected when computing the super predicates of .FirstTrait." "" { target *-*-* } .-1 }
pub trait SecondTrait: FirstTrait {}
// Testing multiple supertraits and calling supertrait methods
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
my_int: u32,
// Testing diamond problem with supertraits
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
+#![feature(no_core)]
+#![no_core]
+
fn main() {}
#[cfg(FALSE)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-options "-O2 -w -fdump-tree-optimized" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
extern "rust-intrinsic" {
// { dg-options "-O2 -w -fdump-tree-optimized" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
extern "rust-intrinsic" {
// { dg-additional-options "-frust-compile-until=typecheck" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-frust-edition=2018" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: (i32, bool) = (123, 123); // { dg-error "expected" }
let b;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let tuple = (((),()),);
+#![feature(no_core)]
+#![no_core]
+
enum E {
V(usize),
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let (_,) = 1; // { dg-error "expected <integer>, found tuple" }
let (_,) = (1, 2); // { dg-error "expected a tuple with 2 elements, found one with 1 element" }
+#![feature(no_core)]
+#![no_core]
+
struct Foo {
one: i32,
two: i32,
+#![feature(no_core)]
+#![no_core]
+
struct Bar(i32, i32, bool);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
struct Foo(i32, i32, bool);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let (a, .., b) = (1, 1);
a = 2; // { dg-error "assignment of read-only variable .a." }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
match (1, 2.2, "not 3") {
// { dg-error "expected a tuple with 3 elements, found one with 5 elements" "" { target *-*-* } .+1 }
// { dg-additional-options "-frust-compile-until=typecheck" }
+#![feature(no_core)]
+#![no_core]
+
struct Struct(i32);
fn struct_pattern(Struct { 0: a }: Struct) {}
+#![feature(no_core)]
+#![no_core]
+
type TypeAlias = (i32, u32);
fn main() {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
pub fn main() -> i32 {
if 12 {} // { dg-error "mismatched types" }
if 12 {} else {} // { dg-error "mismatched types" }
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = -1;
let b: i32 = 3 - -1;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a: i32 = -1;
let b: i32 = 3 - -1;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// ErrorCode::E0426
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn resolve_label_continue() -> () {
loop {
+#![feature(no_core)]
+#![no_core]
+
fn main ()
{
// Braces are required
+#![feature(no_core)]
+#![no_core]
+
fn main() {
// U+304C
let が = ();
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![allow(unused)]
fn main() {
trait Hello {
+#![feature(no_core)]
+#![no_core]
+
fn foo(_a: &i32) {}
fn bar(_a: i32) {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#[target_feature(sse)]
unsafe fn foo() {
let a: usize = 0;
+#![feature(no_core)]
+#![no_core]
+
fn foo(_a: &i32) {}
fn bar(_a: i32) {}
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
static VALUE: char;
}
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
let a = 15;
let p_a = &a as *const i32;
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let b = 15;
let c = *(&b as *const i32); // { dg-error "dereference of raw pointer" }
+#![feature(no_core)]
+#![no_core]
+
unsafe fn foo() {}
unsafe fn bar() {
foo();
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(fmt: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
struct S;
impl S {
+#![feature(no_core)]
+#![no_core]
+
union U {
a: i32,
b: f32,
+#![feature(no_core)]
+#![no_core]
+
unsafe mod toto {}
// { dg-error "module cannot be declared unsafe" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
#[unstable(feature = "some_feature", issue = "12345")]
pub fn foo() {}
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
pub fn foo_1() {
'a: loop {
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
pub fn a() ->i32 {
let mut x = 2;
// { dg-warning "unused mut .x." "" { target *-*-* } .-1 }
// { dg-additional-options "-frust-unused-check-2.0" }
+#![feature(no_core)]
+#![no_core]
+
struct Point { x: i32, y: i32 }
// { dg-warning "field is never read: .x." "" { target *-*-* } .-1 }
// { dg-warning "field is never read: .y." "" { target *-*-* } .-2 }
+#![feature(no_core)]
+#![no_core]
+
mod frob {}
use foo::bar::baz; // { dg-error "unresolved import .foo::bar::baz." }
+#![feature(no_core)]
+#![no_core]
+
mod foo {
pub struct S;
}
+#![feature(no_core)]
+#![no_core]
+
mod intrinsic {
pub fn foo() {}
}
+#![feature(no_core)]
+#![no_core]
+
use self;
// { dg-error ".self. imports are only allowed within a { } list" "" { target *-*-* } .-1 }
+#![feature(no_core)]
+#![no_core]
+
struct B;
use {B as B2, self};
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let a = [1, 2, 3];
let b: u32 = 1;
// { dg-additional-options -frust-mangling=v0 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options -frust-mangling=v0 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let _ = 'l: while break 'l {};
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
// use self::Ordering::*;
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
pub enum Option<T> {
None,
// { dg-additional-options "-frust-compile-until=lowering" }
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A(i32),
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
1 = 3; // { dg-error "assignment of read-only location" }
}
// https://doc.rust-lang.org/error_codes/E0061.html
+#![feature(no_core)]
+#![no_core]
+
fn main() {
fn f(u: i32) {}
fn T(u: i32, v: i32, w: i32, x: i32, y: i32, z: i32) {}
// { dg-excess-errors "warnings" }
+#![feature(no_core)]
+#![no_core]
+
// { dg-error "lifetime not defined" "#359" { xfail *-*-* } .+1 }
fn lifetime_undefined(t: &'a str) -> &'a str {
+#![feature(no_core)]
+#![no_core]
+
pub mod foo {
pub macro bar() {}
}
// { dg-xfail-if "pub visibility not supported #432" *-*-* }
+#![feature(no_core)]
+#![no_core]
+
mod foomod {
pub struct Foo {
+#![feature(no_core)]
+#![no_core]
+
# Copyright (C) 2021-2026 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
// { dg-options "-fsyntax-only" }
+#![feature(no_core)]
+#![no_core]
+
fn foo() {
let [] = [0; 0];
// { dg-skip-if "see https://github.com/Rust-GCC/gccrs/pull/1632" { *-*-darwin* } }
// { dg-options "-w -gdwarf-4 -dA" }
// 'char' should use DW_ATE_UTF
+#![feature(no_core)]
+#![no_core]
+
fn main() {
let c = 'x';
// Use -w to avoid warnings about the unused variables
+#![feature(no_core)]
+#![no_core]
+
#[link_section = ".universe"]
fn not_in_text() -> i32 {
42
// i8 and u8 types should not have the DWARF 'char' encoding.
+#![feature(no_core)]
+#![no_core]
+
fn main () {
let x : i8 = 5;
let y : u8 = 7;
+#![feature(no_core)]
+#![no_core]
+
fn main () {
// { dg-do compile }
// { dg-options "-gdwarf-5 -dA" }
+#![feature(no_core)]
+#![no_core]
+
#[no_mangle]
fn do_not_mangle() -> i32 {
0
+#![feature(no_core)]
+#![no_core]
+
fn main () {
// { dg-do compile }
// { dg-options "-gstrict-dwarf -gdwarf-3 -dA" }
+#![feature(no_core)]
+#![no_core]
+
fn main () {
// { dg-do compile }
// { dg-options "-gdwarf-5 -dA -w" }
// { dg-do compile { target { x86_64-*-* } } }
// { dg-options "-gdwarf-5 -dA -w -O1 -m64" }
+#![feature(no_core)]
+#![no_core]
+
pub extern "win64" fn id(num: i32) -> i32 {
num
}
/* { dg-output "Value is: 42\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
extern "C" {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! foo {
() => {
$crate::bar()
/* { dg-do run { target x86_64*-*-* } } */
/* { dg-output "Value is: 5\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
extern "C" {
/* { dg-do run { target x86_64*-*-* } } */
/* { dg-output "Value is: 5\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
extern "C" {
// { dg-output "minus two!\r*\nelse\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
[55, 66, 77][1] - 66
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
/* { dg-output "less\r*" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
mod core {
/* { dg-output "<><=>=\r*" } */
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
mod core {
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
let ret = {
1;
// { dg-shouldfail "abort should stop the program" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#![feature(intrinsics)]
// { dg-additional-options "-w -frust-cfg=A" }
// { dg-output "A\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-output "\r*\ntest10btrue2.15\r*\ntest10bfalse2.151\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-output "VALUE\r*\nVALUE\r*\n" }
// { dg-set-compiler-env-var ENV_MACRO_TEST "VALUE" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-output "1\r*\n1\r*\n1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
// { dg-output "hello, include!\r*\nhello, include!\r*\nhello, include!\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
-// { dg-output "20\r*\n23\r*\n" }
+// { dg-output "22\r*\n25\r*\n" }
+#![feature(no_core)]
+#![no_core]
#![feature(rustc_attrs)]
extern "C" {
// { dg-output "VALUE\r*\nVALUE\r*\n" }
// { dg-set-compiler-env-var ENV_MACRO_TEST "VALUE" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs, lang_items)]
// { dg-output "a! ()" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-output "rust/execute/torture/builtin_macros1.rs\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-output "14\r*\n42\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
fn foo() -> i32 {
{54}
#[cfg(all(A, not(A)))]
// { dg-additional-options "-w -frust-cfg=A" }
// { dg-output "test1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
// { dg-output "test1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
// { dg-output "test1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
// { dg-output "test1\r*\ntest2\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
let mut a = 0;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-output "3\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-output "3\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
/* { dg-output "123\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-output "123\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
const X: i32 = const {
let a = 15;
let b = 14;
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
const fn const_fn() -> usize {
4
}
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
const A: i32 = 1;
const B: i32 = { A + 2 };
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro one() {
1
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro one {
() => { 1 }
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
macro add {
($e:expr) => {
+#![feature(no_core)]
+#![no_core]
+
#![feature(decl_macro)]
pub macro add {
($e:expr) => {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[derive(Default)]
// { dg-output "true\r*\nfalse\r*\nfalse\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
// { dg-output "true\r*\nfalse\r*\nfalse\r*\nfalse\r*\nfalse\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "clone"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
0
}
/* { dg-output "0\r*\n2\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-xfail-run-if "" { *-*-* } }
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
1
// { dg-additional-options "-w" }
// { dg-output "12\r*" }
+#![feature(no_core)]
+#![no_core]
+
mod modules;
extern "C" {
+#![feature(no_core)]
+#![no_core]
+
fn return_12() -> i32 {
12
}
// { dg-output "loop\r*\nloop\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
// { dg-output "loop1\r*\nloop2\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
1;
2;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
/* { dg-output "Hello World\r*" }*/
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
/* { dg-output "Hello World 123\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
enum Res {
OK,
BAD,
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
/* { dg-output "Hello from Message\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
/* { dg-do run { target arm*-*-* } } */
/* { dg-output "5\r*\n9\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
/* { dg-do run { target x86_64*-*-* } } */
/* { dg-output "5\r*\n9\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
/* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-additional-options "-w" }
// { dg-output "outer\r*\ninner\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
// { dg-output "slice_access=3\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-options "-w" }
// { dg-output "1\r*\n2\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
/* { dg-output "called Foo::print\\(\\)\r*" } */
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
/* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B(i32),
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A,
B(i32),
// { dg-additional-options "-w" }
/* { dg-output "WORKS\r?\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
mod core {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-output "hello world: gccrs\r*\n" }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
static TEST_1: &str = "gccrs";
static TEST_2: i32 = 123;
// { dg-output "123\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-output "123\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
/* { dg-output "L1\r*\n\L2\r*\nL3\r*\nL4" } */
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-warning "field is never read: .x." "" { target *-*-* } .-1 }
// { dg-warning "field is never read: .y." "" { target *-*-* } .-2 }
+#![feature(no_core)]
+#![no_core]
+
struct Point {
x: u32,
y: u32,
/* { dg-output "child\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "Err: 15\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
/* { dg-output "parent 123\r*\nchild\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-options "-w" }
// { dg-output "less\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(exclusive_range_pattern)]
fn main() -> i32 {
/* { dg-output "Hello World 123\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-output "Foo::bar\r*\n" }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "Result: 123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "Result: 123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "hi\r*" } */
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
{
extern "C" {
+#![feature(no_core)]
+#![no_core]
+
struct Pattern(i32);
fn pattern_as_arg(Pattern(value): Pattern) -> i32 {
// { dg-output "1\r*\n2\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
pub use option::Option::{self, None, Some};
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
let foo @ (bar, _, _) = (0, 2, 3);
let mut ret = 1;
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
let (x, y, z) = (2, 3, 6);
x * y - z
// { dg-additional-options "-fdump-rtl-final" }
// { dg-final { scan-rtl-dump "printf" "final" } }
// { dg-output "gcc\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
#[link_name = "printf"]
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
let x = -55;
// { dg-output "1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
pub fn test() -> u64 {
let mut n = 113383; // #20 in https://oeis.org/A006884
while n != 1 {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! stmt {
($s:stmt) => {
$s
+#![feature(no_core)]
+#![no_core]
+
#[macro_use]
mod foo {
macro_rules! a {
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($a:expr,$b:expr) => {
$a + $b
// { dg-output "18\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "2\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "0\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "18\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "15\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($e:literal) => {
0 + $e
+#![feature(no_core)]
+#![no_core]
+
macro_rules! two {
(2) => {
3
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($e:literal) => {
0 + $e
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($e:expr, $($es:expr),*) => {
$e + add!($($es),*)
// { dg-output "arg\r*\narg\r*\narg\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($e:expr , $($es:expr) , *) => {
$e + add!($($es) , *)
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add_parens {
($($rep:ident ( ) )*) => {
{ 0 $(+ $rep ( ))* }
// { dg-output "1\r*\n2\r*\nNaN\r*\n3\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! print_num {
($l:literal) => {{
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! repeat {
( $( $i:literal ),* ; $( $j:literal ),* ) => (( $( ($i,$j) ),* ))
}
+#![feature(no_core)]
+#![no_core]
+
macro_rules! t {
($t:tt) => {
$t
+#![feature(no_core)]
+#![no_core]
+
macro_rules! count_tt {
($t:tt) => { 1 };
($t:tt $($ts:tt)*) => { 1 + count_tt!($($ts)*) };
// { dg-additional-options "-frust-cfg=A" }
+#![feature(no_core)]
+#![no_core]
+
macro_rules! attr {
(#[$attr:meta] $s:stmt) => {
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-output "1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-output "invok\r*\ninvok\r*\ninvok\r*\ninvok\r*\ninvok\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
// { dg-additional-options "-w -frust-cfg=A" }
// { dg-output "A\r*\nB\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($a:expr,$b:expr) => {
$a + $b
+#![feature(no_core)]
+#![no_core]
+
macro_rules! add {
($a:expr,$b:expr) => {{
$a + $b
+#![feature(no_core)]
+#![no_core]
+
macro_rules! Test {
($a:ident, $b:ty) => {
struct $a($b);
// { dg-output "any\r*\nany\r*\nany\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "zo1\r*\nzo1\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "oom\r*\noom\r*\noom\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
let mut x = 2;
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
+#![feature(no_core)]
+#![no_core]
+
pub struct TupStruct (i32, i32);
pub fn main() -> i32 {
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
// { dg-output "correct\r*" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn puts(s: *const i8);
}
+#![feature(no_core)]
+#![no_core]
+
fn main() -> i32 {
struct A (i32, i32);
let a = A (0, 1);
// { dg-output "Foo::A\r*\nFoo::B\r*\nFoo::C x\r*\nFoo::D 20 80\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "123\r*\n80\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "Foo::A\r*\nwildcard\r*\nwildcard\r*\nFoo::D 20 80\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-output "182 is more than 100\r*\n55 is less than 100\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "a\r*\nseven\r*\nquote\r*\nelse" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "amazing\r*\nwildcard\r*\ncompiler\r*\nproductivity\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "other!\r*\nother!\r*\nother!\r*\nfifteen!\r*\nfifteen!\r*\nother!\r*\nother!\r*\nfifteen!\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "E::One\r*\nE::Two\r*\nbreak!\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "zero to END_RANGE\r*\nzero to END_RANGE\r*\nelse\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "lowercase\r*\nuppercase\r*\nother\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
// { dg-output "x:15\r*\ny:20\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
+#![feature(no_core)]
+#![no_core]
+
macro_rules! matches {
($expression:expr, $($pattern:pat)|+ $( if $guard:expr ),*) => {
match $expression {
/* { dg-output "124\r*\n458" } */
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
// { dg-output "foo_deref\r*\nimm_deref\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-additional-options "-w" }
// { dg-output "mut_deref\r*\nfoobar: 123\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-additional-options "-w" }
// { dg-output "mut_deref\r*\nfoobar: 123\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
+#![feature(no_core)]
+#![no_core]
+
#![feature(min_specialization, lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
#![feature(min_specialization, lang_items)]
#[lang = "sized"]
+#![feature(no_core)]
+#![no_core]
+
mod A {
pub mod B {
pub mod C {
// { dg-output "gcc\n\nrs\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(fmt: *const i8, ...);
// { dg-output "Value is 10\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
const BAZ: i32 = 10;
// { dg-output "Named variadic" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(fmt: *const i8, variadic: ...);
// { dg-do run { target x86_64*-*-* } }
// { dg-additional-options "-frust-assume-builtin-offset-of" }
+#![feature(no_core)]
+#![no_core]
+
pub struct Foo {
pub a: i32,
/* { dg-output "3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "foo_deref\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-output "1\r*\n" }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-output "1\r*\n" }
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "3\r*\n3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "neg\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "not\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "add_assign\r*\n3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "imm_deref\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "imm_deref\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "mut_deref\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-shouldfail "i8 overflow" }
// { dg-options "-fdump-tree-original" }
+#![feature(no_core)]
+#![no_core]
+
fn five() -> i8 {
5
/* { dg-output "a == b\r*\na != c\r*\n" }*/
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
mod core {
/* { dg-output "a == b\r*\na != c\r*\n" }*/
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
/* { dg-output "a == b\r*\na != c\r*\n" }*/
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
/* { dg-output "a == b\r*\na != c\r*\n" }*/
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
/* { dg-output "x == y\r*\nx > z\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
/* { dg-output "x == y\r*\nx > z\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
/* { dg-output "x == y\r*\nx > z\r*\nx < z\r*\nx >= y\r*\nx <= y\r*\n" } */
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
/* { dg-output "a == b\r*\na != c\r*\n" }*/
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
/* { dg-output "a == b\r*\na != c\r*\na >= c\r*\na <= b\r*\na > c\r*\nc < b\r*\n" } */
/* { dg-options "-w" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
// { dg-additional-options "-w" }
/* { dg-output "Foo A < B\r?\nFoo B < C\r?\nFoo C == C\r?\nBar x < y\r?\nBarFull s1 < s2\r?\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
fn foo (&a: &i32, b: i32) -> i32 {
a + b
}
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-skip-if "" { *-*-* } { "-m32" } { "" } }
// { dg-options "-w" }
// { dg-output "Hash: 0x63d53fd2170bbb8c\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items, rustc_attrs)]
#[lang = "sized"]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
// { dg-additional-options "-w" }
// { dg-output "t1sz=5 t2sz=10\r*" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
/* { dg-output "bar foo baz foobar\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
fn memchr(s: *const i8, c: u8, n: usize) -> *const i8;
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
A { x: i32 },
B { y: i32 }
+#![feature(no_core)]
+#![no_core]
+
struct A {
// the two warnings are invalid but this should be fixed by our lint rework
// with this year's GSoC so ok for now
/* { dg-output "S::f\r*\nT1::f\r*\nT2::f\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
/* { dg-output "3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n456\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "parent123\r*\nchild\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "parent123\r*\nchild\r*\n" } */
// Testing generics passing with supertraits
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
/* { dg-output "parent123\r*\nchild\r*\n" } */
//Testing lifetimes with supertraits
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
/* { dg-output "parent123\r*\nchild\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
//Second test for lifetimes in supertraits
/* { dg-output "parent\r*\nchild\r*\n" } */
//Testing default implementations with supertraits.
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
/* { dg-output "Bar::A = 456\r*\n<Foo as Bar>::A = 456\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123, 777\r*" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n" }*/
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "123\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
/* { dg-output "3\r*\n" } */
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
extern "C" {
// { dg-additional-options "-w" }
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics, lang_items)]
extern "rust-intrinsic" {
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
#![feature(intrinsics)]
#![feature(lang_items)]
// { dg-output "macro\r*\nmacro\r*\nmacro\r*\nmacro\r*\n" }
+#![feature(no_core)]
+#![no_core]
+
extern "C" {
fn printf(s: *const i8, ...);
}
+#![feature(no_core)]
+#![no_core]
+
enum Foo {
I(i32),
}
+#![feature(no_core)]
+#![no_core]
+
extern crate generic_function_1;
use generic_function_1::generic_function;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
+#![feature(no_core)]
+#![no_core]
+
extern crate simple_function_1;
use simple_function_1::test_func;
+#![feature(no_core)]
+#![no_core]
+
pub fn test_func(a: i32) -> i32 {
a + 1
}
+#![feature(no_core)]
+#![no_core]
+
extern crate trait_import_1;
use trait_import_1::Add;
+#![feature(no_core)]
+#![no_core]
+
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}