File tree Expand file tree Collapse file tree 4 files changed +56
-1
lines changed
Expand file tree Collapse file tree 4 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ pub use use_from_trait_xc::Trait;
1515
1616fn 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}
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments