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

Support extern in paths #47156

Merged
merged 2 commits into from
Jan 7, 2018
Merged

Support extern in paths #47156

merged 2 commits into from
Jan 7, 2018

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Jan 3, 2018

Implement the primary alternative to #46613 + #45771, achieving the same effect without requiring changes to other imports.
Both need to be experimentally evaluated before making further progress.

The PR also adds docs for all these related features into the unstable book.

cc #44660
r? @nikomatsakis

//~^ NOTE cannot glob-import all possible crates

fn main() {
let s = extern::xcrate; //~ ERROR expected value, found module `extern::xcrate`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason not to support extern:: paths in this location? I had thought that one of the bonus points to using a syntax like extern for absolute paths was precisely that it could be unambiguously used anywhere. Basically, the set of paths accepted in a use would now be a strict subset of those that could be accepted elsewhere (excluding relative paths, obviously).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's accepted in this location (as tested in the run-pass test), here we are just checking that extern::xcrate is indeed a crate, and a crate can't be used as a value.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh oh I see =) thanks

@alexcrichton alexcrichton added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 4, 2018
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 4, 2018

📌 Commit ef2b131 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Jan 5, 2018

⌛ Testing commit ef2b131 with merge e08d3784f6fcdfd30b5612c1a876fc3a4ecf0a50...

@bors
Copy link
Contributor

bors commented Jan 5, 2018

💔 Test failed - status-appveyor

@petrochenkov
Copy link
Contributor Author

Appveyor timeout
@bors retry

@bors
Copy link
Contributor

bors commented Jan 6, 2018

⌛ Testing commit ef2b131 with merge 6f360898bc47b930b1f8a2ffc0c1d61e5cc3e795...

@bors
Copy link
Contributor

bors commented Jan 6, 2018

💔 Test failed - status-appveyor

@kennytm
Copy link
Member

kennytm commented Jan 6, 2018

@bors retry

3 hour timeout.

@bors
Copy link
Contributor

bors commented Jan 7, 2018

⌛ Testing commit ef2b131 with merge a704583...

bors added a commit that referenced this pull request Jan 7, 2018
Support `extern` in paths

Implement the primary alternative to #46613 + #45771, achieving the same effect without requiring changes to other imports.
Both need to be experimentally evaluated before making further progress.

The PR also adds docs for all these related features into the unstable book.

cc #44660
r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Jan 7, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants