Skip to content
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

53956 panic on include bytes of own file #54517

Merged

Conversation

matthew-russo
Copy link
Contributor

@matthew-russo matthew-russo commented Sep 24, 2018

fix #53956

When using include_bytes! on a source file in the project, compiler would panic on subsequent compilations because expand_include_bytes would overwrite files in the source_map with no source. This PR changes expand_include_bytes to check source_map and use the already existing src, if any.

@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[01:00:24] ....................................................................................................
[01:00:27] ....................................................i...............................................
[01:00:30] ....................................................................................................
[01:00:33] ....................................................................................................
[01:00:36] .iiiiiiiii..........................................................................................
[01:00:42] ....................................................................................................
[01:00:45] .....................................................................................i..............
[01:00:48] ....................................................................................................
[01:00:51] ........................................i.i..ii.....................................................
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:09:35] 
[01:09:35] running 107 tests
[01:09:38] i..ii...iii....i...i............iii...........i.....i....ii...i.i.ii..............i...i.i.ii.i....ii
[01:09:38] test result: ok. 78 passed; 0 failed; 29 ignored; 0 measured; 0 filtered out
[01:09:38] 
[01:09:38]  finished in 3.640
[01:09:38] travis_fold:end:test_codegen
---
travis_time:start:test_ui-fulldeps
Check compiletest suite=ui-fulldeps mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:10:05] 
[01:10:05] running 40 tests
[01:10:40] ...............FF...F............F.F....
[01:10:40] 
[01:10:40] ---- [ui] ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs stdout ----
[01:10:40] diff of stderr:
[01:10:40] 
[01:10:40] 
[01:10:40] + error[E0428]: the name `Test` is defined multiple times
[01:10:40] +   --> $DIR/ambiguous-builtin-attrs-test.rs:13:1
[01:10:40] +    |
[01:10:40] + LL | #[test] // OK, shadowed
[01:10:40] +    | ------- previous definition of the type `Test` here
[01:10:40] + ...
[01:10:40] + LL | #[bench] // OK, shadowed
[01:10:40] +    | ^^^^^^^^ `Test` redefined here
[01:10:40] +    |
[01:10:40] +    = note: `Test` must be defined only once in the type namespace of this module
[01:10:40] + 
[01:10:40] + error[E0425]: cannot find value `Bench` in this scope
[01:10:40] +   --> $DIR/ambiguous-builtin-attrs-test.rs:18:5
[01:10:40] +    |
[01:10:40] + LL |     Bench;
[01:10:40] + 
[01:10:40] 1 error[E0425]: cannot find value `NonExistent` in this scope
[01:10:40] 2   --> $DIR/ambiguous-builtin-attrs-test.rs:19:5
[01:10:40] 3    |
[01:10:40] 3    |
[01:10:40] 
[01:10:40] 4 LL |     NonExistent; //~ ERROR cannot find value `NonExisten:40] ------------------------------------------
[01:10:40] ------------------------------------------
[01:10:40] stderr:
[01:10:40] ------------------------------------------
[01:10:40] ------------------------------------------
[01:10:40] {"message":"the name `Test` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":206,"byte_end":214,"line_start":13,"line_end":13,"column_start":1,"column_end":9,"is_primary":true,"text":[{"text":"#[bench] // OK, shadowed","highlight_start":1,"highlight_end":9}],"label":"`Test` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":206,"byte_end":214,"line_start":13,"line_end":13,"column_start":1,"column_end":9,"is_primary":false,"text":[{"text":"#[bench] // OK, shadowed","highlight_start":1,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[bench]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":168,"byte_end":175,"line_start":10,"line_end":10,"column_start":1,"column_end":8,"is_primary":false,"text":[{"text":"#[test] // OK, shadowed","highlight_start":1,"highlight_end":8}],"label":"previous definition of the type `Test` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":168,"byte_end":175,"line_start":10,"line_end":10,"column_start":1,"column_end":8,"is_primary":false,"text":[{"text":"#[test] // OK, shadowed","highlight_start":1,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[test]","def_site_span":null}}],"children":[{"message":"`Test` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Test` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs:13:1\n   |\nLL | #[test] // OK, shadowed\n   | ------- previous definition of the type `Test` here\n...\nLL | #[bench] // OK, shadowed\n   | ^^^^^^^^ `Test` redefined here\n   |\n   = note: `Test` must be defined only once in the type namespace of this module\n\n"}
[01:10:40] {"message":"cannot find value `Bench` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":297,"byte_end":302,"line_start":18,"line_end":18,"column_start":5,"column_end":10,"is_primary":true,"text":[{"text":"    Bench;","highlight_start":5,"highlight_end":10}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `Bench` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs:18:5\n   |\nLL |     Bench;\n   |     ^^^^^ not found in this scope\n\n"}
[01:10:40] {"message":"cannot find value `NonExistent` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examptin-attrs.rs`
[01:10:40] error: 1 errors occurred comparing output.
[01:10:40] status: exit code: 1
[01:10:40] status: exit code: 1
[01:10:40] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs/auxiliary" "-A" "unused"
[01:10:40] ------------------------------------------
[01:10:40] 
[01:10:40] ------------------------------------------
[01:10:40] stderr:
[01:10:40] stderr:
[01:10:40] ------------------------------------------
[01:10:40] {"message":"the name `Test` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":336,"byte_end":344,"line_start":17,"line_end":17,"column_start":1,"column_end":9,"is_primary":true,"text":[{"text":"#[bench] // OK, shadowed","highlightion<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous","highlight_start":34,"highlight_end":38}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`repr` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`repr` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":409,"byte_end":413,"line_start":20,"line_end":20,"column_start":34,"column_end":38,"is_primary":true,"text":[{"text":"fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous","highlight_start":34,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `repr` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `repr` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:20:34\n   |\nLL | fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous\n   |                   deps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":481,"byte_end":485,"line_start":22,"line_end":22,"column_start":11,"column_end":15,"is_primary":true,"text":[{"text":"        #[repr(C)] //~ ERROR `repr` is ambiguous","highlight_start":11,"highlight_end":15}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`repr` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`repr` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":481,"byte_end":485,"line_start":22,"line_end":22,"column_start":11,"column_end":15,"is_primary":true,"text":[{"text":"        #[repr(C)] //~ ERROR `repr` is ambiguous","highlight_start":11,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `repr` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `repr` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:22:11\n   |\nLL |         #[repr(C)] //~ ERROR `repr` is ambiguous\n   |           ^^^^ ambiguous name\n   |\nnote: `repr` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `repr` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:22:11\n   |\nLL |         #[repr(C)] //~ ERROR `repr` is ambiguous\n   |           ^^^^\n   = note: consider adding an explicit import of `repr` to disambiguate\n\n"}
[01:10:40] {"message":"`feature` is ambiguous","code":{"code":"E0659","explanation":"\nAn item usage is ambiguous.\n\nErroneous code example:\n\n```compile_fail,E0659\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon::*;\n    pub use earth::*;\n}\n\nfn main() {\n    collider::foo(); // ERROR: `foo` is ambiguous\n}\n```\n\nThis error generally appears when two items with the same name are imported into\na module. Here, the `foo` functions are imported and reexported from the\n`collider` module and therefore, when we're using `collider::foo()`, both\nfunctions collide.\n\nTo solve this error, the best solution is generally to keep the path before the\nitem when using it. Example:\n\n```\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon;\n    pub use earth;\n}\n\nfn main() {\n    collider::moon::foo(); // ok!\n    collider::earth::foo(); // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":34,"byte_end":41,"line_start":3,"line_end":3,"column_start":4,"column_end":11,"is_primary":true,"text":[{"text":"#![feature(decl_macro)] //~ ERROR `feature` is ambiguous","highlight_start":4,"highlight_end":11}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`feature` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`feature` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":34,"byte_end":41,"line_start":3,"line_end":3,"column_start":4,"column_end":11,"is_primary":true,"text":[{"text":"#![feature(decl_macro)] //~ ERROR `feature` is ambiguous","highlight_start":4,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `feature` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `feature` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:3:4\n   |\nLL | #![feature(decl_macro)] //~ ERROR `feature` is ambiguous\n   |    ^^^^^^^ ambiguous name\n   |\nnote: `feature` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `feature` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:3:4\n   |\nLL | #![feature(decl_macro)] //~ ERROR `feature` is ambiguous\n   |    ^^^^^^^\n   = note: consider adding an explicit import of `feature` to disambiguate\n\n"}
[01:10:40] {"message":"cannot find value `Bench` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported usi^^^^^^^^^^^^^^^^^ `Outer` redefined here
[01:10:40] +    |
[01:10:40] +    = note: `Outer` must be defined only once in the type namespace of this module
[01:10:40] + 
[01:10:40] + error[E0428]: the name `inner` is defined multiple times
[01:10:40] +   --> $DIR/generate-mod.rs:22:1
[01:10:40] +    |
[01:10:40] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:10:40] +    | ----------------------- previous definition of the module `inner` here
[01:10:40] + ...
[01:10:40] + LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
[01:10:40] +    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here
[01:10:40] +    |
[01:10:40] +    = note: `inner` must be defined only once in the type namespace of this module
[01:10:40] + 
[01:10:40] + error[E0428]: the name `Alias` is defined multiple times
[01:10:40] +   --> $DIR/generate-mod.rs:26:10
[01:10:40] +    |
[01:10:40] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:10:40] +    | ----------------------- previous definition of the type `Alias` here
[01:10:40] + ...
[01:10:40] + LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
[01:10:40] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here
[01:10:40] +    |
[01:10:40] +    = note: `Alias` must be defined only once in the type namespace of this module
[01:10:40] + 
[01:10:40] + error[E0428]: the name `Outer` is defined multiple times
[01:10:40] +   --> $DIR/generate-mod.rs:26:10
[01:10:40] +    |
[01:10:40] + LL | generate_mod::check!(); suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Alias` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Alias` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Alias` here\n...\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here\n   |\n   = note: `Alias` must be defined only once in the type namespace of this module\n\n"}
[01:10:40] {"message":"the name `Outer` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"`Outer` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Outer` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"`inner` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the module `inner` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`inner` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `inner` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the module `inner` here\n...\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here\n   |\n   = note: `inner` must be defined only once in the type namespace of this module\n\n"}
[01:10:40] {"message":"the name `Alias` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"`Alias` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDerive)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Alias` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Alias` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Alias` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Alias` here\n...\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here\n   |\n   = note: `Alias` must be defined only once in the type namespace of this module\n\n"}
[01:10:40] {"message":"the name `Outer` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"`Outer` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_en//~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here\n   |\n   = note: `inner` must be defined only once in the type namespace of this module\n\n"}
[01:10:40] {"message":"the name `Alias` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"`Alias` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDeriveLint)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proighlight_end":24}],"label":"previous definition of the type `Outer` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Outer` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Outer` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:40:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Outer` here\n...\nLL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here\n   |\n   = note: `Outer` must be defined only once in the type namespace of this module\n\n"}
[01:10:40] {"message":"the name `inner` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"`inner` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDeriveLint)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the module `inner` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":struct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":true,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[],"rendered":"error[E0412]: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:19:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope\n\n"}
[01:10:40] {"message":"cannot find type `Outer` in this scope","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":true,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[],"rendered":"error[E0412]: cannot find type `Outer` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:19:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope\n\n"}
[01:10:40] {"message":"cannot find type `FromOutside` in this scope","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `From"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[warn(proc_macro_derive_resolution_fallback)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = note: #[warn(proc_macro_derive_resolution_fallback)] on by default\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 <https://github.cospans.rs:20:22
[01:10:40] 12    |
[01:10:40] 13 LL |         let x: u32 = "x"; //~ ERROR: mismatched types
[01:10:40] 
[01:10:40] 16    = note: expected type `u32`
[01:10:40] 17               found type `&'static str`
[01:10:40] 18 
---
[01:10:40] 22 
[01:10:40] 
[01:10:40] 
[01:10:40] The actual stderr differed from the expected stderr.
[01:10:40] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/nested-item-spans/nested-item-spans.stderr
[01:10:40] To update references, rerun the tests and pass the `--bless` flag
[01:10:40] To only update this specific test, also pass `--test-args proc-macro/nested-item-spans.rs`
[01:10:40] error: 1 errors occurred comparing output.
[01:10:40] status: exit code: 1
[01:10:40] status: exit code: 1
[01:10:40] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/nested-item-spans/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/nested-item-spans/auxiliary" "-A" "unused"
[01:10:40] ------------------------------------------
[01:10:40] 
[01:10:40] ------------------------------------------
[01:10:40] stderr:
[01:10:40] stderr:
[01:10:40] ------------------------------------------
[01:10:40] {"message":"cannot find function `bar` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/p:null,"expansion":null}],"children":[{"message":"expected type `u32`\n   found type `&'static str`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n   |\n   = note: expected type `u32`\n              found type `&'static str`\n\n"}
[01:10:40] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs","byte_start":622,"byte_end":625,"line_start":20,"line_end":20,"column_start":22,"column_end":25,"is_primary":true,"text":[{"text":"        let x: u32 = \"x\"; //~ ERROR: mismatched types","highlight_start":22,"highlight_end":25}],"label":"expected u32, found reference","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `u32`\n   found type `&'static str`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs:20:22\n   |\nLL |         let x: u32 = \"x\"; //~ ERROR: mismatched types\n   |                      ^^^ expected u32, found reference\n   |\n   = note: expected type `u32`\n              found type `&'static str`\n\n"}
[01:10:40] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:10:40] {"message":"Some errors occurred: E0308, E0425.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0308, E0425.\n"}
[01:10:40] {"message":"For more information about an error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0308`.\n"}
[01:10:40] ------------------------------------------
[01:10:40] 
[01:10:40] thread '[ui] ui-fulldeps/proc-macro/nested-item-spans.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3238:9
[01:10:40] 
[01:10:40] 
[01:10:40] ---- [ui] ui-fulldeps/proc-macro/parent-source-spans.rs stdout ----
[01:10:40] diff of stderr:
[01:10:40] 
[01:10:40] 7 LL |     one!("hello", "world");
[01:10:40] 9 
[01:10:40] 9 
[01:10:40] - error: second final: "world"
[01:10:40] + error: second final: "hello"
[01:10:40] 12    |
[01:10:40] 12    |
[01:10:40] 13 LL |     three!($a, $b);
[01:10:40] 
[01:10:40] 25 LL |     one!("hello", "world");
[01:10:40] 27 
[01:10:40] 27 
[01:10:40] - error: second parent: "world"
[01:10:40] + error: second parent: "hello"
[01:10:40] 30    |
[01:10:40] 30    |
[01:10:40] 31 LL |     two!($a, $b);
[01:10:40] 
[01:10:40] 40 LL |     one!("hello", "world");
[01:10:40] 42 
[01:10:40] 42 
[01:10:40] - error: second grandparent: "world"
[01:10:40] + error: second grandparent: "hello"
[01:10:40] 45    |
[01:10:40] 45    |
[01:10:40] 46 LL |     one!("hello", "world");
[01:10:40] 
[01:10:40] 52 LL |     one!("hello", "world");
[01:10:40] 54 
[01:10:40] 54 
[01:10:40] - error: second source: "world"
[01:10:40] + error: second source: "hello"
[01:10:40] 57    |
[01:10:40] 57    |
[01:10:40] 58 LL |     one!("hello", "world");
[01:10:40] 59    |     ^^^^^^^^^^^^^^^^^^^^^^^
[01:10:40] 60 
[01:10:40] 60 
[01:10:40] - error: first final: "yay"
[01:10:40] + error: first final: "hello"
[01:10:40] 63    |
[01:10:40] 63    |
[01:10:40] 64 LL |     three!($a, $b);
[01:10:40] 
[01:10:40] 67 LL |     two!("yay", "rust");
[01:10:40] 69 
[01:10:40] 69 
[01:10:40] - error: second final: "rust"
[01:10:40] + error: second final: "hello"
[01:10:40] 72    |
[01:10:40] 72    |
[01:10:40] 73 LL |     three!($a, $b);
[01:10:40] 
[01:10:40] 76 LL |     two!("yay", "rust");
[01:10:40] 78 
[01:10:40] 78 
[01:10:40] - error: first parent: "yay"
[01:10:40] + error: first parent: "hello"
[01:10:40] 81    |
[01:10:40] 81    |
[01:10:40] 82 LL |     two!("yay", "rust");
[01:10:40] 83    |     ^^^^^^^^^^^^^^^^^^^^
[01:10:40] 84 
[01:10:40] 84 
[01:10:40] - error: second parent: "rust"
[01:10:40] + error: second parent: "hello"
[01:10:40] 87    |
[01:10:40] 87    |
[01:10:40] 88 LL |     two!("yay", "rust");
[01:10:40] 89    |     ^^^^^^^^^^^^^^^^^^^^
[01:10:40] 90 
[01:10:40] 90 
[01:10:40] - error: first source: "yay"
[01:10:40] + error: first source: "hello"
[01:10:40] 93    |
[01:10:40] 93    |
[01:10:40] 94 LL |     two!("yay", "rust");
[01:10:40] 95    |     ^^^^^^^^^^^^^^^^^^^^
[01:10:40] 96 
[01:10:40] 96 
[01:10:40] - error: second source: "rust"
[01:10:40] + error: second source: "hello"
[01:10:40] 99    |
[01:10:40] 99    |
[01:10:40] 100 LL |     two!("yay", "rust");
[01:10:40] 
[01:10:40] The actual stderr differed from the expected stderr.
[01:10:40] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/parent-source-spans/parent-source-spans.stderr
[01:10:40] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/parent-source-spans/parent-source-spans.stderr
[01:10:40] To update references, rerun the tests and pass the `--bless` flag
[01:10:40] To only update this specific test, also pass `--test-args proc-macro/parent-source-spans.rs`
[01:10:40] error: 1 errors occurred comparing output.
[01:10:40] status: exit code: 1
[01:10:40] status: exit code: 1
[01:10:40] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/tstion_applicability":null,"expansion":null},"macro_decl_name":"one!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":650,"byte_end":774,"line_start":20,"line_end":24,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro one($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    two!($a, $b);","highlight_start":1,"highlight_end":18},{"text":"    //~^ ERROR first parent: \"hello\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR second parent: \"world\"","highlight_start":1,"highlight_end":38},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"two!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":776,"byte_end":970,"line_start":26,"line_end":32,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro two($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    three!($a, $b);","highlight_start":1,"highlight_end":20},{"text":"    //~^ ERROR first final: \"hello\"","highlight_start":1,"highlight_end":36},{"text":"    //~| ERROR second final: \"world\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR first final: \"yay\"","highlight_start":1,"highlight_end":34},{"text":"    //~| ERROR second final: \"rust\"","highlight_start":1,"highlight_end":36},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"chi$b);","highlight_start":1,"highlight_end":20},{"text":"    //~^ ERROR first final: \"hello\"","highlight_start":1,"highlight_end":36},{"text":"    //~| ERROR second final: \"world\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR first final: \"yay\"","highlight_start":1,"highlight_end":34},{"text":"    //~| ERROR second final: \"rust\"","highlight_start":1,"highlight_end":36},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: second final: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:27:16\n   |\nLL |     three!($a, $b);\n   |                ^^\n...\nLL |     two!(\"yay\", \"rust\");\n   |     -------------------- in this macro invocation\n\n"}
[01:10:40] {"message":"first parent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1369,"byte_end":1389,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first parent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:10:40] {"message":"second parent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1369,"byte_end":1389,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second parent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:10:40] {"message":"first source: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1369,"byte_end":1389,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first source: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:10:40] {"message":"second source: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1369,"byte_end":1389,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1546,"byte_end":1551,"line_start":56,"line_end":56,"column_start":12,"column_end":17,"is_primary":true,"text":[{"text":"    three!(\"hip\", \"hop\");","highlight_start":12,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first source: \"hip\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:56:12\n   |\nLL |     three!(\"hip\", \"hop\");\n   |            ^^^^^\n\n"}
[01:10:40] {"message":"second source: \"hop\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1553,"byte_end":1558,"line_start":56,"line_end":56,"column_start":19,"column_end":24,"is_primary":true,"text":[{"text":"    three!(\"hip\", \"hop\");","highlight_start":19,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second source: \"hop\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:56:19\n   |\nLL |     three!(\"hip\", \"hop\");\n   |                   ^^^^^\n\n"}
[01:10:40] {"message":"aborting due to 18 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 18 previous errors\n\n"}
[01:10:40] ------------------------------------------
[01:10:40] 
[01:10:40] thread '[ui] ui-fulldeps/proc-macro/parent-source-spans.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3238:9
[01:10:40] 
---
[01:10:40] test result: FAILED. 35 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out
[01:10:40] 
[01:10:40] 
[01:10:40] 
[01:10:40] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:10:40] 
[01:10:40] 
[01:10:40] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:10:40] Build completed unsuccessfully in 0:19:23
[01:10:40] Build completed unsuccessfully in 0:19:23
[01:10:40] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:496:22
[01:10:40] make: *** [check] Error 1
[01:10:40] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0d04f514
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0022e002:start=1537754006883786899,finish=1537754007000202467,duration=116415568
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:1270dcf4
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:04fdc76c
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@matthew-russo
Copy link
Contributor Author

Will do a full stage 2 build/test and debug

@matthew-russo matthew-russo force-pushed the 53956-panic-on-include_bytes-of-own-file branch from 730e62b to 5a6421d Compare September 27, 2018 02:55
@matthew-russo
Copy link
Contributor Author

@eddyb

@eddyb
Copy link
Member

eddyb commented Sep 28, 2018

r? @michaelwoerister

@michaelwoerister
Copy link
Member

Hm, ok, I think I understand the root cause now. I'll need to think a little more before I can decide if this is a good fix. Thanks for looking into this, @mcr431!

@michaelwoerister
Copy link
Member

OK, so the underlying problem is that the same file can get added to the source map twice, once via the regular parser and once via an include macro. If the macro includes the file after the parser has already added it, it will overwrite the entry in the source map's stable_id_to_source_file map.

The changes in the PR fix this problem by passing the correct source to the duplicate entry. However, I think the cleaner fix would be to safeguard SourceMap::new_source_file() against duplication and then to only pass None for src if String::from_utf8(bytes) fails in expand_include_bytes().

You'll probably need to add another constructor to StableFilemapId that takes the data it needs directly instead of reading them from the SourceFile.

Would you be up to adapting your PR accordingly, @mcr431?

@matthew-russo
Copy link
Contributor Author

@michaelwoerister thanks for the feedback. I’ll make the updates and then tag you when it’s ready for review.

@michaelwoerister michaelwoerister added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 6, 2018
@michaelwoerister
Copy link
Member

Thanks, @mcr431!

@matthew-russo matthew-russo force-pushed the 53956-panic-on-include_bytes-of-own-file branch from 5a6421d to 8ebe646 Compare October 10, 2018 16:23
@matthew-russo
Copy link
Contributor Author

I am not expecting this to build. Stage 1 test passes but Stage 2 has failures with proc macro. pushed for visibility and so i can work across machines

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:49:21] .................................................................................................... 2200/4581
[00:49:25] ......i............................................................................................. 2300/4581
[00:49:29] .................................................................................................... 2400/4581
[00:49:32] .................................................................................................... 2500/4581
[00:49:36] ...................iiiiiiiii........................................................................ 2600/4581
[00:49:42] .................................................................................................... 2800/4581
[00:49:46] .................................................................................................... 2900/4581
[00:49:49] .......................................i............................................................ 3000/4581
[00:49:52] ...................................................................................................i 3100/4581
---
travis_time:start:test_ui-fulldeps
Check compiletest suite=ui-fulldeps mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:02:59] 
[01:02:59] running 42 tests
[01:03:33] .................FF....F...........F.F....
[01:03:33] 
[01:03:33] ---- [ui] ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs stdout ----
[01:03:33] diff of stderr:
[01:03:33] 
[01:03:33] 
[01:03:33] + error[E0428]: the name `Test` is defined multiple times
[01:03:33] +   --> $DIR/ambiguous-builtin-attrs-test.rs:13:1
[01:03:33] +    |
[01:03:33] + LL | #[test] // OK, shadowed
[01:03:33] +    | ------- previous definition of the type `Test` here
[01:03:33] + ...
[01:03:33] + LL | #[bench] // OK, shadowed
[01:03:33] +    | ^^^^^^^^ `Test` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Test` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0425]: cannot find value `Bench` in this scope
[01:03:33] +   --> $DIR/ambiguous-builtin-attrs-test.rs:18:5
[01:03:33] +    |
[01:03:33] + LL |     Bench;
[01:03:33] + 
[01:03:33] 1 error[E0425]: cannot find value `NonExistent` in this scope
[01:03:33] 2   --> $DIR/ambiguous-builtin-attrs-test.rs:19:5
[01:03:33] 3    |
[01:03:33] 3    |
[01:03:33] 
[01:03:33] 4 LL |     NonExistent; //~ ERROR cannot find value `NonExistent` in this scope
[01:03:33] 6 
[01:03:33] - error: aborting due to previous error
[01:03:33] + error: aborting due to 3 previous errors
[01:03:33] 8 
[01:03:33] 8 
[01:03:33] - For more information about this error, try `rustc --explain E0425`.
[01:03:33] + Some errors occurred: E0425, E0428.
[01:03:33] + For more information about an error, try `rustc --explain E0425`.
[01:03:33] 10 
[01:03:33] 
[01:03:33] 
[01:03:33] The actual stderr differed from the expected stderr.
[01:03:33] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test/ambiguous-builtin-attrs-test.stderr
[01:03:33] To update references, rerun the tests and pass the `--bless` flag
[01:03:33] To only update this specific test, also pass `--test-args proc-macro/ambiguous-builtin-attrs-test.rs`
[01:03:33] error: 1 errors occurred comparing output.
[01:03:33] status: exit code: 1
[01:03:33] status: exit code: 1
[01:03:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--test" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test/auxiliary" "-A" "unused"
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] ------------------------------------------
[01:03:33] stderr:
[01:03:33] stderr:
[01:03:33] ------------------------------------------
[01:03:33] {"message":"the name `Test` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":206,"byte_end":214,"line_start":13,"line_end":13,"column_start":1,"column_end":9,"is_primary":true,"text":[{"text":"#[bench] // OK, shadowed","highlight_start":1,"highlight_end":9}],"label":"`Test` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":206,"byte_end":214,"line_start":13,"line_end":13,"column_start":1,"column_end":9,"is_primary":false,"text":[{"text":"#[bench] // OK, shadowed","highlight_start":1,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[bench]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":168,"byte_end":175,"line_start":10,"line_end":10,"column_start":1,"column_end":8,"is_primary":false,"text":[{"text":"#[test] // OK, shadowed","highlight_start":1,"highlight_end":8}],"label":"previous definition of the type `Test` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":168,"byte_end":175,"line_start":10,"line_end":10,"column_start":1,"column_end":8,"is_primary":false,"text":[{"text":"#[test] // OK, shadowed","highlight_start":1,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[test]","def_site_span":null}}],"children":[{"message":"`Test` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Test` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs:13:1\n   |\nLL | #[test] // OK, shadowed\n   | ------- previous definition of the type `Test` here\n...\nLL | #[bench] // OK, shadowed\n   | ^^^^^^^^ `Test` redefined here\n   |\n   = note: `Test` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"cannot find value `Bench` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":297,"byte_end":302,"line_start":18,"line_end":18,"column_start":5,"column_end":10,"is_primary":true,"text":[{"text":"    Bench;","highlight_start":5,"highlight_end":10}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `Bench` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs:18:5\n   |\nLL |     Bench;\n   |     ^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"cannot find value `NonExistent` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs","byte_start":308,"byte_end":319,"line_start":19,"line_end":19,"column_start":5,"column_end":16,"is_primary":true,"text":[{"text":"    NonExistent; //~ ERROR cannot find value `NonExistent` in this scope","highlight_start":5,"highlight_end":16}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `NonExistent` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs:19:5\n   |\nLL |     NonExistent; //~ ERROR cannot find value `NonExistent` in this scope\n   |     ^^^^^^^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:03:33] {"message":"Some errors occurred: E0425, E0428.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0425, E0428.\n"}
[01:03:33] {"message":"For more information about an error, try `rustc --explain E0425`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0425`.\n"}
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] thread '[ui] ui-fulldeps/proc-macro/ambiguous-builtin-attrs-test.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3277:9
[01:03:33] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:03:33] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:03:33] 
[01:03:33] ---- [ui] ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs stdout ----
[01:03:33] diff of stderr:
[01:03:33] 
[01:03:33] + error[E0428]: the name `Test` is defined multiple times
[01:03:33] +   --> $DIR/ambiguous-builtin-attrs.rs:17:1
[01:03:33] +    |
[01:03:33] + LL | #[test] // OK, shadowed
[01:03:33] +    | ------- previous definition of the type `Test` here
[01:03:33] + ...
[01:03:33] + LL | #[bench] // OK, shadowed
[01:03:33] +    | ^^^^^^^^ `Test` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Test` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] 1 error[E0659]: `repr` is ambiguous
[01:03:33] 2   --> $DIR/ambiguous-builtin-attrs.rs:9:3
[01:03:33] 
[01:03:33] 88    |    ^^^^^^^
[01:03:33] 88    |    ^^^^^^^
[01:03:33] 89    = note: consider adding an explicit import of `feature` to disambiguate
[01:03:33] 90 
[01:03:33] + error[E0425]: cannot find value `Bench` in this scope
[01:03:33] +   --> $DIR/ambiguous-builtin-attrs.rs:29:5
[01:03:33] +    |
[01:03:33] + LL |     Bench;
[01:03:33] + 
[01:03:33] 91 error[E0425]: cannot find value `NonExistent` in this scope
[01:03:33] 92   --> $DIR/ambiguous-builtin-attrs.rs:30:5
[01:03:33] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:501:22
[01:03:33] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:501:22
[01:03:33] 93    |
[01:03:33] 
[01:03:33] 94 LL |     NonExistent; //~ ERROR cannot find value `NonExistent` in this scope
[01:03:33] 96 
[01:03:33] - error: aborting due to 6 previous errors
[01:03:33] + error: aborting due to 8 previous errors
[01:03:33] 98 
[01:03:33] 98 
[01:03:33] - Some errors occurred: E0425, E0659.
[01:03:33] + Some errors occurred: E0425, E0428, E0659.
[01:03:33] 100 For more information about an error, try `rustc --explain E0425`.
[01:03:33] 101 
[01:03:33] 
[01:03:33] 
[01:03:33] The actual stderr differed from the expected stderr.
[01:03:33] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs/ambiguous-builtin-attrs.stderr
[01:03:33] To update references, rerun the tests and pass the `--bless` flag
[01:03:33] To only update this specific test, also pass `--test-args proc-macro/ambiguous-builtin-attrs.rs`
[01:03:33] error: 1 errors occurred comparing output.
[01:03:33] status: exit code: 1
[01:03:33] status: exit code: 1
[01:03:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs/auxiliary" "-A" "unused"
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] ------------------------------------------
[01:03:33] stderr:
[01:03:33] stderr:
[01:03:33] ------------------------------------------
[01:03:33] {"message":"the name `Test` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":336,"byte_end":344,"line_start":17,"line_end":17,"column_start":1,"column_end":9,"is_primary":true,"text":[{"text":"#[bench] // OK, shadowed","highlight_start":1,"highlight_end":9}],"label":"`Test` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":336,"byte_end":344,"line_start":17,"line_end":17,"column_start":1,"column_end":9,"is_primary":false,"text":[{"text":"#[bench] // OK, shadowed","highlight_start":1,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[bench]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":298,"byte_end":305,"line_start":14,"line_end":14,"column_start":1,"column_end":8,"is_primary":false,"text":[{"text":"#[test] // OK, shadowed","highlight_start":1,"highlight_end":8}],"label":"previous definition of the type `Test` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":298,"byte_end":305,"line_start":14,"line_end":14,"column_start":1,"column_end":8,"is_primary":false,"text":[{"text":"#[test] // OK, shadowed","highlight_start":1,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[test]","def_site_span":null}}],"children":[{"message":"`Test` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Test` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:17:1\n   |\nLL | #[test] // OK, shadowed\n   | ------- previous definition of the type `Test` here\n...\nLL | #[bench] // OK, shadowed\n   | ^^^^^^^^ `Test` redefined here\n   |\n   = note: `Test` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"`repr` is ambiguous","code":{"code":"E0659","explanation":"\nAn item usage is ambiguous.\n\nErroneous code example:\n\n```compile_fail,E0659\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon::*;\n    pub use earth::*;\n}\n\nfn main() {\n    collider::foo(); // ERROR: `foo` is ambiguous\n}\n```\n\nThis error generally appears when two items with the same name are imported into\na module. Here, the `foo` functions are imported and reexported from the\n`collider` module and therefore, when we're using `collider::foo()`, both\nfunctions collide.\n\nTo solve this error, the best solution is generally to keep the path before the\nitem when using it. Example:\n\n```\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon;\n    pub use earth;\n}\n\nfn main() {\n    collider::moon::foo(); // ok!\n    collider::earth::foo(); // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":176,"byte_end":180,"line_start":9,"line_end":9,"column_start":3,"column_end":7,"is_primary":true,"text":[{"text":"#[repr(C)] //~ ERROR `repr` is ambiguous","highlight_start":3,"highlight_end":7}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`repr` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`repr` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":176,"byte_end":180,"line_start":9,"line_end":9,"column_start":3,"column_end":7,"is_primary":true,"text":[{"text":"#[repr(C)] //~ ERROR `repr` is ambiguous","highlight_start":3,"highlight_end":7}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `repr` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `repr` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:9:3\n   |\nLL | #[repr(C)] //~ ERROR `repr` is ambiguous\n   |   ^^^^ ambiguous name\n   |\nnote: `repr` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `repr` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:9:3\n   |\nLL | #[repr(C)] //~ ERROR `repr` is ambiguous\n   |   ^^^^\n   = note: consider adding an explicit import of `repr` to disambiguate\n\n"}
[01:03:33] {"message":"`repr` is ambiguous","code":{"code":"E0659","explanation":"\nAn item usage is ambiguous.\n\nErroneous code example:\n\n```compile_fail,E0659\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon::*;\n    pub use earth::*;\n}\n\nfn main() {\n    collider::foo(); // ERROR: `foo` is ambiguous\n}\n```\n\nThis error generally appears when two items with the same name are imported into\na module. Here, the `foo` functions are imported and reexported from the\n`collider` module and therefore, when we're using `collider::foo()`, both\nfunctions collide.\n\nTo solve this error, the best solution is generally to keep the path before the\nitem when using it. Example:\n\n```\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon;\n    pub use earth;\n}\n\nfn main() {\n    collider::moon::foo(); // ok!\n    collider::earth::foo(); // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":243,"byte_end":247,"line_start":11,"line_end":11,"column_start":19,"column_end":23,"is_primary":true,"text":[{"text":"#[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous","highlight_start":19,"highlight_end":23}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`repr` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`repr` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":243,"byte_end":247,"line_start":11,"line_end":11,"column_start":19,"column_end":23,"is_primary":true,"text":[{"text":"#[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous","highlight_start":19,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `repr` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `repr` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:11:19\n   |\nLL | #[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous\n   |                   ^^^^ ambiguous name\n   |\nnote: `repr` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `repr` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:11:19\n   |\nLL | #[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous\n   |                   ^^^^\n   = note: consider adding an explicit import of `repr` to disambiguate\n\n"}
[01:03:33] {"message":"`repr` is ambiguous","code":{"code":"E0659","explanation":"\nAn item usage is ambiguous.\n\nErroneous code example:\n\n```compile_fail,E0659\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon::*;\n    pub use earth::*;\n}\n\nfn main() {\n    collider::foo(); // ERROR: `foo` is ambiguous\n}\n```\n\nThis error generally appears when two items with the same name are imported into\na module. Here, the `foo` functions are imported and reexported from the\n`collider` module and therefore, when we're using `collider::foo()`, both\nfunctions collide.\n\nTo solve this error, the best solution is generally to keep the path before the\nitem when using it. Example:\n\n```\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon;\n    pub use earth;\n}\n\nfn main() {\n    collider::moon::foo(); // ok!\n    collider::earth::foo(); // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":409,"byte_end":413,"line_start":20,"line_end":20,"column_start":34,"column_end":38,"is_primary":true,"text":[{"text":"fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous","highlight_start":34,"highlight_end":38}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`repr` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`repr` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":409,"byte_end":413,"line_start":20,"line_end":20,"column_start":34,"column_end":38,"is_primary":true,"text":[{"text":"fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous","highlight_start":34,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `repr` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `repr` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:20:34\n   |\nLL | fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous\n   |                                  ^^^^ ambiguous name\n   |\nnote: `repr` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `repr` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:20:34\n   |\nLL | fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous\n   |                                  ^^^^\n   = note: consider adding an explicit import of `repr` to disambiguate\n\n"}
[01:03:33] {"message":"`repr` is ambiguous","code":{"code":"E0659","explanation":"\nAn item usage is ambiguous.\n\nErroneous code example:\n\n```compile_fail,E0659\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon::*;\n    pub use earth::*;\n}\n\nfn main() {\n    collider::foo(); // ERROR: `foo` is ambiguous\n}\n```\n\nThis error generally appears when two items with the same name are imported into\na module. Here, the `foo` functions are imported and reexported from the\n`collider` module and therefore, when we're using `collider::foo()`, both\nfunctions collide.\n\nTo solve this error, the best solution is generally to keep the path before the\nitem when using it. Example:\n\n```\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon;\n    pub use earth;\n}\n\nfn main() {\n    collider::moon::foo(); // ok!\n    collider::earth::foo(); // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":481,"byte_end":485,"line_start":22,"line_end":22,"column_start":11,"column_end":15,"is_primary":true,"text":[{"text":"        #[repr(C)] //~ ERROR `repr` is ambiguous","highlight_start":11,"highlight_end":15}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`repr` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`repr` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":481,"byte_end":485,"line_start":22,"line_end":22,"column_start":11,"column_end":15,"is_primary":true,"text":[{"text":"        #[repr(C)] //~ ERROR `repr` is ambiguous","highlight_start":11,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `repr` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `repr` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:22:11\n   |\nLL |         #[repr(C)] //~ ERROR `repr` is ambiguous\n   |           ^^^^ ambiguous name\n   |\nnote: `repr` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `repr` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:22:11\n   |\nLL |         #[repr(C)] //~ ERROR `repr` is ambiguous\n   |           ^^^^\n   = note: consider adding an explicit import of `repr` to disambiguate\n\n"}
[01:03:33] {"message":"`feature` is ambiguous","code":{"code":"E0659","explanation":"\nAn item usage is ambiguous.\n\nErroneous code example:\n\n```compile_fail,E0659\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon::*;\n    pub use earth::*;\n}\n\nfn main() {\n    collider::foo(); // ERROR: `foo` is ambiguous\n}\n```\n\nThis error generally appears when two items with the same name are imported into\na module. Here, the `foo` functions are imported and reexported from the\n`collider` module and therefore, when we're using `collider::foo()`, both\nfunctions collide.\n\nTo solve this error, the best solution is generally to keep the path before the\nitem when using it. Example:\n\n```\npub mod moon {\n    pub fn foo() {}\n}\n\npub mod earth {\n    pub fn foo() {}\n}\n\nmod collider {\n    pub use moon;\n    pub use earth;\n}\n\nfn main() {\n    collider::moon::foo(); // ok!\n    collider::earth::foo(); // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":34,"byte_end":41,"line_start":3,"line_end":3,"column_start":4,"column_end":11,"is_primary":true,"text":[{"text":"#![feature(decl_macro)] //~ ERROR `feature` is ambiguous","highlight_start":4,"highlight_end":11}],"label":"ambiguous name","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`feature` could refer to the name imported here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":155,"byte_end":171,"line_start":7,"line_end":7,"column_start":5,"column_end":21,"is_primary":true,"text":[{"text":"use builtin_attrs::*;","highlight_start":5,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"`feature` could also refer to the name defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":34,"byte_end":41,"line_start":3,"line_end":3,"column_start":4,"column_end":11,"is_primary":true,"text":[{"text":"#![feature(decl_macro)] //~ ERROR `feature` is ambiguous","highlight_start":4,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider adding an explicit import of `feature` to disambiguate","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0659]: `feature` is ambiguous\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:3:4\n   |\nLL | #![feature(decl_macro)] //~ ERROR `feature` is ambiguous\n   |    ^^^^^^^ ambiguous name\n   |\nnote: `feature` could refer to the name imported here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:7:5\n   |\nLL | use builtin_attrs::*;\n   |     ^^^^^^^^^^^^^^^^\nnote: `feature` could also refer to the name defined here\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:3:4\n   |\nLL | #![feature(decl_macro)] //~ ERROR `feature` is ambiguous\n   |    ^^^^^^^\n   = note: consider adding an explicit import of `feature` to disambiguate\n\n"}
[01:03:33] {"message":"cannot find value `Bench` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":571,"byte_end":576,"line_start":29,"line_end":29,"column_start":5,"column_end":10,"is_primary":true,"text":[{"text":"    Bench;","highlight_start":5,"highlight_end":10}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `Bench` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:29:5\n   |\nLL |     Bench;\n   |     ^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"cannot find value `NonExistent` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs","byte_start":582,"byte_end":593,"line_start":30,"line_end":30,"column_start":5,"column_end":16,"is_primary":true,"text":[{"text":"    NonExistent; //~ ERROR cannot find value `NonExistent` in this scope","highlight_start":5,"highlight_end":16}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `NonExistent` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs:30:5\n   |\nLL |     NonExistent; //~ ERROR cannot find value `NonExistent` in this scope\n   |     ^^^^^^^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"aborting due to 8 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 8 previous errors\n\n"}
[01:03:33] {"message":"Some errors occurred: E0425, E0428, E0659.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0425, E0428, E0659.\n"}
[01:03:33] {"message":"For more information about an error, try `rustc --explain E0425`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0425`.\n"}
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] thread '[ui] ui-fulldeps/proc-macro/ambiguous-builtin-attrs.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3277:9
[01:03:33] 
[01:03:33] 
[01:03:33] ---- [ui] ui-fulldeps/proc-macro/generate-mod.rs stdout ----
[01:03:33] diff of stderr:
[01:03:33] 
[01:03:33] + error[E0428]: the name `Alias` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:22:1
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the type `Alias` here
[01:03:33] + ...
[01:03:33] + LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Alias` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `Outer` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:22:1
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the type `Outer` here
[01:03:33] + ...
[01:03:33] + LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Outer` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `inner` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:22:1
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the module `inner` here
[01:03:33] + ...
[01:03:33] + LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `inner` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `Alias` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:26:10
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the type `Alias` here
[01:03:33] + ...
[01:03:33] + LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Alias` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `Outer` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:26:10
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the type `Outer` here
[01:03:33] + ...
[01:03:33] + LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Outer` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `inner` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:26:10
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the module `inner` here
[01:03:33] + ...
[01:03:33] + LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `inner` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `Alias` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:40:10
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the type `Alias` here
[01:03:33] + ...
[01:03:33] + LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Alias` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `Outer` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:40:10
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the type `Outer` here
[01:03:33] + ...
[01:03:33] + LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `Outer` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] + error[E0428]: the name `inner` is defined multiple times
[01:03:33] +   --> $DIR/generate-mod.rs:40:10
[01:03:33] +    |
[01:03:33] + LL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] +    | ----------------------- previous definition of the module `inner` here
[01:03:33] + ...
[01:03:33] + LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here
[01:03:33] +    |
[01:03:33] +    = note: `inner` must be defined only once in the type namespace of this module
[01:03:33] + 
[01:03:33] 1 error[E0412]: cannot find type `FromOutside` in this scope
[01:03:33] 3    |
[01:03:33] 
[01:03:33] 
[01:03:33] 16 LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] 18 
[01:03:33] 18 
[01:03:33] - error[E0412]: cannot find type `OuterAttr` in this scope
[01:03:33] + error[E0412]: cannot find type `Outer` in this scope
[01:03:33] 21    |
[01:03:33] 21    |
[01:03:33] 22 LL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
[01:03:33] 32    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[01:03:33] 33    = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>
[01:03:33] 34 
[01:03:33] 34 
[01:03:33] - warning: cannot find type `OuterDerive` in this scope
[01:03:33] + warning: cannot find type `Outer` in this scope
[01:03:33] 37    |
[01:03:33] 37    |
[01:03:33] 38 LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
[01:03:33] 50    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[01:03:33] 51    = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>
[01:03:33] 52 
[01:03:33] 52 
[01:03:33] - warning: cannot find type `OuterDerive` in this scope
[01:03:33] + warning: cannot find type `Outer` in this scope
[01:03:33] 55    |
[01:03:33] 55    |
[01:03:33] 56 LL |     #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope
[01:03:33] 59    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[01:03:33] 60    = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>
[01:03:33] 61 
[01:03:33] - error: aborting due to 4 previous errors
[01:03:33] - error: aborting due to 4 previous errors
[01:03:33] + warning: cannot find type `FromOutside` in this scope
[01:03:33] +   --> $DIR/generate-mod.rs:40:10
[01:03:33] +    |
[01:03:33] + LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
[01:03:33] +    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[01:03:33] +    = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>
[01:03:33] 63 
[01:03:33] - For more information about this error, try `rustc --explain E0412`.
[01:03:33] - For more information about this error, try `rustc --explain E0412`.
[01:03:33] + warning: cannot find type `Outer` in this scope
[01:03:33] +   --> $DIR/generate-mod.rs:40:10
[01:03:33] +    |
[01:03:33] + LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
[01:03:33] +    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
[01:03:33] +    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[01:03:33] +    = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>
[01:03:33] + 
[01:03:33] + error: aborting due to 13 previous errors
[01:03:33] + error: aborting due to 13 previous errors
[01:03:33] + 
[01:03:33] + Some errors occurred: E0412, E0428.
[01:03:33] + For more information about an error, try `rustc --explain E0412`.
[01:03:33] 65 
[01:03:33] 
[01:03:33] 
[01:03:33] The actual stderr differed from the expected stderr.
[01:03:33] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/generate-mod/generate-mod.stderr
[01:03:33] To update references, rerun the tests and pass the `--bless` flag
[01:03:33] To only update this specific test, also pass `--test-args proc-macro/generate-mod.rs`
[01:03:33] error: 1 errors occurred comparing output.
[01:03:33] status: exit code: 1
[01:03:33] status: exit code: 1
[01:03:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/generate-mod/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/generate-mod/auxiliary" "-A" "unused"
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] ------------------------------------------
[01:03:33] stderr:
[01:03:33] stderr:
[01:03:33] ------------------------------------------
[01:03:33] {"message":"the name `Alias` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"`Alias` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Alias` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Alias` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Alias` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Alias` here\n...\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here\n   |\n   = note: `Alias` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `Outer` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"`Outer` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Outer` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Outer` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Outer` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Outer` here\n...\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here\n   |\n   = note: `Outer` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `inner` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"`inner` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the module `inner` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`inner` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `inner` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the module `inner` here\n...\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here\n   |\n   = note: `inner` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `Alias` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"`Alias` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDerive)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Alias` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Alias` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Alias` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Alias` here\n...\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here\n   |\n   = note: `Alias` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `Outer` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"`Outer` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDerive)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Outer` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Outer` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Outer` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Outer` here\n...\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here\n   |\n   = note: `Outer` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `inner` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"`inner` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDerive)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the module `inner` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`inner` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `inner` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the module `inner` here\n...\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here\n   |\n   = note: `inner` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `Alias` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"`Alias` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDeriveLint)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Alias` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Alias` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Alias` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:40:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Alias` here\n...\nLL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Alias` redefined here\n   |\n   = note: `Alias` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `Outer` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"`Outer` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDeriveLint)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the type `Outer` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`Outer` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `Outer` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:40:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the type `Outer` here\n...\nLL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Outer` redefined here\n   |\n   = note: `Outer` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"the name `inner` is defined multiple times","code":{"code":"E0428","explanation":"\nA type or module has been defined more than once.\n\nErroneous code example:\n\n```compile_fail,E0428\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn't misspell the type/module's name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"`inner` redefined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":false,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[derive(generate_mod::CheckDeriveLint)]","def_site_span":null}},{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"previous definition of the module `inner` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[{"message":"`inner` must be defined only once in the type namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0428]: the name `inner` is defined multiple times\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:40:10\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ----------------------- previous definition of the module `inner` here\n...\nLL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `inner` redefined here\n   |\n   = note: `inner` must be defined only once in the type namespace of this module\n\n"}
[01:03:33] {"message":"cannot find type `FromOutside` in this scope","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":true,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[],"rendered":"error[E0412]: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:19:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"cannot find type `Outer` in this scope","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":true,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":644,"byte_end":667,"line_start":19,"line_end":19,"column_start":1,"column_end":24,"is_primary":false,"text":[{"text":"generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"generate_mod::check!","def_site_span":null}}],"children":[],"rendered":"error[E0412]: cannot find type `Outer` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:19:1\n   |\nLL | generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"cannot find type `FromOutside` in this scope","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}}],"children":[],"rendered":"error[E0412]: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"cannot find type `Outer` in this scope","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":798,"byte_end":825,"line_start":22,"line_end":22,"column_start":1,"column_end":28,"is_primary":false,"text":[{"text":"#[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[generate_mod::check_attr]","def_site_span":null}}],"children":[],"rendered":"error[E0412]: cannot find type `Outer` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:22:1\n   |\nLL | #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope\n\n"}
[01:03:33] {"message":"cannot find type `FromOutside` in this scope","code":{"code":"proc_macro_derive_resolution_fallback","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[warn(proc_macro_derive_resolution_fallback)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = note: #[warn(proc_macro_derive_resolution_fallback)] on by default\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>\n\n"}
[01:03:33] {"message":"cannot find type `Outer` in this scope","code":{"code":"proc_macro_derive_resolution_fallback","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":983,"byte_end":1008,"line_start":26,"line_end":26,"column_start":10,"column_end":35,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":10,"highlight_end":35}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `Outer` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:26:10\n   |\nLL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>\n\n"}
[01:03:33] {"message":"cannot find type `FromOutside` in this scope","code":{"code":"proc_macro_derive_resolution_fallback","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1352,"byte_end":1377,"line_start":33,"line_end":33,"column_start":14,"column_end":39,"is_primary":true,"text":[{"text":"    #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":14,"highlight_end":39}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:33:14\n   |\nLL |     #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>\n\n"}
[01:03:33] {"message":"cannot find type `Outer` in this scope","code":{"code":"proc_macro_derive_resolution_fallback","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1352,"byte_end":1377,"line_start":33,"line_end":33,"column_start":14,"column_end":39,"is_primary":true,"text":[{"text":"    #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope","highlight_start":14,"highlight_end":39}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `Outer` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:33:14\n   |\nLL |     #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope\n   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>\n\n"}
[01:03:33] {"message":"cannot find type `FromOutside` in this scope","code":{"code":"proc_macro_derive_resolution_fallback","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `FromOutside` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:40:10\n   |\nLL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>\n\n"}
[01:03:33] {"message":"cannot find type `Outer` in this scope","code":{"code":"proc_macro_derive_resolution_fallback","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs","byte_start":1718,"byte_end":1747,"line_start":40,"line_end":40,"column_start":10,"column_end":39,"is_primary":true,"text":[{"text":"#[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed","highlight_start":10,"highlight_end":39}],"label":"names from parent modules are not accessible without an explicit import","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: cannot find type `Outer` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/generate-mod.rs:40:10\n   |\nLL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import\n   |\n   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!\n   = note: for more information, see issue #50504 </~https://github.com/rust-lang/rust/issues/50504>\n\n"}
[01:03:33] {"message":"aborting due to 13 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 13 previous errors\n\n"}
[01:03:33] {"message":"Some errors occurred: E0412, E0428.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0412, E0428.\n"}
[01:03:33] {"message":"For more information about an error, try `rustc --explain E0412`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0412`.\n"}
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] thread '[ui] ui-fulldeps/proc-macro/generate-mod.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3277:9
[01:03:33] 
[01:03:33] 
[01:03:33] ---- [ui] ui-fulldeps/proc-macro/nested-item-spans.rs stdout ----
[01:03:33] diff of stderr:
[01:03:33] 
[01:03:33] + error[E0425]: cannot find function `bar` in this scope
[01:03:33] +   --> $DIR/nested-item-spans.rs:32:5
[01:03:33] +    |
[01:03:33] + LL |     bar();
[01:03:33] + 
[01:03:33] 1 error[E0308]: mismatched types
[01:03:33] -   --> $DIR/nested-item-spans.rs:20:22
[01:03:33] 3    |
[01:03:33] 3    |
[01:03:33] - LL |         let x: u32 = "x"; //~ ERROR: mismatched types
[01:03:33] -    |
[01:03:33] 7    = note: expected type `u32`
[01:03:33] 8               found type `&'static str`
[01:03:33] 9 
[01:03:33] 9 
[01:03:33] 
[01:03:33] 10 error[E0308]: mismatched types
[01:03:33] -   --> $DIR/nested-item-spans.rs:29:22
[01:03:33] +   --> $DIR/nested-item-spans.rs:20:22
[01:03:33] 12    |
[01:03:33] 13 LL |         let x: u32 = "x"; //~ ERROR: mismatched types
[01:03:33] 
[01:03:33] 16    = note: expected type `u32`
[01:03:33] 17               found type `&'static str`
[01:03:33] 18 
---
[01:03:33] 22 
[01:03:33] 
[01:03:33] 
[01:03:33] The actual stderr differed from the expected stderr.
[01:03:33] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/nested-item-spans/nested-item-spans.stderr
[01:03:33] To update references, rerun the tests and pass the `--bless` flag
[01:03:33] To only update this specific test, also pass `--test-args proc-macro/nested-item-spans.rs`
[01:03:33] error: 1 errors occurred comparing output.
[01:03:33] status: exit code: 1
[01:03:33] status: exit code: 1
[01:03:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/nested-item-spans/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/nested-item-spans/auxiliary" "-A" "unused"
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] ------------------------------------------
[01:03:33] stderr:
[01:03:33] stderr:
[01:03:33] ------------------------------------------
[01:03:33] {"message":"cannot find function `bar` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs","byte_start":779,"byte_end":782,"line_start":32,"line_end":32,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    bar();","highlight_start":5,"highlight_end":8}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find function `bar` in this scope\n  --> /checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs:32:5\n   |\nLL |     bar();\n   |     ^^^ not found in this scope\n\n"}
[01:03:33] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs","byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"// Copyright 2018 The Rust Project Developers. See the COPYRIGHT","highlight_start":1,"highlight_end":1}],"label":"expected u32, found reference","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `u32`\n   found type `&'static str`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n   |\n   = note: expected type `u32`\n              found type `&'static str`\n\n"}
[01:03:33] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs","byte_start":622,"byte_end":625,"line_start":20,"line_end":20,"column_start":22,"column_end":25,"is_primary":true,"text":[{"text":"        let x: u32 = \"x\"; //~ ERROR: mismatched types","highlight_start":22,"highlight_end":25}],"label":"expected u32, found reference","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `u32`\n   found type `&'static str`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui-fulldeps/proc-macro/nested-item-spans.rs:20:22\n   |\nLL |         let x: u32 = \"x\"; //~ ERROR: mismatched types\n   |                      ^^^ expected u32, found reference\n   |\n   = note: expected type `u32`\n              found type `&'static str`\n\n"}
[01:03:33] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:03:33] {"message":"Some errors occurred: E0308, E0425.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0308, E0425.\n"}
[01:03:33] {"message":"For more information about an error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0308`.\n"}
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] thread '[ui] ui-fulldeps/proc-macro/nested-item-spans.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3277:9
[01:03:33] 
[01:03:33] 
[01:03:33] ---- [ui] ui-fulldeps/proc-macro/parent-source-spans.rs stdout ----
[01:03:33] diff of stderr:
[01:03:33] 
[01:03:33] 7 LL |     one!("hello", "world");
[01:03:33] 9 
[01:03:33] 9 
[01:03:33] - error: second final: "world"
[01:03:33] + error: second final: "hello"
[01:03:33] 12    |
[01:03:33] 12    |
[01:03:33] 13 LL |     three!($a, $b);
[01:03:33] 
[01:03:33] 25 LL |     one!("hello", "world");
[01:03:33] 27 
[01:03:33] 27 
[01:03:33] - error: second parent: "world"
[01:03:33] + error: second parent: "hello"
[01:03:33] 30    |
[01:03:33] 30    |
[01:03:33] 31 LL |     two!($a, $b);
[01:03:33] 
[01:03:33] 40 LL |     one!("hello", "world");
[01:03:33] 42 
[01:03:33] 42 
[01:03:33] - error: second grandparent: "world"
[01:03:33] + error: second grandparent: "hello"
[01:03:33] 45    |
[01:03:33] 45    |
[01:03:33] 46 LL |     one!("hello", "world");
[01:03:33] 
[01:03:33] 52 LL |     one!("hello", "world");
[01:03:33] 54 
[01:03:33] 54 
[01:03:33] - error: second source: "world"
[01:03:33] + error: second source: "hello"
[01:03:33] 57    |
[01:03:33] 57    |
[01:03:33] 58 LL |     one!("hello", "world");
[01:03:33] 59    |     ^^^^^^^^^^^^^^^^^^^^^^^
[01:03:33] 60 
[01:03:33] 60 
[01:03:33] - error: first final: "yay"
[01:03:33] + error: first final: "hello"
[01:03:33] 63    |
[01:03:33] 63    |
[01:03:33] 64 LL |     three!($a, $b);
[01:03:33] 
[01:03:33] 67 LL |     two!("yay", "rust");
[01:03:33] 69 
[01:03:33] 69 
[01:03:33] - error: second final: "rust"
[01:03:33] + error: second final: "hello"
[01:03:33] 72    |
[01:03:33] 72    |
[01:03:33] 73 LL |     three!($a, $b);
[01:03:33] 
[01:03:33] 76 LL |     two!("yay", "rust");
[01:03:33] 78 
[01:03:33] 78 
[01:03:33] - error: first parent: "yay"
[01:03:33] + error: first parent: "hello"
[01:03:33] 81    |
[01:03:33] 81    |
[01:03:33] 82 LL |     two!("yay", "rust");
[01:03:33] 83    |     ^^^^^^^^^^^^^^^^^^^^
[01:03:33] 84 
[01:03:33] 84 
[01:03:33] - error: second parent: "rust"
[01:03:33] + error: second parent: "hello"
[01:03:33] 87    |
[01:03:33] 87    |
[01:03:33] 88 LL |     two!("yay", "rust");
[01:03:33] 89    |     ^^^^^^^^^^^^^^^^^^^^
[01:03:33] 90 
[01:03:33] 90 
[01:03:33] - error: first source: "yay"
[01:03:33] + error: first source: "hello"
[01:03:33] 93    |
[01:03:33] 93    |
[01:03:33] 94 LL |     two!("yay", "rust");
[01:03:33] 95    |     ^^^^^^^^^^^^^^^^^^^^
[01:03:33] 96 
[01:03:33] 96 
[01:03:33] - error: second source: "rust"
[01:03:33] + error: second source: "hello"
[01:03:33] 99    |
[01:03:33] 99    |
[01:03:33] 100 LL |     two!("yay", "rust");
[01:03:33] 
[01:03:33] The actual stderr differed from the expected stderr.
[01:03:33] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/parent-source-spans/parent-source-spans.stderr
[01:03:33] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/parent-source-spans/parent-source-spans.stderr
[01:03:33] To update references, rerun the tests and pass the `--bless` flag
[01:03:33] To only update this specific test, also pass `--test-args proc-macro/parent-source-spans.rs`
[01:03:33] error: 1 errors occurred comparing output.
[01:03:33] status: exit code: 1
[01:03:33] status: exit code: 1
[01:03:33] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/parent-source-spans/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/proc-macro/parent-source-spans/auxiliary" "-A" "unused"
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] ------------------------------------------
[01:03:33] stderr:
[01:03:33] stderr:
[01:03:33] ------------------------------------------
[01:03:33] {"message":"first final: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":815,"byte_end":817,"line_start":27,"line_end":27,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    three!($a, $b);","highlight_start":12,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":682,"byte_end":695,"line_start":21,"line_end":21,"column_start":5,"column_end":18,"is_primary":false,"text":[{"text":"    two!($a, $b);","highlight_start":5,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":false,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"one!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":648,"byte_end":772,"line_start":20,"line_end":24,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro one($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    two!($a, $b);","highlight_start":1,"highlight_end":18},{"text":"    //~^ ERROR first parent: \"hello\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR second parent: \"world\"","highlight_start":1,"highlight_end":38},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"two!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":774,"byte_end":968,"line_start":26,"line_end":32,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro two($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    three!($a, $b);","highlight_start":1,"highlight_end":20},{"text":"    //~^ ERROR first final: \"hello\"","highlight_start":1,"highlight_end":36},{"text":"    //~| ERROR second final: \"world\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR first final: \"yay\"","highlight_start":1,"highlight_end":34},{"text":"    //~| ERROR second final: \"rust\"","highlight_start":1,"highlight_end":36},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: first final: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:27:12\n   |\nLL |     three!($a, $b);\n   |            ^^\n...\nLL |     one!(\"hello\", \"world\");\n   |     ----------------------- in this macro invocation\n\n"}
[01:03:33] {"message":"second final: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":819,"byte_end":821,"line_start":27,"line_end":27,"column_start":16,"column_end":18,"is_primary":true,"text":[{"text":"    three!($a, $b);","highlight_start":16,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":682,"byte_end":695,"line_start":21,"line_end":21,"column_start":5,"column_end":18,"is_primary":false,"text":[{"text":"    two!($a, $b);","highlight_start":5,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":false,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"one!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":648,"byte_end":772,"line_start":20,"line_end":24,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro one($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    two!($a, $b);","highlight_start":1,"highlight_end":18},{"text":"    //~^ ERROR first parent: \"hello\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR second parent: \"world\"","highlight_start":1,"highlight_end":38},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"two!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":774,"byte_end":968,"line_start":26,"line_end":32,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro two($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    three!($a, $b);","highlight_start":1,"highlight_end":20},{"text":"    //~^ ERROR first final: \"hello\"","highlight_start":1,"highlight_end":36},{"text":"    //~| ERROR second final: \"world\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR first final: \"yay\"","highlight_start":1,"highlight_end":34},{"text":"    //~| ERROR second final: \"rust\"","highlight_start":1,"highlight_end":36},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: second final: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:27:16\n   |\nLL |     three!($a, $b);\n   |                ^^\n...\nLL |     one!(\"hello\", \"world\");\n   |     ----------------------- in this macro invocation\n\n"}
[01:03:33] {"message":"first parent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":682,"byte_end":695,"line_start":21,"line_end":21,"column_start":5,"column_end":18,"is_primary":true,"text":[{"text":"    two!($a, $b);","highlight_start":5,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":false,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"one!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":648,"byte_end":772,"line_start":20,"line_end":24,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro one($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    two!($a, $b);","highlight_start":1,"highlight_end":18},{"text":"    //~^ ERROR first parent: \"hello\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR second parent: \"world\"","highlight_start":1,"highlight_end":38},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: first parent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:21:5\n   |\nLL |     two!($a, $b);\n   |     ^^^^^^^^^^^^^\n...\nLL |     one!(\"hello\", \"world\");\n   |     ----------------------- in this macro invocation\n\n"}
[01:03:33] {"message":"second parent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":682,"byte_end":695,"line_start":21,"line_end":21,"column_start":5,"column_end":18,"is_primary":true,"text":[{"text":"    two!($a, $b);","highlight_start":5,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":false,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"one!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":648,"byte_end":772,"line_start":20,"line_end":24,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro one($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    two!($a, $b);","highlight_start":1,"highlight_end":18},{"text":"    //~^ ERROR first parent: \"hello\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR second parent: \"world\"","highlight_start":1,"highlight_end":38},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: second parent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:21:5\n   |\nLL |     two!($a, $b);\n   |     ^^^^^^^^^^^^^\n...\nLL |     one!(\"hello\", \"world\");\n   |     ----------------------- in this macro invocation\n\n"}
[01:03:33] {"message":"first grandparent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":true,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first grandparent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:44:5\n   |\nLL |     one!(\"hello\", \"world\");\n   |     ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"second grandparent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":true,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second grandparent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:44:5\n   |\nLL |     one!(\"hello\", \"world\");\n   |     ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"first source: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":true,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first source: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:44:5\n   |\nLL |     one!(\"hello\", \"world\");\n   |     ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"second source: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1178,"byte_end":1201,"line_start":44,"line_end":44,"column_start":5,"column_end":28,"is_primary":true,"text":[{"text":"    one!(\"hello\", \"world\");","highlight_start":5,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second source: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:44:5\n   |\nLL |     one!(\"hello\", \"world\");\n   |     ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"first final: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":815,"byte_end":817,"line_start":27,"line_end":27,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    three!($a, $b);","highlight_start":12,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1367,"byte_end":1387,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":false,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"two!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":774,"byte_end":968,"line_start":26,"line_end":32,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro two($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    three!($a, $b);","highlight_start":1,"highlight_end":20},{"text":"    //~^ ERROR first final: \"hello\"","highlight_start":1,"highlight_end":36},{"text":"    //~| ERROR second final: \"world\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR first final: \"yay\"","highlight_start":1,"highlight_end":34},{"text":"    //~| ERROR second final: \"rust\"","highlight_start":1,"highlight_end":36},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: first final: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:27:12\n   |\nLL |     three!($a, $b);\n   |            ^^\n...\nLL |     two!(\"yay\", \"rust\");\n   |     -------------------- in this macro invocation\n\n"}
[01:03:33] {"message":"second final: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":819,"byte_end":821,"line_start":27,"line_end":27,"column_start":16,"column_end":18,"is_primary":true,"text":[{"text":"    three!($a, $b);","highlight_start":16,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1367,"byte_end":1387,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":false,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"two!","def_site_span":{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":774,"byte_end":968,"line_start":26,"line_end":32,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"macro two($a:expr, $b:expr) {","highlight_start":1,"highlight_end":30},{"text":"    three!($a, $b);","highlight_start":1,"highlight_end":20},{"text":"    //~^ ERROR first final: \"hello\"","highlight_start":1,"highlight_end":36},{"text":"    //~| ERROR second final: \"world\"","highlight_start":1,"highlight_end":37},{"text":"    //~| ERROR first final: \"yay\"","highlight_start":1,"highlight_end":34},{"text":"    //~| ERROR second final: \"rust\"","highlight_start":1,"highlight_end":36},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"error: second final: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:27:16\n   |\nLL |     three!($a, $b);\n   |                ^^\n...\nLL |     two!(\"yay\", \"rust\");\n   |     -------------------- in this macro invocation\n\n"}
[01:03:33] {"message":"first parent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1367,"byte_end":1387,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first parent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"second parent: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1367,"byte_end":1387,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second parent: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"first source: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1367,"byte_end":1387,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first source: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"second source: \"hello\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1367,"byte_end":1387,"line_start":50,"line_end":50,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    two!(\"yay\", \"rust\");","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second source: \"hello\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:50:5\n   |\nLL |     two!(\"yay\", \"rust\");\n   |     ^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:03:33] {"message":"first final: \"hip\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1544,"byte_end":1549,"line_start":56,"line_end":56,"column_start":12,"column_end":17,"is_primary":true,"text":[{"text":"    three!(\"hip\", \"hop\");","highlight_start":12,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first final: \"hip\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:56:12\n   |\nLL |     three!(\"hip\", \"hop\");\n   |            ^^^^^\n\n"}
[01:03:33] {"message":"second final: \"hop\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1551,"byte_end":1556,"line_start":56,"line_end":56,"column_start":19,"column_end":24,"is_primary":true,"text":[{"text":"    three!(\"hip\", \"hop\");","highlight_start":19,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second final: \"hop\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:56:19\n   |\nLL |     three!(\"hip\", \"hop\");\n   |                   ^^^^^\n\n"}
[01:03:33] {"message":"first source: \"hip\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1544,"byte_end":1549,"line_start":56,"line_end":56,"column_start":12,"column_end":17,"is_primary":true,"text":[{"text":"    three!(\"hip\", \"hop\");","highlight_start":12,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: first source: \"hip\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:56:12\n   |\nLL |     three!(\"hip\", \"hop\");\n   |            ^^^^^\n\n"}
[01:03:33] {"message":"second source: \"hop\"","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs","byte_start":1551,"byte_end":1556,"line_start":56,"line_end":56,"column_start":19,"column_end":24,"is_primary":true,"text":[{"text":"    three!(\"hip\", \"hop\");","highlight_start":19,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: second source: \"hop\"\n  --> /checkout/src/test/ui-fulldeps/proc-macro/parent-source-spans.rs:56:19\n   |\nLL |     three!(\"hip\", \"hop\");\n   |                   ^^^^^\n\n"}
[01:03:33] {"message":"aborting due to 18 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 18 previous errors\n\n"}
[01:03:33] ------------------------------------------
[01:03:33] 
[01:03:33] thread '[ui] ui-fulldeps/proc-macro/parent-source-spans.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3277:9
[01:03:33] 
---
[01:03:33] test result: FAILED. 37 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out
[01:03:33] 
[01:03:33] 
[01:03:33] 
[01:03:33] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:03:33] 
[01:03:33] 
[01:03:33] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:03:33] Build completed unsuccessfully in 0:18:50
[01:03:33] Build completed unsuccessfully in 0:18:50
[01:03:33] Makefile:58: recipe for target 'check' failed
[01:03:33] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:21dcc08c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@matthew-russo
Copy link
Contributor Author

@michaelwoerister can i get some help from you or someone else on this? I made the changes so new_source_file doesn't insert duplicates and it resolves the problem. Test suite stage 1 seems to run fine but fails on stage 2 on a few proc macro tests. I'm not sure how this is getting affected and I've been having some trouble debugging. If you have any tips or places I should look to, that would be really helpful

// Add this input file to the code map to make it available as
// dependency information, but don't enter it's contents
cx.source_map().new_source_file(file.into(), String::new());
let src = match String::from_utf8(bytes.clone()) {
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't need to clone the bytes vec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is cloned because bytes is also used to make both the src string and the LitKind::ByteStr ast node at the end of the method.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, I didn't see that. Nevermind then.

@@ -118,6 +118,18 @@ impl StableFilemapId {

StableFilemapId(hasher.finish())
Copy link
Member

Choose a reason for hiding this comment

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

I would be good to make new just call new_from_pieces.


pub fn new_from_pieces(name: &FileName,
name_was_remapped: bool,
unmapped_path: Option<FileName>) -> StableFilemapId {
Copy link
Member

Choose a reason for hiding this comment

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

unmapped_path should be passed as a reference (either &Option<FileName> or Option<&FileName>). Then you don't have to clone it. You can use Option::as_ref() to convert from Option<T> to Option<&T>.

@michaelwoerister
Copy link
Member

Hm, I don't know yet why this is failing. Maybe proc-macros rely on being able to "overwrite" files in the SourceMap somehow.

@matthew-russo
Copy link
Contributor Author

Hm, I don't know yet why this is failing. Maybe proc-macros rely on being able to "overwrite" files in the SourceMap somehow.

That was my initial assumption. I naively tried to have new_source_file just update the src property if it already existed but it wasn't working because there was another mutable reference to it elsewhere. I'll make the adjustments you commented on

@michaelwoerister
Copy link
Member

So, yes, it looks like proc-macros all have the same "filename" and rely on the source map for parsing. I'm surprised that this hasn't caused any problems with incremental compilation yet.

@matthew-russo
Copy link
Contributor Author

@michaelwoerister Good to know. Where did you find that just so I can get a better idea? And should I change it so each proc macro gets its own file or did you have a different idea?

@michaelwoerister
Copy link
Member

michaelwoerister commented Oct 23, 2018

FileName is an enum with a special case for proc-macros:

/// Differentiates between real files and common virtual files
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash, RustcDecodable, RustcEncodable)]
pub enum FileName {
Real(PathBuf),
/// A macro. This includes the full name of the macro, so that there are no clashes.
Macros(String),
/// call to `quote!`
QuoteExpansion,
/// Command line
Anon,
/// Hack in src/libsyntax/parse.rs
/// FIXME(jseyfried)
MacroExpansion,
ProcMacroSourceCode,
/// Strings provided as --cfg [cfgspec] stored in a crate_cfg
CfgSpec,
/// Strings provided as crate attributes in the CLI
CliCrateAttr,
/// Custom sources for explicit parser calls from plugins and drivers
Custom(String),
}

Since the ProcMacroSourceCode variant has no field to differentiate between different invocations, all "file names" of SourceFiles generated for proc-macro invocations will be the same.

We could add a field that somehow identifies the invocation but that has implications for incremental compilation. I'm not sure yet how to best solve this.

@matthew-russo matthew-russo force-pushed the 53956-panic-on-include_bytes-of-own-file branch from 8ebe646 to 4c5b8c7 Compare October 23, 2018 18:37
@matthew-russo
Copy link
Contributor Author

@michaelwoerister noted. I made a couple of the changes you suggested. bytes is cloned because its consumed to make the src string and also to make the ast node at the end of the method

@michaelwoerister
Copy link
Member

Awesome, thank you!

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:04136056:start=1543955152393528172,finish=1543955234324839854,duration=81931311682
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:07:25] 405 |             FileName::ProcMacroSourceCode,
[00:07:25]     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `syntax_pos::FileName`, found fn item
[00:07:25]     |
[00:07:25]     = note: expected type `syntax_pos::FileName`
[00:07:25]                found type `fn(u64) -> syntax_pos::FileName {syntax_pos::FileName::ProcMacroSourceCode}`
[00:07:25] error: aborting due to previous error
[00:07:25] 
[00:07:25] For more information about this error, try `rustc --explain E0308`.
[00:07:25] error: Could not compile `syntax_ext`.
[00:07:25] error: Could not compile `syntax_ext`.
[00:07:25] warning: build failed, waiting for other jobs to finish...
[00:13:19] error: build failed
[00:13:19] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:13:19] expected success, got: exit code: 101
[00:13:19] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:13:19] Build completed unsuccessfully in 0:09:31
[00:13:19] Makefile:28: recipe for target 'all' failed
[00:13:19] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:16998c90
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Dec  4 20:40:42 UTC 2018
---
travis_time:end:00e0749c:start=1543956043235866324,finish=1543956043243392645,duration=7526321
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0d4b9af8
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -[   11.118870] init: failsafe main process (1094) killed by TERM signal
travis_fold:end:after_failure.6

Done. Your build exited with 1.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@matthew-russo
Copy link
Contributor Author

Hmmm. something smells off. everything is green locally. will debug and update

@matthew-russo matthew-russo force-pushed the 53956-panic-on-include_bytes-of-own-file branch from ba1d347 to 223ea10 Compare December 4, 2018 22:14
@matthew-russo matthew-russo force-pushed the 53956-panic-on-include_bytes-of-own-file branch from 223ea10 to f0f8aa9 Compare December 5, 2018 00:53
@matthew-russo
Copy link
Contributor Author

WOOHOOOO finally! @michaelwoerister can you check it out and make sure my code changes are acceptable?

@michaelwoerister
Copy link
Member

Looks great! Thanks a lot for keeping at it for so long, @mcr431.

@bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2018

📌 Commit f0f8aa9 has been approved by michaelwoerister

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 5, 2018
@bors
Copy link
Contributor

bors commented Dec 6, 2018

⌛ Testing commit f0f8aa9 with merge 1839c14...

bors added a commit that referenced this pull request Dec 6, 2018
…e, r=michaelwoerister

53956 panic on include bytes of own file

fix #53956

When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
@bors
Copy link
Contributor

bors commented Dec 6, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: michaelwoerister
Pushing 1839c14 to master...

@michaelwoerister
Copy link
Member

🎉

jieyouxu pushed a commit to jieyouxu/rust that referenced this pull request Jan 20, 2025
I believe this variant name was used incorrectly. The timeline is roughly:

* `FileName::cfg_spec_source_code` was added in
  rust-lang#54517. However, it used
  `FileName::Quote` instead of `FileName::CfgSpec` which I believe was a
  mistake.
* Quote stuff was removed in
  rust-lang#51285, but did not remove
  `FileName::Quote`.
* `FileName::CfgSpec` was removed in
  rust-lang#116474 because it was unused.

This restores it so that the `--cfg` variant uses a name that makes more
sense with how it is used, and restores what I think is the original
intent.
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jan 20, 2025
Rename FileName::QuoteExpansion to CfgSpec

I believe this variant name was used incorrectly. The timeline is roughly:

* `FileName::cfg_spec_source_code` was added in rust-lang#54517. However, it used `FileName::Quote` instead of `FileName::CfgSpec` which I believe was a mistake.
* Quote stuff was removed in rust-lang#51285, but did not remove `FileName::Quote`.
* `FileName::CfgSpec` was removed in rust-lang#116474 because it was unused.

This restores it so that the `--cfg` variant uses a name that makes more sense with how it is used, and restores what I think is the original intent.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2025
Rollup merge of rust-lang#135747 - ehuss:filename-quote, r=SparrowLii

Rename FileName::QuoteExpansion to CfgSpec

I believe this variant name was used incorrectly. The timeline is roughly:

* `FileName::cfg_spec_source_code` was added in rust-lang#54517. However, it used `FileName::Quote` instead of `FileName::CfgSpec` which I believe was a mistake.
* Quote stuff was removed in rust-lang#51285, but did not remove `FileName::Quote`.
* `FileName::CfgSpec` was removed in rust-lang#116474 because it was unused.

This restores it so that the `--cfg` variant uses a name that makes more sense with how it is used, and restores what I think is the original intent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo build panics with include_bytes!() of the file itself
7 participants