diff options
| author | bors <bors@rust-lang.org> | 2014-10-06 02:52:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-06 02:52:22 +0000 |
| commit | f50b56c62b1dbdcc0c80ac44200e3b100bc2f656 (patch) | |
| tree | 09861af1b69e4396109a513dede6a87d59cea242 /src/test | |
| parent | 6d15f28986e00e1a1b290b0f0fcf76c3f4e6e261 (diff) | |
| parent | b9896cbf6efa6736730f4666957b94b7e29d7fdf (diff) | |
| download | rust-f50b56c62b1dbdcc0c80ac44200e3b100bc2f656.tar.gz rust-f50b56c62b1dbdcc0c80ac44200e3b100bc2f656.zip | |
auto merge of #17414 : jakub-/rust/issue-17405, r=alexcrichton
Fixes #17405. Fixes #17518. Fixes #17800.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/issue-15896.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-17405.rs | 19 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-17518.rs | 17 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-17800.rs | 21 |
4 files changed, 58 insertions, 1 deletions
diff --git a/src/test/compile-fail/issue-15896.rs b/src/test/compile-fail/issue-15896.rs index a873c1e3b3f..b7fa54e5c18 100644 --- a/src/test/compile-fail/issue-15896.rs +++ b/src/test/compile-fail/issue-15896.rs @@ -18,7 +18,7 @@ fn main() { let e = B(REB(()), Tau { t: 3 }); let u = match e { B( - Tau{t: x}, //~ ERROR mismatched types + Tau{t: x}, //~ ERROR `Tau` does not name a variant _) => x, }; } diff --git a/src/test/compile-fail/issue-17405.rs b/src/test/compile-fail/issue-17405.rs new file mode 100644 index 00000000000..b80cfb521ef --- /dev/null +++ b/src/test/compile-fail/issue-17405.rs @@ -0,0 +1,19 @@ +// Copyright 2014 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 { + Bar(int) +} + +fn main() { + match Bar(1i) { + Foo { i } => () //~ ERROR `Foo` does not name a variant + } +} diff --git a/src/test/compile-fail/issue-17518.rs b/src/test/compile-fail/issue-17518.rs new file mode 100644 index 00000000000..0410fadeb78 --- /dev/null +++ b/src/test/compile-fail/issue-17518.rs @@ -0,0 +1,17 @@ +// Copyright 2014 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 SomeEnum { + E +} + +fn main() { + E { name: "foobar" }; //~ ERROR `E` does not name a structure +} diff --git a/src/test/compile-fail/issue-17800.rs b/src/test/compile-fail/issue-17800.rs new file mode 100644 index 00000000000..8ef016e3fd5 --- /dev/null +++ b/src/test/compile-fail/issue-17800.rs @@ -0,0 +1,21 @@ +// Copyright 2014 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 MyOption<T> { + MySome(T), + MyNone, +} + +fn main() { + match MySome(42i) { + MySome { x: 42i } => (), //~ ERROR `MySome` does not name a struct variant + _ => (), + } +} |
