summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-13 04:46:31 +0000
committerbors <bors@rust-lang.org>2014-07-13 04:46:31 +0000
commit13dc0d7938c0f343dd13240dd316eb3a22036e89 (patch)
tree0120b5923c4939fbad5e67ce9d4ecbbde17c9a78 /src/libsyntax
parentad7ef8c27cffcaf14a6e75fad35d42daee83b8cd (diff)
parent2dfbe7f9893ef8ff7efc86345941216e564323e7 (diff)
downloadrust-13dc0d7938c0f343dd13240dd316eb3a22036e89.tar.gz
rust-13dc0d7938c0f343dd13240dd316eb3a22036e89.zip
auto merge of #15584 : alexcrichton/rust/warn-annoyances, r=cmr
* Don't warn about `#[crate_name]` if `--crate-name` is specified
* Don't warn about non camel case identifiers on `#[repr(C)]` structs
* Switch `mode` to `mode_t` in libc.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index dd830401443..d51054542b9 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -58,7 +58,14 @@ impl Ident {
 
 impl Show for Ident {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "\"{}\"#{}", token::get_ident(*self).get(), self.ctxt)
+        write!(f, "{}#{}", self.name, self.ctxt)
+    }
+}
+
+impl Show for Name {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let Name(nm) = *self;
+        write!(f, "\"{}\"({})", token::get_name(*self).get(), nm)
     }
 }
 
@@ -106,7 +113,7 @@ pub static ILLEGAL_CTXT : SyntaxContext = 1;
 
 /// A name is a part of an identifier, representing a string or gensym. It's
 /// the result of interning.
-#[deriving(Eq, Ord, PartialEq, PartialOrd, Hash, Encodable, Decodable, Clone, Show)]
+#[deriving(Eq, Ord, PartialEq, PartialOrd, Hash, Encodable, Decodable, Clone)]
 pub struct Name(pub u32);
 
 impl Name {