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

resolve: Disambiguate a subset of conflicts "macro_rules" vs "macro name in module" #54605

Merged
merged 1 commit into from
Oct 3, 2018

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Sep 27, 2018

Currently if macro name may refer to both a macro_rules macro definition and a macro defined/imported into module we conservatively report an ambiguity error.
Unfortunately, these errors became a source of regressions when macro modularization was enabled - see issue #54472.

This PR disambiguates such conflicts in favor of macro_rules if both the macro_rules item and in-module macro name are defined in the same normal (named) module and macro_rules is closer in scope to the point of use (see the tests for examples).
This is a subset of more general approach described in #54472 (comment).
The subset is enough to fix all the regressions from #54472, but it can be extended to apply to all "macro_rules" vs "macro name in module" conflicts in the future.

To give an analogy, this is equivalent to scoping rules for let variables and items defined in blocks (macro_rules behaves like "let at module level" in general).

{ // beginning of the block
    use xxx::m; // (1)
    
    // Starting from the beginning of the block and until here m!() refers to (1)
    macro_rules! m { ... } // (2)
    // Starting from here and until the end of the block m!() refers to (2)
} // end of the block

More complex examples with use and macro_rules from different modules still report ambiguity errors, even if equivalent examples with let are legal.

Fixes #54472 (stable-to-beta regression)

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(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 27, 2018
@petrochenkov
Copy link
Contributor Author

cc @rust-lang/lang

@petrochenkov petrochenkov added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 27, 2018
@matthewjasper
Copy link
Contributor

r? @alexcrichton

@alexcrichton
Copy link
Member

This all looks and sounds good to me, thanks @petrochenkov! r=me with some tests

@petrochenkov petrochenkov 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 Sep 28, 2018
@pietroalbini pietroalbini added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 2, 2018
@petrochenkov
Copy link
Contributor Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Oct 2, 2018

📌 Commit d8887bf61a626f39e26302902128b6915517c99a has been approved by alexcrichton

@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 Oct 2, 2018
@petrochenkov
Copy link
Contributor Author

Argh, asserts are firing. Will fix tomorrow.
@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 2, 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.
[00:45:16] .................................................................................................... 500/4319
[00:45:20] .......................i............................................................................ 600/4319
[00:45:25] .................................................................................................... 700/4319
[00:45:29] ................................i...........i....................................................... 800/4319
[00:45:32] .......................F...........................iiiii..........F................................. 900/4319
[00:45:36] .................................................................................................... 1000/4319
[00:45:38] ..........................................................F......................................... 1100/4319
[00:45:40] .................F.................................................................................. 1200/4319
[00:45:43] .......................................F............................................................ 1300/4319
[00:45:45] ......................................F............................................................. 1400/4319
[00:45:48] .....................F.....................i..........................................F.F........... 1500/4319
[00:45:52] ..........i......................................................................................... 1600/4319
[00:45:55] .F...FFF..F.F.F...FFF.......F.................F..........................................F.......... 1700/4319
[00:45:57] ...........................................F........................................................ 1800/4319
[00:46:00] ..i................................F................................................................ 1900/4319
[00:46:03] .................................................................................................... 2000/4319
[00:46:06] ............................................................................F....................... 2100/4319
[00:46:09] ............................................F........F............................................F. 2200/4319
[00:46:12] .................F......................F........................................................... 2300/4319
[00:46:18] .................................................................................................... 2500/4319
[00:46:21] .................................................................................................... 2600/4319
[00:46:25] .................................................................................................... 2700/4319
[00:46:27] .i.................................................................................................. 2800/4319
[00:46:27] .i.................................................................................................. 2800/4319
[00:46:30] .............................................................i.i..ii................................ 2900/4319
[00:46:34] .................................................................................................... 3000/4319
[00:46:37] ...............................................................................................i.... 3100/4319
[00:46:40] .................................................................................................... 3200/4319
[00:46:43] ....................FFF..FF............................F............................................ 3300/4319
[00:46:46] .................................................................................................... 3400/4319
[00:46:49] ......................................................................F............................. 3500/4319
[00:46:52] ....F................................i...............................F.FFFF....F.................... 3600/4319
[00:46:57] .................................F........F........F.........F.....F................................ 3700/4319
[00:47:00] .............................................................................F...................... 3800/4319
[00:47:04] .....................................F.............................................................. 3900/4319
[00:47:10] .................................................................................................... 4100/4319
[00:47:10] .................................................................................................... 4100/4319
[00:47:13] ...........................................................FF......................................F 4200/4319
[00:47:15] .F.FFFFF..F...............................................i......................................... 4300/4319
[00:47:16] failures:
[00:47:16] 
[00:47:16] ---- [ui] ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs stdout ----
[00:47:16] 
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.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/did_you_mean/issue-38054-do-not-show-unresolved-names/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/did_you_mean/issue-38054-do-not-show-unresolved-names/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:47:16] 
[00:47:16] ---- [ui] ui/dollar-crate/dollar-crate-is-keyword-2.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.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/dollar-crate/dollar-crate-is-keyword-2/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/dollar-crate/dollar-crate-is-keyword-2/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/dollar-crate/dollar-crate-is-keyword-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/dollar-crate/dollar-crate-is-keyword-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/error-codes/E0253.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0253.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/error-codes/E0253/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/error-codes/E0253/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] {"message":"`do_something` is not directly importable","code":{"code":"E0253","explanation":"\nAttempt was made to import an unimportable value. This can happen when trying\nto import a method from a trait.\n\nErroneous code example:\n\n```compile_fail,E0253\nmod foo {\n    pub trait MyTrait {\n        fn do_something();\n    }\n}\n\nuse foo::MyTrait::do_something;\n// error: `do_something` is not directly importable\n\nfn main() {}\n```\n\nIt's invalid to directly import methods belonging to a trait or concrete type.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0253.rs","byte_start":541,"byte_end":567,"line_start":17,"line_end":17,"column_start":5,"column_end":31,"is_primary":true,"text":[{"text":"use foo::MyTrait::do_something;","highlight_start":5,"highlight_end":31}],"label":"cannot be imported directly","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0253]: `do_something` is not directly importable\n  --> /checkout/src/test/ui/error-codes/E0253.rs:17:5\n   |\nLL | use foo::MyTrait::do_something;\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly\n\n"}
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:47:16] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:47:16] {"message":"For more information about this error, try `rustc --explain E0253`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0253`.\n"}
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/error-codes/E0253.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/error-codes/E0253.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/error-codes/E0432.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0432.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/error-codes/E0432/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/error-codes/E0432/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/error-codes/E0432.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/error-codes/E0432.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/export-import.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/export-import.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/export-import/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/export-import/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/export-import.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/export-import.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/feature-gates/feature-gate-extern_absolute_paths.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.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/feature-gates/feature-gate-extern_absolute_paths/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/feature-gates/feature-gate-extern_absolute_paths/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/feature-gates/feature-gate-extern_absolute_paths.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/feature-gates/feature-gate-extern_absolute_paths.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/feature-gates/feature-gate-uniform-paths.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gates/feature-gate-uniform-paths.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/feature-gates/feature-gate-uniform-paths/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/feature-gates/feature-gate-uniform-paths/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/feature-gates/feature-gate-uniform-paths.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/feature-gates/feature-gate-uniform-paths.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/hidden-rt-injection.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/hidden-rt-injection.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/hidden-rt-injection/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/hidden-rt-injection/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/hidden-rt-injection.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/hidden-rt-injection.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/hidden-rt-injection2.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/hidden-rt-injection2.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/hidden-rt-injection2/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/hidden-rt-injection2/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/hidden-rt-injection2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/hidden-rt-injection2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/import.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/import.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/import/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/import/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/import.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/import.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/import2.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/import2.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/import2/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/import2/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/import2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/import2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/import4.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/import4.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/import4/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/import4/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/import4.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/import4.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/import3.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/import3.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/import3/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/import3/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/import3.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/import3.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/imports/import-from-missing.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/imports/import-from-missing.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/imports/import-from-missing/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/imports/import-from-missing/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/imports/import-from-missing.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/imports/import-from-missing.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/imports/import-loop-2.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/imports/import-loop-2.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/imports/import-loop-2/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/imports/import-loop-2/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:16] 
[00:47:16] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:47:16] 
[00:47:16] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] thread '[ui] ui/imports/import-loop-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] thread '[ui] ui/imports/import-loop-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:16] 
[00:47:16] ---- [ui] ui/imports/import-loop.rs stdout ----
[00:47:16] 
[00:47:16] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:16] status: exit code: 101
[00:47:16] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/imports/import-loop.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/imports/import-loop/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/imports/import-loop/auxiliary" "-A" "unused"
[00:47:16] ------------------------------------------
[00:47:16] 
[00:47:16] ------------------------------------------
[00:47:16] stderr:
[00:47:16] stderr:
[00:47:16] ------------------------------------------
[00:47:16] thread 'main' panicked at 'librustc_resolve/lib.rs:4613: parent module is reset for binding', librustc/util/bug.rs:47:26
[00:47:16] 
[00:47:16] error: internal compiler error: unexpected panic
[00:47:16] 
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] note: the compiler unexpectedly panicked. this is a bug.
[00:47:16] 
[00:47:16] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
---
[00:47:16] test result: FAILED. 4238 passed; 61 failed; 20 ignored; 0 measured; 0 filtered out
[00:47:16] 
[00:47:16] 
[00:47:16] 
[00:47:16] 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" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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"
[00:47:16] 
[00:47:16] 
[00:47:16] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:47:16] Build completed unsuccessfully in 0:03:12
[00:47:16] Build completed unsuccessfully in 0:03:12
[00:47:16] Makefile:58: recipe for target 'check' failed
[00:47:16] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:090e4800
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:13ceeb55:start=1538493686430324764,finish=1538493686435171330,duration=4846566
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01853604
$ 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 -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:29f96d54
travis_time:start:29f96d54
$ 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:0608ba04
$ 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)

@petrochenkov
Copy link
Contributor Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Oct 3, 2018

📌 Commit 078fc52 has been approved by alexcrichton

@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 Oct 3, 2018
@petrochenkov
Copy link
Contributor Author

@bors p=1
Fixes a beta regression + unblocks #54336.

@bors
Copy link
Contributor

bors commented Oct 3, 2018

⌛ Testing commit 078fc52 with merge 36399ce...

bors added a commit that referenced this pull request Oct 3, 2018
resolve: Disambiguate a subset of conflicts "macro_rules" vs "macro name in module"

Currently if macro name may refer to both a `macro_rules` macro definition and a macro defined/imported into module we conservatively report an ambiguity error.
Unfortunately, these errors became a source of regressions when macro modularization was enabled - see issue #54472.

This PR disambiguates such conflicts in favor of `macro_rules` if both the `macro_rules` item and in-module macro name are defined in the same normal (named) module and `macro_rules` is closer in scope to the point of use (see the tests for examples).
This is a subset of more general approach described in #54472 (comment).
The subset is enough to fix all the regressions from #54472, but it can be extended to apply to all "macro_rules" vs "macro name in module" conflicts in the future.

To give an analogy, this is equivalent to scoping rules for `let` variables and items defined in blocks (`macro_rules` behaves like "`let` at module level" in general).
```rust
{ // beginning of the block
    use xxx::m; // (1)

    // Starting from the beginning of the block and until here m!() refers to (1)
    macro_rules! m { ... } // (2)
    // Starting from here and until the end of the block m!() refers to (2)
} // end of the block
```
More complex examples with `use` and `macro_rules` from different modules still report ambiguity errors, even if equivalent examples with `let` are legal.

Fixes #54472 (stable-to-beta regression)
@bors
Copy link
Contributor

bors commented Oct 3, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 3, 2018
@rust-highfive
Copy link
Collaborator

The job asmjs 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.
[02:15:09] failures:
[02:15:09] 
[02:15:09] ---- [run-pass (nll)] run-pass/generics/generic-tag-local.rs stdout ----
[02:15:09] 
[02:15:09] error: test compilation failed although it shouldn't!
[02:15:09] status: exit code: 1
[02:15:09] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/generics/generic-tag-local.rs" "--target=asmjs-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.js" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/auxiliary"
[02:15:09] ------------------------------------------
[02:15:09] 
[02:15:09] ------------------------------------------
[02:15:09] stderr:
[02:15:09] stderr:
[02:15:09] ------------------------------------------
[02:15:09] {"message":"linking with `emcc` failed: exit code: 1","code":null,"level":"error","spans":[],"children":[{"message":"\"emcc\" \"-s\" \"DISABLE_EXCEPTION_CATCHING=0\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.0.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.1.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.2.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.3.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.4.rcgu.o\" \"-o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.js\" \"-s\" \"EXPORTED_FUNCTIONS=[\\\"_main\\\",\\\"_rust_eh_personality\\\"]\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.4riosz2xe2q4dk0b.rcgu.o\" \"-O0\" \"--memory-init-file\" \"0\" \"-g0\" \"-s\" \"DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]\" \"-L\" \"/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/auxiliary\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-7071e59de94c3175.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-ea4ebb4db08f759f.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-a1212ca14ff4129b.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc_system-78c8f6017dc5ec95.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-9283279f9fce83e1.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-65fd40e8c97df1ca.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-5d64ed038ad0cc2d.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-92e637e4b1a6ef5e.rlib\" \"-l\" \"c\" \"-s\" \"ERROR_ON_UNDEFINED_SYMBOLS=1\" \"-s\" \"ABORTING_MALLOC=0\" \"-s\" \"WASM=0\"","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"error: unresolved symbol: _ZN5alloc7raw_vec17capacity_overflow17h3569b5257e87d2d8E\nerror: unresolved symbol: _ZN49_$LT$alloc__raw_vec__RawVec$LT$T$C$$u20$A$GT$$GT$16reserve_internal17h2e6aed6bd5f3dcd5E_llvm_6FBEDB8A\nerror: unresolved symbol: anon_2908f0d75c4e1a1d8258623fc05ccc63_13_llvm_6FBEDB8A\nAborting compilation due to previous errors | undefined\nTraceback (most recent call last):\n  File \"/emsdk-portable/emscripten/1.37.13//emcc\", line 13, in <module>\n    emcc.run()\n  File \"/emsdk-portable/emscripten/1.37.13/emcc.py\", line 1526, in run\n    final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)\n  File \"/emsdk-portable/emscripten/1.37.13/tools/shared.py\", line 1963, in emscripten\n    call_emscripten(cmdline)\n  File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 2190, in _main\n    temp_files.run_and_clean(lambda: main(\n  File \"/emsdk-portable/emscripten/1.37.13/tools/tempfiles.py\", line 78, in run_and_clean\n    return func()\n  File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 2195, in <lambda>\n    DEBUG=DEBUG,\n  File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 2095, in main\n    temp_files=temp_files, DEBUG=DEBUG)\n  File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 98, in emscript\n    glue, forwarded_data = compiler_glue(metadata, settings, libraries, compiler_engine, temp_files, DEBUG)\n  File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 219, in compiler_glue\n    glue, forwarded_data = compile_settings(compiler_engine, settings, libraries, temp_files)\n  File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 531, in compile_settings\n    cwd=path_from_root('src'), error_limit=300)\n  File \"/emsdk-portable/emscripten/1.37.13/tools/jsrun.py\", line 128, in run_js\n    raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])\nException: Expected the command ['/emsdk-portable/node/4.1.1_64bit/bin/node', '/emsdk-portable/emscripten/1.37.13/src/compiler.js', '/tmp/tmpzNlnyl.txt', '/emsdk-portable/emscripten/1.37.13/src/library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import\n// and export values on it, and do the work to get that through\n// closure compiler if necessary. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..gener\n","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: linking with `emcc` failed: exit code: 1\n   |\n   = note: \"emcc\" \"-s\" \"DISABLE_EXCEPTION_CATCHING=0\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.0.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.1.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.2.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.3.rcgu.o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.generic_tag_local.7rcbfp3g-cgu.4.rcgu.o\" \"-o\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.js\" \"-s\" \"EXPORTED_FUNCTIONS=[\\\"_main\\\",\\\"_rust_eh_personality\\\"]\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/a.4riosz2xe2q4dk0b.rcgu.o\" \"-O0\" \"--memory-init-file\" \"0\" \"-g0\" \"-s\" \"DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]\" \"-L\" \"/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generics/generic-tag-local.nll/auxiliary\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libstd-7071e59de94c3175.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libpanic_unwind-ea4ebb4db08f759f.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libunwind-a1212ca14ff4129b.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc_system-78c8f6017dc5ec95.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liblibc-9283279f9fce83e1.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/liballoc-65fd40e8c97df1ca.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcore-5d64ed038ad0cc2d.rlib\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/asmjs-unknown-emscripten/lib/libcompiler_builtins-92e637e4b1a6ef5e.rlib\" \"-l\" \"c\" \"-s\" \"ERROR_ON_UNDEFINED_SYMBOLS=1\" \"-s\" \"ABORTING_MALLOC=0\" \"-s\" \"WASM=0\"\n   = note: error: unresolved symbol: _ZN5alloc7raw_vec17capacity_overflow17h3569b5257e87d2d8E\n           error: unresolved symbol: _ZN49_$LT$alloc__raw_vec__RawVec$LT$T$C$$u20$A$GT$$GT$16reserve_internal17h2e6aed6bd5f3dcd5E_llvm_6FBEDB8A\n           error: unresolved symbol: anon_2908f0d75c4e1a1d8258623fc05ccc63_13_llvm_6FBEDB8A\n           Aborting compilation due to previous errors | undefined\n           Traceback (most recent call last):\n             File \"/emsdk-portable/emscripten/1.37.13//emcc\", line 13, in <module>\n               emcc.run()\n             File \"/emsdk-portable/emscripten/1.37.13/emcc.py\", line 1526, in run\n               final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)\n             File \"/emsdk-portable/emscripten/1.37.13/tools/shared.py\", line 1963, in emscripten\n               call_emscripten(cmdline)\n             File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 2190, in _main\n               temp_files.run_and_clean(lambda: main(\n             File \"/emsdk-portable/emscripten/1.37.13/tools/tempfiles.py\", line 78, in run_and_clean\n               return func()\n             File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 2195, in <lambda>\n               DEBUG=DEBUG,\n             File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 2095, in main\n               temp_files=temp_files, DEBUG=DEBUG)\n             File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 98, in emscript\n               glue, forwarded_data = compiler_glue(metadata, settings, libraries, compiler_engine, temp_files, DEBUG)\n             File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 219, in compiler_glue\n               glue, forwarded_data = compile_settings(compiler_engine, settings, libraries, temp_files)\n             File \"/emsdk-portable/emscripten/1.37.13/emscripten.py\", line 531, in compile_settings\n               cwd=path_from_root('src'), error_limit=300)\n             File \"/emsdk-portable/emscripten/1.37.13/tools/jsrun.py\", line 128, in run_js\n               raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])\n           Exception: Expected the command ['/emsdk-portable/node/4.1.1_64bit/bin/node', '/emsdk-portable/emscripten/1.37.13/src/compiler.js', '/tmp/tmpzNlnyl.txt', '/emsdk-portable/emscripten/1.37.13/src/library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import\n           // and export values on it, and do the work to get that through\n           // closure compiler if necessary. There are various ways Module can be used:\n           // 1. Not defined. We create it here\n           // 2. A function parameter, function(Module) { ..gener\n           \n\n"}
[02:15:09] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[02:15:09] ------------------------------------------
[02:15:09] 
[02:15:09] thread '[run-pass (nll)] run-pass/generics/generic-tag-local.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[02:15:09] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[02:15:09] 
[02:15:09] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:499:22
[02:15:09] 
[02:15:09] 
[02:15:09] 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/asmjs-unknown-emscripten/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--stage-id" "stage2-asmjs-unknown-emscripten" "--mode" "run-pass" "--target" "asmjs-unknown-emscripten" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/emsdk-portable/node/4.1.1_64bit/bin/node" "--host-rustcflags" "-Crpath -Zunstable-options " "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/asmjs-unknown-emscripten/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
[02:15:09] 
[02:15:09] 
[02:15:09] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target asmjs-unknown-emscripten src/test/run-pass src/test/run-fail src/libstd src/liballoc src/libcore
[02:15:09] Build completed unsuccessfully in 2:10:36
---
travis_time:end:00a501d1:start=1538585050755897154,finish=1538585050765448003,duration=9550849
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:16da1660
$ 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 -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:026fc397
travis_time:start:026fc397
$ 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:3b528723
$ 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)

@kennytm
Copy link
Member

kennytm commented Oct 3, 2018

The relevant link error message:

error: unresolved symbol: _ZN5alloc7raw_vec17capacity_overflow17h3569b5257e87d2d8E
error: unresolved symbol: _ZN49_$LT$alloc__raw_vec__RawVec$LT$T$C$$u20$A$GT$$GT$16reserve_internal17h2e6aed6bd5f3dcd5E_llvm_6FBEDB8A
error: unresolved symbol: anon_2908f0d75c4e1a1d8258623fc05ccc63_13_llvm_6FBEDB8A

@kennytm kennytm 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 3, 2018
@petrochenkov
Copy link
Contributor Author

Spurious? I don't this emscripten-specific linking error has anything to do with my PR.
@bors retry

@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 Oct 3, 2018
@bors
Copy link
Contributor

bors commented Oct 3, 2018

⌛ Testing commit 078fc52 with merge 5597ee8...

bors added a commit that referenced this pull request Oct 3, 2018
resolve: Disambiguate a subset of conflicts "macro_rules" vs "macro name in module"

Currently if macro name may refer to both a `macro_rules` macro definition and a macro defined/imported into module we conservatively report an ambiguity error.
Unfortunately, these errors became a source of regressions when macro modularization was enabled - see issue #54472.

This PR disambiguates such conflicts in favor of `macro_rules` if both the `macro_rules` item and in-module macro name are defined in the same normal (named) module and `macro_rules` is closer in scope to the point of use (see the tests for examples).
This is a subset of more general approach described in #54472 (comment).
The subset is enough to fix all the regressions from #54472, but it can be extended to apply to all "macro_rules" vs "macro name in module" conflicts in the future.

To give an analogy, this is equivalent to scoping rules for `let` variables and items defined in blocks (`macro_rules` behaves like "`let` at module level" in general).
```rust
{ // beginning of the block
    use xxx::m; // (1)

    // Starting from the beginning of the block and until here m!() refers to (1)
    macro_rules! m { ... } // (2)
    // Starting from here and until the end of the block m!() refers to (2)
} // end of the block
```
More complex examples with `use` and `macro_rules` from different modules still report ambiguity errors, even if equivalent examples with `let` are legal.

Fixes #54472 (stable-to-beta regression)
@bors
Copy link
Contributor

bors commented Oct 3, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 5597ee8 to master...

@bors bors merged commit 078fc52 into rust-lang:master Oct 3, 2018
@pnkfelix
Copy link
Member

pnkfelix commented Oct 4, 2018

discussed at T-compiler meeting. accepting for beta backport.

@pnkfelix pnkfelix added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Oct 4, 2018
@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 4, 2018
bors added a commit that referenced this pull request Oct 4, 2018
[beta] Rollup backports

Merged and approved:

* #54605: resolve: Disambiguate a subset of conflicts "macro_rules" vs "macro name in module"
* #54557: incr.comp.: Don't automatically enable -Zshare-generics for incr. comp. builds.
* #54759: do not normalize non-scalar constants to a ConstValue::ScalarPair

Closes #54759
r? @ghost
@petrochenkov petrochenkov deleted the mambig branch June 5, 2019 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.30 beta] Ambiguous macro names
8 participants