Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added diff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, this shouldn't have been committed!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit to #139897 to remove it.

(I noticed this because I regularly redirect the output of git diff and similar commands to a file called diff.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops I didn't notice this stray file

Empty file.
1 change: 1 addition & 0 deletions tests/ui/asm/unpretty-expanded.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ needs-asm-support
//@ check-pass
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
core::arch::global_asm!("x: .byte 42");
1 change: 1 addition & 0 deletions tests/ui/asm/unpretty-expanded.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ extern crate std;
//@ needs-asm-support
//@ check-pass
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
global_asm! ("x: .byte 42");
1 change: 1 addition & 0 deletions tests/ui/codemap_tests/unicode.expanded.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern crate std;
//@ revisions: normal expanded
//@[expanded] check-pass
//@[expanded]compile-flags: -Zunpretty=expanded
//@ edition: 2015

extern "路濫狼á́́" fn foo() {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/codemap_tests/unicode.normal.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/codemap_tests/unicode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ revisions: normal expanded
//@[expanded] check-pass
//@[expanded]compile-flags: -Zunpretty=expanded
//@ edition: 2015

extern "路濫狼á́́" fn foo() {} //[normal]~ ERROR invalid ABI

Expand Down
1 change: 1 addition & 0 deletions tests/ui/const-generics/defaults/pretty-printing-ast.rs
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/built-in-proc-macro-scope.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ check-pass
//@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded
//@ edition:2015

#![feature(derive_coerce_pointee)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/built-in-proc-macro-scope.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//@ check-pass
//@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded
//@ edition:2015

#![feature(derive_coerce_pointee)]
#[prelude_import]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/deriving-coerce-pointee-expanded.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ check-pass
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015
#![feature(derive_coerce_pointee)]
use std::marker::CoercePointee;

Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/deriving-coerce-pointee-expanded.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/proc-macro-attribute-mixing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//@ check-pass
//@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015

#![feature(derive_coerce_pointee)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/proc-macro-attribute-mixing.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//@ check-pass
//@ proc-macro: another-proc-macro.rs
//@ compile-flags: -Zunpretty=expanded
//@ edition: 2015

#![feature(derive_coerce_pointee)]
#[prelude_import]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/macros/genercs-in-path-with-prettry-hir.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ compile-flags: -Zunpretty=hir
//@ edition: 2015

// issue#97006

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/genercs-in-path-with-prettry-hir.stderr
Original file line number Diff line number Diff line change
@@ -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>);
| ^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/macros/genercs-in-path-with-prettry-hir.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
//@ compile-flags: -Zunpretty=hir
//@ edition: 2015

// issue#97006

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ check-pass
//@ compile-flags: -Z unpretty=expanded
//@ edition: 2015

#![feature(core_intrinsics, generic_assert)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![no_std]
//@ check-pass
//@ compile-flags: -Z unpretty=expanded
//@ edition: 2015

#![feature(core_intrinsics, generic_assert)]
#[prelude_import]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/match/issue-82392.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/match/issue-82392.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/ui/proc-macro/nonterminal-token-hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions tests/ui/proc-macro/nonterminal-token-hygiene.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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 */]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/proc-macro/quote/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/proc-macro/quote/debug.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ check-pass
//@ compile-flags: -Z unpretty=expanded
//@ edition: 2015

fn main() {
if let 0 = 1 {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {} }
1 change: 1 addition & 0 deletions tests/ui/type-alias-impl-trait/issue-60662.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ check-pass
//@ compile-flags: -Z unpretty=hir
//@ edition: 2015

#![feature(type_alias_impl_trait)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/type-alias-impl-trait/issue-60662.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ check-pass
//@ compile-flags: -Z unpretty=hir
//@ edition: 2015

#![feature(type_alias_impl_trait)]
#[prelude_import]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/bad-literal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir
//@ check-fail
//@ edition: 2015

// In #100948 this caused an ICE with -Zunpretty=hir.
fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unpretty/bad-literal.stderr
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/bad-literal.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/debug-fmt-hir.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

use std::fmt;

Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/debug-fmt-hir.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std;
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

use std::fmt;

Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/deprecated-attr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

#[deprecated]
pub struct PlainDeprecated;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/deprecated-attr.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/diagnostic-attr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

#[diagnostic::on_unimplemented(
message = "My Message for `ImportantTrait<{A}>` implemented for `{Self}`",
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/diagnostic-attr.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/expanded-interpolation.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/expanded-interpolation.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/flattened-format-args.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
//@ check-pass
//@ edition: 2015

fn main() {
let x = 1;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/flattened-format-args.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/let-else-hir.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015



Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/let-else-hir.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std;
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015



Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/self-hir.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

pub struct Bar {
a: String,
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/self-hir.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
extern crate std;
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

struct Bar {
a: String,
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/unpretty-expr-fn-arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

//@ check-pass
//@ compile-flags: -Zunpretty=hir,typed
//@ edition: 2015
#![allow(dead_code)]

fn main() {}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/unpretty/unpretty-expr-fn-arg.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

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