auto merge of #17414 : jakub-/rust/issue-17405, r=alexcrichton
Fixes #17405. Fixes #17518. Fixes #17800.
This commit is contained in:
commit
f50b56c62b
7 changed files with 86 additions and 14 deletions
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
19
src/test/compile-fail/issue-17405.rs
Normal file
19
src/test/compile-fail/issue-17405.rs
Normal file
|
|
@ -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
|
||||
}
|
||||
}
|
||||
17
src/test/compile-fail/issue-17518.rs
Normal file
17
src/test/compile-fail/issue-17518.rs
Normal file
|
|
@ -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
|
||||
}
|
||||
21
src/test/compile-fail/issue-17800.rs
Normal file
21
src/test/compile-fail/issue-17800.rs
Normal file
|
|
@ -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
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue