Remove specific errors for very old obsolete syntax
Replaces existing tests for removed obsolete-syntax errors with tests for the resulting regular errors, adds a test for each of the removed parser errors to make sure that obsolete forms don't start working again, removes some obsolete/superfluous tests that were now failing. Deletes some amount of dead code in the parser, also includes some small changes to parser error messages to accomodate new tests.
This commit is contained in:
parent
4bae639d86
commit
fa411500f9
29 changed files with 358 additions and 528 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,47 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
struct s {
|
||||
let foo: (),
|
||||
//~^ ERROR obsolete syntax: `let` in field declaration
|
||||
bar: ();
|
||||
//~^ ERROR obsolete syntax: field declaration terminated with semicolon
|
||||
}
|
||||
|
||||
struct q : r {
|
||||
//~^ ERROR obsolete syntax: class traits
|
||||
foo: int
|
||||
}
|
||||
|
||||
struct sss {
|
||||
bar: int,
|
||||
priv {
|
||||
//~^ ERROR obsolete syntax: private section
|
||||
foo: ()
|
||||
}
|
||||
}
|
||||
|
||||
fn obsolete_with() {
|
||||
struct S {
|
||||
foo: (),
|
||||
bar: (),
|
||||
}
|
||||
|
||||
let a = S { foo: (), bar: () };
|
||||
let b = S { foo: () with a };
|
||||
//~^ ERROR obsolete syntax: with
|
||||
let c = S { foo: (), with a };
|
||||
//~^ ERROR obsolete syntax: with
|
||||
}
|
||||
|
||||
fn obsolete_moves() {
|
||||
let mut x = 0;
|
||||
let y <- x;
|
||||
//~^ ERROR obsolete syntax: initializer-by-move
|
||||
y <- x;
|
||||
//~^ ERROR obsolete syntax: binary move
|
||||
}
|
||||
|
||||
extern mod obsolete_name {
|
||||
//~^ ERROR obsolete syntax: named external module
|
||||
fn bar();
|
||||
|
|
|
|||
14
src/test/compile-fail/removed-syntax-class-traits.rs
Normal file
14
src/test/compile-fail/removed-syntax-class-traits.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
struct q : r {
|
||||
//~^ ERROR expected `{`, `(`, or `;` after struct name
|
||||
foo: int
|
||||
}
|
||||
11
src/test/compile-fail/removed-syntax-closure-lifetime.rs
Normal file
11
src/test/compile-fail/removed-syntax-closure-lifetime.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
type closure = ~lt/fn(); //~ ERROR expected `;` but found `/`
|
||||
11
src/test/compile-fail/removed-syntax-const-item.rs
Normal file
11
src/test/compile-fail/removed-syntax-const-item.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
const i: int = 42; //~ ERROR expected item but found `const`
|
||||
11
src/test/compile-fail/removed-syntax-enum-newtype.rs
Normal file
11
src/test/compile-fail/removed-syntax-enum-newtype.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
enum e = int; //~ ERROR expected `{` but found `=`
|
||||
13
src/test/compile-fail/removed-syntax-extern-const.rs
Normal file
13
src/test/compile-fail/removed-syntax-extern-const.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
extern {
|
||||
const i: int; //~ ERROR unexpected token: `const`
|
||||
}
|
||||
15
src/test/compile-fail/removed-syntax-field-let.rs
Normal file
15
src/test/compile-fail/removed-syntax-field-let.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
struct s {
|
||||
let foo: (),
|
||||
//~^ ERROR found `let` in ident position
|
||||
//~^^ ERROR expected `:` but found `foo`
|
||||
}
|
||||
14
src/test/compile-fail/removed-syntax-field-semicolon.rs
Normal file
14
src/test/compile-fail/removed-syntax-field-semicolon.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
struct s {
|
||||
bar: ();
|
||||
//~^ ERROR expected `,`, or `}` but found `;`
|
||||
}
|
||||
11
src/test/compile-fail/removed-syntax-fixed-vec.rs
Normal file
11
src/test/compile-fail/removed-syntax-fixed-vec.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
type v = [int * 3]; //~ ERROR expected `]` but found `*`
|
||||
11
src/test/compile-fail/removed-syntax-fn-pure.rs
Normal file
11
src/test/compile-fail/removed-syntax-fn-pure.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
pure fn f() {} //~ ERROR expected item but found `pure`
|
||||
13
src/test/compile-fail/removed-syntax-fn-sigil.rs
Normal file
13
src/test/compile-fail/removed-syntax-fn-sigil.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn f() {
|
||||
let x: fn~() = || (); //~ ERROR expected `(` but found `~`
|
||||
}
|
||||
15
src/test/compile-fail/removed-syntax-larrow-init.rs
Normal file
15
src/test/compile-fail/removed-syntax-larrow-init.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn removed_moves() {
|
||||
let mut x = 0;
|
||||
let y <- x;
|
||||
//~^ ERROR expected `;` but found `<-`
|
||||
}
|
||||
16
src/test/compile-fail/removed-syntax-larrow-move.rs
Normal file
16
src/test/compile-fail/removed-syntax-larrow-move.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn removed_moves() {
|
||||
let mut x = 0;
|
||||
let y = 0;
|
||||
y <- x;
|
||||
//~^ ERROR expected one of `;`, `}` but found `<-`
|
||||
}
|
||||
11
src/test/compile-fail/removed-syntax-mode.rs
Normal file
11
src/test/compile-fail/removed-syntax-mode.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn f(+x: int) {} //~ ERROR unexpected token: `+`
|
||||
15
src/test/compile-fail/removed-syntax-mut-vec-expr.rs
Normal file
15
src/test/compile-fail/removed-syntax-mut-vec-expr.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn f() {
|
||||
let v = [mut 1, 2, 3, 4];
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `]` but found `1`
|
||||
}
|
||||
13
src/test/compile-fail/removed-syntax-mut-vec-ty.rs
Normal file
13
src/test/compile-fail/removed-syntax-mut-vec-ty.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
type v = [mut int];
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `]` but found `int`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,16 +8,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
struct cat : int { //~ ERROR trait
|
||||
meows: uint,
|
||||
}
|
||||
|
||||
fn cat(in_x : uint) -> cat {
|
||||
cat {
|
||||
meows: in_x
|
||||
struct sss {
|
||||
bar: int,
|
||||
priv {
|
||||
//~^ ERROR expected ident
|
||||
foo: ()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let nyan = cat(0u);
|
||||
}
|
||||
11
src/test/compile-fail/removed-syntax-ptr-lifetime.rs
Normal file
11
src/test/compile-fail/removed-syntax-ptr-lifetime.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
type bptr = &lifetime/int; //~ ERROR expected `;` but found `/`
|
||||
11
src/test/compile-fail/removed-syntax-record.rs
Normal file
11
src/test/compile-fail/removed-syntax-record.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
type t = { f: () }; //~ ERROR expected type, found token LBRACE
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,10 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:unexpected token: `}`
|
||||
// Issue #1200
|
||||
struct S;
|
||||
|
||||
type t = {};
|
||||
|
||||
fn main() {
|
||||
impl S {
|
||||
static fn f() {} //~ ERROR unexpected token: `static`
|
||||
}
|
||||
15
src/test/compile-fail/removed-syntax-uniq-mut-expr.rs
Normal file
15
src/test/compile-fail/removed-syntax-uniq-mut-expr.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn f() {
|
||||
let box = ~mut 42;
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `;` but found `42`
|
||||
}
|
||||
13
src/test/compile-fail/removed-syntax-uniq-mut-ty.rs
Normal file
13
src/test/compile-fail/removed-syntax-uniq-mut-ty.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
type mut_box = ~mut int;
|
||||
//~^ ERROR found `mut` in ident position
|
||||
//~^^ ERROR expected `;` but found `int`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,17 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use extra;
|
||||
struct S;
|
||||
|
||||
struct Deserializer : extra::serialization::deserializer{ //~ ERROR obsolete syntax: class traits
|
||||
x: ()
|
||||
impl S {
|
||||
fn f(~mut self) {} //~ ERROR mutability declaration not allowed here
|
||||
}
|
||||
|
||||
struct Foo {
|
||||
a: ()
|
||||
}
|
||||
|
||||
fn deserialize_foo<__D: extra::serialization::deserializer>(__d: __D) {
|
||||
}
|
||||
|
||||
fn main() { let des = Deserializer(); let foo = deserialize_foo(des); }
|
||||
20
src/test/compile-fail/removed-syntax-with-1.rs
Normal file
20
src/test/compile-fail/removed-syntax-with-1.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn removed_with() {
|
||||
struct S {
|
||||
foo: (),
|
||||
bar: (),
|
||||
}
|
||||
|
||||
let a = S { foo: (), bar: () };
|
||||
let b = S { foo: () with a };
|
||||
//~^ ERROR expected one of `,`, `}` but found `with`
|
||||
}
|
||||
20
src/test/compile-fail/removed-syntax-with-2.rs
Normal file
20
src/test/compile-fail/removed-syntax-with-2.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2013 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.
|
||||
|
||||
fn removed_with() {
|
||||
struct S {
|
||||
foo: (),
|
||||
bar: (),
|
||||
}
|
||||
|
||||
let a = S { foo: (), bar: () };
|
||||
let b = S { foo: (), with a };
|
||||
//~^ ERROR expected `:` but found `a`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue