File tree 9 files changed +128
-0
lines changed
9 files changed +128
-0
lines changed Original file line number Diff line number Diff line change
1
+ // build-fail
2
+ // ignore-emscripten no asm! support
3
+ // Regression test for #69092
4
+
5
+ #![ feature( asm) ]
6
+
7
+ fn main ( ) {
8
+ unsafe { asm ! ( ".ascii \" Xen\0 \" " ) ; }
9
+ //~^ ERROR: <inline asm>:1:9: error: expected string in '.ascii' directive
10
+ }
Original file line number Diff line number Diff line change
1
+ error: <inline asm>:1:9: error: expected string in '.ascii' directive
2
+ .ascii "Xen
3
+ ^
4
+
5
+ --> $DIR/issue-69092.rs:8:14
6
+ |
7
+ LL | unsafe { asm!(".ascii \"Xen\0\""); }
8
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
9
+
10
+ error: aborting due to previous error
11
+
Original file line number Diff line number Diff line change
1
+ // Regression test for #62504
2
+
3
+ #![ feature( const_generics) ]
4
+ #![ allow( incomplete_features) ]
5
+
6
+ trait HasSize {
7
+ const SIZE : usize ;
8
+ }
9
+
10
+ impl < const X : usize > HasSize for ArrayHolder < { X } > {
11
+ const SIZE : usize = X ;
12
+ }
13
+
14
+ struct ArrayHolder < const X : usize > ( [ u32 ; X ] ) ;
15
+
16
+ impl < const X : usize > ArrayHolder < { X } > {
17
+ pub const fn new ( ) -> Self {
18
+ ArrayHolder ( [ 0 ; Self :: SIZE ] )
19
+ //~^ ERROR: array lengths can't depend on generic parameters
20
+ }
21
+ }
22
+
23
+ fn main ( ) {
24
+ let mut array = ArrayHolder :: new ( ) ;
25
+ }
Original file line number Diff line number Diff line change
1
+ error: array lengths can't depend on generic parameters
2
+ --> $DIR/issue-62504.rs:18:25
3
+ |
4
+ LL | ArrayHolder([0; Self::SIZE])
5
+ | ^^^^^^^^^^
6
+
7
+ error: aborting due to previous error
8
+
Original file line number Diff line number Diff line change
1
+ // Regression test for #67739
2
+
3
+ #![ allow( incomplete_features) ]
4
+ #![ feature( const_generics) ]
5
+
6
+ use std:: mem;
7
+
8
+ pub trait Trait {
9
+ type Associated : Sized ;
10
+
11
+ fn associated_size ( & self ) -> usize {
12
+ [ 0u8 ; mem:: size_of :: < Self :: Associated > ( ) ] ;
13
+ //~^ ERROR: array lengths can't depend on generic parameters
14
+ 0
15
+ }
16
+ }
17
+
18
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: array lengths can't depend on generic parameters
2
+ --> $DIR/issue-67739.rs:12:15
3
+ |
4
+ LL | [0u8; mem::size_of::<Self::Associated>()];
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+
7
+ error: aborting due to previous error
8
+
Original file line number Diff line number Diff line change
1
+ // Regression test for #58490
2
+
3
+ macro_rules! a {
4
+ ( @1 $i: item ) => {
5
+ a! { @2 $i }
6
+ } ;
7
+ ( @2 $i: item ) => {
8
+ $i
9
+ } ;
10
+ }
11
+ mod b {
12
+ a ! {
13
+ @1
14
+ #[ macro_export]
15
+ macro_rules! b { ( ) => ( ) }
16
+ }
17
+ #[ macro_export]
18
+ macro_rules! b { ( ) => ( ) }
19
+ //~^ ERROR: the name `b` is defined multiple times
20
+ }
21
+ mod c {
22
+ #[ allow( unused_imports) ]
23
+ use crate :: b;
24
+ }
25
+
26
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0428]: the name `b` is defined multiple times
2
+ --> $DIR/issue-58490.rs:18:5
3
+ |
4
+ LL | macro_rules! b { () => () }
5
+ | -------------- previous definition of the macro `b` here
6
+ ...
7
+ LL | macro_rules! b { () => () }
8
+ | ^^^^^^^^^^^^^^ `b` redefined here
9
+ |
10
+ = note: `b` must be defined only once in the macro namespace of this module
11
+
12
+ error: aborting due to previous error
13
+
14
+ For more information about this error, try `rustc --explain E0428`.
Original file line number Diff line number Diff line change
1
+ // check-pass
2
+ // compile-flags: --emit=mir,link
3
+ // Regression test for #60390, this ICE requires `--emit=mir` flag.
4
+
5
+ fn main ( ) {
6
+ enum Inner { Member ( u32 ) } ;
7
+ Inner :: Member ( 0 ) ;
8
+ }
You can’t perform that action at this time.
0 commit comments