crate shorthand visibility modifier

With regrets, this breaks rustfmt and rls.

This is in the matter of #45388.
This commit is contained in:
Zack M. Davis
2017-10-19 14:43:47 -07:00
parent 4c053db233
commit 214b0f2293
15 changed files with 99 additions and 12 deletions

View File

@@ -1787,10 +1787,19 @@ impl PolyTraitRef {
}
}
#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum CrateSugar {
/// Source is `pub(crate)`
PubCrate,
/// Source is (just) `crate`
JustCrate,
}
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum Visibility {
Public,
Crate(Span),
Crate(Span, CrateSugar),
Restricted { path: P<Path>, id: NodeId },
Inherited,
}