diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-24 23:05:02 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-24 23:05:02 +0300 |
| commit | f284cbc7af06a941de0cdd06291dc78d37268b9f (patch) | |
| tree | 94b287ceb5755130191c61dbefd317da66ccd4be /src/libsyntax/parse/parser.rs | |
| parent | 40ce80484c636e525ac796a81f38a96c0ca8bf09 (diff) | |
| download | rust-f284cbc7af06a941de0cdd06291dc78d37268b9f.tar.gz rust-f284cbc7af06a941de0cdd06291dc78d37268b9f.zip | |
Cleanup interfaces of Name, SyntaxContext and Ident
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6220bd6fa6f..9d12a9217e9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4715,7 +4715,7 @@ impl<'a> Parser<'a> { (fields, None) // Tuple-style struct definition with optional where-clause. } else if self.token == token::OpenDelim(token::Paren) { - let fields = try!(self.parse_tuple_struct_body(&class_name, &mut generics)); + let fields = try!(self.parse_tuple_struct_body(class_name, &mut generics)); (fields, Some(ast::DUMMY_NODE_ID)) } else { let token_str = self.this_token_to_string(); @@ -4750,7 +4750,7 @@ impl<'a> Parser<'a> { } pub fn parse_tuple_struct_body(&mut self, - class_name: &ast::Ident, + class_name: ast::Ident, generics: &mut ast::Generics) -> PResult<Vec<StructField>> { // This is the case where we find `struct Foo<T>(T) where T: Copy;` @@ -5780,10 +5780,10 @@ impl<'a> Parser<'a> { Option<ast::Name>)>> { let ret = match self.token { token::Literal(token::Str_(s), suf) => { - (self.id_to_interned_str(s.ident()), ast::CookedStr, suf) + (self.id_to_interned_str(ast::Ident::with_empty_ctxt(s)), ast::CookedStr, suf) } token::Literal(token::StrRaw(s, n), suf) => { - (self.id_to_interned_str(s.ident()), ast::RawStr(n), suf) + (self.id_to_interned_str(ast::Ident::with_empty_ctxt(s)), ast::RawStr(n), suf) } _ => return Ok(None) }; |
