提交 a8b7146f 编写于 作者: B bors

Auto merge of #27432 - sanxiyn:impl-dotdot, r=sfackler

Fix #27255.
......@@ -4610,7 +4610,7 @@ fn parse_item_impl(&mut self, unsafety: ast::Unsafety) -> PResult<ItemInfo> {
None
};
if try!(self.eat(&token::DotDot) ){
if opt_trait.is_some() && try!(self.eat(&token::DotDot) ){
if generics.is_parameterized() {
self.span_err(impl_span, "default trait implementations are not \
allowed to have generics");
......
......@@ -10,4 +10,4 @@
// compile-flags: -Z parse-only
impl Foo; //~ ERROR expected one of `(`, `+`, `..`, `::`, `<`, `for`, `where`, or `{`, found `;`
impl Foo; //~ ERROR expected one of `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
impl A .. {} //~ ERROR
fn main() {}
......@@ -15,7 +15,7 @@ struct S {
}
impl Cmp, ToString for S {
//~^ ERROR: expected one of `(`, `+`, `..`, `::`, `<`, `for`, `where`, or `{`, found `,`
//~^ ERROR: expected one of `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,`
fn eq(&&other: S) { false }
fn to_string(&self) -> String { "hi".to_string() }
}
......@@ -17,7 +17,7 @@ trait Foo {
impl Foo + Owned for Bar {
//~^ ERROR not a trait
//~^^ ERROR expected one of `..`, `where`, or `{`, found `Bar`
//~^^ ERROR expected one of `where` or `{`, found `Bar`
}
fn main() { }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册