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: Simplify treatment of ambiguity errors #57199

Merged
merged 1 commit into from Jan 1, 2019

Conversation

Projects
None yet
4 participants
@petrochenkov
Copy link
Contributor

petrochenkov commented Dec 29, 2018

If we have a glob conflict like this

mod m1 { struct S; }
mod m2 { struct S; }

use m1::*;
use m2::*;

we treat it as a special "ambiguity item" that's not an error by itself, but produces an error when actually used.

use m1::*; // primary
use m2::*; // secondary

=>

ambiguity S(m1::S, m2::S);

Ambiguity items were sometimes treated as their primary items for error recovery, but pretty irregularly.

After this PR they are always treated as their primary items, except that

  • If an ambiguity item is marked as used, then it still produces an error.
  • Ambiguity items are still filtered away when exported to other crates (which is also a use in some sense).
@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Dec 31, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 31, 2018

📌 Commit 06f22ba has been approved by estebank

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 1, 2019

⌛️ Testing commit 06f22ba with merge d8371c6...

bors added a commit that referenced this pull request Jan 1, 2019

Auto merge of #57199 - petrochenkov:ambig, r=estebank
resolve: Simplify treatment of ambiguity errors

If we have a glob conflict like this
```rust
mod m1 { struct S; }
mod m2 { struct S; }

use m1::*;
use m2::*;
```
we treat it as a special "ambiguity item" that's not an error by itself, but produces an error when actually used.
```rust
use m1::*; // primary
use m2::*; // secondary

=>

ambiguity S(m1::S, m2::S);
```

Ambiguity items were *sometimes* treated as their primary items for error recovery, but pretty irregularly.

After this PR they are always treated as their primary items, except that
- If an ambiguity item is marked as used, then it still produces an error.
- Ambiguity items are still filtered away when exported to other crates (which is also a use in some sense).
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 1, 2019

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing d8371c6 to master...

@bors bors merged commit 06f22ba into rust-lang:master Jan 1, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@bors bors referenced this pull request Jan 1, 2019

Merged

Stabilize `uniform_paths` #56759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment