diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 18:47:45 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-05 18:47:45 -0800 |
| commit | afbce050ca3748a66b9e9783dc50f6c77f9bdf8b (patch) | |
| tree | 300e5e6c014bf748c65be267bd4bb99edf416000 /src/libsyntax/parse | |
| parent | cf8a11e98bf3871cf3475913fd68187784b542a3 (diff) | |
| parent | cd4205a970b07a9f4e8a2a6363ebe535df530386 (diff) | |
| download | rust-afbce050ca3748a66b9e9783dc50f6c77f9bdf8b.tar.gz rust-afbce050ca3748a66b9e9783dc50f6c77f9bdf8b.zip | |
rollup merge of #20556: japaric/no-for-sized
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/test/compile-fail/issue-19009.rs
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/obsolete.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 75b2c17b81b..f4606a4e6da 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -24,6 +24,7 @@ use ptr::P; /// The specific types of unsupported syntax #[derive(Copy, PartialEq, Eq, Hash)] pub enum ObsoleteSyntax { + ObsoleteForSized, ObsoleteOwnedType, ObsoleteOwnedExpr, ObsoleteOwnedPattern, @@ -56,6 +57,11 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> { /// Reports an obsolete syntax non-fatal error. fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) { let (kind_str, desc) = match kind { + ObsoleteForSized => ( + "for Sized?", + "no longer required. Traits (and their `Self` type) do not have the `Sized` bound \ + by default", + ), ObsoleteProcType => ( "the `proc` type", "use unboxed closures instead", diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9b3df744317..2eb77489c6e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5052,6 +5052,7 @@ impl<'a> Parser<'a> { // re-jigged shortly in any case, so leaving the hacky version for now. if self.eat_keyword(keywords::For) { let span = self.span; + let mut ate_question = false; if self.eat(&token::Question) { ate_question = true; @@ -5069,8 +5070,11 @@ impl<'a> Parser<'a> { "expected `?Sized` after `for` in trait item"); return None; } - let tref = Parser::trait_ref_from_ident(ident, span); - Some(tref) + let _tref = Parser::trait_ref_from_ident(ident, span); + + self.obsolete(span, ObsoleteForSized); + + None } else { None } |
