Add a span to the Crate variant of ast::Visibility
This commit is contained in:
parent
2b60207231
commit
4b189e65c8
2 changed files with 3 additions and 3 deletions
|
|
@ -1887,7 +1887,7 @@ pub struct PolyTraitRef {
|
|||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||
pub enum Visibility {
|
||||
Public,
|
||||
Crate,
|
||||
Crate(Span),
|
||||
Restricted { path: P<Path>, id: NodeId },
|
||||
Inherited,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ pub fn mac_to_string(arg: &ast::Mac) -> String {
|
|||
pub fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
|
||||
match *vis {
|
||||
ast::Visibility::Public => format!("pub {}", s),
|
||||
ast::Visibility::Crate => format!("pub(crate) {}", s),
|
||||
ast::Visibility::Crate(_) => format!("pub(crate) {}", s),
|
||||
ast::Visibility::Restricted { ref path, .. } => format!("pub({}) {}", path, s),
|
||||
ast::Visibility::Inherited => s.to_string()
|
||||
}
|
||||
|
|
@ -1386,7 +1386,7 @@ impl<'a> State<'a> {
|
|||
pub fn print_visibility(&mut self, vis: &ast::Visibility) -> io::Result<()> {
|
||||
match *vis {
|
||||
ast::Visibility::Public => self.word_nbsp("pub"),
|
||||
ast::Visibility::Crate => self.word_nbsp("pub(crate)"),
|
||||
ast::Visibility::Crate(_) => self.word_nbsp("pub(crate)"),
|
||||
ast::Visibility::Restricted { ref path, .. } =>
|
||||
self.word_nbsp(&format!("pub({})", path)),
|
||||
ast::Visibility::Inherited => Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue