Rollup merge of #69966 - JohnTitor:more-more-tests, r=Centril
Add more regression tests Closes #58490, closes #60390, closes #62504, closes #67739, closes #69092 r? @Centril
This commit is contained in:
commit
93da9d7fe1
10
src/test/ui/asm/issue-69092.rs
Normal file
10
src/test/ui/asm/issue-69092.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// build-fail
|
||||
// ignore-emscripten no asm! support
|
||||
// Regression test for #69092
|
||||
|
||||
#![feature(asm)]
|
||||
|
||||
fn main() {
|
||||
unsafe { asm!(".ascii \"Xen\0\""); }
|
||||
//~^ ERROR: <inline asm>:1:9: error: expected string in '.ascii' directive
|
||||
}
|
11
src/test/ui/asm/issue-69092.stderr
Normal file
11
src/test/ui/asm/issue-69092.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error: <inline asm>:1:9: error: expected string in '.ascii' directive
|
||||
.ascii "Xen
|
||||
^
|
||||
|
||||
--> $DIR/issue-69092.rs:8:14
|
||||
|
|
||||
LL | unsafe { asm!(".ascii \"Xen\0\""); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
25
src/test/ui/const-generics/issues/issue-62504.rs
Normal file
25
src/test/ui/const-generics/issues/issue-62504.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// Regression test for #62504
|
||||
|
||||
#![feature(const_generics)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait HasSize {
|
||||
const SIZE: usize;
|
||||
}
|
||||
|
||||
impl<const X: usize> HasSize for ArrayHolder<{ X }> {
|
||||
const SIZE: usize = X;
|
||||
}
|
||||
|
||||
struct ArrayHolder<const X: usize>([u32; X]);
|
||||
|
||||
impl<const X: usize> ArrayHolder<{ X }> {
|
||||
pub const fn new() -> Self {
|
||||
ArrayHolder([0; Self::SIZE])
|
||||
//~^ ERROR: array lengths can't depend on generic parameters
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut array = ArrayHolder::new();
|
||||
}
|
8
src/test/ui/const-generics/issues/issue-62504.stderr
Normal file
8
src/test/ui/const-generics/issues/issue-62504.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: array lengths can't depend on generic parameters
|
||||
--> $DIR/issue-62504.rs:18:25
|
||||
|
|
||||
LL | ArrayHolder([0; Self::SIZE])
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
18
src/test/ui/const-generics/issues/issue-67739.rs
Normal file
18
src/test/ui/const-generics/issues/issue-67739.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// Regression test for #67739
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(const_generics)]
|
||||
|
||||
use std::mem;
|
||||
|
||||
pub trait Trait {
|
||||
type Associated: Sized;
|
||||
|
||||
fn associated_size(&self) -> usize {
|
||||
[0u8; mem::size_of::<Self::Associated>()];
|
||||
//~^ ERROR: array lengths can't depend on generic parameters
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
8
src/test/ui/const-generics/issues/issue-67739.stderr
Normal file
8
src/test/ui/const-generics/issues/issue-67739.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: array lengths can't depend on generic parameters
|
||||
--> $DIR/issue-67739.rs:12:15
|
||||
|
|
||||
LL | [0u8; mem::size_of::<Self::Associated>()];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
26
src/test/ui/macros/issue-58490.rs
Normal file
26
src/test/ui/macros/issue-58490.rs
Normal file
@ -0,0 +1,26 @@
|
||||
// Regression test for #58490
|
||||
|
||||
macro_rules! a {
|
||||
( @1 $i:item ) => {
|
||||
a! { @2 $i }
|
||||
};
|
||||
( @2 $i:item ) => {
|
||||
$i
|
||||
};
|
||||
}
|
||||
mod b {
|
||||
a! {
|
||||
@1
|
||||
#[macro_export]
|
||||
macro_rules! b { () => () }
|
||||
}
|
||||
#[macro_export]
|
||||
macro_rules! b { () => () }
|
||||
//~^ ERROR: the name `b` is defined multiple times
|
||||
}
|
||||
mod c {
|
||||
#[allow(unused_imports)]
|
||||
use crate::b;
|
||||
}
|
||||
|
||||
fn main() {}
|
14
src/test/ui/macros/issue-58490.stderr
Normal file
14
src/test/ui/macros/issue-58490.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0428]: the name `b` is defined multiple times
|
||||
--> $DIR/issue-58490.rs:18:5
|
||||
|
|
||||
LL | macro_rules! b { () => () }
|
||||
| -------------- previous definition of the macro `b` here
|
||||
...
|
||||
LL | macro_rules! b { () => () }
|
||||
| ^^^^^^^^^^^^^^ `b` redefined here
|
||||
|
|
||||
= note: `b` must be defined only once in the macro namespace of this module
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0428`.
|
8
src/test/ui/mir/issue-60390.rs
Normal file
8
src/test/ui/mir/issue-60390.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// check-pass
|
||||
// compile-flags: --emit=mir,link
|
||||
// Regression test for #60390, this ICE requires `--emit=mir` flag.
|
||||
|
||||
fn main() {
|
||||
enum Inner { Member(u32) };
|
||||
Inner::Member(0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user