Skip to content

Commit 392b6e7

Browse files
committed
Add tests
1 parent ee4e553 commit 392b6e7

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

src/test/compile-fail-fulldeps/issue-18986.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub use use_from_trait_xc::Trait;
1515

1616
fn main() {
1717
match () {
18-
Trait { x: 42 } => () //~ ERROR `Trait` does not name a struct
18+
Trait { x: 42 } => () //~ ERROR expected variant, struct or type alias, found trait `Trait`
19+
//~^ ERROR `Trait` does not name a struct or a struct variant
1920
}
2021
}

src/test/compile-fail/issue-32086.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct S(u8);
12+
const C: S = S(10);
13+
14+
fn main() {
15+
let C(a) = S(11); //~ ERROR expected variant or struct, found constant `C`
16+
let C(..) = S(11); //~ ERROR expected variant or struct, found constant `C`
17+
}

src/test/compile-fail/issue-34047.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
const C: u8 = 0; //~ NOTE a constant `C` is defined here
12+
13+
fn main() {
14+
match 1u8 {
15+
mut C => {} //~ ERROR match bindings cannot shadow constants
16+
//~^ NOTE cannot be named the same as a constant
17+
_ => {}
18+
}
19+
}

src/test/run-pass/issue-34074.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Make sure several unnamed function arguments don't conflict with each other
12+
13+
trait Tr {
14+
fn f(u8, u8) {}
15+
}
16+
17+
fn main() {
18+
}

0 commit comments

Comments
 (0)