diff options
| author | Jakub Bukaj <jakub@jakub.cc> | 2014-11-19 22:37:02 +0100 |
|---|---|---|
| committer | Jakub Bukaj <jakub@jakub.cc> | 2014-11-19 22:37:02 +0100 |
| commit | 655eb44df3a7edd87d365f64cbfca061223c5232 (patch) | |
| tree | 7009a71df361468c5ff54823acd1a73813e77b14 /src/libsyntax/parse/parser.rs | |
| parent | fee71bd476720abc01422a4184badcb734fd4f35 (diff) | |
| parent | b64c7b83dd08c7c3afc643564d65975d57785172 (diff) | |
| download | rust-655eb44df3a7edd87d365f64cbfca061223c5232.tar.gz rust-655eb44df3a7edd87d365f64cbfca061223c5232.zip | |
rollup merge of #18868: nikomatsakis/issue-17388-unbound-path-assoc-type
This fixes #17388. Note that we don't check type parameters in trait-references and so on, so we accept some nonsense (I opened https://github.com/rust-lang/rust/issues/18865). (It may be easier to just add support for `T::Foo` and deprecate the qpath code until we can implement it more robustly using the trait lookup infrastructure, not sure.)
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 50b1a2204b0..d3ae9838c6d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1502,17 +1502,17 @@ impl<'a> Parser<'a> { } else if self.eat_keyword(keywords::Proc) { self.parse_proc_type(Vec::new()) } else if self.token == token::Lt { - // QUALIFIED PATH + // QUALIFIED PATH `<TYPE as TRAIT_REF>::item` self.bump(); - let for_type = self.parse_ty(true); + let self_type = self.parse_ty(true); self.expect_keyword(keywords::As); - let trait_name = self.parse_path(LifetimeAndTypesWithoutColons); + let trait_ref = self.parse_trait_ref(); self.expect(&token::Gt); self.expect(&token::ModSep); let item_name = self.parse_ident(); TyQPath(P(QPath { - for_type: for_type, - trait_name: trait_name.path, + self_type: self_type, + trait_ref: P(trait_ref), item_name: item_name, })) } else if self.token == token::ModSep || |
