From 07f855d7817aa53af8adbb385407f6c2cacc2702 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Mon, 10 Jul 2023 23:16:28 +0100 Subject: [PATCH] Hide `compiler_builtins` in the prelude This crate is a private implementation detail. We only need to insert it into the crate graph for linking and should not expose any of its public API. Fixes #113533 --- .../src/standard_library_imports.rs | 27 ++- .../proc-macro/allowed-attr-stmt-expr.stdout | 12 +- tests/ui/proc-macro/attr-stmt-expr.stdout | 12 +- .../capture-macro-rules-invoke.stdout | 42 ++--- .../proc-macro/capture-unglued-token.stdout | 2 +- .../dollar-crate-issue-57089.stdout | 32 ++-- .../dollar-crate-issue-62325.stdout | 44 ++--- tests/ui/proc-macro/dollar-crate.stdout | 96 +++++----- tests/ui/proc-macro/expand-to-derive.stdout | 20 +-- .../expr-stmt-nonterminal-tokens.stdout | 166 +++++++++--------- tests/ui/proc-macro/input-interpolated.stdout | 16 +- .../ui/proc-macro/issue-75734-pp-paren.stdout | 6 +- .../issue-78675-captured-inner-attrs.stdout | 14 +- .../proc-macro/issue-80760-empty-stmt.stdout | 2 +- .../proc-macro/macro-rules-derive-cfg.stdout | 38 ++-- tests/ui/proc-macro/meta-macro-hygiene.stdout | 29 ++- tests/ui/proc-macro/meta-macro.stdout | 2 +- tests/ui/proc-macro/nested-macro-rules.stdout | 16 +- .../nested-nonterminal-tokens.stdout | 18 +- tests/ui/proc-macro/nodelim-groups.stdout | 30 ++-- .../proc-macro/nonterminal-expansion.stdout | 10 +- .../nonterminal-recollect-attr.stdout | 24 +-- .../nonterminal-token-hygiene.stdout | 33 ++-- 23 files changed, 347 insertions(+), 344 deletions(-) diff --git a/compiler/rustc_builtin_macros/src/standard_library_imports.rs b/compiler/rustc_builtin_macros/src/standard_library_imports.rs index 6493c6f13d541..07e6288ed8c61 100644 --- a/compiler/rustc_builtin_macros/src/standard_library_imports.rs +++ b/compiler/rustc_builtin_macros/src/standard_library_imports.rs @@ -44,20 +44,29 @@ pub fn inject( // .rev() to preserve ordering above in combination with insert(0, ...) for &name in names.iter().rev() { - let ident = if edition >= Edition2018 { - Ident::new(name, span) + let ident_span = if edition >= Edition2018 { span } else { call_site }; + let item = if name == sym::compiler_builtins { + // compiler_builtins is a private implementation detail. We only + // need to insert it into the crate graph for linking and should not + // expose any of its public API. + // + // FIXME(#113634) We should inject this during post-processing like + // we do for the panic runtime, profiler runtime, etc. + cx.item( + span, + Ident::new(kw::Underscore, ident_span), + thin_vec![], + ast::ItemKind::ExternCrate(Some(name)), + ) } else { - Ident::new(name, call_site) - }; - krate.items.insert( - 0, cx.item( span, - ident, + Ident::new(name, ident_span), thin_vec![cx.attr_word(sym::macro_use, span)], ast::ItemKind::ExternCrate(None), - ), - ); + ) + }; + krate.items.insert(0, item); } // The crates have been injected, the assumption is that the first one is diff --git a/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout b/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout index 091862de30f7f..4f8730053ee9a 100644 --- a/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout +++ b/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout @@ -19,17 +19,17 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/allowed-attr-stmt-expr.rs:35:9: 35:10 (#11), + span: $DIR/allowed-attr-stmt-expr.rs:35:9: 35:10 (#10), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/allowed-attr-stmt-expr.rs:35:11: 35:22 (#11), + span: $DIR/allowed-attr-stmt-expr.rs:35:11: 35:22 (#10), }, ], - span: $DIR/allowed-attr-stmt-expr.rs:35:10: 35:23 (#11), + span: $DIR/allowed-attr-stmt-expr.rs:35:10: 35:23 (#10), }, Ident { ident: "struct", @@ -206,17 +206,17 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/allowed-attr-stmt-expr.rs:35:9: 35:10 (#32), + span: $DIR/allowed-attr-stmt-expr.rs:35:9: 35:10 (#31), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/allowed-attr-stmt-expr.rs:35:11: 35:22 (#32), + span: $DIR/allowed-attr-stmt-expr.rs:35:11: 35:22 (#31), }, ], - span: $DIR/allowed-attr-stmt-expr.rs:35:10: 35:23 (#32), + span: $DIR/allowed-attr-stmt-expr.rs:35:10: 35:23 (#31), }, Punct { ch: '#', diff --git a/tests/ui/proc-macro/attr-stmt-expr.stdout b/tests/ui/proc-macro/attr-stmt-expr.stdout index f9b2305c7359b..c6d77e0ed0c1e 100644 --- a/tests/ui/proc-macro/attr-stmt-expr.stdout +++ b/tests/ui/proc-macro/attr-stmt-expr.stdout @@ -3,17 +3,17 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/attr-stmt-expr.rs:33:9: 33:10 (#8), + span: $DIR/attr-stmt-expr.rs:33:9: 33:10 (#7), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/attr-stmt-expr.rs:33:11: 33:22 (#8), + span: $DIR/attr-stmt-expr.rs:33:11: 33:22 (#7), }, ], - span: $DIR/attr-stmt-expr.rs:33:10: 33:23 (#8), + span: $DIR/attr-stmt-expr.rs:33:10: 33:23 (#7), }, Ident { ident: "struct", @@ -190,17 +190,17 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/attr-stmt-expr.rs:33:9: 33:10 (#29), + span: $DIR/attr-stmt-expr.rs:33:9: 33:10 (#28), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/attr-stmt-expr.rs:33:11: 33:22 (#29), + span: $DIR/attr-stmt-expr.rs:33:11: 33:22 (#28), }, ], - span: $DIR/attr-stmt-expr.rs:33:10: 33:23 (#29), + span: $DIR/attr-stmt-expr.rs:33:10: 33:23 (#28), }, Punct { ch: '#', diff --git a/tests/ui/proc-macro/capture-macro-rules-invoke.stdout b/tests/ui/proc-macro/capture-macro-rules-invoke.stdout index b88fbd3e89776..01d71ff989b47 100644 --- a/tests/ui/proc-macro/capture-macro-rules-invoke.stdout +++ b/tests/ui/proc-macro/capture-macro-rules-invoke.stdout @@ -8,7 +8,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:36:24: 36:28 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:21:21: 21:26 (#4), + span: $DIR/capture-macro-rules-invoke.rs:21:21: 21:26 (#3), }, ] PRINT-BANG INPUT (DISPLAY): 1 + 1, { "a" }, let a = 1;, String, my_name, 'a, my_val = 30, @@ -37,12 +37,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:38:17: 38:18 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:14:29: 14:34 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:29: 14:34 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:14:34: 14:35 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:34: 14:35 (#7), }, Group { delimiter: None, @@ -60,12 +60,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:39:13: 39:20 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:14:36: 14:42 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:36: 14:42 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:14:42: 14:43 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:42: 14:43 (#7), }, Group { delimiter: None, @@ -90,12 +90,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:40:21: 40:22 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:14:44: 14:49 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:44: 14:49 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:14:49: 14:50 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:49: 14:50 (#7), }, Group { delimiter: None, @@ -105,12 +105,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:41:13: 41:19 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:14:51: 14:54 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:51: 14:54 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:14:54: 14:55 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:54: 14:55 (#7), }, Ident { ident: "my_name", @@ -119,7 +119,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:14:62: 14:63 (#8), + span: $DIR/capture-macro-rules-invoke.rs:14:62: 14:63 (#7), }, Group { delimiter: None, @@ -134,12 +134,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:43:13: 43:15 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:15:29: 15:38 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:29: 15:38 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:15:38: 15:39 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:38: 15:39 (#7), }, Group { delimiter: None, @@ -160,12 +160,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:44:22: 44:24 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:15:40: 15:45 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:40: 15:45 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:15:45: 15:46 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:45: 15:46 (#7), }, Group { delimiter: None, @@ -203,12 +203,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:45:26: 45:32 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:15:47: 15:52 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:47: 15:52 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:15:52: 15:53 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:52: 15:53 (#7), }, Group { delimiter: None, @@ -246,12 +246,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:46:16: 46:31 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:15:54: 15:58 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:54: 15:58 (#7), }, Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:15:58: 15:59 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:58: 15:59 (#7), }, Group { delimiter: Bracket, @@ -274,7 +274,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ',', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:15:63: 15:64 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:63: 15:64 (#7), }, Group { delimiter: None, @@ -291,7 +291,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:48:14: 48:16 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:15:65: 15:69 (#8), + span: $DIR/capture-macro-rules-invoke.rs:15:65: 15:69 (#7), }, ] PRINT-BANG INPUT (DISPLAY): (a, b) @@ -319,6 +319,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-macro-rules-invoke.rs:52:26: 52:32 (#0), }, ], - span: $DIR/capture-macro-rules-invoke.rs:27:21: 27:25 (#12), + span: $DIR/capture-macro-rules-invoke.rs:27:21: 27:25 (#11), }, ] diff --git a/tests/ui/proc-macro/capture-unglued-token.stdout b/tests/ui/proc-macro/capture-unglued-token.stdout index 7e6b540332c79..a0d2178f000e5 100644 --- a/tests/ui/proc-macro/capture-unglued-token.stdout +++ b/tests/ui/proc-macro/capture-unglued-token.stdout @@ -23,6 +23,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/capture-unglued-token.rs:19:30: 19:31 (#0), }, ], - span: $DIR/capture-unglued-token.rs:15:42: 15:48 (#4), + span: $DIR/capture-unglued-token.rs:15:42: 15:48 (#3), }, ] diff --git a/tests/ui/proc-macro/dollar-crate-issue-57089.stdout b/tests/ui/proc-macro/dollar-crate-issue-57089.stdout index 2622c005d937f..de4f0c000b6cb 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-57089.stdout +++ b/tests/ui/proc-macro/dollar-crate-issue-57089.stdout @@ -2,79 +2,79 @@ PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/dollar-crate-issue-57089.rs:17:13: 17:19 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:13: 17:19 (#3), }, Ident { ident: "M", - span: $DIR/dollar-crate-issue-57089.rs:17:20: 17:21 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:20: 17:21 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/dollar-crate-issue-57089.rs:17:22: 17:28 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:22: 17:28 (#3), }, Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:29 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:29 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate-issue-57089.rs:17:29: 17:30 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:29: 17:30 (#3), }, Ident { ident: "S", - span: $DIR/dollar-crate-issue-57089.rs:17:30: 17:31 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:30: 17:31 (#3), }, ], - span: $DIR/dollar-crate-issue-57089.rs:17:21: 17:32 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:21: 17:32 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/dollar-crate-issue-57089.rs:17:32: 17:33 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:32: 17:33 (#3), }, ] PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/dollar-crate-issue-57089.rs:21:9: 21:15 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:9: 21:15 (#3), }, Ident { ident: "A", - span: $DIR/dollar-crate-issue-57089.rs:21:16: 21:17 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:16: 21:17 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/dollar-crate-issue-57089.rs:21:18: 21:24 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:18: 21:24 (#3), }, Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:25 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:25 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate-issue-57089.rs:21:25: 21:26 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:25: 21:26 (#3), }, Ident { ident: "S", - span: $DIR/dollar-crate-issue-57089.rs:21:26: 21:27 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:26: 21:27 (#3), }, ], - span: $DIR/dollar-crate-issue-57089.rs:21:17: 21:28 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:17: 21:28 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/dollar-crate-issue-57089.rs:21:28: 21:29 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:28: 21:29 (#3), }, ] diff --git a/tests/ui/proc-macro/dollar-crate-issue-62325.stdout b/tests/ui/proc-macro/dollar-crate-issue-62325.stdout index a91908239c3f8..c7e72bf4ff525 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-62325.stdout +++ b/tests/ui/proc-macro/dollar-crate-issue-62325.stdout @@ -2,109 +2,109 @@ PRINT-ATTR INPUT (DISPLAY): struct A(identity! ($crate :: S)) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/dollar-crate-issue-62325.rs:19:5: 19:11 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:5: 19:11 (#3), }, Ident { ident: "A", - span: $DIR/dollar-crate-issue-62325.rs:19:12: 19:13 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:12: 19:13 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "identity", - span: $DIR/dollar-crate-issue-62325.rs:19:14: 19:22 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:14: 19:22 (#3), }, Punct { ch: '!', spacing: Alone, - span: $DIR/dollar-crate-issue-62325.rs:19:22: 19:23 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:22: 19:23 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/dollar-crate-issue-62325.rs:19:24: 19:30 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:24: 19:30 (#3), }, Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:31 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:31 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate-issue-62325.rs:19:31: 19:32 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:31: 19:32 (#3), }, Ident { ident: "S", - span: $DIR/dollar-crate-issue-62325.rs:19:32: 19:33 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:32: 19:33 (#3), }, ], - span: $DIR/dollar-crate-issue-62325.rs:19:23: 19:34 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:23: 19:34 (#3), }, ], - span: $DIR/dollar-crate-issue-62325.rs:19:13: 19:35 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:13: 19:35 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/dollar-crate-issue-62325.rs:19:35: 19:36 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:35: 19:36 (#3), }, ] PRINT-ATTR INPUT (DISPLAY): struct B(identity! ($crate :: S)) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/auxiliary/dollar-crate-external.rs:21:5: 21:11 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:5: 21:11 (#11), }, Ident { ident: "B", - span: $DIR/auxiliary/dollar-crate-external.rs:21:12: 21:13 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:12: 21:13 (#11), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "identity", - span: $DIR/auxiliary/dollar-crate-external.rs:21:14: 21:22 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:14: 21:22 (#11), }, Punct { ch: '!', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:21:22: 21:23 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:22: 21:23 (#11), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/auxiliary/dollar-crate-external.rs:21:24: 21:30 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:24: 21:30 (#11), }, Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:31 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:31 (#11), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:21:31: 21:32 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:31: 21:32 (#11), }, Ident { ident: "S", - span: $DIR/auxiliary/dollar-crate-external.rs:21:32: 21:33 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:32: 21:33 (#11), }, ], - span: $DIR/auxiliary/dollar-crate-external.rs:21:23: 21:34 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:23: 21:34 (#11), }, ], - span: $DIR/auxiliary/dollar-crate-external.rs:21:13: 21:35 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:13: 21:35 (#11), }, Punct { ch: ';', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:21:35: 21:36 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:35: 21:36 (#11), }, ] diff --git a/tests/ui/proc-macro/dollar-crate.stdout b/tests/ui/proc-macro/dollar-crate.stdout index 4e169d47e1ab2..0f5f87ceca214 100644 --- a/tests/ui/proc-macro/dollar-crate.stdout +++ b/tests/ui/proc-macro/dollar-crate.stdout @@ -2,239 +2,239 @@ 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 (#4), + span: $DIR/dollar-crate.rs:20:17: 20:23 (#3), }, Ident { ident: "M", - span: $DIR/dollar-crate.rs:20:24: 20:25 (#4), + 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 (#4), + span: $DIR/dollar-crate.rs:20:26: 20:32 (#3), }, Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate.rs:20:32: 20:33 (#4), + span: $DIR/dollar-crate.rs:20:32: 20:33 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate.rs:20:33: 20:34 (#4), + span: $DIR/dollar-crate.rs:20:33: 20:34 (#3), }, Ident { ident: "S", - span: $DIR/dollar-crate.rs:20:34: 20:35 (#4), + span: $DIR/dollar-crate.rs:20:34: 20:35 (#3), }, ], - span: $DIR/dollar-crate.rs:20:25: 20:36 (#4), + span: $DIR/dollar-crate.rs:20:25: 20:36 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/dollar-crate.rs:20:36: 20:37 (#4), + 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 (#4), + span: $DIR/dollar-crate.rs:24:13: 24:19 (#3), }, Ident { ident: "A", - span: $DIR/dollar-crate.rs:24:20: 24:21 (#4), + 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 (#4), + span: $DIR/dollar-crate.rs:24:22: 24:28 (#3), }, Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate.rs:24:28: 24:29 (#4), + span: $DIR/dollar-crate.rs:24:28: 24:29 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate.rs:24:29: 24:30 (#4), + span: $DIR/dollar-crate.rs:24:29: 24:30 (#3), }, Ident { ident: "S", - span: $DIR/dollar-crate.rs:24:30: 24:31 (#4), + span: $DIR/dollar-crate.rs:24:30: 24:31 (#3), }, ], - span: $DIR/dollar-crate.rs:24:21: 24:32 (#4), + span: $DIR/dollar-crate.rs:24:21: 24:32 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/dollar-crate.rs:24:32: 24:33 (#4), + 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 (#4), + span: $DIR/dollar-crate.rs:27:13: 27:19 (#3), }, Ident { ident: "D", - span: $DIR/dollar-crate.rs:27:20: 27:21 (#4), + 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 (#4), + span: $DIR/dollar-crate.rs:27:22: 27:28 (#3), }, Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate.rs:27:28: 27:29 (#4), + span: $DIR/dollar-crate.rs:27:28: 27:29 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate.rs:27:29: 27:30 (#4), + span: $DIR/dollar-crate.rs:27:29: 27:30 (#3), }, Ident { ident: "S", - span: $DIR/dollar-crate.rs:27:30: 27:31 (#4), + span: $DIR/dollar-crate.rs:27:30: 27:31 (#3), }, ], - span: $DIR/dollar-crate.rs:27:21: 27:32 (#4), + span: $DIR/dollar-crate.rs:27:21: 27:32 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/dollar-crate.rs:27:32: 27:33 (#4), + 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 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:13: 7:19 (#14), }, Ident { ident: "M", - span: $DIR/auxiliary/dollar-crate-external.rs:7:20: 7:21 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:20: 7:21 (#14), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/auxiliary/dollar-crate-external.rs:7:22: 7:28 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:22: 7:28 (#14), }, Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:29 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:29 (#14), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:7:29: 7:30 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:29: 7:30 (#14), }, Ident { ident: "S", - span: $DIR/auxiliary/dollar-crate-external.rs:7:30: 7:31 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:30: 7:31 (#14), }, ], - span: $DIR/auxiliary/dollar-crate-external.rs:7:21: 7:32 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:21: 7:32 (#14), }, Punct { ch: ';', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:7:32: 7:33 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:32: 7:33 (#14), }, ] 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 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:9: 11:15 (#14), }, Ident { ident: "A", - span: $DIR/auxiliary/dollar-crate-external.rs:11:16: 11:17 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:16: 11:17 (#14), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/auxiliary/dollar-crate-external.rs:11:18: 11:24 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:18: 11:24 (#14), }, Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:25 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:25 (#14), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:11:25: 11:26 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:25: 11:26 (#14), }, Ident { ident: "S", - span: $DIR/auxiliary/dollar-crate-external.rs:11:26: 11:27 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:26: 11:27 (#14), }, ], - span: $DIR/auxiliary/dollar-crate-external.rs:11:17: 11:28 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:17: 11:28 (#14), }, Punct { ch: ';', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:11:28: 11:29 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:28: 11:29 (#14), }, ] 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 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:9: 14:15 (#14), }, Ident { ident: "D", - span: $DIR/auxiliary/dollar-crate-external.rs:14:16: 14:17 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:16: 14:17 (#14), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: $DIR/auxiliary/dollar-crate-external.rs:14:18: 14:24 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:18: 14:24 (#14), }, Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:25 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:25 (#14), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:14:25: 14:26 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:25: 14:26 (#14), }, Ident { ident: "S", - span: $DIR/auxiliary/dollar-crate-external.rs:14:26: 14:27 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:26: 14:27 (#14), }, ], - span: $DIR/auxiliary/dollar-crate-external.rs:14:17: 14:28 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:17: 14:28 (#14), }, Punct { ch: ';', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:14:28: 14:29 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:28: 14:29 (#14), }, ] diff --git a/tests/ui/proc-macro/expand-to-derive.stdout b/tests/ui/proc-macro/expand-to-derive.stdout index a6437982a3737..39f00918329f7 100644 --- a/tests/ui/proc-macro/expand-to-derive.stdout +++ b/tests/ui/proc-macro/expand-to-derive.stdout @@ -6,35 +6,35 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/expand-to-derive.rs:16:9: 16:15 (#4), + span: $DIR/expand-to-derive.rs:16:9: 16:15 (#3), }, Ident { ident: "Foo", - span: $DIR/expand-to-derive.rs:16:16: 16:19 (#4), + span: $DIR/expand-to-derive.rs:16:16: 16:19 (#3), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "field", - span: $DIR/expand-to-derive.rs:18:13: 18:18 (#4), + span: $DIR/expand-to-derive.rs:18:13: 18:18 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/expand-to-derive.rs:18:18: 18:19 (#4), + span: $DIR/expand-to-derive.rs:18:18: 18:19 (#3), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "bool", - span: $DIR/expand-to-derive.rs:18:21: 18:25 (#4), + span: $DIR/expand-to-derive.rs:18:21: 18:25 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/expand-to-derive.rs:18:25: 18:26 (#4), + span: $DIR/expand-to-derive.rs:18:25: 18:26 (#3), }, Group { delimiter: Brace, @@ -90,15 +90,15 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "0", suffix: None, - span: $DIR/expand-to-derive.rs:20:17: 20:18 (#4), + span: $DIR/expand-to-derive.rs:20:17: 20:18 (#3), }, ], - span: $DIR/expand-to-derive.rs:18:27: 21:14 (#4), + span: $DIR/expand-to-derive.rs:18:27: 21:14 (#3), }, ], - span: $DIR/expand-to-derive.rs:18:20: 21:15 (#4), + span: $DIR/expand-to-derive.rs:18:20: 21:15 (#3), }, ], - span: $DIR/expand-to-derive.rs:16:20: 22:10 (#4), + span: $DIR/expand-to-derive.rs:16:20: 22:10 (#3), }, ] diff --git a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout index 686d53e887660..40181efc0b8d9 100644 --- a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout +++ b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout @@ -3,39 +3,39 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = #[allow(warning PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #4 bytes(299..303), + span: #3 bytes(299..303), }, Ident { ident: "E", - span: #4 bytes(304..305), + span: #3 bytes(304..305), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #4 bytes(320..321), + span: #3 bytes(320..321), }, Punct { ch: '=', spacing: Alone, - span: #4 bytes(322..323), + span: #3 bytes(322..323), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #4 bytes(326..329), + span: #3 bytes(326..329), }, Ident { ident: "_", - span: #4 bytes(330..331), + span: #3 bytes(330..331), }, Punct { ch: '=', spacing: Alone, - span: #4 bytes(332..333), + span: #3 bytes(332..333), }, Group { delimiter: None, @@ -97,29 +97,29 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #0 bytes(560..561), }, ], - span: #4 bytes(334..339), + span: #3 bytes(334..339), }, Punct { ch: ';', spacing: Alone, - span: #4 bytes(339..340), + span: #3 bytes(339..340), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #4 bytes(341..342), + span: #3 bytes(341..342), }, ], - span: #4 bytes(324..344), + span: #3 bytes(324..344), }, Punct { ch: ',', spacing: Alone, - span: #4 bytes(344..345), + span: #3 bytes(344..345), }, ], - span: #4 bytes(306..355), + span: #3 bytes(306..355), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0; } ; 0 }, } @@ -127,39 +127,39 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #8 bytes(423..427), + span: #7 bytes(423..427), }, Ident { ident: "E", - span: #8 bytes(428..429), + span: #7 bytes(428..429), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #8 bytes(444..445), + span: #7 bytes(444..445), }, Punct { ch: '=', spacing: Alone, - span: #8 bytes(446..447), + span: #7 bytes(446..447), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #8 bytes(450..453), + span: #7 bytes(450..453), }, Ident { ident: "_", - span: #8 bytes(454..455), + span: #7 bytes(454..455), }, Punct { ch: '=', spacing: Alone, - span: #8 bytes(456..457), + span: #7 bytes(456..457), }, Group { delimiter: Brace, @@ -174,71 +174,71 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #0 bytes(578..579), }, ], - span: #8 bytes(460..465), + span: #7 bytes(460..465), }, ], - span: #8 bytes(458..467), + span: #7 bytes(458..467), }, Punct { ch: ';', spacing: Alone, - span: #8 bytes(467..468), + span: #7 bytes(467..468), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #8 bytes(469..470), + span: #7 bytes(469..470), }, ], - span: #8 bytes(448..472), + span: #7 bytes(448..472), }, Punct { ch: ',', spacing: Alone, - span: #8 bytes(472..473), + span: #7 bytes(472..473), }, ], - span: #8 bytes(430..483), + span: #7 bytes(430..483), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #12 bytes(423..427), + span: #11 bytes(423..427), }, Ident { ident: "E", - span: #12 bytes(428..429), + span: #11 bytes(428..429), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #12 bytes(444..445), + span: #11 bytes(444..445), }, Punct { ch: '=', spacing: Alone, - span: #12 bytes(446..447), + span: #11 bytes(446..447), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #12 bytes(450..453), + span: #11 bytes(450..453), }, Ident { ident: "_", - span: #12 bytes(454..455), + span: #11 bytes(454..455), }, Punct { ch: '=', spacing: Alone, - span: #12 bytes(456..457), + span: #11 bytes(456..457), }, Group { delimiter: Brace, @@ -252,32 +252,32 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #0 bytes(596..598), }, ], - span: #12 bytes(460..465), + span: #11 bytes(460..465), }, ], - span: #12 bytes(458..467), + span: #11 bytes(458..467), }, Punct { ch: ';', spacing: Alone, - span: #12 bytes(467..468), + span: #11 bytes(467..468), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #12 bytes(469..470), + span: #11 bytes(469..470), }, ], - span: #12 bytes(448..472), + span: #11 bytes(448..472), }, Punct { ch: ',', spacing: Alone, - span: #12 bytes(472..473), + span: #11 bytes(472..473), }, ], - span: #12 bytes(430..483), + span: #11 bytes(430..483), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH; } ; 0 }, } @@ -285,39 +285,39 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH } ; 0 }, PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #16 bytes(423..427), + span: #15 bytes(423..427), }, Ident { ident: "E", - span: #16 bytes(428..429), + span: #15 bytes(428..429), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #16 bytes(444..445), + span: #15 bytes(444..445), }, Punct { ch: '=', spacing: Alone, - span: #16 bytes(446..447), + span: #15 bytes(446..447), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #16 bytes(450..453), + span: #15 bytes(450..453), }, Ident { ident: "_", - span: #16 bytes(454..455), + span: #15 bytes(454..455), }, Punct { ch: '=', spacing: Alone, - span: #16 bytes(456..457), + span: #15 bytes(456..457), }, Group { delimiter: Brace, @@ -330,32 +330,32 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #0 bytes(615..619), }, ], - span: #16 bytes(460..465), + span: #15 bytes(460..465), }, ], - span: #16 bytes(458..467), + span: #15 bytes(458..467), }, Punct { ch: ';', spacing: Alone, - span: #16 bytes(467..468), + span: #15 bytes(467..468), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #16 bytes(469..470), + span: #15 bytes(469..470), }, ], - span: #16 bytes(448..472), + span: #15 bytes(448..472), }, Punct { ch: ',', spacing: Alone, - span: #16 bytes(472..473), + span: #15 bytes(472..473), }, ], - span: #16 bytes(430..483), + span: #15 bytes(430..483), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1; } ; 0 }, } @@ -363,39 +363,39 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 } ; 0 } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #20 bytes(423..427), + span: #19 bytes(423..427), }, Ident { ident: "E", - span: #20 bytes(428..429), + span: #19 bytes(428..429), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #20 bytes(444..445), + span: #19 bytes(444..445), }, Punct { ch: '=', spacing: Alone, - span: #20 bytes(446..447), + span: #19 bytes(446..447), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #20 bytes(450..453), + span: #19 bytes(450..453), }, Ident { ident: "_", - span: #20 bytes(454..455), + span: #19 bytes(454..455), }, Punct { ch: '=', spacing: Alone, - span: #20 bytes(456..457), + span: #19 bytes(456..457), }, Group { delimiter: Brace, @@ -421,32 +421,32 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #0 bytes(640..641), }, ], - span: #20 bytes(460..465), + span: #19 bytes(460..465), }, ], - span: #20 bytes(458..467), + span: #19 bytes(458..467), }, Punct { ch: ';', spacing: Alone, - span: #20 bytes(467..468), + span: #19 bytes(467..468), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #20 bytes(469..470), + span: #19 bytes(469..470), }, ], - span: #20 bytes(448..472), + span: #19 bytes(448..472), }, Punct { ch: ',', spacing: Alone, - span: #20 bytes(472..473), + span: #19 bytes(472..473), }, ], - span: #20 bytes(430..483), + span: #19 bytes(430..483), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1; } ; 0 }, } @@ -454,39 +454,39 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 } ; PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #24 bytes(423..427), + span: #23 bytes(423..427), }, Ident { ident: "E", - span: #24 bytes(428..429), + span: #23 bytes(428..429), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #24 bytes(444..445), + span: #23 bytes(444..445), }, Punct { ch: '=', spacing: Alone, - span: #24 bytes(446..447), + span: #23 bytes(446..447), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #24 bytes(450..453), + span: #23 bytes(450..453), }, Ident { ident: "_", - span: #24 bytes(454..455), + span: #23 bytes(454..455), }, Punct { ch: '=', spacing: Alone, - span: #24 bytes(456..457), + span: #23 bytes(456..457), }, Group { delimiter: Brace, @@ -510,31 +510,31 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #0 bytes(665..666), }, ], - span: #24 bytes(460..465), + span: #23 bytes(460..465), }, ], - span: #24 bytes(458..467), + span: #23 bytes(458..467), }, Punct { ch: ';', spacing: Alone, - span: #24 bytes(467..468), + span: #23 bytes(467..468), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #24 bytes(469..470), + span: #23 bytes(469..470), }, ], - span: #24 bytes(448..472), + span: #23 bytes(448..472), }, Punct { ch: ',', spacing: Alone, - span: #24 bytes(472..473), + span: #23 bytes(472..473), }, ], - span: #24 bytes(430..483), + span: #23 bytes(430..483), }, ] diff --git a/tests/ui/proc-macro/input-interpolated.stdout b/tests/ui/proc-macro/input-interpolated.stdout index 34566c7801944..6a8789b2c4197 100644 --- a/tests/ui/proc-macro/input-interpolated.stdout +++ b/tests/ui/proc-macro/input-interpolated.stdout @@ -9,7 +9,7 @@ PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0 ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "const", - span: #4 bytes(416..421), + span: #3 bytes(416..421), }, Ident { ident: "A", @@ -18,34 +18,34 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Alone, - span: #4 bytes(424..425), + span: #3 bytes(424..425), }, Ident { ident: "u8", - span: #4 bytes(426..428), + span: #3 bytes(426..428), }, Punct { ch: '=', spacing: Alone, - span: #4 bytes(429..430), + span: #3 bytes(429..430), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #4 bytes(431..432), + span: #3 bytes(431..432), }, Punct { ch: ';', spacing: Alone, - span: #4 bytes(432..433), + span: #3 bytes(432..433), }, ] PRINT-DERIVE INPUT (DISPLAY): struct A {} PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #4 bytes(468..474), + span: #3 bytes(468..474), }, Ident { ident: "A", @@ -54,6 +54,6 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Group { delimiter: Brace, stream: TokenStream [], - span: #4 bytes(478..480), + span: #3 bytes(478..480), }, ] diff --git a/tests/ui/proc-macro/issue-75734-pp-paren.stdout b/tests/ui/proc-macro/issue-75734-pp-paren.stdout index 0fda6654ff370..2f7c013e95801 100644 --- a/tests/ui/proc-macro/issue-75734-pp-paren.stdout +++ b/tests/ui/proc-macro/issue-75734-pp-paren.stdout @@ -118,17 +118,17 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/issue-75734-pp-paren.rs:25:16: 25:17 (#0), }, ], - span: $DIR/issue-75734-pp-paren.rs:17:21: 17:25 (#7), + span: $DIR/issue-75734-pp-paren.rs:17:21: 17:25 (#6), }, Punct { ch: '*', spacing: Alone, - span: $DIR/issue-75734-pp-paren.rs:17:26: 17:27 (#7), + span: $DIR/issue-75734-pp-paren.rs:17:26: 17:27 (#6), }, Literal { kind: Integer, symbol: "2", suffix: None, - span: $DIR/issue-75734-pp-paren.rs:17:28: 17:29 (#7), + span: $DIR/issue-75734-pp-paren.rs:17:28: 17:29 (#6), }, ] diff --git a/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout b/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout index 60a400a5deabf..ae5e94008094c 100644 --- a/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout +++ b/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout @@ -5,12 +5,12 @@ PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "foo", - span: $DIR/issue-78675-captured-inner-attrs.rs:20:9: 20:12 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:20:9: 20:12 (#3), }, Punct { ch: '!', spacing: Alone, - span: $DIR/issue-78675-captured-inner-attrs.rs:20:12: 20:13 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:20:12: 20:13 (#3), }, Group { delimiter: Brace, @@ -18,17 +18,17 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/issue-78675-captured-inner-attrs.rs:21:13: 21:14 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:21:13: 21:14 (#3), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "fake_attr", - span: $DIR/issue-78675-captured-inner-attrs.rs:21:15: 21:24 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:21:15: 21:24 (#3), }, ], - span: $DIR/issue-78675-captured-inner-attrs.rs:21:14: 21:25 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:21:14: 21:25 (#3), }, Group { delimiter: None, @@ -79,9 +79,9 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/issue-78675-captured-inner-attrs.rs:27:13: 29:6 (#0), }, ], - span: $DIR/issue-78675-captured-inner-attrs.rs:22:13: 22:18 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:22:13: 22:18 (#3), }, ], - span: $DIR/issue-78675-captured-inner-attrs.rs:20:14: 23:10 (#4), + span: $DIR/issue-78675-captured-inner-attrs.rs:20:14: 23:10 (#3), }, ] diff --git a/tests/ui/proc-macro/issue-80760-empty-stmt.stdout b/tests/ui/proc-macro/issue-80760-empty-stmt.stdout index 4b7ed874307d8..82f52e4bc48a5 100644 --- a/tests/ui/proc-macro/issue-80760-empty-stmt.stdout +++ b/tests/ui/proc-macro/issue-80760-empty-stmt.stdout @@ -9,6 +9,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/issue-80760-empty-stmt.rs:25:17: 25:18 (#0), }, ], - span: $DIR/issue-80760-empty-stmt.rs:13:21: 13:23 (#4), + span: $DIR/issue-80760-empty-stmt.rs:13:21: 13:23 (#3), }, ] diff --git a/tests/ui/proc-macro/macro-rules-derive-cfg.stdout b/tests/ui/proc-macro/macro-rules-derive-cfg.stdout index 74641058ef3d2..aee0f966d0fce 100644 --- a/tests/ui/proc-macro/macro-rules-derive-cfg.stdout +++ b/tests/ui/proc-macro/macro-rules-derive-cfg.stdout @@ -10,76 +10,76 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/macro-rules-derive-cfg.rs:17:9: 17:15 (#4), + span: $DIR/macro-rules-derive-cfg.rs:17:9: 17:15 (#3), }, Ident { ident: "Foo", - span: $DIR/macro-rules-derive-cfg.rs:17:16: 17:19 (#4), + span: $DIR/macro-rules-derive-cfg.rs:17:16: 17:19 (#3), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "val", - span: $DIR/macro-rules-derive-cfg.rs:18:13: 18:16 (#4), + span: $DIR/macro-rules-derive-cfg.rs:18:13: 18:16 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/macro-rules-derive-cfg.rs:18:16: 18:17 (#4), + span: $DIR/macro-rules-derive-cfg.rs:18:16: 18:17 (#3), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "bool", - span: $DIR/macro-rules-derive-cfg.rs:18:19: 18:23 (#4), + span: $DIR/macro-rules-derive-cfg.rs:18:19: 18:23 (#3), }, Punct { ch: ';', spacing: Alone, - span: $DIR/macro-rules-derive-cfg.rs:18:23: 18:24 (#4), + span: $DIR/macro-rules-derive-cfg.rs:18:23: 18:24 (#3), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: $DIR/macro-rules-derive-cfg.rs:19:17: 19:20 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:17: 19:20 (#3), }, Ident { ident: "a", - span: $DIR/macro-rules-derive-cfg.rs:19:21: 19:22 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:21: 19:22 (#3), }, Punct { ch: '=', spacing: Alone, - span: $DIR/macro-rules-derive-cfg.rs:19:23: 19:24 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:23: 19:24 (#3), }, Punct { ch: '#', spacing: Alone, - span: $DIR/macro-rules-derive-cfg.rs:19:25: 19:26 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:25: 19:26 (#3), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/macro-rules-derive-cfg.rs:19:48: 19:59 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:48: 19:59 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "first", - span: $DIR/macro-rules-derive-cfg.rs:19:60: 19:65 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:60: 19:65 (#3), }, ], - span: $DIR/macro-rules-derive-cfg.rs:19:59: 19:66 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:59: 19:66 (#3), }, ], - span: $DIR/macro-rules-derive-cfg.rs:19:25: 19:26 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:25: 19:26 (#3), }, Punct { ch: '#', @@ -151,21 +151,21 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: ';', spacing: Alone, - span: $DIR/macro-rules-derive-cfg.rs:19:74: 19:75 (#4), + span: $DIR/macro-rules-derive-cfg.rs:19:74: 19:75 (#3), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/macro-rules-derive-cfg.rs:20:17: 20:18 (#4), + span: $DIR/macro-rules-derive-cfg.rs:20:17: 20:18 (#3), }, ], - span: $DIR/macro-rules-derive-cfg.rs:18:25: 21:14 (#4), + span: $DIR/macro-rules-derive-cfg.rs:18:25: 21:14 (#3), }, ], - span: $DIR/macro-rules-derive-cfg.rs:18:18: 21:15 (#4), + span: $DIR/macro-rules-derive-cfg.rs:18:18: 21:15 (#3), }, ], - span: $DIR/macro-rules-derive-cfg.rs:17:20: 22:10 (#4), + span: $DIR/macro-rules-derive-cfg.rs:17:20: 22:10 (#3), }, ] diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index 6b7b0c819cca6..17b69daa4f0e8 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -1,6 +1,6 @@ -Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) -Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:44 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:44: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }] -Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }] +Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) +Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#3) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:44 (#3) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:44: 24:45 (#3) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#3) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#3) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#3) }] +Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }] #![feature /* 0#0 */(prelude_import)] // aux-build:make-macro.rs // aux-build:meta-macro.rs @@ -18,8 +18,7 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*; #[macro_use /* 0#1 */] extern crate core /* 0#1 */; -#[macro_use /* 0#1 */] -extern crate compiler_builtins /* 0#1 */; +extern crate compiler_builtins /* 442 */ as _ /* 0#1 */; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; @@ -47,23 +46,21 @@ Expansions: crate0::{{expn0}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Root crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports) crate0::{{expn2}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "produce_it") -crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #4, def_site_ctxt: #0, kind: Macro(Bang, "meta_macro::print_def_site") -crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #5, def_site_ctxt: #0, kind: Macro(Bang, "$crate::dummy") +crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #3, def_site_ctxt: #0, kind: Macro(Bang, "meta_macro::print_def_site") +crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #4, def_site_ctxt: #0, kind: Macro(Bang, "$crate::dummy") crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive") crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive") crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "include") -crate2::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports) SyntaxContexts: #0: parent: #0, outer_mark: (crate0::{{expn0}}, Opaque) #1: parent: #0, outer_mark: (crate0::{{expn1}}, Opaque) #2: parent: #0, outer_mark: (crate0::{{expn1}}, Transparent) -#3: parent: #0, outer_mark: (crate2::{{expn1}}, Opaque) -#4: parent: #0, outer_mark: (crate0::{{expn2}}, SemiTransparent) -#5: parent: #0, outer_mark: (crate0::{{expn3}}, Opaque) -#6: parent: #4, outer_mark: (crate0::{{expn3}}, Transparent) -#7: parent: #0, outer_mark: (crate0::{{expn3}}, SemiTransparent) -#8: parent: #0, outer_mark: (crate0::{{expn4}}, Opaque) -#9: parent: #5, outer_mark: (crate0::{{expn4}}, Transparent) -#10: parent: #5, outer_mark: (crate0::{{expn4}}, SemiTransparent) +#3: parent: #0, outer_mark: (crate0::{{expn2}}, SemiTransparent) +#4: parent: #0, outer_mark: (crate0::{{expn3}}, Opaque) +#5: parent: #3, outer_mark: (crate0::{{expn3}}, Transparent) +#6: parent: #0, outer_mark: (crate0::{{expn3}}, SemiTransparent) +#7: parent: #0, outer_mark: (crate0::{{expn4}}, Opaque) +#8: parent: #4, outer_mark: (crate0::{{expn4}}, Transparent) +#9: parent: #4, outer_mark: (crate0::{{expn4}}, SemiTransparent) */ diff --git a/tests/ui/proc-macro/meta-macro.stdout b/tests/ui/proc-macro/meta-macro.stdout index 662682d40b2c6..b2d20c237220c 100644 --- a/tests/ui/proc-macro/meta-macro.stdout +++ b/tests/ui/proc-macro/meta-macro.stdout @@ -1,3 +1,3 @@ -Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) +Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#3) Input: TokenStream [] Respanned: TokenStream [] diff --git a/tests/ui/proc-macro/nested-macro-rules.stdout b/tests/ui/proc-macro/nested-macro-rules.stdout index 3111390404196..829cfdc0c33f5 100644 --- a/tests/ui/proc-macro/nested-macro-rules.stdout +++ b/tests/ui/proc-macro/nested-macro-rules.stdout @@ -2,45 +2,45 @@ PRINT-BANG INPUT (DISPLAY): FirstStruct PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "FirstStruct", - span: $DIR/auxiliary/nested-macro-rules.rs:16:14: 16:25 (#7), + span: $DIR/auxiliary/nested-macro-rules.rs:16:14: 16:25 (#6), }, ] PRINT-ATTR INPUT (DISPLAY): struct FirstAttrStruct {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/auxiliary/nested-macro-rules.rs:10:32: 10:38 (#6), + span: $DIR/auxiliary/nested-macro-rules.rs:10:32: 10:38 (#5), }, Ident { ident: "FirstAttrStruct", - span: $DIR/auxiliary/nested-macro-rules.rs:16:27: 16:42 (#7), + span: $DIR/auxiliary/nested-macro-rules.rs:16:27: 16:42 (#6), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/auxiliary/nested-macro-rules.rs:10:57: 10:59 (#6), + span: $DIR/auxiliary/nested-macro-rules.rs:10:57: 10:59 (#5), }, ] PRINT-BANG INPUT (DISPLAY): SecondStruct PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "SecondStruct", - span: $DIR/nested-macro-rules.rs:21:38: 21:50 (#16), + span: $DIR/nested-macro-rules.rs:21:38: 21:50 (#15), }, ] PRINT-ATTR INPUT (DISPLAY): struct SecondAttrStruct {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/auxiliary/nested-macro-rules.rs:10:32: 10:38 (#15), + span: $DIR/auxiliary/nested-macro-rules.rs:10:32: 10:38 (#14), }, Ident { ident: "SecondAttrStruct", - span: $DIR/nested-macro-rules.rs:21:52: 21:68 (#16), + span: $DIR/nested-macro-rules.rs:21:52: 21:68 (#15), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/auxiliary/nested-macro-rules.rs:10:57: 10:59 (#15), + span: $DIR/auxiliary/nested-macro-rules.rs:10:57: 10:59 (#14), }, ] diff --git a/tests/ui/proc-macro/nested-nonterminal-tokens.stdout b/tests/ui/proc-macro/nested-nonterminal-tokens.stdout index a3d24dd26fe97..4c5550bb077df 100644 --- a/tests/ui/proc-macro/nested-nonterminal-tokens.stdout +++ b/tests/ui/proc-macro/nested-nonterminal-tokens.stdout @@ -16,45 +16,45 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/nested-nonterminal-tokens.rs:25:26: 25:27 (#0), }, ], - span: $DIR/nested-nonterminal-tokens.rs:17:41: 17:43 (#4), + span: $DIR/nested-nonterminal-tokens.rs:17:41: 17:43 (#3), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nested-nonterminal-tokens.rs:17:44: 17:45 (#4), + span: $DIR/nested-nonterminal-tokens.rs:17:44: 17:45 (#3), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: $DIR/nested-nonterminal-tokens.rs:17:46: 17:47 (#4), + span: $DIR/nested-nonterminal-tokens.rs:17:46: 17:47 (#3), }, ], - span: $DIR/nested-nonterminal-tokens.rs:18:41: 18:43 (#5), + span: $DIR/nested-nonterminal-tokens.rs:18:41: 18:43 (#4), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nested-nonterminal-tokens.rs:18:44: 18:45 (#5), + span: $DIR/nested-nonterminal-tokens.rs:18:44: 18:45 (#4), }, Literal { kind: Integer, symbol: "2", suffix: None, - span: $DIR/nested-nonterminal-tokens.rs:18:46: 18:47 (#5), + span: $DIR/nested-nonterminal-tokens.rs:18:46: 18:47 (#4), }, ], - span: $DIR/nested-nonterminal-tokens.rs:20:21: 20:23 (#6), + span: $DIR/nested-nonterminal-tokens.rs:20:21: 20:23 (#5), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nested-nonterminal-tokens.rs:20:24: 20:25 (#6), + span: $DIR/nested-nonterminal-tokens.rs:20:24: 20:25 (#5), }, Literal { kind: Integer, symbol: "3", suffix: None, - span: $DIR/nested-nonterminal-tokens.rs:20:26: 20:27 (#6), + span: $DIR/nested-nonterminal-tokens.rs:20:26: 20:27 (#5), }, ] diff --git a/tests/ui/proc-macro/nodelim-groups.stdout b/tests/ui/proc-macro/nodelim-groups.stdout index 6b410f0bfb7e3..cdf851b535aa5 100644 --- a/tests/ui/proc-macro/nodelim-groups.stdout +++ b/tests/ui/proc-macro/nodelim-groups.stdout @@ -4,7 +4,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Str, symbol: "hi", suffix: None, - span: $DIR/nodelim-groups.rs:16:42: 16:46 (#4), + span: $DIR/nodelim-groups.rs:16:42: 16:46 (#3), }, Group { delimiter: None, @@ -44,7 +44,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/nodelim-groups.rs:20:27: 20:28 (#0), }, ], - span: $DIR/nodelim-groups.rs:16:47: 16:51 (#4), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#3), }, Group { delimiter: Parenthesis, @@ -53,21 +53,21 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:16:53: 16:54 (#4), + span: $DIR/nodelim-groups.rs:16:53: 16:54 (#3), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:16:55: 16:56 (#4), + span: $DIR/nodelim-groups.rs:16:55: 16:56 (#3), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:16:57: 16:58 (#4), + span: $DIR/nodelim-groups.rs:16:57: 16:58 (#3), }, ], - span: $DIR/nodelim-groups.rs:16:52: 16:59 (#4), + span: $DIR/nodelim-groups.rs:16:52: 16:59 (#3), }, ] PRINT-BANG INPUT (DISPLAY): "hi" "hello".len() + "world".len() (1 + 1) @@ -76,7 +76,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Str, symbol: "hi", suffix: None, - span: $DIR/nodelim-groups.rs:16:42: 16:46 (#9), + span: $DIR/nodelim-groups.rs:16:42: 16:46 (#8), }, Group { delimiter: None, @@ -105,12 +105,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/nodelim-groups.rs:21:28: 21:30 (#0), }, ], - span: $DIR/nodelim-groups.rs:15:49: 15:54 (#8), + span: $DIR/nodelim-groups.rs:15:49: 15:54 (#7), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:15:55: 15:56 (#8), + span: $DIR/nodelim-groups.rs:15:55: 15:56 (#7), }, Group { delimiter: None, @@ -136,10 +136,10 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/nodelim-groups.rs:21:44: 21:46 (#0), }, ], - span: $DIR/nodelim-groups.rs:15:57: 15:62 (#8), + span: $DIR/nodelim-groups.rs:15:57: 15:62 (#7), }, ], - span: $DIR/nodelim-groups.rs:16:47: 16:51 (#9), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Group { delimiter: Parenthesis, @@ -148,20 +148,20 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:16:53: 16:54 (#9), + span: $DIR/nodelim-groups.rs:16:53: 16:54 (#8), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:16:55: 16:56 (#9), + span: $DIR/nodelim-groups.rs:16:55: 16:56 (#8), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:16:57: 16:58 (#9), + span: $DIR/nodelim-groups.rs:16:57: 16:58 (#8), }, ], - span: $DIR/nodelim-groups.rs:16:52: 16:59 (#9), + span: $DIR/nodelim-groups.rs:16:52: 16:59 (#8), }, ] diff --git a/tests/ui/proc-macro/nonterminal-expansion.stdout b/tests/ui/proc-macro/nonterminal-expansion.stdout index 4d884348f2ca4..b2557af18cad4 100644 --- a/tests/ui/proc-macro/nonterminal-expansion.stdout +++ b/tests/ui/proc-macro/nonterminal-expansion.stdout @@ -3,12 +3,12 @@ PRINT-ATTR_ARGS RE-COLLECTED (DISPLAY): a, line! (), b PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "a", - span: $DIR/nonterminal-expansion.rs:13:27: 13:28 (#4), + span: $DIR/nonterminal-expansion.rs:13:27: 13:28 (#3), }, Punct { ch: ',', spacing: Alone, - span: $DIR/nonterminal-expansion.rs:13:28: 13:29 (#4), + span: $DIR/nonterminal-expansion.rs:13:28: 13:29 (#3), }, Group { delimiter: None, @@ -28,15 +28,15 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/nonterminal-expansion.rs:19:24: 19:26 (#0), }, ], - span: $DIR/nonterminal-expansion.rs:13:30: 13:35 (#4), + span: $DIR/nonterminal-expansion.rs:13:30: 13:35 (#3), }, Punct { ch: ',', spacing: Alone, - span: $DIR/nonterminal-expansion.rs:13:35: 13:36 (#4), + span: $DIR/nonterminal-expansion.rs:13:35: 13:36 (#3), }, Ident { ident: "b", - span: $DIR/nonterminal-expansion.rs:13:37: 13:38 (#4), + span: $DIR/nonterminal-expansion.rs:13:37: 13:38 (#3), }, ] diff --git a/tests/ui/proc-macro/nonterminal-recollect-attr.stdout b/tests/ui/proc-macro/nonterminal-recollect-attr.stdout index 6824395ae4056..e722ee97d4cc2 100644 --- a/tests/ui/proc-macro/nonterminal-recollect-attr.stdout +++ b/tests/ui/proc-macro/nonterminal-recollect-attr.stdout @@ -5,30 +5,30 @@ First recollected: TokenStream [ }, Ident { ident: "struct", - span: $DIR/nonterminal-recollect-attr.rs:14:12: 14:18 (#4), + span: $DIR/nonterminal-recollect-attr.rs:14:12: 14:18 (#3), }, Ident { ident: "Foo", - span: $DIR/nonterminal-recollect-attr.rs:14:19: 14:22 (#4), + span: $DIR/nonterminal-recollect-attr.rs:14:19: 14:22 (#3), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "field", - span: $DIR/nonterminal-recollect-attr.rs:15:13: 15:18 (#4), + span: $DIR/nonterminal-recollect-attr.rs:15:13: 15:18 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/nonterminal-recollect-attr.rs:15:18: 15:19 (#4), + span: $DIR/nonterminal-recollect-attr.rs:15:18: 15:19 (#3), }, Ident { ident: "u8", - span: $DIR/nonterminal-recollect-attr.rs:15:20: 15:22 (#4), + span: $DIR/nonterminal-recollect-attr.rs:15:20: 15:22 (#3), }, ], - span: $DIR/nonterminal-recollect-attr.rs:14:23: 16:10 (#4), + span: $DIR/nonterminal-recollect-attr.rs:14:23: 16:10 (#3), }, ] Second recollected: TokenStream [ @@ -38,29 +38,29 @@ Second recollected: TokenStream [ }, Ident { ident: "struct", - span: $DIR/nonterminal-recollect-attr.rs:14:12: 14:18 (#4), + span: $DIR/nonterminal-recollect-attr.rs:14:12: 14:18 (#3), }, Ident { ident: "Foo", - span: $DIR/nonterminal-recollect-attr.rs:14:19: 14:22 (#4), + span: $DIR/nonterminal-recollect-attr.rs:14:19: 14:22 (#3), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "field", - span: $DIR/nonterminal-recollect-attr.rs:15:13: 15:18 (#4), + span: $DIR/nonterminal-recollect-attr.rs:15:13: 15:18 (#3), }, Punct { ch: ':', spacing: Alone, - span: $DIR/nonterminal-recollect-attr.rs:15:18: 15:19 (#4), + span: $DIR/nonterminal-recollect-attr.rs:15:18: 15:19 (#3), }, Ident { ident: "u8", - span: $DIR/nonterminal-recollect-attr.rs:15:20: 15:22 (#4), + span: $DIR/nonterminal-recollect-attr.rs:15:20: 15:22 (#3), }, ], - span: $DIR/nonterminal-recollect-attr.rs:14:23: 16:10 (#4), + span: $DIR/nonterminal-recollect-attr.rs:14:23: 16:10 (#3), }, ] diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index c08e5308138c9..76d54ab2f1386 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -6,19 +6,19 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ stream: TokenStream [ Ident { ident: "struct", - span: $DIR/nonterminal-token-hygiene.rs:31:5: 31:11 (#5), + span: $DIR/nonterminal-token-hygiene.rs:31:5: 31:11 (#4), }, Ident { ident: "S", - span: $DIR/nonterminal-token-hygiene.rs:31:12: 31:13 (#5), + span: $DIR/nonterminal-token-hygiene.rs:31:12: 31:13 (#4), }, Punct { ch: ';', spacing: Alone, - span: $DIR/nonterminal-token-hygiene.rs:31:13: 31:14 (#5), + span: $DIR/nonterminal-token-hygiene.rs:31:13: 31:14 (#4), }, ], - span: $DIR/nonterminal-token-hygiene.rs:21:27: 21:32 (#6), + span: $DIR/nonterminal-token-hygiene.rs:21:27: 21:32 (#5), }, ] #![feature /* 0#0 */(prelude_import)] @@ -39,8 +39,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; #[macro_use /* 0#1 */] extern crate core /* 0#2 */; -#[macro_use /* 0#1 */] -extern crate compiler_builtins /* 0#2 */; +extern crate compiler_builtins /* 442 */ as _ /* 0#2 */; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; @@ -59,9 +58,9 @@ macro_rules! outer } struct S /* 0#0 */; -macro inner /* 0#4 */ { () => { print_bang! { struct S; } } } +macro inner /* 0#3 */ { () => { print_bang! { struct S; } } } -struct S /* 0#5 */; +struct S /* 0#4 */; // OK, not a duplicate definition of `S` fn main /* 0#0 */() {} @@ -71,22 +70,20 @@ Expansions: crate0::{{expn0}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Root crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports) crate0::{{expn2}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "outer") -crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #4, def_site_ctxt: #4, kind: Macro(Bang, "inner") -crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #6, def_site_ctxt: #0, kind: Macro(Bang, "print_bang") +crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #3, def_site_ctxt: #3, kind: Macro(Bang, "inner") +crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #5, def_site_ctxt: #0, kind: Macro(Bang, "print_bang") crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive") crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive") crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "include") -crate2::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports) SyntaxContexts: #0: parent: #0, outer_mark: (crate0::{{expn0}}, Opaque) #1: parent: #0, outer_mark: (crate0::{{expn1}}, Opaque) #2: parent: #0, outer_mark: (crate0::{{expn1}}, Transparent) -#3: parent: #0, outer_mark: (crate2::{{expn1}}, Opaque) -#4: parent: #0, outer_mark: (crate0::{{expn2}}, SemiTransparent) -#5: parent: #0, outer_mark: (crate0::{{expn3}}, Opaque) -#6: parent: #4, outer_mark: (crate0::{{expn3}}, Opaque) -#7: parent: #0, outer_mark: (crate0::{{expn4}}, Opaque) -#8: parent: #6, outer_mark: (crate0::{{expn4}}, Transparent) -#9: parent: #5, outer_mark: (crate0::{{expn4}}, SemiTransparent) +#3: parent: #0, outer_mark: (crate0::{{expn2}}, SemiTransparent) +#4: parent: #0, outer_mark: (crate0::{{expn3}}, Opaque) +#5: parent: #3, outer_mark: (crate0::{{expn3}}, Opaque) +#6: parent: #0, outer_mark: (crate0::{{expn4}}, Opaque) +#7: parent: #5, outer_mark: (crate0::{{expn4}}, Transparent) +#8: parent: #4, outer_mark: (crate0::{{expn4}}, SemiTransparent) */