about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-14 19:52:13 +0000
committerbors <bors@rust-lang.org>2018-09-14 19:52:13 +0000
commit2ab3eba30741652ba538bc2fc2bba9d81a5c84c6 (patch)
tree4049f656ba168c91ebd8a4be13c9b08d798387d8 /src/test/incremental/thinlto
parent052d24e6c827577dadac28fb2b782dbe5445eab7 (diff)
parent514c6b6fe3e0738a5a06bb5907fb7a6a98007ccb (diff)
downloadrust-2ab3eba30741652ba538bc2fc2bba9d81a5c84c6.tar.gz
rust-2ab3eba30741652ba538bc2fc2bba9d81a5c84c6.zip
Auto merge of #54201 - eddyb:reflexive-disambiguation, r=petrochenkov
rustc_resolve: don't treat uniform_paths canaries as ambiguities unless they resolve to distinct Def's.

In particular, this allows this pattern that @cramertj mentioned in https://github.com/rust-lang/rust/issues/53130#issuecomment-420848814:
```rust
use log::{debug, log};
fn main() {
    use log::{debug, log};
    debug!(...);
}
```
The canaries for the inner `use log::...;`, *in the macro namespace*, see the `log` macro imported at the module scope, and the (same) `log` macro, imported in the block scope inside `main`.

Previously, these two possible (macro namspace) `log` resolutions would be considered ambiguous (from a forwards-compat standpoint, where we might make imports aware of block scopes).

With this PR, such a case is allowed *if and only if* all the possible resolutions refer to the same definition (more specifically, because the *same* `log` macro is being imported twice).
This condition subsumes previous (weaker) checks like #54005 and the second commit of #54011.

Only the last commit is the main change, the other two are cleanups.

r? @petrochenkov cc @Centril @joshtriplett
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions