File tree Expand file tree Collapse file tree 7 files changed +189
-0
lines changed Expand file tree Collapse file tree 7 files changed +189
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2018 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+ // only-x86_64
12+
13+ #![ allow( dead_code, non_upper_case_globals) ]
14+ #![ feature( asm) ]
15+
16+ #[ repr( C ) ]
17+ pub struct D32x4 ( f32 , f32 , f32 , f32 ) ;
18+
19+ impl D32x4 {
20+ fn add ( & self , vec : Self ) -> Self {
21+ unsafe {
22+ let ret: Self ;
23+ asm ! ( "
24+ movaps $1, %xmm1
25+ movaps $2, %xmm2
26+ addps %xmm1, %xmm2
27+ movaps $xmm1, $0
28+ "
29+ : "=r" ( ret)
30+ : "1" ( self ) , "2" ( vec)
31+ : "xmm1" , "xmm2"
32+ ) ;
33+ ret
34+ }
35+ }
36+ }
37+
38+ fn main ( ) { }
39+
Original file line number Diff line number Diff line change 1+ // Copyright 2018 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 : * const u8 = & 0 ;
12+
13+ fn foo ( x : * const u8 ) {
14+ match x {
15+ C => { }
16+ _ => { }
17+ }
18+ }
19+
20+ const D : * const [ u8 ; 4 ] = b"abcd" ;
21+
22+ fn main ( ) {
23+ match D {
24+ D => { }
25+ _ => { }
26+ }
27+ }
28+
Original file line number Diff line number Diff line change 1+ // Copyright 2018 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+ pub trait Foo < ' a > {
12+ type Bar ;
13+ fn foo ( & ' a self ) -> Self :: Bar ;
14+ }
15+
16+ impl < ' a , ' b , T : ' a > Foo < ' a > for & ' b T {
17+ type Bar = & ' a T ;
18+ fn foo ( & ' a self ) -> & ' a T {
19+ self
20+ }
21+ }
22+
23+ pub fn uncallable < T , F > ( x : T , f : F )
24+ where T : for < ' a > Foo < ' a > ,
25+ F : for < ' a > Fn ( <T as Foo < ' a > >:: Bar )
26+ {
27+ f ( x. foo ( ) ) ;
28+ }
29+
30+ pub fn catalyst ( x : & i32 ) {
31+ broken ( x, |_| { } )
32+ }
33+
34+ pub fn broken < F : Fn ( & i32 ) > ( x : & i32 , f : F ) {
35+ uncallable ( x, |y| f ( y) ) ;
36+ }
37+
38+ fn main ( ) { }
39+
Original file line number Diff line number Diff line change 1+ // Copyright 2018 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+ fn main ( ) {
12+ let thing = ( ) ;
13+ let other: typeof ( thing ) = thing; //~ ERROR attempt to use a non-constant value in a constant
14+ //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516]
15+ }
16+
17+ fn f ( ) {
18+ let q = 1 ;
19+ <typeof ( q ) >:: N //~ ERROR attempt to use a non-constant value in a constant
20+ //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516]
21+ }
22+
Original file line number Diff line number Diff line change 1+ error[E0435]: attempt to use a non-constant value in a constant
2+ --> $DIR/issue-42060.rs:13:23
3+ |
4+ LL | let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
5+ | ^^^^^ non-constant value
6+
7+ error[E0435]: attempt to use a non-constant value in a constant
8+ --> $DIR/issue-42060.rs:19:13
9+ |
10+ LL | <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
11+ | ^ non-constant value
12+
13+ error[E0516]: `typeof` is a reserved keyword but unimplemented
14+ --> $DIR/issue-42060.rs:13:16
15+ |
16+ LL | let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
17+ | ^^^^^^^^^^^^^ reserved keyword
18+
19+ error[E0516]: `typeof` is a reserved keyword but unimplemented
20+ --> $DIR/issue-42060.rs:19:6
21+ |
22+ LL | <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
23+ | ^^^^^^^^^ reserved keyword
24+
25+ error: aborting due to 4 previous errors
26+
27+ Some errors occurred: E0435, E0516.
28+ For more information about an error, try `rustc --explain E0435`.
Original file line number Diff line number Diff line change 1+ // Copyright 2018 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+ fn main ( ) {
12+ |
13+ }
14+ //~^ ERROR expected `|`, found `}`
15+ |
16+ //~^ ERROR expected item, found `|`
17+
Original file line number Diff line number Diff line change 1+ error: expected `|`, found `}`
2+ --> $DIR/issue-43196.rs:13:1
3+ |
4+ LL | |
5+ | - expected `|` here
6+ LL | }
7+ | ^ unexpected token
8+
9+ error: expected item, found `|`
10+ --> $DIR/issue-43196.rs:15:1
11+ |
12+ LL | |
13+ | ^ expected item
14+
15+ error: aborting due to 2 previous errors
16+
You can’t perform that action at this time.
0 commit comments