1
Fork 0

Explicitly annotate edition for unpretty=expanded and unpretty=hir tests

These emit prelude imports which means they are always edition dependent
This commit is contained in:
Lukas Wirth 2025-04-16 10:45:03 +02:00
parent efb1e3d676
commit 20ab952b4d
50 changed files with 53 additions and 7 deletions

0
diff Normal file
View file

View file

@ -1,4 +1,5 @@
//@ needs-asm-support //@ needs-asm-support
//@ check-pass //@ check-pass
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
core::arch::global_asm!("x: .byte 42"); core::arch::global_asm!("x: .byte 42");

View file

@ -7,4 +7,5 @@ extern crate std;
//@ needs-asm-support //@ needs-asm-support
//@ check-pass //@ check-pass
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
global_asm! ("x: .byte 42"); global_asm! ("x: .byte 42");

View file

@ -7,6 +7,7 @@ extern crate std;
//@ revisions: normal expanded //@ revisions: normal expanded
//@[expanded] check-pass //@[expanded] check-pass
//@[expanded]compile-flags: -Zunpretty=expanded //@[expanded]compile-flags: -Zunpretty=expanded
//@ edition: 2015
extern "路濫狼á́́" fn foo() {} extern "路濫狼á́́" fn foo() {}

View file

@ -1,5 +1,5 @@
error[E0703]: invalid ABI: found `路濫狼á́́` error[E0703]: invalid ABI: found `路濫狼á́́`
--> $DIR/unicode.rs:5:8 --> $DIR/unicode.rs:6:8
| |
LL | extern "路濫狼á́́" fn foo() {} LL | extern "路濫狼á́́" fn foo() {}
| ^^^^^^^^^ invalid ABI | ^^^^^^^^^ invalid ABI

View file

@ -1,6 +1,7 @@
//@ revisions: normal expanded //@ revisions: normal expanded
//@[expanded] check-pass //@[expanded] check-pass
//@[expanded]compile-flags: -Zunpretty=expanded //@[expanded]compile-flags: -Zunpretty=expanded
//@ edition: 2015
extern "路濫狼á́́" fn foo() {} //[normal]~ ERROR invalid ABI extern "路濫狼á́́" fn foo() {} //[normal]~ ERROR invalid ABI

View file

@ -1,6 +1,7 @@
// Test the AST pretty printer correctly handles default values for const generics // Test the AST pretty printer correctly handles default values for const generics
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
#![crate_type = "lib"] #![crate_type = "lib"]

View file

@ -3,6 +3,7 @@
// Test the AST pretty printer correctly handles default values for const generics // Test the AST pretty printer correctly handles default values for const generics
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
#![crate_type = "lib"] #![crate_type = "lib"]
#[prelude_import] #[prelude_import]

View file

@ -1,6 +1,7 @@
//@ check-pass //@ check-pass
//@ proc-macro: another-proc-macro.rs //@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition:2015
#![feature(derive_coerce_pointee)] #![feature(derive_coerce_pointee)]

View file

@ -3,6 +3,7 @@
//@ check-pass //@ check-pass
//@ proc-macro: another-proc-macro.rs //@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition:2015
#![feature(derive_coerce_pointee)] #![feature(derive_coerce_pointee)]
#[prelude_import] #[prelude_import]

View file

@ -1,5 +1,6 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
#![feature(derive_coerce_pointee)] #![feature(derive_coerce_pointee)]
use std::marker::CoercePointee; use std::marker::CoercePointee;

View file

@ -2,6 +2,7 @@
#![no_std] #![no_std]
//@ check-pass //@ check-pass
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
#![feature(derive_coerce_pointee)] #![feature(derive_coerce_pointee)]
#[prelude_import] #[prelude_import]
use ::std::prelude::rust_2015::*; use ::std::prelude::rust_2015::*;

View file

@ -7,6 +7,7 @@
//@ check-pass //@ check-pass
//@ proc-macro: another-proc-macro.rs //@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
#![feature(derive_coerce_pointee)] #![feature(derive_coerce_pointee)]

View file

@ -9,6 +9,7 @@
//@ check-pass //@ check-pass
//@ proc-macro: another-proc-macro.rs //@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
#![feature(derive_coerce_pointee)] #![feature(derive_coerce_pointee)]
#[prelude_import] #[prelude_import]

View file

@ -1,6 +1,7 @@
// This ensures that ICEs like rust#94953 don't happen // This ensures that ICEs like rust#94953 don't happen
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
// This `expect` will create an expectation with an unstable expectation id // This `expect` will create an expectation with an unstable expectation id
#[expect(while_true)] #[expect(while_true)]

View file

