Skip to content

Commit 4b189e6

Browse files
committed
Add a span to the Crate variant of ast::Visibility
1 parent 2b60207 commit 4b189e6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,7 @@ pub struct PolyTraitRef {
18871887
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
18881888
pub enum Visibility {
18891889
Public,
1890-
Crate,
1890+
Crate(Span),
18911891
Restricted { path: P<Path>, id: NodeId },
18921892
Inherited,
18931893
}

src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ pub fn mac_to_string(arg: &ast::Mac) -> String {
435435
pub fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
436436
match *vis {
437437
ast::Visibility::Public => format!("pub {}", s),
438-
ast::Visibility::Crate => format!("pub(crate) {}", s),
438+
ast::Visibility::Crate(_) => format!("pub(crate) {}", s),
439439
ast::Visibility::Restricted { ref path, .. } => format!("pub({}) {}", path, s),
440440
ast::Visibility::Inherited => s.to_string()
441441
}
@@ -1386,7 +1386,7 @@ impl<'a> State<'a> {
13861386
pub fn print_visibility(&mut self, vis: &ast::Visibility) -> io::Result<()> {
13871387
match *vis {
13881388
ast::Visibility::Public => self.word_nbsp("pub"),
1389-
ast::Visibility::Crate => self.word_nbsp("pub(crate)"),
1389+
ast::Visibility::Crate(_) => self.word_nbsp("pub(crate)"),
13901390
ast::Visibility::Restricted { ref path, .. } =>
13911391
self.word_nbsp(&format!("pub({})", path)),
13921392
ast::Visibility::Inherited => Ok(())

0 commit comments

Comments
 (0)