diff options
| author | bors <bors@rust-lang.org> | 2024-07-22 17:45:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-22 17:45:18 +0000 |
| commit | 2a1c384f0e44ad01ac5c85f0cd9de58c97981974 (patch) | |
| tree | cbbe591a5628d02834bec50135264a4dfa6c2a3c /tests | |
| parent | 20f23abbecd7ac5e04dd7ccadc29c3824e28a269 (diff) | |
| parent | db368ea938bfa6b974f600ce7a5b1d7eeb0378c0 (diff) | |
| download | rust-2a1c384f0e44ad01ac5c85f0cd9de58c97981974.tar.gz rust-2a1c384f0e44ad01ac5c85f0cd9de58c97981974.zip | |
Auto merge of #128063 - tgross35:rollup-hsxmptf, r=tgross35
Rollup of 9 pull requests Successful merges: - #117932 (Correct rustdoc section where we talk about rustdoc emitting errors on invalid code) - #125990 (Rename `deprecated_safe` lint to `deprecated_safe_2024`) - #127506 (rustc_target: add known safe s390x target features) - #127820 (Rewrite and rename `issue-14698`. `issue-33329` and `issue-107094` `run-make` tests to rmake or ui) - #127923 (Use reuse tool 4.0) - #128008 (Start using `#[diagnostic::do_not_recommend]` in the standard library) - #128036 (add more tests) - #128051 (rustdoc: revert spacing change in item-table) - #128059 (Add regression test for items list size (#128023)) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
32 files changed, 240 insertions, 45 deletions
diff --git a/tests/crashes/127351.rs b/tests/crashes/127351.rs new file mode 100644 index 00000000000..e3f41594885 --- /dev/null +++ b/tests/crashes/127351.rs @@ -0,0 +1,17 @@ +//@ known-bug: #127351 +#![feature(lazy_type_alias)] +#![allow(incomplete_features)] + +struct Outer0<'a, T>(ExplicitTypeOutlives<'a, T>); +type ExplicitTypeOutlives<'a, T: 'a> = (&'a (), T); + +pub struct Warns { + _significant_drop: ExplicitTypeOutlives, + field: String, +} + +pub fn test(w: Warns) { + _ = || drop(w.field); +} + +fn main() {} diff --git a/tests/crashes/127353.rs b/tests/crashes/127353.rs new file mode 100644 index 00000000000..9bcb90b5c57 --- /dev/null +++ b/tests/crashes/127353.rs @@ -0,0 +1,18 @@ +//@ known-bug: #127353 +#![feature(type_alias_impl_trait)] +trait Trait<T> {} +type Alias<'a, U> = impl Trait<U>; + +fn f<'a>() -> Alias<'a, ()> {} + +pub enum UninhabitedVariants { + Tuple(Alias), +} + +struct A; + +fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(x: UninhabitedVariants) -> A { + match x {} +} + +fn main() {} diff --git a/tests/crashes/127628.rs b/tests/crashes/127628.rs new file mode 100644 index 00000000000..f11ab3f7e8d --- /dev/null +++ b/tests/crashes/127628.rs @@ -0,0 +1,14 @@ +//@ known-bug: #127628 +//@ compile-flags: -Zpolonius=next + +use std::io::{self, Read}; + +pub struct Container<'a> { + reader: &'a mut dyn Read, +} + +impl<'a> Container { + pub fn wrap<'s>(reader: &'s mut dyn io::Read) -> Container<'s> { + Container { reader: reader } + } +} diff --git a/tests/crashes/127643.rs b/tests/crashes/127643.rs new file mode 100644 index 00000000000..a4db9397bde --- /dev/null +++ b/tests/crashes/127643.rs @@ -0,0 +1,18 @@ +//@ known-bug: #127643 + +#![feature(associated_const_equality)] + +fn user() -> impl Owner<dyn Sized, C = 0> {} + +trait Owner<K> { + const C: K; +} +impl<K: ConstDefault> Owner<K> for () { + const C: K = K::DEFAULT; +} + +trait ConstDefault { + const DEFAULT: Self; +} + +fn main() {} diff --git a/tests/crashes/127676.rs b/tests/crashes/127676.rs new file mode 100644 index 00000000000..81149c2ef84 --- /dev/null +++ b/tests/crashes/127676.rs @@ -0,0 +1,8 @@ +//@ known-bug: #127676 +//@ edition:2018 + +#![feature(dyn_star,const_async_blocks)] + +static S: dyn* Send + Sync = async { 42 }; + +pub fn main() {} diff --git a/tests/crashes/127737.rs b/tests/crashes/127737.rs new file mode 100644 index 00000000000..2ee8c769858 --- /dev/null +++ b/tests/crashes/127737.rs @@ -0,0 +1,21 @@ +//@ known-bug: #127737 +//@ compile-flags: -Zmir-opt-level=5 --crate-type lib + +pub trait TestTrait { + type MyType; + fn func() -> Option<Self> + where + Self: Sized; +} + +impl<T> dyn TestTrait<MyType = T> +where + Self: Sized, +{ + pub fn other_func() -> Option<Self> { + match Self::func() { + Some(me) => Some(me), + None => None, + } + } +} diff --git a/tests/crashes/127742.rs b/tests/crashes/127742.rs new file mode 100644 index 00000000000..24add454135 --- /dev/null +++ b/tests/crashes/127742.rs @@ -0,0 +1,11 @@ +//@ known-bug: #127742 +struct Vtable(dyn Cap); // missing lifetime + +trait Cap<'a> {} + +union Transmute { + t: u64, // ICEs with u64, u128, or usize. Correctly errors with u32. + u: &'static Vtable, +} + +const G: &'static Vtable = unsafe { Transmute { t: 1 }.u }; diff --git a/tests/crashes/127880.rs b/tests/crashes/127880.rs new file mode 100644 index 00000000000..6c625eac691 --- /dev/null +++ b/tests/crashes/127880.rs @@ -0,0 +1,5 @@ +//@ known-bug: #127880 +//@ compile-flags: -Cinstrument-coverage + +#[coverage] +fn main() {} diff --git a/tests/crashes/127916.rs b/tests/crashes/127916.rs new file mode 100644 index 00000000000..295c88df857 --- /dev/null +++ b/tests/crashes/127916.rs @@ -0,0 +1,16 @@ +//@ known-bug: #127916 + +trait Trait { + fn foo(&self) -> u32 { 0 } +} + +struct F; +struct S; + +mod to_reuse { + pub fn foo(&self) -> u32 {} +} + +impl Trait S { + reuse to_reuse::foo { self } +} diff --git a/tests/crashes/127972.rs b/tests/crashes/127972.rs new file mode 100644 index 00000000000..d0764f875db --- /dev/null +++ b/tests/crashes/127972.rs @@ -0,0 +1,6 @@ +//@ known-bug: #127962 +#![feature(generic_const_exprs)] + +fn zero_init<const usize: usize>() -> Substs1<{ (N) }> { + Substs1([0; { (usize) }]) +} diff --git a/tests/crashes/128016.rs b/tests/crashes/128016.rs new file mode 100644 index 00000000000..d23721ae14e --- /dev/null +++ b/tests/crashes/128016.rs @@ -0,0 +1,10 @@ +//@ known-bug: #128016 +macro_rules! len { + () => { + target + }; +} + +fn main() { + let val: [str; len!()] = []; +} diff --git a/tests/run-make/issue-14698/foo.rs b/tests/run-make/invalid-tmpdir-env-var/foo.rs index f328e4d9d04..f328e4d9d04 100644 --- a/tests/run-make/issue-14698/foo.rs +++ b/tests/run-make/invalid-tmpdir-env-var/foo.rs diff --git a/tests/run-make/invalid-tmpdir-env-var/rmake.rs b/tests/run-make/invalid-tmpdir-env-var/rmake.rs new file mode 100644 index 00000000000..db44debb319 --- /dev/null +++ b/tests/run-make/invalid-tmpdir-env-var/rmake.rs @@ -0,0 +1,20 @@ +// When the TMP (on Windows) or TMPDIR (on Unix) variable is set to an invalid +// or non-existing directory, this used to cause an internal compiler error (ICE). After the +// addition of proper error handling in #28430, this test checks that the expected message is +// printed. +// See https://github.com/rust-lang/rust/issues/14698 + +use run_make_support::{is_windows, rustc}; + +// NOTE: This is not a UI test despite its simplicity, as the error message contains a path +// with some variability that is difficult to normalize + +fn main() { + let mut rustc = rustc(); + if is_windows() { + rustc.env("TMP", "fake"); + } else { + rustc.env("TMPDIR", "fake"); + } + rustc.input("foo.rs").run_fail().assert_stderr_contains("couldn't create a temp dir"); +} diff --git a/tests/run-make/issue-107094/Makefile b/tests/run-make/issue-107094/Makefile deleted file mode 100644 index d614e3e1055..00000000000 --- a/tests/run-make/issue-107094/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# needs-git-hash - -include ../tools.mk - -all: - $(BARE_RUSTC) --version --verbose | $(CGREP) -i -e "commit-hash: [0-9a-f]{40}" "commit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}" - $(BARE_RUSTDOC) --version --verbose | $(CGREP) -i -e "commit-hash: [0-9a-f]{40}" "commit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}" diff --git a/tests/run-make/issue-14698/Makefile b/tests/run-make/issue-14698/Makefile deleted file mode 100644 index a1cfb5abab5..00000000000 --- a/tests/run-make/issue-14698/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - TMP=fake TMPDIR=fake $(RUSTC) foo.rs 2>&1 | $(CGREP) "couldn't create a temp dir:" diff --git a/tests/run-make/issue-33329/Makefile b/tests/run-make/issue-33329/Makefile deleted file mode 100644 index 9c149440d8e..00000000000 --- a/tests/run-make/issue-33329/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --target x86_64_unknown-linux-musl main.rs 2>&1 | $(CGREP) \ - "error: Error loading target specification: Could not find specification for target" diff --git a/tests/run-make/issue-33329/main.rs b/tests/run-make/issue-33329/main.rs deleted file mode 100644 index f328e4d9d04..00000000000 --- a/tests/run-make/issue-33329/main.rs +++ /dev/null @@ -1 +0,0 @@ -fn main() {} diff --git a/tests/run-make/version-verbose-commit-hash/rmake.rs b/tests/run-make/version-verbose-commit-hash/rmake.rs new file mode 100644 index 00000000000..733c0e2cdb1 --- /dev/null +++ b/tests/run-make/version-verbose-commit-hash/rmake.rs @@ -0,0 +1,20 @@ +// `--version --verbose` should display the git-commit hashes of rustc and rustdoc, but this +// functionality was lost due to #104184. After this feature was returned by #109981, this +// test ensures it will not be broken again. +// See https://github.com/rust-lang/rust/issues/107094 + +//@ needs-git-hash + +use run_make_support::{bare_rustc, bare_rustdoc, regex}; + +fn main() { + let out_rustc = + bare_rustc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase(); + let out_rustdoc = + bare_rustdoc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase(); + let re = + regex::Regex::new(r#"commit-hash: [0-9a-f]{40}\ncommit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}"#) + .unwrap(); + assert!(re.is_match(&out_rustc)); + assert!(re.is_match(&out_rustdoc)); +} diff --git a/tests/rustdoc-gui/item-name-wrap.goml b/tests/rustdoc-gui/item-name-wrap.goml new file mode 100644 index 00000000000..825c16ac5b8 --- /dev/null +++ b/tests/rustdoc-gui/item-name-wrap.goml @@ -0,0 +1,23 @@ +// This test ensures that the item name's width is not wrapped. +go-to: "file://" + |DOC_PATH| + "/test_docs/short_docs/index.html" +set-window-size: (1000, 600) + +// First we ensure that there is only one `item-table`... +assert-count: ("ul.item-table", 1) +// And only two items in it. +assert-count: ("ul.item-table li", 2) + +// If they don't have the same height, then it means one of the two is on two lines whereas it +// shouldn't! +compare-elements-size: ( + ".item-table .item-name a[href='fn.mult_vec_num.html']", + ".item-table .item-name a[href='fn.subt_vec_num.html']", + ["height"], +) + +// We also check that the `item-table` is taking the full width. +compare-elements-size: ( + "#functions", + "ul.item-table", + ["width"], +) diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs index 244c1b9c5cd..7397992c0ab 100644 --- a/tests/rustdoc-gui/src/test_docs/lib.rs +++ b/tests/rustdoc-gui/src/test_docs/lib.rs @@ -620,3 +620,11 @@ pub mod trait_bounds { pub trait TwoBounds: Sized + Copy {} pub trait ThreeBounds: Sized + Copy + Eq {} } + +pub mod short_docs { + /// mult_vec_num(x: &[f64], y: f64) + pub fn mult_vec_num() {} + + /// subt_vec_num(x: &[f64], y: f64) + pub fn subt_vec_num() {} +} diff --git a/tests/ui/check-cfg/mix.stderr b/tests/ui/check-cfg/mix.stderr index 00a97ca1488..57cbe173c78 100644 --- a/tests/ui/check-cfg/mix.stderr +++ b/tests/ui/check-cfg/mix.stderr @@ -251,7 +251,7 @@ warning: unexpected `cfg` condition value: `zebra` LL | cfg!(target_feature = "zebra"); | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 197 more + = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 199 more = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: 27 warnings emitted diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr index 78b7f0f5d99..764f1c86639 100644 --- a/tests/ui/check-cfg/well-known-values.stderr +++ b/tests/ui/check-cfg/well-known-values.stderr @@ -165,7 +165,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` LL | target_feature = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `fcma`, `fdivdu`, `fhm`, `flagm`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `lor`, `lse`, `lsx`, `lvz`, `lzcnt`, `m`, `mclass`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sign-ext`, `simd128`, `sm4`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `sve`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt` + = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `fcma`, `fdivdu`, `fhm`, `flagm`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `lor`, `lse`, `lsx`, `lvz`, `lzcnt`, `m`, `mclass`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sign-ext`, `simd128`, `sm4`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `sve`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` diff --git a/tests/ui/errors/wrong-target-spec.rs b/tests/ui/errors/wrong-target-spec.rs new file mode 100644 index 00000000000..bc9038c1fab --- /dev/null +++ b/tests/ui/errors/wrong-target-spec.rs @@ -0,0 +1,8 @@ +// The attentive may note the underscores in the target triple, making it invalid. This test +// checks that such invalid target specs are rejected by the compiler. +// See https://github.com/rust-lang/rust/issues/33329 + +//@ needs-llvm-components: x86 +//@ compile-flags: --target x86_64_unknown-linux-musl + +fn main() {} diff --git a/tests/ui/errors/wrong-target-spec.stderr b/tests/ui/errors/wrong-target-spec.stderr new file mode 100644 index 00000000000..8b06f404078 --- /dev/null +++ b/tests/ui/errors/wrong-target-spec.stderr @@ -0,0 +1,2 @@ +error: Error loading target specification: Could not find specification for target "x86_64_unknown-linux-musl". Run `rustc --print target-list` for a list of built-in targets + diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.fixed b/tests/ui/rust-2024/unsafe-env-suggestion.fixed index 1f3d2dc0a31..eba35180ef6 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.fixed +++ b/tests/ui/rust-2024/unsafe-env-suggestion.fixed @@ -1,6 +1,6 @@ //@ run-rustfix -#![deny(deprecated_safe)] +#![deny(deprecated_safe_2024)] use std::env; diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.rs b/tests/ui/rust-2024/unsafe-env-suggestion.rs index 3bd169973e3..c039d7f2583 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.rs +++ b/tests/ui/rust-2024/unsafe-env-suggestion.rs @@ -1,6 +1,6 @@ //@ run-rustfix -#![deny(deprecated_safe)] +#![deny(deprecated_safe_2024)] use std::env; diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.stderr b/tests/ui/rust-2024/unsafe-env-suggestion.stderr index 7c12f4aa5ed..3aa10a3bed6 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.stderr +++ b/tests/ui/rust-2024/unsafe-env-suggestion.stderr @@ -9,8 +9,8 @@ LL | env::set_var("FOO", "BAR"); note: the lint level is defined here --> $DIR/unsafe-env-suggestion.rs:3:9 | -LL | #![deny(deprecated_safe)] - | ^^^^^^^^^^^^^^^ +LL | #![deny(deprecated_safe_2024)] + | ^^^^^^^^^^^^^^^^^^^^ help: you can wrap the call in an `unsafe` block if you can guarantee the code is only ever called from single-threaded code | LL + // TODO: Audit that the environment access only happens in single-threaded code. diff --git a/tests/ui/target-feature/gate.rs b/tests/ui/target-feature/gate.rs index af47e84672f..94d79d56c59 100644 --- a/tests/ui/target-feature/gate.rs +++ b/tests/ui/target-feature/gate.rs @@ -21,6 +21,7 @@ // gate-test-loongarch_target_feature // gate-test-lahfsahf_target_feature // gate-test-prfchw_target_feature +// gate-test-s390x_target_feature #[target_feature(enable = "avx512bw")] //~^ ERROR: currently unstable diff --git a/tests/ui/target-feature/gate.stderr b/tests/ui/target-feature/gate.stderr index 31198f73c20..a69020e6864 100644 --- a/tests/ui/target-feature/gate.stderr +++ b/tests/ui/target-feature/gate.stderr @@ -1,5 +1,5 @@ error[E0658]: the target feature `avx512bw` is currently unstable - --> $DIR/gate.rs:25:18 + --> $DIR/gate.rs:26:18 | LL | #[target_feature(enable = "avx512bw")] | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/try-trait/bad-interconversion.stderr b/tests/ui/try-trait/bad-interconversion.stderr index c30b6334fed..642a93d64e2 100644 --- a/tests/ui/try-trait/bad-interconversion.stderr +++ b/tests/ui/try-trait/bad-interconversion.stderr @@ -23,9 +23,7 @@ LL | Some(3)?; | ^ use `.ok_or(...)?` to provide an error compatible with `Result<u64, String>` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u64, String>` - = help: the following other types implement trait `FromResidual<R>`: - `Result<T, F>` implements `FromResidual<Result<Infallible, E>>` - `Result<T, F>` implements `FromResidual<Yeet<E>>` + = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>` error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result` --> $DIR/bad-interconversion.rs:17:31 @@ -36,9 +34,7 @@ LL | Ok(ControlFlow::Break(123)?) | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Result<u64, String>` | = help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Result<u64, String>` - = help: the following other types implement trait `FromResidual<R>`: - `Result<T, F>` implements `FromResidual<Result<Infallible, E>>` - `Result<T, F>` implements `FromResidual<Yeet<E>>` + = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>` error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` --> $DIR/bad-interconversion.rs:22:22 @@ -49,9 +45,7 @@ LL | Some(Err("hello")?) | ^ use `.ok()?` if you want to discard the `Result<Infallible, &str>` error information | = help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `Option<u16>` - = help: the following other types implement trait `FromResidual<R>`: - `Option<T>` implements `FromResidual<Yeet<()>>` - `Option<T>` implements `FromResidual` + = help: the trait `FromResidual` is implemented for `Option<T>` error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option` --> $DIR/bad-interconversion.rs:27:33 @@ -62,9 +56,7 @@ LL | Some(ControlFlow::Break(123)?) | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Option<u64>` | = help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Option<u64>` - = help: the following other types implement trait `FromResidual<R>`: - `Option<T>` implements `FromResidual<Yeet<()>>` - `Option<T>` implements `FromResidual` + = help: the trait `FromResidual` is implemented for `Option<T>` error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` --> $DIR/bad-interconversion.rs:32:39 diff --git a/tests/ui/try-trait/option-to-result.stderr b/tests/ui/try-trait/option-to-result.stderr index 2d97226275d..8055b2a0b04 100644 --- a/tests/ui/try-trait/option-to-result.stderr +++ b/tests/ui/try-trait/option-to-result.stderr @@ -8,9 +8,7 @@ LL | a?; | ^ use `.ok_or(...)?` to provide an error compatible with `Result<(), ()>` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<(), ()>` - = help: the following other types implement trait `FromResidual<R>`: - `Result<T, F>` implements `FromResidual<Result<Infallible, E>>` - `Result<T, F>` implements `FromResidual<Yeet<E>>` + = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>` error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` --> $DIR/option-to-result.rs:11:6 @@ -22,9 +20,7 @@ LL | a?; | ^ use `.ok()?` if you want to discard the `Result<Infallible, i32>` error information | = help: the trait `FromResidual<Result<Infallible, i32>>` is not implemented for `Option<i32>` - = help: the following other types implement trait `FromResidual<R>`: - `Option<T>` implements `FromResidual<Yeet<()>>` - `Option<T>` implements `FromResidual` + = help: the trait `FromResidual` is implemented for `Option<T>` error: aborting due to 2 previous errors diff --git a/tests/ui/try-trait/try-on-option.stderr b/tests/ui/try-trait/try-on-option.stderr index 84a51a078af..15d0b28ddc1 100644 --- a/tests/ui/try-trait/try-on-option.stderr +++ b/tests/ui/try-trait/try-on-option.stderr @@ -8,9 +8,7 @@ LL | x?; | ^ use `.ok_or(...)?` to provide an error compatible with `Result<u32, ()>` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u32, ()>` - = help: the following other types implement trait `FromResidual<R>`: - `Result<T, F>` implements `FromResidual<Result<Infallible, E>>` - `Result<T, F>` implements `FromResidual<Yeet<E>>` + = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>` error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option.rs:11:6 |
