Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up(Modules) Tracking issue for Picking a Module Path System variant #53130
Comments
Centril
added
B-RFC-approved
T-lang
C-tracking-issue
labels
Aug 6, 2018
Centril
added this to the Rust 2018 RC milestone
Aug 6, 2018
Centril
changed the title
(Modules) Tracking issue for Picking one of the two proposed Module Path Systems
(Modules) Tracking issue for Picking one of the two Module Path Systems
Aug 6, 2018
Centril
changed the title
(Modules) Tracking issue for Picking one of the two Module Path Systems
(Modules) Tracking issue for Picking a Module Path System variant
Aug 6, 2018
Centril
referenced this issue
Aug 6, 2018
Closed
Tracking issue for RFC 2126: Clarify and streamline paths and visibility #44660
This comment has been minimized.
This comment has been minimized.
sanmai-NL
commented
Aug 7, 2018
|
Could you give more details about what has been implemented concretely, and what renaming operations are needed exactly? It comes down to: how can I start testing anything right now? A priori, I vote for |
sanmai-NL
referenced this issue
Aug 7, 2018
Closed
(Modules) Tracking issue for `(use) crate_name::` paths without `extern crate` #53128
petrochenkov
referenced this issue
Aug 7, 2018
Closed
std-using paths work just fine in 2018 edition #![no_std] #53166
This comment has been minimized.
This comment has been minimized.
|
cc @eddyb re. @sanmai-NL's question. |
eddyb
referenced this issue
Aug 9, 2018
Merged
#[feature(uniform_paths)]: allow `use x::y;` to resolve through `self::x`, not just `::x`. #52923
bors
added a commit
that referenced
this issue
Aug 14, 2018
bors
added a commit
that referenced
this issue
Aug 14, 2018
This comment has been minimized.
This comment has been minimized.
|
@sanmai-NL Now that #52923 has landed, the next nightly should have both options available:
I'd suggesting trying the latter after upgrading to the edition, and report back if the ambiguity errors end up being too excessive. AFAIK, the upgrade involves taking a Rust 2015 crate, adding |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
archer884
commented
Aug 16, 2018
•
|
I absolutely despise the "anchored paths variant," and I am very excited to see that we're considering an alternative. Any alternative, honestly. >.> ...That said, uniform paths look great. :) I'd much prefer to let people use absolute paths (the anchored version) if they like, but not force people to do it. (No idea where the appropriate place to provide feedback for this would be, so I just left it here. Sorry.) |
This comment has been minimized.
This comment has been minimized.
kohensu
commented
Aug 16, 2018
|
Using #![feature(rust_2018_preview)]
#![feature(uniform_paths)]
use hex;
fn main() {
println!("hex {}", hex::encode("01"));
}I get this error: error: import from `hex` is ambiguous
--> src/main.rs:3:5
|
3 | use hex;
| ^^^
| |
| could refer to external crate `::hex`
| could also refer to `self::hex`
|
= help: write `::hex` or `self::hex` explicitly instead
= note: relative `use` paths enabled by `#![feature(uniform_paths)]`whereas Because the code is working without |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kohensu
commented
Aug 16, 2018
|
@Nemo157 |
This comment has been minimized.
This comment has been minimized.
sanmai-NL
commented
Aug 16, 2018
|
@archer884: What’s more interesting is your motivation to feel that way? |
This comment has been minimized.
This comment has been minimized.
Xymist
commented
Aug 16, 2018
|
As a user (who perhaps hasn't been paying as much attention as I should) I think the |
This comment has been minimized.
This comment has been minimized.
Not sure what you mean. Does #53427 (by treating each namespace independently) solve that for you? |
This comment has been minimized.
This comment has been minimized.
archer884
commented
Aug 16, 2018
•
|
@sanmai-NL:
Either Eric Lippert or Anders Hejlsberg had an article on this awhile back: people want loud syntax for things at first, but then as time goes on they want the syntax to be unobtrusive and elegant instead. If we make long, annoying imports the standard (and ONLY) option, we will absolutely regret it.
"Maybe not today, maybe not tomorrow, but someday." :)
|
This comment has been minimized.
This comment has been minimized.
sanmai-NL
commented
Aug 17, 2018
•
|
That’s an argument from authority, and a very aspecific one. Conciseness is a criterion independent from explicitness and also from simplicity. |
This comment was marked as off-topic.
This comment was marked as off-topic.
archer884
commented
Aug 17, 2018
|
@sanmai-NL, it's not. It's just a chance for you to read the thoughts of another person who covers the issue in greater depth. Google is your friend. |
This comment was marked as off-topic.
This comment was marked as off-topic.
sanmai-NL
commented
Aug 17, 2018
|
Very poor way to argue your case. You seem not to even recall which author you mean, but you ask me to Google for something. |
This comment was marked as off-topic.
This comment was marked as off-topic.
archer884
commented
Aug 17, 2018
|
Ok, I'm done being badgered here. Glad to see rust is still so inclusive. :)
…On Fri, Aug 17, 2018, 9:42 AM Sander Maijers ***@***.***> wrote:
Very poor way to argue your case. You seem not to even recall which author
you mean, but you ask me to Google for something.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#53130 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApeRmCERlVvJYp9wVS9mBYTeJaUolXMks5uRtZFgaJpZM4VxEE_>
.
|
This comment was marked as off-topic.
This comment was marked as off-topic.
|
cc me |
This comment was marked as off-topic.
This comment was marked as off-topic.
sanmai-NL
commented
Aug 18, 2018
|
Sad to see how some people dramatize a technical discussion. I hope only comments that are motivated and consider the earlier discussion are taken seriously. Just chiming in doesn’t bring us any further. |
This comment has been minimized.
This comment has been minimized.
|
@cramertj I think that you can just use log 0.4.4 or newer, and then stop importing |
This comment has been minimized.
This comment has been minimized.
|
@cramertj It's not suggesting You hit the "nested scopes" problem, where However, you happen to be importing the same entity, so I think we should just silence the error in that case, like we did for imports of an external crate. EDIT: PR up at #54201. |
eddyb
referenced this issue
Sep 13, 2018
Merged
rustc_resolve: don't treat uniform_paths canaries as ambiguities unless they resolve to distinct Def's. #54201
bors
added a commit
that referenced
this issue
Sep 14, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Sep 16, 2018
|
The final comment period, with a disposition to merge, as per the review above, is now complete. |
rfcbot
added
finished-final-comment-period
and removed
final-comment-period
labels
Sep 16, 2018
petrochenkov
referenced this issue
Sep 21, 2018
Closed
`use proc_macro` regressed from nightly-2018-09-14 to nightly 2018-09-15 in edition 2018 #54418
petrochenkov
referenced this issue
Oct 5, 2018
Merged
Add `extern crate` items to extern prelude #54658
Centril
referenced this issue
Oct 7, 2018
Closed
Ability to refer to a path relative to the current scope in use declarations #959
stephaneyfx
referenced this issue
Oct 29, 2018
Merged
Fix extern crate alias example for anchored paths #118
This comment has been minimized.
This comment has been minimized.
|
See also: #53130 proposing to stabilize on uniform paths. |
Centril commentedAug 6, 2018
•
edited by eddyb
This is a sub-tracking issue for the RFC "Clarify and streamline paths and visibility" (rust-lang/rfcs#2126)
as well as the internals post Relative Paths in Rust 2018.
The issue deals with revamping paths and making a decision about whether we should pick:
uniform_pathsvariant.Proposed in Relative Paths in Rust 2018.
anchored_use_pathsvariant.You have to use
self::,super::, andcrate::, or an external crate name explicitly....See rust-lang/rfcs#2126).
uniform_paths, #52923anchored_use_pathsUnresolved questions: