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 use *; and use ::*;. #37367

Merged
merged 1 commit into from
Oct 29, 2016
Merged

Conversation

jseyfried
Copy link
Contributor

Fixes #31484.
r? @nrc

@jseyfried
Copy link
Contributor Author

cc @rust-lang/lang, @petrochenkov, @retep998

@nrc nrc added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Oct 25, 2016
@nrc
Copy link
Member

nrc commented Oct 25, 2016

This seems reasonable to me (r=me), but is technically a language change, so I'd like the lang team to approve and/or discuss.

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Oct 25, 2016

Team member nrc has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.
Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@withoutboats
Copy link
Contributor

@rfcbot reviewed

Accepting this is definitely the behavior I would expect.

(I'd also really like to see use path::{self, *}; accepted someday, but that's neither here nor there.)

@steveklabnik
Copy link
Member

What's the motivation here? use :: is not actually useful; I agree that supporting some of this stuff makes it more orthogonal, but if it's not something that you're supposed to write anyway...

basically, there's nearly no actual motivation here or in #31484.

@nrc
Copy link
Member

nrc commented Oct 25, 2016

What's the motivation here? use :: is not actually useful;

This doesn't support use :: it supports use ::* which imports everything from the crate root module. That seems just as useful as glob importing from any other module.

@nrc
Copy link
Member

nrc commented Oct 25, 2016

@withoutboats @dikaiosune the rfcbot reviewed comment didn't tick off the box in the request for feedback, is it meant to?

@nrc
Copy link
Member

nrc commented Oct 25, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented Oct 25, 2016

📌 Commit 4a93648 has been approved by nrc

@anp
Copy link
Member

anp commented Oct 25, 2016

@nrc it's a race condition with some DB interaction that I fixed this morning, but haven't deployed yet. Can you manually check the box for now? (see rust-lang/rfcbot-rs#91)

EDIT: Or not, just realized you already r+'d :)

@rfcbot
Copy link

rfcbot commented Oct 25, 2016

All relevant subteam members have reviewed. No concerns remain.

@steveklabnik
Copy link
Member

steveklabnik commented Oct 25, 2016

This doesn't support use :: it supports use ::* which imports everything from the crate root module.

Given that use always starts from the crate root, shouldn't that be the same as use *?

What I meant with my earlier comment is, use ::<ANYTHING> isn't useful, since it's the same as use <ANYTHING>

@withoutboats
Copy link
Contributor

withoutboats commented Oct 25, 2016

@steveklabnik you're right that the :: in use ::[path] is redundant, but its already supported. This just adds glob imports of the module root (using both of the path forms that are supported for use statements in general).

@steveklabnik
Copy link
Member

Okay, so it's more that the use ::* case falls out than it is specifically adding support for this case. That makes sense, then.

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 26, 2016
@bors
Copy link
Contributor

bors commented Oct 28, 2016

⌛ Testing commit 4a93648 with merge f0ab4a4...

bors added a commit that referenced this pull request Oct 28, 2016
Support `use *;` and `use ::*;`.

Fixes #31484.
r? @nrc
@bors bors merged commit 4a93648 into rust-lang:master Oct 29, 2016
@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Nov 1, 2016
@jseyfried jseyfried deleted the import_crate_root branch November 1, 2016 01:24
@nikomatsakis
Copy link
Contributor

Similarly to #37035, arguably this should have been feature-gated (and moved for stabilization in the next cycle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants