diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-06-11 18:47:47 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-07-08 12:42:57 +0300 |
| commit | a397b60ebba531fb4de7e88111e0d489e44c549e (patch) | |
| tree | 79dc821f33f2ba03e767bbcc28ffb86d37f58bd0 /src/test | |
| parent | 49ea3d48a26c1325dd584c8420227f6e35721f66 (diff) | |
| download | rust-a397b60ebba531fb4de7e88111e0d489e44c549e.tar.gz rust-a397b60ebba531fb4de7e88111e0d489e44c549e.zip | |
Resolve partially resolved paths in struct patterns/expressions
Treat Def::Err correctly in struct patterns Make instantiate_path and instantiate_type a bit closer to each other
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/E0163.rs | 20 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-16058.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-17001.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-17405.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-21449.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-26459.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-27815.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-27831.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-4736.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/lexical-scopes.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-as-struct-constructor.rs | 2 |
11 files changed, 9 insertions, 33 deletions
diff --git a/src/test/compile-fail/E0163.rs b/src/test/compile-fail/E0163.rs deleted file mode 100644 index 5cb6f4d2803..00000000000 --- a/src/test/compile-fail/E0163.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 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 Foo { B(u32) } - -fn bar(foo: Foo) -> u32 { - match foo { - Foo::B { i } => i, //~ ERROR E0163 - } -} - -fn main() { -} diff --git a/src/test/compile-fail/issue-16058.rs b/src/test/compile-fail/issue-16058.rs index 4637512216c..671232e701f 100644 --- a/src/test/compile-fail/issue-16058.rs +++ b/src/test/compile-fail/issue-16058.rs @@ -16,7 +16,7 @@ pub struct GslResult { impl GslResult { pub fn new() -> GslResult { - Result { //~ ERROR: `Result` does not name a structure + Result { //~ ERROR: `Result` does not name a struct or a struct variant val: 0f64, err: 0f64 } diff --git a/src/test/compile-fail/issue-17001.rs b/src/test/compile-fail/issue-17001.rs index 0fee6dc7617..218f68714ff 100644 --- a/src/test/compile-fail/issue-17001.rs +++ b/src/test/compile-fail/issue-17001.rs @@ -11,5 +11,5 @@ mod foo {} fn main() { - let p = foo { x: () }; //~ ERROR `foo` does not name a structure + let p = foo { x: () }; //~ ERROR `foo` does not name a struct or a struct variant } diff --git a/src/test/compile-fail/issue-17405.rs b/src/test/compile-fail/issue-17405.rs index db43c1cce99..2f2c252b947 100644 --- a/src/test/compile-fail/issue-17405.rs +++ b/src/test/compile-fail/issue-17405.rs @@ -15,6 +15,5 @@ enum Foo { fn main() { match Foo::Bar(1) { Foo { i } => () //~ ERROR expected variant, struct or type alias, found enum `Foo` - //~^ ERROR `Foo` does not name a struct or a struct variant } } diff --git a/src/test/compile-fail/issue-21449.rs b/src/test/compile-fail/issue-21449.rs index 93c4f4bfcef..090b8a0d16e 100644 --- a/src/test/compile-fail/issue-21449.rs +++ b/src/test/compile-fail/issue-21449.rs @@ -11,5 +11,5 @@ mod MyMod {} fn main() { - let myVar = MyMod { T: 0 }; //~ ERROR `MyMod` does not name a structure + let myVar = MyMod { T: 0 }; //~ ERROR `MyMod` does not name a struct or a struct variant } diff --git a/src/test/compile-fail/issue-26459.rs b/src/test/compile-fail/issue-26459.rs index 6cadbef33e7..24b39eeff0f 100644 --- a/src/test/compile-fail/issue-26459.rs +++ b/src/test/compile-fail/issue-26459.rs @@ -12,6 +12,5 @@ fn main() { match 'a' { char{ch} => true //~^ ERROR expected variant, struct or type alias, found builtin type `char` - //~| ERROR `char` does not name a struct or a struct variant }; } diff --git a/src/test/compile-fail/issue-27815.rs b/src/test/compile-fail/issue-27815.rs index d2f9abd2e31..7a329bac61b 100644 --- a/src/test/compile-fail/issue-27815.rs +++ b/src/test/compile-fail/issue-27815.rs @@ -11,12 +11,10 @@ mod A {} fn main() { - let u = A { x: 1 }; //~ ERROR `A` does not name a structure - let v = u32 { x: 1 }; //~ ERROR `u32` does not name a structure + let u = A { x: 1 }; //~ ERROR `A` does not name a struct or a struct variant + let v = u32 { x: 1 }; //~ ERROR `u32` does not name a struct or a struct variant match () { A { x: 1 } => {} //~ ERROR expected variant, struct or type alias, found module `A` - //~^ ERROR `A` does not name a struct or a struct variant u32 { x: 1 } => {} //~ ERROR expected variant, struct or type alias, found builtin type `u32 - //~^ ERROR `u32` does not name a struct or a struct variant } } diff --git a/src/test/compile-fail/issue-27831.rs b/src/test/compile-fail/issue-27831.rs index d014c45ad2d..e20e6ea2319 100644 --- a/src/test/compile-fail/issue-27831.rs +++ b/src/test/compile-fail/issue-27831.rs @@ -18,7 +18,7 @@ enum Enum { fn main() { let x = Foo(1); - Foo { ..x }; //~ ERROR `Foo` does not name a structure + Foo { ..x }; //~ ERROR `Foo` does not name a struct or a struct variant let Foo { .. } = x; //~ ERROR `Foo` does not name a struct let x = Bar; diff --git a/src/test/compile-fail/issue-4736.rs b/src/test/compile-fail/issue-4736.rs index 843ff38df49..55983c672aa 100644 --- a/src/test/compile-fail/issue-4736.rs +++ b/src/test/compile-fail/issue-4736.rs @@ -11,5 +11,5 @@ struct NonCopyable(()); fn main() { - let z = NonCopyable{ p: () }; //~ ERROR `NonCopyable` does not name a structure + let z = NonCopyable{ p: () }; //~ ERROR `NonCopyable` does not name a struct or a struct variant } diff --git a/src/test/compile-fail/lexical-scopes.rs b/src/test/compile-fail/lexical-scopes.rs index dbcd3f32f3b..505a91f223c 100644 --- a/src/test/compile-fail/lexical-scopes.rs +++ b/src/test/compile-fail/lexical-scopes.rs @@ -10,7 +10,7 @@ struct T { i: i32 } fn f<T>() { - let t = T { i: 0 }; //~ ERROR `T` does not name a structure + let t = T { i: 0 }; //~ ERROR `T` does not name a struct or a struct variant } mod Foo { diff --git a/src/test/compile-fail/trait-as-struct-constructor.rs b/src/test/compile-fail/trait-as-struct-constructor.rs index 67ccd6b7cd0..13fdaa302f7 100644 --- a/src/test/compile-fail/trait-as-struct-constructor.rs +++ b/src/test/compile-fail/trait-as-struct-constructor.rs @@ -12,5 +12,5 @@ trait TraitNotAStruct {} fn main() { TraitNotAStruct{ value: 0 }; - //~^ ERROR: `TraitNotAStruct` does not name a structure [E0071] + //~^ ERROR: `TraitNotAStruct` does not name a struct or a struct variant [E0071] } |
