Skip to content

Seemingly incorrect info about path clarity #139

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

Closed
brson opened this issue Jan 23, 2019 · 7 comments
Closed

Seemingly incorrect info about path clarity #139

brson opened this issue Jan 23, 2019 · 7 comments

Comments

@brson
Copy link
Contributor

brson commented Jan 23, 2019

In "2018-specific changes":

  • "use declarations must begin with ... an external crate name"

This does not seem to be true - paths like "use foo::bar" will resolve a "foo" in local scope, not just a crate name.

  • "to catch possible ambiguities with uniform paths (which is planned for inclusion soon #55618)."

That issue is closed and presumably in stable?

In "Path clarity":

  • "Absolute paths begin with a crate name, where the keyword crate refers to the current crate."

It's not clear what "absolute paths" means. Is this for "::"? It should be explicit.

Again on this page I don't see mention of unprefixed paths resolving names in local scope, which they do.

  • "In Rust 2018, paths in use declarations must begin with a crate name, crate, self, or super"

Again, 'use' declarations seem to resolve names in local scope. No mention of "::" here.

All of the above applies with or with out the 'uniform_paths' feature.

@Centril
Copy link
Contributor

Centril commented Jan 23, 2019

This does not seem to be true - paths like "use foo::bar" will resolve a "foo" in local scope, not just a crate name.

Yes; this is outdated; in 1.32 uniform paths were stabilized.

That issue is closed and presumably in stable?

Correct.

It's not clear what "absolute paths" means. Is this for "::"? It should be explicit.

Correct and agreed.

@brson
Copy link
Contributor Author

brson commented Jan 23, 2019

Thanks @Centril.

Since uniform paths are stable there's quite a bit more to be updated there too.

@Centril
Copy link
Contributor

Centril commented Jan 23, 2019

Thanks for reminding us @brson. :)

Would you perhaps be willing to go over the guide and update where needed?

@brson
Copy link
Contributor Author

brson commented Jan 23, 2019

@Centril I'm willing but I don't know if I'll be able to find the time soon. I'll put it on my todo list though. Maybe this weekend, but no guarantees.

@ehuss
Copy link
Contributor

ehuss commented Jan 23, 2019

Sorry, I've been trying to figure out how to document uniform paths over the past week, but I haven't felt like I understand it well enough to document it clearly and correctly. I was intending to see what it would take to update the reference before trying to update the summary here, but maybe doing it the other way around would be better. This is also still in flux so I didn't want to put too much effort if it is going to change in a few days.

@petrochenkov
Copy link
Contributor

@ehuss
I don't think rust-lang/rust#57745 is blocking documentation for uniform paths specifically (it doesn't change anything on pure 2018 edition).

@ehuss
Copy link
Contributor

ehuss commented Jan 23, 2019

I meant I was holding off specifically on the edition-changes page which only compares and contrasts 2015 to 2018 with a brief summary. I guess 57745 doesn't make that big of a difference now that I look at it closer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants