diff options
| author | bors <bors@rust-lang.org> | 2024-09-21 07:00:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-09-21 07:00:52 +0000 |
| commit | 74fd001cdae0321144a20133f2216ea8a97da476 (patch) | |
| tree | 8c25cac318c638e5aed9fb64678176a23741bac5 /tests | |
| parent | c0838c8ebec23fb87855bb6de3a287981cb1df98 (diff) | |
| parent | 5770ba86860a7594189e69c5d34a730ca46344bd (diff) | |
| download | rust-74fd001cdae0321144a20133f2216ea8a97da476.tar.gz rust-74fd001cdae0321144a20133f2216ea8a97da476.zip | |
Auto merge of #130649 - matthiaskrgr:rollup-57zc7lz, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #129718 (add guarantee about remove_dir and remove_file error kinds) - #130598 (Add recursion limit to FFI safety lint) - #130642 (Pass the current cargo to `run-make` tests) - #130644 (Only expect valtree consts in codegen) - #130645 (Normalize consts in writeback when GCE is enabled) - #130646 (compiler: factor out `OVERFLOWING_LITERALS` impl) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/crashes/130310.rs | 15 | ||||
| -rw-r--r-- | tests/run-make/compiler-builtins/rmake.rs | 4 | ||||
| -rw-r--r-- | tests/run-make/thumb-none-cortex-m/rmake.rs | 6 | ||||
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/issue-109141.rs | 3 | ||||
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/issue-109141.stderr | 33 | ||||
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/opaque_type.rs | 1 | ||||
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/opaque_type.stderr | 14 | ||||
| -rw-r--r-- | tests/ui/consts/issue-116186.rs | 2 | ||||
| -rw-r--r-- | tests/ui/consts/issue-116186.stderr | 11 | ||||
| -rw-r--r-- | tests/ui/lint/improper-types-stack-overflow-130310.rs | 20 | ||||
| -rw-r--r-- | tests/ui/lint/improper-types-stack-overflow-130310.stderr | 11 |
11 files changed, 46 insertions, 74 deletions
diff --git a/tests/crashes/130310.rs b/tests/crashes/130310.rs deleted file mode 100644 index d59dd39983c..00000000000 --- a/tests/crashes/130310.rs +++ /dev/null @@ -1,15 +0,0 @@ -//@ known-bug: rust-lang/rust#130310 - -use std::marker::PhantomData; - -#[repr(C)] -struct A<T> { - a: *const A<A<T>>, - p: PhantomData<T>, -} - -extern "C" { - fn f(a: *const A<()>); -} - -fn main() {} diff --git a/tests/run-make/compiler-builtins/rmake.rs b/tests/run-make/compiler-builtins/rmake.rs index 42ed07d9daf..3b05fe2055c 100644 --- a/tests/run-make/compiler-builtins/rmake.rs +++ b/tests/run-make/compiler-builtins/rmake.rs @@ -33,8 +33,8 @@ fn main() { let path = env_var("PATH"); let rustc = env_var("RUSTC"); - let bootstrap_cargo = env_var("BOOTSTRAP_CARGO"); - let mut cmd = cmd(bootstrap_cargo); + let cargo = env_var("CARGO"); + let mut cmd = cmd(cargo); cmd.args(&[ "build", "--manifest-path", diff --git a/tests/run-make/thumb-none-cortex-m/rmake.rs b/tests/run-make/thumb-none-cortex-m/rmake.rs index 0ddb91d378f..9112646290f 100644 --- a/tests/run-make/thumb-none-cortex-m/rmake.rs +++ b/tests/run-make/thumb-none-cortex-m/rmake.rs @@ -36,10 +36,10 @@ fn main() { let path = env_var("PATH"); let rustc = env_var("RUSTC"); - let bootstrap_cargo = env_var("BOOTSTRAP_CARGO"); - // FIXME: extract bootstrap cargo invocations to a proper command + let cargo = env_var("CARGO"); + // FIXME: extract cargo invocations to a proper command // https://github.com/rust-lang/rust/issues/128734 - let mut cmd = cmd(bootstrap_cargo); + let mut cmd = cmd(cargo); cmd.args(&[ "build", "--manifest-path", diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs index c6dd981cced..5303b247173 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs @@ -3,8 +3,7 @@ impl EntriesBuffer { fn a(&self) -> impl Iterator { - self.0.iter_mut() //~ ERROR: cannot borrow `*self.0` as mutable, as it is behind a `&` reference - //~| ERROR captures lifetime that does not appear in bounds + self.0.iter_mut() } } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr index 24f3ed7cdf1..fcbd6904599 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `HashesEntryLEN` in this scope - --> $DIR/issue-109141.rs:11:32 + --> $DIR/issue-109141.rs:10:32 | LL | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>); | ^^^^^^^^^^^^^^ not found in this scope @@ -9,33 +9,6 @@ help: you might be missing a const parameter LL | struct EntriesBuffer<const HashesEntryLEN: /* Type */>(Box<[[u8; HashesEntryLEN]; 5]>); | ++++++++++++++++++++++++++++++++++ -error[E0596]: cannot borrow `*self.0` as mutable, as it is behind a `&` reference - --> $DIR/issue-109141.rs:6:9 - | -LL | self.0.iter_mut() - | ^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable - | -help: consider changing this to be a mutable reference - | -LL | fn a(&mut self) -> impl Iterator { - | ~~~~~~~~~ - -error[E0700]: hidden type for `impl Iterator` captures lifetime that does not appear in bounds - --> $DIR/issue-109141.rs:6:9 - | -LL | fn a(&self) -> impl Iterator { - | ----- ------------- opaque type defined here - | | - | hidden type `std::slice::IterMut<'_, [u8; {const error}]>` captures the anonymous lifetime defined here -LL | self.0.iter_mut() - | ^^^^^^^^^^^^^^^^^ - | -help: add a `use<...>` bound to explicitly capture `'_` - | -LL | fn a(&self) -> impl Iterator + use<'_> { - | +++++++++ - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0425, E0596, E0700. -For more information about an error, try `rustc --explain E0425`. +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/const-generics/generic_const_exprs/opaque_type.rs b/tests/ui/const-generics/generic_const_exprs/opaque_type.rs index 7209290a36e..56b8acbf88c 100644 --- a/tests/ui/const-generics/generic_const_exprs/opaque_type.rs +++ b/tests/ui/const-generics/generic_const_exprs/opaque_type.rs @@ -2,7 +2,6 @@ #![allow(incomplete_features)] type Foo = impl Sized; -//~^ ERROR: unconstrained opaque type fn with_bound<const N: usize>() -> Foo where diff --git a/tests/ui/const-generics/generic_const_exprs/opaque_type.stderr b/tests/ui/const-generics/generic_const_exprs/opaque_type.stderr index c7a266205b4..e9fb8c0f403 100644 --- a/tests/ui/const-generics/generic_const_exprs/opaque_type.stderr +++ b/tests/ui/const-generics/generic_const_exprs/opaque_type.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/opaque_type.rs:11:17 + --> $DIR/opaque_type.rs:10:17 | LL | type Foo = impl Sized; | ---------- the found opaque type @@ -11,20 +11,12 @@ LL | let _: [u8; (N / 2) as Foo] = [0; (N / 2) as usize]; found opaque type `Foo` error[E0605]: non-primitive cast: `usize` as `Foo` - --> $DIR/opaque_type.rs:11:17 + --> $DIR/opaque_type.rs:10:17 | LL | let _: [u8; (N / 2) as Foo] = [0; (N / 2) as usize]; | ^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object -error: unconstrained opaque type - --> $DIR/opaque_type.rs:4:12 - | -LL | type Foo = impl Sized; - | ^^^^^^^^^^ - | - = note: `Foo` must be used in combination with a concrete type within the same module - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0308, E0605. For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/issue-116186.rs b/tests/ui/consts/issue-116186.rs index a77c38c64dc..8bfb47629e7 100644 --- a/tests/ui/consts/issue-116186.rs +++ b/tests/ui/consts/issue-116186.rs @@ -4,7 +4,7 @@ fn something(path: [usize; N]) -> impl Clone { //~^ ERROR cannot find value `N` in this scope match path { - [] => 0, //~ ERROR cannot pattern-match on an array without a fixed length + [] => 0, _ => 1, }; } diff --git a/tests/ui/consts/issue-116186.stderr b/tests/ui/consts/issue-116186.stderr index e6eae2d9f55..46931f79dd0 100644 --- a/tests/ui/consts/issue-116186.stderr +++ b/tests/ui/consts/issue-116186.stderr @@ -9,13 +9,6 @@ help: you might be missing a const parameter LL | fn something<const N: /* Type */>(path: [usize; N]) -> impl Clone { | +++++++++++++++++++++ -error[E0730]: cannot pattern-match on an array without a fixed length - --> $DIR/issue-116186.rs:7:9 - | -LL | [] => 0, - | ^^ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0425, E0730. -For more information about an error, try `rustc --explain E0425`. +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/lint/improper-types-stack-overflow-130310.rs b/tests/ui/lint/improper-types-stack-overflow-130310.rs new file mode 100644 index 00000000000..60eb8739817 --- /dev/null +++ b/tests/ui/lint/improper-types-stack-overflow-130310.rs @@ -0,0 +1,20 @@ +// Regression test for #130310 +// Tests that we do not fall into infinite +// recursion while checking FFI safety of +// recursive types like `A<T>` below + +//@ build-pass +use std::marker::PhantomData; + +#[repr(C)] +struct A<T> { + a: *const A<A<T>>, // Recursive because of this field + p: PhantomData<T>, +} + +extern "C" { + fn f(a: *const A<()>); + //~^ WARN `extern` block uses type `*const A<()>`, which is not FFI-safe +} + +fn main() {} diff --git a/tests/ui/lint/improper-types-stack-overflow-130310.stderr b/tests/ui/lint/improper-types-stack-overflow-130310.stderr new file mode 100644 index 00000000000..6981bb25755 --- /dev/null +++ b/tests/ui/lint/improper-types-stack-overflow-130310.stderr @@ -0,0 +1,11 @@ +warning: `extern` block uses type `*const A<()>`, which is not FFI-safe + --> $DIR/improper-types-stack-overflow-130310.rs:16:13 + | +LL | fn f(a: *const A<()>); + | ^^^^^^^^^^^^ not FFI-safe + | + = note: type is infinitely recursive + = note: `#[warn(improper_ctypes)]` on by default + +warning: 1 warning emitted + |
