Fixes #74800 The definition of `is_x86_feature_detected!` (and similar macros) depends on the platform - it is produced by a `cfg_if!` invocation on x86, and a plain `#[cfg]` on other platforms. Since it is part of the prelude, we will end up importing different hygiene information depending on the platform. This previously required us to avoid printing raw `SyntaxContext` ids in any tests that uses the standard library, since the captured output will be platform-dependent. Previously, we replaced all `SyntaxContext` ids with "#CTXT", and the raw `Span` lo/hi bytes with "LO..HI". This commit adds `#![no_std]` and `extern crate std` to all proc-macro tests that print spans. This suppresses the prelude import, while still using lang items from `std` (which gives us a buildable binary). With this apporach, we will only load hygiene information for things which we explicitly import. This lets us re-add `-Z unpretty=expanded,hygiene`, since its output can now be made stable across all platforms. Additionally, we use `-Z span-debug` in more places, which lets us avoid the "LO..HI" normalization hack.
240 lines
7 KiB
Text
240 lines
7 KiB
Text
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ;
|
|
PRINT-BANG INPUT (DEBUG): TokenStream [
|
|
Ident {
|
|
ident: "struct",
|
|
span: $DIR/dollar-crate.rs:20:17: 20:23 (#3),
|
|
},
|
|
Ident {
|
|
ident: "M",
|
|
span: $DIR/dollar-crate.rs:20:24: 20:25 (#3),
|
|
},
|
|
Group {
|
|
delimiter: Parenthesis,
|
|
stream: TokenStream [
|
|
Ident {
|
|
ident: "$crate",
|
|
span: $DIR/dollar-crate.rs:20:26: 20:32 (#3),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Joint,
|
|
span: $DIR/dollar-crate.rs:20:32: 20:34 (#3),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Alone,
|
|
span: $DIR/dollar-crate.rs:20:32: 20:34 (#3),
|
|
},
|
|
Ident {
|
|
ident: "S",
|
|
span: $DIR/dollar-crate.rs:20:34: 20:35 (#3),
|
|
},
|
|
],
|
|
span: $DIR/dollar-crate.rs:20:25: 20:36 (#3),
|
|
},
|
|
Punct {
|
|
ch: ';',
|
|
spacing: Alone,
|
|
span: $DIR/dollar-crate.rs:20:36: 20:37 (#3),
|
|
},
|
|
]
|
|
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ;
|
|
PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|
Ident {
|
|
ident: "struct",
|
|
span: $DIR/dollar-crate.rs:24:13: 24:19 (#3),
|
|
},
|
|
Ident {
|
|
ident: "A",
|
|
span: $DIR/dollar-crate.rs:24:20: 24:21 (#3),
|
|
},
|
|
Group {
|
|
delimiter: Parenthesis,
|
|
stream: TokenStream [
|
|
Ident {
|
|
ident: "$crate",
|
|
span: $DIR/dollar-crate.rs:24:22: 24:28 (#3),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Joint,
|
|
span: $DIR/dollar-crate.rs:24:28: 24:30 (#3),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Alone,
|
|
span: $DIR/dollar-crate.rs:24:28: 24:30 (#3),
|
|
},
|
|
Ident {
|
|
ident: "S",
|
|
span: $DIR/dollar-crate.rs:24:30: 24:31 (#3),
|
|
},
|
|
],
|
|
span: $DIR/dollar-crate.rs:24:21: 24:32 (#3),
|
|
},
|
|
Punct {
|
|
ch: ';',
|
|
spacing: Alone,
|
|
span: $DIR/dollar-crate.rs:24:32: 24:33 (#3),
|
|
},
|
|
]
|
|
PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S) ;
|
|
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|
Ident {
|
|
ident: "struct",
|
|
span: $DIR/dollar-crate.rs:27:13: 27:19 (#3),
|
|
},
|
|
Ident {
|
|
ident: "D",
|
|
span: $DIR/dollar-crate.rs:27:20: 27:21 (#3),
|
|
},
|
|
Group {
|
|
delimiter: Parenthesis,
|
|
stream: TokenStream [
|
|
Ident {
|
|
ident: "$crate",
|
|
span: $DIR/dollar-crate.rs:27:22: 27:28 (#3),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Joint,
|
|
span: $DIR/dollar-crate.rs:27:28: 27:30 (#3),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Alone,
|
|
span: $DIR/dollar-crate.rs:27:28: 27:30 (#3),
|
|
},
|
|
Ident {
|
|
ident: "S",
|
|
span: $DIR/dollar-crate.rs:27:30: 27:31 (#3),
|
|
},
|
|
],
|
|
span: $DIR/dollar-crate.rs:27:21: 27:32 (#3),
|
|
},
|
|
Punct {
|
|
ch: ';',
|
|
spacing: Alone,
|
|
span: $DIR/dollar-crate.rs:27:32: 27:33 (#3),
|
|
},
|
|
]
|
|
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ;
|
|
PRINT-BANG INPUT (DEBUG): TokenStream [
|
|
Ident {
|
|
ident: "struct",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:13: 7:19 (#13),
|
|
},
|
|
Ident {
|
|
ident: "M",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:20: 7:21 (#13),
|
|
},
|
|
Group {
|
|
delimiter: Parenthesis,
|
|
stream: TokenStream [
|
|
Ident {
|
|
ident: "$crate",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:22: 7:28 (#13),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Joint,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#13),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Alone,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#13),
|
|
},
|
|
Ident {
|
|
ident: "S",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:30: 7:31 (#13),
|
|
},
|
|
],
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:21: 7:32 (#13),
|
|
},
|
|
Punct {
|
|
ch: ';',
|
|
spacing: Alone,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:7:32: 7:33 (#13),
|
|
},
|
|
]
|
|
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ;
|
|
PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|
Ident {
|
|
ident: "struct",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:9: 11:15 (#13),
|
|
},
|
|
Ident {
|
|
ident: "A",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:16: 11:17 (#13),
|
|
},
|
|
Group {
|
|
delimiter: Parenthesis,
|
|
stream: TokenStream [
|
|
Ident {
|
|
ident: "$crate",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:18: 11:24 (#13),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Joint,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#13),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Alone,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#13),
|
|
},
|
|
Ident {
|
|
ident: "S",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:26: 11:27 (#13),
|
|
},
|
|
],
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:17: 11:28 (#13),
|
|
},
|
|
Punct {
|
|
ch: ';',
|
|
spacing: Alone,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:11:28: 11:29 (#13),
|
|
},
|
|
]
|
|
PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S) ;
|
|
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|
Ident {
|
|
ident: "struct",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:9: 14:15 (#13),
|
|
},
|
|
Ident {
|
|
ident: "D",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:16: 14:17 (#13),
|
|
},
|
|
Group {
|
|
delimiter: Parenthesis,
|
|
stream: TokenStream [
|
|
Ident {
|
|
ident: "$crate",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:18: 14:24 (#13),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Joint,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#13),
|
|
},
|
|
Punct {
|
|
ch: ':',
|
|
spacing: Alone,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#13),
|
|
},
|
|
Ident {
|
|
ident: "S",
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:26: 14:27 (#13),
|
|
},
|
|
],
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:17: 14:28 (#13),
|
|
},
|
|
Punct {
|
|
ch: ';',
|
|
spacing: Alone,
|
|
span: $DIR/auxiliary/dollar-crate-external.rs:14:28: 14:29 (#13),
|
|
},
|
|
]
|