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
//@ check-pass
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
core::arch::global_asm!("x: .byte 42");

View file

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

View file

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

View file

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

View file

@ -1,6 +1,7 @@
//@ revisions: normal expanded
//@[expanded] check-pass
//@[expanded]compile-flags: -Zunpretty=expanded
//@ edition: 2015
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
//@ check-pass
//@ compile-flags: -Z unpretty=expanded
//@ edition: 2015
#![crate_type = "lib"]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
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>);
| ^^^^

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,6 +2,7 @@
#![no_std]
//@ compile-flags: -Zunpretty=expanded
//@ check-pass
//@ edition: 2015
// This test covers the AST pretty-printer's insertion of parentheses in some
// 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
//@ check-pass
//@ edition: 2015
fn main() {
let x = 1;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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