@ -7,6 +7,7 @@ extern crate std;
// This ensures that ICEs like rust#94953 don't happen // This ensures that ICEs like rust#94953 don't happen
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
// This `expect` will create an expectation with an unstable expectation id // This `expect` will create an expectation with an unstable expectation id
#[expect(while_true)] #[expect(while_true)]

View file

@ -1,4 +1,5 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ edition: 2015
// issue#97006 // issue#97006

View file

@ -1,5 +1,5 @@
error: unexpected generic arguments in path error: unexpected generic arguments in path
--> $DIR/genercs-in-path-with-prettry-hir.rs:12:10 --> $DIR/genercs-in-path-with-prettry-hir.rs:13:10
| |
LL | m!(inline<u8>); LL | m!(inline<u8>);
| ^^^^ | ^^^^

View file

@ -3,6 +3,7 @@ use ::std::prelude::rust_2015::*;
#[macro_use] #[macro_use]
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ edition: 2015
// issue#97006 // issue#97006

View file

@ -1,5 +1,6 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
#![feature(core_intrinsics, generic_assert)] #![feature(core_intrinsics, generic_assert)]

View file

@ -2,6 +2,7 @@
#![no_std] #![no_std]
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
#![feature(core_intrinsics, generic_assert)] #![feature(core_intrinsics, generic_assert)]
#[prelude_import] #[prelude_import]

View file

@ -1,6 +1,7 @@
// https://github.com/rust-lang/rust/issues/82329 // https://github.com/rust-lang/rust/issues/82329
//@ compile-flags: -Zunpretty=hir,typed //@ compile-flags: -Zunpretty=hir,typed
//@ check-pass //@ check-pass
//@ edition:2015
pub fn main() { pub fn main() {
if true { if true {

View file

@ -5,6 +5,7 @@ extern crate std;
// https://github.com/rust-lang/rust/issues/82329 // https://github.com/rust-lang/rust/issues/82329
//@ compile-flags: -Zunpretty=hir,typed //@ compile-flags: -Zunpretty=hir,typed
//@ check-pass //@ check-pass
//@ edition:2015
fn main() ({ fn main() ({
(if (true as bool) (if (true as bool)

View file

@ -8,6 +8,7 @@
//@ normalize-stdout: "expn\d{3,}" -> "expnNNN" //@ normalize-stdout: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */" //@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ proc-macro: test-macros.rs //@ proc-macro: test-macros.rs
//@ edition: 2015
#![feature(decl_macro)] #![feature(decl_macro)]
#![no_std] // Don't load unnecessary hygiene information from std #![no_std] // Don't load unnecessary hygiene information from std

View file

@ -5,19 +5,19 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
stream: TokenStream [ stream: TokenStream [
Ident { Ident {
ident: "struct", ident: "struct",
span: $DIR/nonterminal-token-hygiene.rs:32:5: 32:11 (#5), span: $DIR/nonterminal-token-hygiene.rs:33:5: 33:11 (#5),
}, },
Ident { Ident {
ident: "S", ident: "S",
span: $DIR/nonterminal-token-hygiene.rs:32:12: 32:13 (#5), span: $DIR/nonterminal-token-hygiene.rs:33:12: 33:13 (#5),
}, },
Punct { Punct {
ch: ';', ch: ';',
spacing: Alone, spacing: Alone,
span: $DIR/nonterminal-token-hygiene.rs:32:13: 32:14 (#5), span: $DIR/nonterminal-token-hygiene.rs:33:13: 33:14 (#5),
}, },
], ],
span: $DIR/nonterminal-token-hygiene.rs:22:27: 22:32 (#4), span: $DIR/nonterminal-token-hygiene.rs:23:27: 23:32 (#4),
}, },
] ]
#![feature /* 0#0 */(prelude_import)] #![feature /* 0#0 */(prelude_import)]
@ -32,6 +32,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
//@ normalize-stdout: "expn\d{3,}" -> "expnNNN" //@ normalize-stdout: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */" //@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ proc-macro: test-macros.rs //@ proc-macro: test-macros.rs
//@ edition: 2015
#![feature /* 0#0 */(decl_macro)] #![feature /* 0#0 */(decl_macro)]
#![no_std /* 0#0 */] #![no_std /* 0#0 */]

View file

@ -3,6 +3,7 @@
//@ no-prefer-dynamic //@ no-prefer-dynamic
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ needs-unwind compiling proc macros with panic=abort causes a warning //@ needs-unwind compiling proc macros with panic=abort causes a warning
//@ edition: 2015
// //
// This file is not actually used as a proc-macro - instead, // This file is not actually used as a proc-macro - instead,
// it's just used to show the output of the `quote!` macro // it's just used to show the output of the `quote!` macro

View file

@ -5,6 +5,7 @@
//@ no-prefer-dynamic //@ no-prefer-dynamic
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ needs-unwind compiling proc macros with panic=abort causes a warning //@ needs-unwind compiling proc macros with panic=abort causes a warning
//@ edition: 2015
// //
// This file is not actually used as a proc-macro - instead, // This file is not actually used as a proc-macro - instead,
// it's just used to show the output of the `quote!` macro // it's just used to show the output of the `quote!` macro

View file

@ -1,5 +1,6 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
fn main() { fn main() {
if let 0 = 1 {} if let 0 = 1 {}

View file

@ -6,5 +6,6 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=expanded //@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
fn main() { if let 0 = 1 {} } fn main() { if let 0 = 1 {} }

View file

@ -1,5 +1,6 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=hir //@ compile-flags: -Z unpretty=hir
//@ edition: 2015
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]

View file

@ -1,5 +1,6 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Z unpretty=hir //@ compile-flags: -Z unpretty=hir
//@ edition: 2015
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
#[prelude_import] #[prelude_import]

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-fail //@ check-fail
//@ edition: 2015
// In #100948 this caused an ICE with -Zunpretty=hir. // In #100948 this caused an ICE with -Zunpretty=hir.
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error: invalid suffix `u` for number literal error: invalid suffix `u` for number literal
--> $DIR/bad-literal.rs:6:5 --> $DIR/bad-literal.rs:7:5
| |
LL | 1u; LL | 1u;
| ^^ invalid suffix `u` | ^^ invalid suffix `u`

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-fail //@ check-fail
//@ edition: 2015
// In #100948 this caused an ICE with -Zunpretty=hir. // In #100948 this caused an ICE with -Zunpretty=hir.
fn main() { fn main() {

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
use std::fmt; use std::fmt;

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
use std::fmt; use std::fmt;

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
#[deprecated] #[deprecated]
pub struct PlainDeprecated; pub struct PlainDeprecated;

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
struct PlainDeprecated; struct PlainDeprecated;

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
#[diagnostic::on_unimplemented( #[diagnostic::on_unimplemented(
message = "My Message for `ImportantTrait<{A}>` implemented for `{Self}`", message = "My Message for `ImportantTrait<{A}>` implemented for `{Self}`",

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
#[diagnostic::on_unimplemented(message = #[diagnostic::on_unimplemented(message =
"My Message for `ImportantTrait<{A}>` implemented for `{Self}`", label = "My Message for `ImportantTrait<{A}>` implemented for `{Self}`", label =

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ check-pass //@ check-pass
//@ edition: 2015
// This test covers the AST pretty-printer's insertion of parentheses in some // This test covers the AST pretty-printer's insertion of parentheses in some
// macro metavariable edge cases. Synthetic parentheses (i.e. not appearing in // macro metavariable edge cases. Synthetic parentheses (i.e. not appearing in

View file

@ -2,6 +2,7 @@
#![no_std] #![no_std]
//@ compile-flags: -Zunpretty=expanded //@ compile-flags: -Zunpretty=expanded
//@ check-pass //@ check-pass
//@ edition: 2015
// This test covers the AST pretty-printer's insertion of parentheses in some // This test covers the AST pretty-printer's insertion of parentheses in some
// macro metavariable edge cases. Synthetic parentheses (i.e. not appearing in // macro metavariable edge cases. Synthetic parentheses (i.e. not appearing in

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes //@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
//@ check-pass //@ check-pass
//@ edition: 2015
fn main() { fn main() {
let x = 1; let x = 1;

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes //@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
//@ check-pass //@ check-pass
//@ edition: 2015
fn main() { fn main() {
let x = 1; let x = 1;

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015

View file

@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
pub struct Bar { pub struct Bar {
a: String, a: String,

View file

@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std; extern crate std;
//@ compile-flags: -Zunpretty=hir //@ compile-flags: -Zunpretty=hir
//@ check-pass //@ check-pass
//@ edition: 2015
struct Bar { struct Bar {
a: String, a: String,

View file

@ -6,6 +6,7 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Zunpretty=hir,typed //@ compile-flags: -Zunpretty=hir,typed
//@ edition: 2015
#![allow(dead_code)] #![allow(dead_code)]
fn main() {} fn main() {}

View file

@ -6,6 +6,7 @@
//@ check-pass //@ check-pass
//@ compile-flags: -Zunpretty=hir,typed //@ compile-flags: -Zunpretty=hir,typed
//@ edition: 2015
#![allow(dead_code)] #![allow(dead_code)]
#[prelude_import] #[prelude_import]
use ::std::prelude::rust_2015::*; use ::std::prelude::rust_2015::*;