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: Account for new importable entities #59047

Merged
merged 1 commit into from Mar 17, 2019

Conversation

Projects
None yet
9 participants
@petrochenkov
Copy link
Contributor

petrochenkov commented Mar 9, 2019

Fixes the ICE encountered in #58837
r? @Centril

let module = self.new_module(parent,
ModuleKind::Def(def, ident.name),
def_id,
expansion,
span);
self.define(parent, ident, TypeNS, (module, vis, DUMMY_SP, expansion));
}
Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) => {
Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) | Def::Existential(..) |
Def::TraitAlias(..) | Def::PrimTy(..) | Def::ToolMod => {

This comment has been minimized.

Copy link
@Centril

Centril Mar 9, 2019

Contributor

I think I understand but to make sure, could you educate me as to why ToolMod uses the TypeNS as opposed to MacroNS (the documentation on hir::def::Def barely exists...)?

Otherwise the PR looks good; r=me with green travis :)

This comment has been minimized.

Copy link
@petrochenkov

petrochenkov Mar 10, 2019

Author Contributor

ToolMod is very similar to Mod living in type namespace, it's a container for other items.
The difference is that contained items are limited to tool attributes and nested tool modules + the number of contained items is infinite (i.e. no name checks are performed).

This comment has been minimized.

Copy link
@Centril

Centril Mar 10, 2019

Contributor

Ah; that makes sense, thanks!

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 9, 2019

Btw.. @oli-obk suggested we beta-backport fixing the problem?

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Mar 9, 2019

Nominating for backport since it makes developing stage 0 less annoying (if you get the ICE you don't get the error that is the actual problem, thus not being able to figure out how to work around the ICE).

@Centril Centril added the T-compiler label Mar 9, 2019

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Mar 9, 2019

@bors r=Centril

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 9, 2019

📌 Commit 967e7f4 has been approved by Centril

Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril

bors added a commit that referenced this pull request Mar 10, 2019

Auto merge of #59067 - Centril:rollup, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #58021 (Fix fallout from #57667)
 - #58330 (Add rustdoc JS non-std tests)
 - #58788 (Make migrate mode work at item level granularity)
 - #58789 (Update compiler_builtins to 0.1.7 to get windows/arm fix)
 - #58803 (fs::copy() linux: set file mode early)
 - #58829 (librustc_interface: Update scoped-tls to 1.0)
 - #58848 (Prevent cache issues on version updates)
 - #58855 (std: Spin for a global malloc lock on wasm32)
 - #58872 (Adds help message in error for invalid `impl for T` syntax)
 - #58876 (Parse lifetimes that start with a number and give specific error)
 - #58901 (Change `std::fs::copy` to use `copyfile` on MacOS and iOS)
 - #58938 (core: ensure VaList passes improper_ctypes lint)
 - #58941 (MIPS: add r6 support)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59036 (Fix ICE in MIR pretty printing)
 - #59047 (resolve: Account for new importable entities)
 - #59056 (Use lifetime contravariance to elide more lifetimes in core+alloc+std)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril

bors added a commit that referenced this pull request Mar 10, 2019

Auto merge of #59069 - Centril:rollup, r=Centril
Rollup of 16 pull requests

Successful merges:

 - #58021 (Fix fallout from #57667)
 - #58330 (Add rustdoc JS non-std tests)
 - #58789 (Update compiler_builtins to 0.1.7 to get windows/arm fix)
 - #58803 (fs::copy() linux: set file mode early)
 - #58829 (librustc_interface: Update scoped-tls to 1.0)
 - #58848 (Prevent cache issues on version updates)
 - #58855 (std: Spin for a global malloc lock on wasm32)
 - #58872 (Adds help message in error for invalid `impl for T` syntax)
 - #58876 (Parse lifetimes that start with a number and give specific error)
 - #58901 (Change `std::fs::copy` to use `copyfile` on MacOS and iOS)
 - #58938 (core: ensure VaList passes improper_ctypes lint)
 - #58941 (MIPS: add r6 support)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59036 (Fix ICE in MIR pretty printing)
 - #59047 (resolve: Account for new importable entities)
 - #59056 (Use lifetime contravariance to elide more lifetimes in core+alloc+std)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril

bors added a commit that referenced this pull request Mar 10, 2019

Auto merge of #59075 - Centril:rollup, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #58021 (Fix fallout from #57667)
 - #58788 (Make migrate mode work at item level granularity)
 - #58789 (Update compiler_builtins to 0.1.7 to get windows/arm fix)
 - #58803 (fs::copy() linux: set file mode early)
 - #58829 (librustc_interface: Update scoped-tls to 1.0)
 - #58848 (Prevent cache issues on version updates)
 - #58855 (std: Spin for a global malloc lock on wasm32)
 - #58872 (Adds help message in error for invalid `impl for T` syntax)
 - #58876 (Parse lifetimes that start with a number and give specific error)
 - #58901 (Change `std::fs::copy` to use `copyfile` on MacOS and iOS)
 - #58938 (core: ensure VaList passes improper_ctypes lint)
 - #58941 (MIPS: add r6 support)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59036 (Fix ICE in MIR pretty printing)
 - #59047 (resolve: Account for new importable entities)
 - #59056 (Use lifetime contravariance to elide more lifetimes in core+alloc+std)
 - #59072 (we can now skip should_panic tests with the libtest harness)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Mar 11, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril

bors added a commit that referenced this pull request Mar 11, 2019

Auto merge of #59081 - Centril:rollup, r=Centril
Rollup of 15 pull requests

Successful merges:

 - #58021 (Fix fallout from #57667)
 - #58788 (Make migrate mode work at item level granularity)
 - #58789 (Update compiler_builtins to 0.1.7 to get windows/arm fix)
 - #58829 (librustc_interface: Update scoped-tls to 1.0)
 - #58848 (Prevent cache issues on version updates)
 - #58855 (std: Spin for a global malloc lock on wasm32)
 - #58872 (Adds help message in error for invalid `impl for T` syntax)
 - #58876 (Parse lifetimes that start with a number and give specific error)
 - #58938 (core: ensure VaList passes improper_ctypes lint)
 - #58941 (MIPS: add r6 support)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59036 (Fix ICE in MIR pretty printing)
 - #59047 (resolve: Account for new importable entities)
 - #59056 (Use lifetime contravariance to elide more lifetimes in core+alloc+std)
 - #59072 (we can now skip should_panic tests with the libtest harness)

Failed merges:

r? @ghost

@taiki-e taiki-e referenced this pull request Mar 11, 2019

Merged

librustc_driver => 2018 #58253

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Mar 13, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril

Centril added a commit to Centril/rust that referenced this pull request Mar 13, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
@@ -639,24 +639,24 @@ impl<'a> Resolver<'a> {
// but metadata cannot encode gensyms currently, so we create it here.
// This is only a guess, two equivalent idents may incorrectly get different gensyms here.
let ident = ident.gensym_if_underscore();
let def_id = def.def_id();

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Mar 14, 2019

Contributor

this part of the diff, I presume isn't meaningful -- that is, we're now getting the def_id as part of the match, but in each case, it's the same def_id it was before?

This comment has been minimized.

Copy link
@petrochenkov

petrochenkov Mar 14, 2019

Author Contributor

Yes, the def-ids are the same.

Centril added a commit to Centril/rust that referenced this pull request Mar 16, 2019

Rollup merge of rust-lang#59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59244 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57729 (extra testing of how NLL handles wildcard type `_`)
 - #58995 (Refactor tools/build-mainfest)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59038 (Track embedded-book in the toolstate)
 - #59047 (resolve: Account for new importable entities)
 - #59068 (HirIdification: kill off NodeId stragglers)
 - #59096 (middle: replace NodeId with HirId in AccessLevels)
 - #59106 (Add peer_addr function to UdpSocket)
 - #59116 (Be more discerning on when to attempt suggesting a comma in a macro invocation)

Failed merges:

 - #59195 (When moving out of a for loop head, suggest borrowing it)

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 17, 2019

⌛️ Testing commit 47ee538 with merge 7ea8bbe...

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in #58837
r? @Centril
@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 17, 2019

@bors retry

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59244 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57729 (extra testing of how NLL handles wildcard type `_`)
 - #58995 (Refactor tools/build-mainfest)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59038 (Track embedded-book in the toolstate)
 - #59047 (resolve: Account for new importable entities)
 - #59068 (HirIdification: kill off NodeId stragglers)
 - #59096 (middle: replace NodeId with HirId in AccessLevels)
 - #59106 (Add peer_addr function to UdpSocket)
 - #59116 (Be more discerning on when to attempt suggesting a comma in a macro invocation)

Failed merges:

 - #59195 (When moving out of a for loop head, suggest borrowing it)

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 17, 2019

⌛️ Testing commit 47ee538 with merge 3375b82...

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in #58837
r? @Centril
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 17, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Mar 17, 2019

The job arm-android 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:56:12] test string::test_str_clear ... ok
[01:56:12] test string::test_str_truncate ... ok
[01:56:12] test string::test_str_truncate_split_codepoint ... ok
[01:56:12] test string::test_str_truncate_invalid_len ... ok
[01:56:12] died due to signal 11
[01:56:12] 
[01:56:12] 
[01:56:12] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "arm-linux-androideabi" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--"
[01:56:12] expected success, got: exit code: 3
---
travis_time:end:04a69204:start=1552803476840448757,finish=1552803476864190150,duration=23741393
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:049946d0
$ 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:150ab7b0
travis_time:start:150ab7b0
$ 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:0258b4d8
$ 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)

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 17, 2019

@bors retry Seems unrelated to this PR...

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59244 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57729 (extra testing of how NLL handles wildcard type `_`)
 - #58995 (Refactor tools/build-mainfest)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59038 (Track embedded-book in the toolstate)
 - #59047 (resolve: Account for new importable entities)
 - #59068 (HirIdification: kill off NodeId stragglers)
 - #59096 (middle: replace NodeId with HirId in AccessLevels)
 - #59106 (Add peer_addr function to UdpSocket)
 - #59116 (Be more discerning on when to attempt suggesting a comma in a macro invocation)

Failed merges:

 - #59195 (When moving out of a for loop head, suggest borrowing it)

r? @ghost

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59244 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57729 (extra testing of how NLL handles wildcard type `_`)
 - #58995 (Refactor tools/build-mainfest)
 - #59035 (When encountetring `||{}()`, suggest the likely intended `(||{})()`)
 - #59038 (Track embedded-book in the toolstate)
 - #59047 (resolve: Account for new importable entities)
 - #59068 (HirIdification: kill off NodeId stragglers)
 - #59096 (middle: replace NodeId with HirId in AccessLevels)
 - #59106 (Add peer_addr function to UdpSocket)
 - #59116 (Be more discerning on when to attempt suggesting a comma in a macro invocation)

Failed merges:

 - #59195 (When moving out of a for loop head, suggest borrowing it)

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 17, 2019

⌛️ Testing commit 47ee538 with merge f649c76...

bors added a commit that referenced this pull request Mar 17, 2019

Auto merge of #59047 - petrochenkov:modnodefid, r=Centril
resolve: Account for new importable entities

Fixes the ICE encountered in #58837
r? @Centril
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 17, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing f649c76 to master...

@bors bors added the merged-by-bors label Mar 17, 2019

@bors bors merged commit 47ee538 into rust-lang:master Mar 17, 2019

1 check passed

homu Test successful
Details

bors added a commit that referenced this pull request Mar 19, 2019

Auto merge of #59295 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports

Rolled up:

* [beta] Move to static.r-l.o stable release #58896

Cherry-picked:

* Add release notes for PR #56243 #58959
* resolve: Account for new importable entities #59047
* bootstrap: Default to a sensible llvm-suffix. #59173

r? @ghost

bors added a commit that referenced this pull request Mar 26, 2019

Auto merge of #59434 - Centril:bootstrap-to-2019-03-20, r=Mark-Simula…
…crum

Bump bootstrap compiler to 2019-03-20

Includes #59295 and by extension #59047, which unblocks #58253, #58837, and possibly #59336, and so therefore:

@bors p=50

r? @Mark-Simulacrum

cc @pietroalbini

@ehuss ehuss referenced this pull request Apr 21, 2019

Open

Document name resolution. #568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.