-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
As part of #44660, we plan to support absolute paths that begin with crate
. The RFC was actually a bit vague about how crate::foo
paths work outside of use
items. I'm going to go with the interpretation described by @rpjohnst, that one would write ::crate::foo
to reference the item foo
from outside of a use
statement.
This means we want to support use
statements like this:
use crate::foo::bar; // equivalent to `use foo::bar` today.
and "absolute" code references like this:
fn baz() {
::crate::foo::bar() // equivalent to `::foo::bar` today
}
This version also avoids a parsing ambiguity around tuple structs and the crate
visibility modifier:
struct Foo(crate ::crate::Bar)
stepancheg
Metadata
Metadata
Assignees
Labels
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.