mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
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:
parent
efb1e3d676
commit
20ab952b4d
@ -1,4 +1,5 @@
|
||||
//@ needs-asm-support
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
core::arch::global_asm!("x: .byte 42");
|
||||
|
@ -7,4 +7,5 @@ extern crate std;
|
||||
//@ needs-asm-support
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
global_asm! ("x: .byte 42");
|
||||
|
@ -7,6 +7,7 @@ extern crate std;
|
||||
//@ revisions: normal expanded
|
||||
//@[expanded] check-pass
|
||||
//@[expanded]compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
extern "路濫狼á́́" fn foo() {}
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,7 @@
|
||||
//@ revisions: normal expanded
|
||||
//@[expanded] check-pass
|
||||
//@[expanded]compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
extern "路濫狼á́́" fn foo() {} //[normal]~ ERROR invalid ABI
|
||||
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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]
|
||||
|
@ -1,6 +1,7 @@
|
||||
//@ check-pass
|
||||
//@ proc-macro: another-proc-macro.rs
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition:2015
|
||||
|
||||
#![feature(derive_coerce_pointee)]
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
//@ check-pass
|
||||
//@ proc-macro: another-proc-macro.rs
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition:2015
|
||||
|
||||
#![feature(derive_coerce_pointee)]
|
||||
#[prelude_import]
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
#![feature(derive_coerce_pointee)]
|
||||
use std::marker::CoercePointee;
|
||||
|
||||
|
@ -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::*;
|
||||
|
@ -7,6 +7,7 @@
|
||||
//@ check-pass
|
||||
//@ proc-macro: another-proc-macro.rs
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
#![feature(derive_coerce_pointee)]
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
//@ check-pass
|
||||
//@ proc-macro: another-proc-macro.rs
|
||||
//@ compile-flags: -Zunpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
#![feature(derive_coerce_pointee)]
|
||||
#[prelude_import]
|
||||
|
@ -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)]
|
||||
|
@ -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)]
|
||||
|
@ -1,4 +1,5 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ edition: 2015
|
||||
|
||||
// issue#97006
|
||||
|
||||
|
@ -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>);
|
||||
| ^^^^
|
||||
|
@ -3,6 +3,7 @@ use ::std::prelude::rust_2015::*;
|
||||
#[macro_use]
|
||||
extern crate std;
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ edition: 2015
|
||||
|
||||
// issue#97006
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Z unpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
#![feature(core_intrinsics, generic_assert)]
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#![no_std]
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Z unpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
#![feature(core_intrinsics, generic_assert)]
|
||||
#[prelude_import]
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 */]
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Z unpretty=expanded
|
||||
//@ edition: 2015
|
||||
|
||||
fn main() {
|
||||
if let 0 = 1 {}
|
||||
|
@ -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,5 +1,6 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Z unpretty=hir
|
||||
//@ edition: 2015
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Z unpretty=hir
|
||||
//@ edition: 2015
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#[prelude_import]
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-fail
|
||||
//@ edition: 2015
|
||||
|
||||
// In #100948 this caused an ICE with -Zunpretty=hir.
|
||||
fn main() {
|
||||
|
@ -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`
|
||||
|
@ -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() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
use std::fmt;
|
||||
|
||||
|
@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
|
||||
extern crate std;
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
use std::fmt;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
#[deprecated]
|
||||
pub struct PlainDeprecated;
|
||||
|
@ -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;
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
#[diagnostic::on_unimplemented(
|
||||
message = "My Message for `ImportantTrait<{A}>` implemented for `{Self}`",
|
||||
|
@ -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 =
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
fn main() {
|
||||
let x = 1;
|
||||
|
@ -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;
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
|
||||
extern crate std;
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
pub struct Bar {
|
||||
a: String,
|
||||
|
@ -4,6 +4,7 @@ use ::std::prelude::rust_2015::*;
|
||||
extern crate std;
|
||||
//@ compile-flags: -Zunpretty=hir
|
||||
//@ check-pass
|
||||
//@ edition: 2015
|
||||
|
||||
struct Bar {
|
||||
a: String,
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Zunpretty=hir,typed
|
||||
//@ edition: 2015
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn main() {}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Zunpretty=hir,typed
|
||||
//@ edition: 2015
|
||||
#![allow(dead_code)]
|
||||
#[prelude_import]
|
||||
use ::std::prelude::rust_2015::*;
|
||||
|
Loading…
Reference in New Issue
Block a user