diff --git a/.mailmap b/.mailmap index 219f21c05096a..19adab647a553 100644 --- a/.mailmap +++ b/.mailmap @@ -505,6 +505,11 @@ Nathaniel Hamovitz <18648574+nhamovitz@users.noreply.github.com> Nathaniel Herman Nathaniel Herman Neil Pankey Ngo Iok Ui (Wu Yu Wei) +Nia Deckers +Nia Deckers +Nia Deckers +Nia Deckers +Nia Deckers Nicholas Baron Nicholas Bishop Nicholas Bishop diff --git a/compiler/rustc_ast_lowering/src/stability.rs b/compiler/rustc_ast_lowering/src/stability.rs index c56edb5f8ee7e..5c770e6880630 100644 --- a/compiler/rustc_ast_lowering/src/stability.rs +++ b/compiler/rustc_ast_lowering/src/stability.rs @@ -70,6 +70,7 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> { ExternAbi::Rust | ExternAbi::C { .. } | ExternAbi::Cdecl { .. } + | ExternAbi::Custom | ExternAbi::Stdcall { .. } | ExternAbi::Fastcall { .. } | ExternAbi::Thiscall { .. } @@ -144,9 +145,6 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> { feature: sym::cmse_nonsecure_entry, explain: GateReason::Experimental, }), - ExternAbi::Custom => { - Err(UnstableAbi { abi, feature: sym::abi_custom, explain: GateReason::Experimental }) - } ExternAbi::Swift => { Err(UnstableAbi { abi, feature: sym::abi_swift, explain: GateReason::Experimental }) } diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index c71fecf046c9b..30ae99a56f6ad 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -46,6 +46,8 @@ declare_features! ( /// Allows `#[target_feature(...)]` on aarch64 platforms (accepted, aarch64_target_feature, "1.61.0", Some(44839)), + /// Allows `extern "custom" fn()`. + (accepted, abi_custom, "CURRENT_RUSTC_VERSION", Some(140829)), /// Allows using the `efiapi` ABI. (accepted, abi_efiapi, "1.68.0", Some(65815)), /// Allows the sysV64 ABI to be specified on all platforms diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 3a80145e2897d..665661f43006e 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -372,8 +372,6 @@ declare_features! ( (unstable, abi_avr_interrupt, "1.45.0", Some(69664)), /// Allows `extern "cmse-nonsecure-call" fn()`. (unstable, abi_cmse_nonsecure_call, "1.90.0", Some(81391)), - /// Allows `extern "custom" fn()`. - (unstable, abi_custom, "1.89.0", Some(140829)), /// Allows `extern "gpu-kernel" fn()`. (unstable, abi_gpu_kernel, "1.86.0", Some(135467)), /// Allows `extern "msp430-interrupt" fn()`. diff --git a/library/compiler-builtins/compiler-builtins/src/lib.rs b/library/compiler-builtins/compiler-builtins/src/lib.rs index 9e847206caf19..6bde5195e8af4 100644 --- a/library/compiler-builtins/compiler-builtins/src/lib.rs +++ b/library/compiler-builtins/compiler-builtins/src/lib.rs @@ -1,6 +1,5 @@ #![cfg_attr(feature = "compiler-builtins", compiler_builtins)] #![cfg_attr(all(target_family = "wasm"), feature(wasm_numeric_instr))] -#![feature(abi_custom)] #![feature(abi_unadjusted)] #![feature(asm_experimental_arch)] #![feature(cfg_target_has_atomic)] diff --git a/library/core/src/iter/adapters/step_by.rs b/library/core/src/iter/adapters/step_by.rs index 3a1ff98ec3343..aa4e46743a316 100644 --- a/library/core/src/iter/adapters/step_by.rs +++ b/library/core/src/iter/adapters/step_by.rs @@ -1,5 +1,5 @@ use crate::intrinsics; -use crate::iter::{TrustedLen, TrustedRandomAccess, from_fn}; +use crate::iter::{FusedIterator, TrustedLen, TrustedRandomAccess, from_fn}; use crate::num::NonZero; use crate::ops::{Range, Try}; use crate::range::RangeIter; @@ -136,6 +136,11 @@ where #[stable(feature = "iterator_step_by", since = "1.28.0")] impl ExactSizeIterator for StepBy where I: ExactSizeIterator {} +// StepBy stops yielding items once the underlying iterator does, so it is fused +// whenever the underlying iterator is fused. +#[stable(feature = "step_by_fused", since = "CURRENT_RUSTC_VERSION")] +impl FusedIterator for StepBy where I: FusedIterator {} + // SAFETY: This adapter is shortening. TrustedLen requires the upper bound to be calculated correctly. // These requirements can only be satisfied when the upper bound of the inner iterator's upper // bound is never `None`. I: TrustedRandomAccess happens to provide this guarantee while diff --git a/library/coretests/tests/iter/adapters/step_by.rs b/library/coretests/tests/iter/adapters/step_by.rs index 810c014fdc8d9..7580b6fb9f8af 100644 --- a/library/coretests/tests/iter/adapters/step_by.rs +++ b/library/coretests/tests/iter/adapters/step_by.rs @@ -418,3 +418,16 @@ fn test_step_by_nth_non_fused_on_non_first_take() { // so we should expect `StepBy::nth` to return `None` assert_eq!(iter.nth(usize::MAX), None) } + +#[test] +fn test_step_by_fused() { + // `StepBy` is fused whenever the underlying iterator is fused. + fn assert_fused(_: I) {} + assert_fused((0..10).step_by(3)); + + // Once the underlying fused iterator is exhausted, `StepBy` keeps yielding `None`. + let mut it = (0..3).step_by(5); + assert_eq!(it.next(), Some(0)); + assert_eq!(it.next(), None); + assert_eq!(it.next(), None); +} diff --git a/src/ci/scripts/verify-channel.sh b/src/ci/scripts/verify-channel.sh index 286869e8a411b..ff577fe3a6cb9 100755 --- a/src/ci/scripts/verify-channel.sh +++ b/src/ci/scripts/verify-channel.sh @@ -8,7 +8,8 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" -if isCiBranch try-perf || isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then +if isCiBranch try-perf || isCiBranch automation/bors/try-perf || \ + isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then echo "channel verification is only executed on PR builds" exit fi diff --git a/src/doc/man/rustc.1 b/src/doc/man/rustc.1 index 2a91774d671ac..2731a7257cdd2 100644 --- a/src/doc/man/rustc.1 +++ b/src/doc/man/rustc.1 @@ -62,7 +62,7 @@ Comma separated list of compiler information to print on stdout. Equivalent to \fI\-C\ debuginfo=2\fR. .TP \fB\-O\fR -Equivalent to \fI\-C\ opt\-level=2\fR. +Equivalent to \fI\-C\ opt\-level=3\fR. .TP \fB\-o\fR \fIFILENAME\fR Write output to \fIFILENAME\fR. Ignored if multiple \fI\-\-emit\fR outputs are specified which diff --git a/src/doc/rustc-dev-guide/src/tests/ecosystem.md b/src/doc/rustc-dev-guide/src/tests/ecosystem.md index eee07dd079bbf..9e5b3a1e1c11d 100644 --- a/src/doc/rustc-dev-guide/src/tests/ecosystem.md +++ b/src/doc/rustc-dev-guide/src/tests/ecosystem.md @@ -14,7 +14,7 @@ CI. See the [Crater chapter](crater.md) for more details. ### `cargotest` `cargotest` is a small tool which runs `cargo test` on a few sample projects -(such as `servo`, `ripgrep`, `tokei`, etc.). This runs as part of CI and ensures +(such as `stylo`, `ripgrep`, `tokei`, etc.). This runs as part of CI and ensures there aren't any significant regressions: ```console diff --git a/src/doc/unstable-book/src/compiler-flags/instrument-mcount.md b/src/doc/unstable-book/src/compiler-flags/instrument-mcount.md index 07af4435bc7c1..f7beca6e5a627 100644 --- a/src/doc/unstable-book/src/compiler-flags/instrument-mcount.md +++ b/src/doc/unstable-book/src/compiler-flags/instrument-mcount.md @@ -40,7 +40,6 @@ The following example can be compiled with `-Zinstrument-mcount=yes` or `-Zinstr ```rust #![feature(instrument_fn)] -#![feature(abi_custom)] fn main() { // Ensure all the early startup occurs before attempting to call this trivial, single-threaded diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index 04dd0eaf22899..04c54e134b48e 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -227,14 +227,22 @@ impl Cfg { } fn should_append_only_to_description(&self) -> bool { - match self.0 { - CfgEntry::Any(..) - | CfgEntry::All(..) - | CfgEntry::NameValue { .. } - | CfgEntry::Version(..) - | CfgEntry::Not(CfgEntry::NameValue { .. }, _) => true, - CfgEntry::Not(..) | CfgEntry::Bool(..) => false, + fn should_append_only_to_description(cfg: &CfgEntry) -> bool { + match cfg { + CfgEntry::NameValue { .. } + | CfgEntry::Version(..) + | CfgEntry::Not(CfgEntry::NameValue { .. }, _) => true, + CfgEntry::Any(a, _) | CfgEntry::All(a, _) => { + if a.is_empty() { + false + } else { + a.iter().any(|sub| should_append_only_to_description(sub)) + } + } + CfgEntry::Not(..) | CfgEntry::Bool(..) => false, + } } + should_append_only_to_description(&self.0) } fn should_use_with_in_description(&self) -> bool { @@ -309,7 +317,19 @@ impl Cfg { } fn omit_preposition(&self) -> bool { - matches!(self.0, CfgEntry::Bool(..)) + fn omit_preposition(cfg: &CfgEntry) -> bool { + match cfg { + CfgEntry::NameValue { .. } + | CfgEntry::Version(..) + | CfgEntry::Not(CfgEntry::NameValue { .. }, _) => false, + CfgEntry::Any(a, _) | CfgEntry::All(a, _) => { + a.is_empty() || matches!(a.as_slice(), [a] if omit_preposition(&a)) + } + CfgEntry::Not(a, _) => omit_preposition(a), + CfgEntry::Bool(..) => true, + } + } + omit_preposition(&self.0) } pub(crate) fn inner(&self) -> &CfgEntry { @@ -459,15 +479,20 @@ impl Display<'_> { use fmt::Display as _; let short_longhand = self.1.is_long() && { - let all_crate_features = sub_cfgs.iter().all(|sub_cfg| { - matches!(sub_cfg, CfgEntry::NameValue { name: sym::feature, value: Some(_), .. }) - }); - let all_target_features = sub_cfgs.iter().all(|sub_cfg| { - matches!( - sub_cfg, - CfgEntry::NameValue { name: sym::target_feature, value: Some(_), .. } - ) - }); + let all_crate_features = !sub_cfgs.is_empty() + && sub_cfgs.iter().all(|sub_cfg| { + matches!( + sub_cfg, + CfgEntry::NameValue { name: sym::feature, value: Some(_), .. } + ) + }); + let all_target_features = !sub_cfgs.is_empty() + && sub_cfgs.iter().all(|sub_cfg| { + matches!( + sub_cfg, + CfgEntry::NameValue { name: sym::target_feature, value: Some(_), .. } + ) + }); if all_crate_features { fmt.write_str("crate features ")?; @@ -506,20 +531,45 @@ impl Display<'_> { impl fmt::Display for Display<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + fn display_bool(fmt: &mut fmt::Formatter<'_>, value: bool) -> fmt::Result { + if value { fmt.write_str("everywhere") } else { fmt.write_str("nowhere") } + } + match &self.0 { - CfgEntry::Not(CfgEntry::Any(sub_cfgs, _), _) => { - let separator = if sub_cfgs.iter().all(is_simple_cfg) { " nor " } else { ", nor " }; - fmt.write_str("neither ")?; - - sub_cfgs - .iter() - .map(|sub_cfg| { - Wrapped::with_parens() - .when(is_any_cfg(sub_cfg)) - .wrap(Display(sub_cfg, self.1)) - }) - .joined(separator, fmt) - } + CfgEntry::Not(CfgEntry::Not(sub_cfg, _), _) => Display(sub_cfg, self.1).fmt(fmt), + CfgEntry::Not(CfgEntry::Any(sub_cfgs, _), _) => match sub_cfgs.as_slice() { + // `not(any())` is `true` because `any()` is `false`. + [] => display_bool(fmt, true), + [CfgEntry::Bool(value, _)] => display_bool(fmt, !*value), + sub_cfgs => { + let separator = + if sub_cfgs.iter().all(is_simple_cfg) { " nor " } else { ", nor " }; + if sub_cfgs.len() > 1 { + fmt.write_str("neither ")?; + } else { + fmt.write_str("not(")?; + } + + sub_cfgs + .iter() + .map(|sub_cfg| { + Wrapped::with_parens() + .when(is_any_cfg(sub_cfg)) + .wrap(Display(sub_cfg, self.1)) + }) + .joined(separator, fmt)?; + if sub_cfgs.len() == 1 { + fmt.write_str(")")?; + } + Ok(()) + } + }, + CfgEntry::Not(s @ CfgEntry::All(sub_cfgs, _), _) => match sub_cfgs.as_slice() { + // `not(all())` is `false` because `all()` is `true`. + [] => display_bool(fmt, false), + [CfgEntry::Bool(value, _)] => display_bool(fmt, !*value), + _ => write!(fmt, "not ({})", Display(s, self.1)), + }, CfgEntry::Not(simple @ CfgEntry::NameValue { .. }, _) => { write!(fmt, "non-{}", Display(simple, self.1)) } @@ -531,13 +581,7 @@ impl fmt::Display for Display<'_> { } CfgEntry::All(sub_cfgs, _) => self.display_sub_cfgs(fmt, sub_cfgs.as_slice(), " and "), - CfgEntry::Bool(v, _) => { - if *v { - fmt.write_str("everywhere") - } else { - fmt.write_str("nowhere") - } - } + CfgEntry::Bool(v, _) => display_bool(fmt, *v), &CfgEntry::NameValue { name, value, .. } => { let human_readable = match (*name, value) { diff --git a/src/librustdoc/clean/cfg/tests.rs b/src/librustdoc/clean/cfg/tests.rs index 97f9d1fe71673..a1c25d4251823 100644 --- a/src/librustdoc/clean/cfg/tests.rs +++ b/src/librustdoc/clean/cfg/tests.rs @@ -42,11 +42,19 @@ fn cfg_any_e(v: ThinVec) -> CfgEntry { } fn cfg_not(v: CfgEntry) -> Cfg { - Cfg(CfgEntry::Not(Box::new(v), DUMMY_SP)) + Cfg(cfg_not_e(v)) +} + +fn cfg_not_e(v: CfgEntry) -> CfgEntry { + CfgEntry::Not(Box::new(v), DUMMY_SP) } fn cfg_true() -> Cfg { - Cfg(CfgEntry::Bool(true, DUMMY_SP)) + Cfg(cfg_true_e()) +} + +fn cfg_true_e() -> CfgEntry { + CfgEntry::Bool(true, DUMMY_SP) } fn cfg_false() -> Cfg { @@ -377,6 +385,32 @@ fn test_render_long_html() { .render_long_html(), "Available on x86-64 and target feature sse2 only." ); + // `any(true)` + assert_eq!( + cfg_any(thin_vec![cfg_true_e()]).render_long_html(), + "Available everywhere.", + ); + // `not(any(true))` + assert_eq!( + cfg_not(cfg_any_e(thin_vec![cfg_true_e()])).render_long_html(), + "Available nowhere.", + ); + // `any(all(true))` + assert_eq!( + cfg_any(thin_vec![cfg_all_e(thin_vec![cfg_true_e()])]).render_long_html(), + "Available everywhere." + ); + // `not(any(all(true)))` + assert_eq!( + cfg_not(cfg_any_e(thin_vec![cfg_all_e(thin_vec![cfg_true_e()])])).render_long_html(), + "Available not(everywhere).", + ); + // `not(not(any(all(true))))` + assert_eq!( + cfg_not(cfg_not_e(cfg_any_e(thin_vec![cfg_all_e(thin_vec![cfg_true_e()])]))) + .render_long_html(), + "Available everywhere.", + ); }) } diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs index e920d49eb2e44..82531f328da66 100644 --- a/src/tools/cargotest/main.rs +++ b/src/tools/cargotest/main.rs @@ -70,13 +70,11 @@ const TEST_REPOS: &[Test] = &[ ], }, Test { - name: "servo", - repo: "https://github.com/servo/servo", - sha: "785a344e32db58d4e631fd3cae17fd1f29a721ab", + name: "stylo", + repo: "https://github.com/servo/stylo", + sha: "127b0b5cab6a6927552e889debb20beb031b79d1", lock: None, - // Only test Stylo a.k.a. Quantum CSS, the parts of Servo going into Firefox. - // This takes much less time to build than all of Servo and supports stable Rust. - packages: &["selectors"], + packages: &["selectors", "stylo"], features: None, manifest_path: None, filters: &[], @@ -213,10 +211,6 @@ fn run_cargo_test( .env("CFG_DISABLE_CROSS_TESTS", "1") // Relax #![deny(warnings)] in some crates .env("RUSTFLAGS", "--cap-lints warn") - // servo tries to use 'lld-link.exe' on windows, but we don't - // have lld on our PATH in CI. Override it to use 'link.exe' - .env("CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER", "link.exe") - .env("CARGO_TARGET_I686_PC_WINDOWS_MSVC_LINKER", "link.exe") .current_dir(crate_path) .status() .unwrap(); diff --git a/tests/rustdoc-html/doc-cfg/always-true.rs b/tests/rustdoc-html/doc-cfg/always-true.rs new file mode 100644 index 0000000000000..a753a25619af1 --- /dev/null +++ b/tests/rustdoc-html/doc-cfg/always-true.rs @@ -0,0 +1,20 @@ +// Some generated "cfg text" check. +// Regression test for . + +#![feature(doc_cfg)] +#![crate_name = "foo"] + +// This one doesn't display any cfg label. +//@ has 'foo/fn.f.html' +//@ count - '//*[@class="stab portability"]' 0 +#[cfg(any(all()))] +pub fn f() {} + +//@ has 'foo/fn.f2.html' +// If you change the selector in this one, don't forget to update the one of the `f` +// function as well! +//@ count - '//*[@class="stab portability"]' 1 +//@ has - '//*[@class="stab portability"]' 'Available everywhere.' +// This one display a cfg label. +#[cfg(any(true))] +pub fn f2() {} diff --git a/tests/ui/abi/bad-custom.rs b/tests/ui/abi/bad-custom.rs index 6811520df44cb..93c054a8c900f 100644 --- a/tests/ui/abi/bad-custom.rs +++ b/tests/ui/abi/bad-custom.rs @@ -1,7 +1,6 @@ //@ edition: 2021 //@ check-fail //@ needs-asm-support -#![feature(abi_custom)] #[unsafe(naked)] unsafe extern "custom" fn return_explicit_unit() -> () { diff --git a/tests/ui/abi/bad-custom.stderr b/tests/ui/abi/bad-custom.stderr index 4801b294d818f..472c0041234e6 100644 --- a/tests/ui/abi/bad-custom.stderr +++ b/tests/ui/abi/bad-custom.stderr @@ -1,5 +1,5 @@ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:14:50 + --> $DIR/bad-custom.rs:13:50 | LL | unsafe extern "custom" fn return_alias_unit() -> UnitAlias { | ^^^^^^^^^ @@ -12,7 +12,7 @@ LL + unsafe extern "custom" fn return_alias_unit() { | error: functions with the "custom" ABI must be unsafe - --> $DIR/bad-custom.rs:20:1 + --> $DIR/bad-custom.rs:19:1 | LL | extern "custom" fn must_be_unsafe(a: i64) -> i64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | unsafe extern "custom" fn must_be_unsafe(a: i64) -> i64 { | ++++++ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:20:35 + --> $DIR/bad-custom.rs:19:35 | LL | extern "custom" fn must_be_unsafe(a: i64) -> i64 { | ^^^^^^ ^^^ @@ -36,7 +36,7 @@ LL + extern "custom" fn must_be_unsafe() { | error: functions with the "custom" ABI must be unsafe - --> $DIR/bad-custom.rs:26:21 + --> $DIR/bad-custom.rs:25:21 | LL | type MustbeUnsafe = extern "custom" fn(i64) -> i64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | type MustbeUnsafe = unsafe extern "custom" fn(i64) -> i64; | ++++++ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:26:40 + --> $DIR/bad-custom.rs:25:40 | LL | type MustbeUnsafe = extern "custom" fn(i64) -> i64; | ^^^ ^^^ @@ -60,7 +60,7 @@ LL + type MustbeUnsafe = extern "custom" fn(); | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:31:41 + --> $DIR/bad-custom.rs:30:41 | LL | unsafe extern "custom" fn no_parameters(a: i64) { | ^^^^^^ @@ -73,7 +73,7 @@ LL + unsafe extern "custom" fn no_parameters() { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:36:47 + --> $DIR/bad-custom.rs:35:47 | LL | type NoParameters = unsafe extern "custom" fn(i64); | ^^^ @@ -86,7 +86,7 @@ LL + type NoParameters = unsafe extern "custom" fn(); | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:40:47 + --> $DIR/bad-custom.rs:39:47 | LL | unsafe extern "custom" fn no_return_type() -> i64 { | ^^^ @@ -99,7 +99,7 @@ LL + unsafe extern "custom" fn no_return_type() { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:45:52 + --> $DIR/bad-custom.rs:44:52 | LL | type NoReturnType = unsafe extern "custom" fn() -> i64; | ^^^ @@ -112,7 +112,7 @@ LL + type NoReturnType = unsafe extern "custom" fn(); | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:49:53 + --> $DIR/bad-custom.rs:48:53 | LL | unsafe extern "custom" fn no_never_return_type() -> ! { | ^ @@ -125,7 +125,7 @@ LL + unsafe extern "custom" fn no_never_return_type() { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:54:57 + --> $DIR/bad-custom.rs:53:57 | LL | type NoNeverReturnType = unsafe extern "custom" fn() -> !; | ^ @@ -138,7 +138,7 @@ LL + type NoNeverReturnType = unsafe extern "custom" fn(); | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:57:36 + --> $DIR/bad-custom.rs:56:36 | LL | unsafe extern "custom" fn not_both(a: i64) -> i64 { | ^^^^^^ ^^^ @@ -151,7 +151,7 @@ LL + unsafe extern "custom" fn not_both() { | error: an `extern "custom"` function can only be declared externally or defined via naked functions - --> $DIR/bad-custom.rs:57:1 + --> $DIR/bad-custom.rs:56:1 | LL | unsafe extern "custom" fn not_both(a: i64) -> i64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -163,7 +163,7 @@ LL | unsafe extern "custom" fn not_both(a: i64) -> i64 { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:63:42 + --> $DIR/bad-custom.rs:62:42 | LL | type NotBoth = unsafe extern "custom" fn(i64) -> i64; | ^^^ ^^^ @@ -176,7 +176,7 @@ LL + type NotBoth = unsafe extern "custom" fn(); | error: functions with the "custom" ABI must be unsafe - --> $DIR/bad-custom.rs:69:5 + --> $DIR/bad-custom.rs:68:5 | LL | extern "custom" fn is_even(self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -187,7 +187,7 @@ LL | unsafe extern "custom" fn is_even(self) -> bool { | ++++++ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:69:32 + --> $DIR/bad-custom.rs:68:32 | LL | extern "custom" fn is_even(self) -> bool { | ^^^^ ^^^^ @@ -200,7 +200,7 @@ LL + extern "custom" fn is_even() { | error: an `extern "custom"` function can only be declared externally or defined via naked functions - --> $DIR/bad-custom.rs:69:5 + --> $DIR/bad-custom.rs:68:5 | LL | extern "custom" fn is_even(self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -212,7 +212,7 @@ LL | extern "custom" fn is_even(self) -> bool { | error: functions with the "custom" ABI must be unsafe - --> $DIR/bad-custom.rs:78:5 + --> $DIR/bad-custom.rs:77:5 | LL | extern "custom" fn bitwise_not(a: i64) -> i64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -223,7 +223,7 @@ LL | unsafe extern "custom" fn bitwise_not(a: i64) -> i64 { | ++++++ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:78:36 + --> $DIR/bad-custom.rs:77:36 | LL | extern "custom" fn bitwise_not(a: i64) -> i64 { | ^^^^^^ ^^^ @@ -236,7 +236,7 @@ LL + extern "custom" fn bitwise_not() { | error: an `extern "custom"` function can only be declared externally or defined via naked functions - --> $DIR/bad-custom.rs:78:5 + --> $DIR/bad-custom.rs:77:5 | LL | extern "custom" fn bitwise_not(a: i64) -> i64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -248,7 +248,7 @@ LL | extern "custom" fn bitwise_not(a: i64) -> i64 { | error: functions with the "custom" ABI must be unsafe - --> $DIR/bad-custom.rs:89:5 + --> $DIR/bad-custom.rs:88:5 | LL | extern "custom" fn negate(a: i64) -> i64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -259,7 +259,7 @@ LL | unsafe extern "custom" fn negate(a: i64) -> i64; | ++++++ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:89:31 + --> $DIR/bad-custom.rs:88:31 | LL | extern "custom" fn negate(a: i64) -> i64; | ^^^^^^ ^^^ @@ -272,7 +272,7 @@ LL + extern "custom" fn negate(); | error: functions with the "custom" ABI must be unsafe - --> $DIR/bad-custom.rs:95:5 + --> $DIR/bad-custom.rs:94:5 | LL | extern "custom" fn negate(a: i64) -> i64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -283,7 +283,7 @@ LL | unsafe extern "custom" fn negate(a: i64) -> i64 { | ++++++ error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:95:31 + --> $DIR/bad-custom.rs:94:31 | LL | extern "custom" fn negate(a: i64) -> i64 { | ^^^^^^ ^^^ @@ -296,7 +296,7 @@ LL + extern "custom" fn negate() { | error: an `extern "custom"` function can only be declared externally or defined via naked functions - --> $DIR/bad-custom.rs:95:5 + --> $DIR/bad-custom.rs:94:5 | LL | extern "custom" fn negate(a: i64) -> i64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -308,7 +308,7 @@ LL | extern "custom" fn negate(a: i64) -> i64 { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:104:18 + --> $DIR/bad-custom.rs:103:18 | LL | fn increment(a: i64) -> i64; | ^^^^^^ ^^^ @@ -321,7 +321,7 @@ LL + fn increment(); | error: foreign functions with the "custom" ABI cannot be safe - --> $DIR/bad-custom.rs:107:5 + --> $DIR/bad-custom.rs:106:5 | LL | safe fn extern_cannot_be_safe(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -333,7 +333,7 @@ LL + fn extern_cannot_be_safe(); | error: function pointers cannot be declared with `safe` safety qualifier - --> $DIR/bad-custom.rs:111:13 + --> $DIR/bad-custom.rs:110:13 | LL | type Safe = safe extern "custom" fn(); | ^^^^ @@ -345,7 +345,7 @@ LL + type Safe = extern "custom" fn(); | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:114:40 + --> $DIR/bad-custom.rs:113:40 | LL | fn caller(f: unsafe extern "custom" fn(i64) -> i64, mut x: i64) -> i64 { | ^^^ ^^^ @@ -358,7 +358,7 @@ LL + fn caller(f: unsafe extern "custom" fn(), mut x: i64) -> i64 { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:120:48 + --> $DIR/bad-custom.rs:119:48 | LL | fn caller_by_ref(f: &unsafe extern "custom" fn(i64) -> i64, mut x: i64) -> i64 { | ^^^ ^^^ @@ -371,7 +371,7 @@ LL + fn caller_by_ref(f: &unsafe extern "custom" fn(), mut x: i64) -> i64 { | error: invalid signature for `extern "custom"` function - --> $DIR/bad-custom.rs:126:40 + --> $DIR/bad-custom.rs:125:40 | LL | type Alias = unsafe extern "custom" fn(i64) -> i64; | ^^^ ^^^ @@ -384,7 +384,7 @@ LL + type Alias = unsafe extern "custom" fn(); | error: functions with the "custom" ABI cannot be `async` - --> $DIR/bad-custom.rs:140:1 + --> $DIR/bad-custom.rs:139:1 | LL | async unsafe extern "custom" fn no_async_fn() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -396,7 +396,7 @@ LL + unsafe extern "custom" fn no_async_fn() { | error: an `extern "custom"` function can only be declared externally or defined via naked functions - --> $DIR/bad-custom.rs:140:1 + --> $DIR/bad-custom.rs:139:1 | LL | async unsafe extern "custom" fn no_async_fn() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -408,7 +408,7 @@ LL | async unsafe extern "custom" fn no_async_fn() { | error: an `extern "custom"` function cannot be marked `#[cold]` - --> $DIR/bad-custom.rs:152:1 + --> $DIR/bad-custom.rs:151:1 | LL | #[cold] | ------- help: remove the `#[cold]` attribute @@ -419,7 +419,7 @@ LL | unsafe extern "custom" fn no_cold_attribute() { | `extern "custom"` because of this error[E0277]: expected an `Fn()` closure, found `unsafe extern "custom" fn()` - --> $DIR/bad-custom.rs:145:64 + --> $DIR/bad-custom.rs:144:64 | LL | fn no_promotion_to_fn_trait(f: unsafe extern "custom" fn()) -> impl Fn() { | ^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` @@ -432,91 +432,91 @@ LL | f = note: unsafe function cannot be called generically without an unsafe block error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:116:14 + --> $DIR/bad-custom.rs:115:14 | LL | unsafe { f(x) } | ^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:116:14 + --> $DIR/bad-custom.rs:115:14 | LL | unsafe { f(x) } | ^^^^ error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:122:14 + --> $DIR/bad-custom.rs:121:14 | LL | unsafe { f(x) } | ^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:122:14 + --> $DIR/bad-custom.rs:121:14 | LL | unsafe { f(x) } | ^^^^ error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:130:14 + --> $DIR/bad-custom.rs:129:14 | LL | unsafe { f(x) } | ^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:130:14 + --> $DIR/bad-custom.rs:129:14 | LL | unsafe { f(x) } | ^^^^ error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:159:20 + --> $DIR/bad-custom.rs:158:20 | LL | assert_eq!(not_both(21), 42); | ^^^^^^^^^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:159:20 + --> $DIR/bad-custom.rs:158:20 | LL | assert_eq!(not_both(21), 42); | ^^^^^^^^^^^^ error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:162:29 + --> $DIR/bad-custom.rs:161:29 | LL | assert_eq!(unsafe { increment(41) }, 42); | ^^^^^^^^^^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:162:29 + --> $DIR/bad-custom.rs:161:29 | LL | assert_eq!(unsafe { increment(41) }, 42); | ^^^^^^^^^^^^^ error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:165:17 + --> $DIR/bad-custom.rs:164:17 | LL | assert!(Thing(41).is_even()); | ^^^^^^^^^^^^^^^^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:165:17 + --> $DIR/bad-custom.rs:164:17 | LL | assert!(Thing(41).is_even()); | ^^^^^^^^^^^^^^^^^^^ error: functions with the "custom" ABI cannot be called - --> $DIR/bad-custom.rs:168:20 + --> $DIR/bad-custom.rs:167:20 | LL | assert_eq!(Thing::bitwise_not(42), !42); | ^^^^^^^^^^^^^^^^^^^^^^ | note: an `extern "custom"` function can only be called using inline assembly - --> $DIR/bad-custom.rs:168:20 + --> $DIR/bad-custom.rs:167:20 | LL | assert_eq!(Thing::bitwise_not(42), !42); | ^^^^^^^^^^^^^^^^^^^^^^ error[E0015]: inline assembly is not allowed in constant functions - --> $DIR/bad-custom.rs:136:5 + --> $DIR/bad-custom.rs:135:5 | LL | std::arch::naked_asm!("") | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/custom.rs b/tests/ui/abi/custom.rs index dae3925f19916..fba4f2bc70844 100644 --- a/tests/ui/abi/custom.rs +++ b/tests/ui/abi/custom.rs @@ -3,7 +3,6 @@ // //@ run-pass //@ only-x86_64 -#![feature(abi_custom)] use std::arch::{asm, global_asm, naked_asm}; diff --git a/tests/ui/abi/unsupported.aarch64.stderr b/tests/ui/abi/unsupported.aarch64.stderr index f0768b8953c5b..ed9cde8658159 100644 --- a/tests/ui/abi/unsupported.aarch64.stderr +++ b/tests/ui/abi/unsupported.aarch64.stderr @@ -1,89 +1,89 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:71:8 + --> $DIR/unsupported.rs:70:8 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -91,7 +91,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -99,7 +99,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -107,7 +107,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -115,49 +115,49 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:117:8 + --> $DIR/unsupported.rs:116:8 | LL | extern "vectorcall" fn vectorcall() {} | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:119:29 + --> $DIR/unsupported.rs:118:29 | LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) { | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:123:8 + --> $DIR/unsupported.rs:122:8 | LL | extern "vectorcall" {} | ^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -168,7 +168,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -178,7 +178,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -188,7 +188,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.arm.stderr b/tests/ui/abi/unsupported.arm.stderr index dc50397601690..63b27f428543e 100644 --- a/tests/ui/abi/unsupported.arm.stderr +++ b/tests/ui/abi/unsupported.arm.stderr @@ -1,71 +1,71 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:71:8 + --> $DIR/unsupported.rs:70:8 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -73,7 +73,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -81,7 +81,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -89,7 +89,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -97,49 +97,49 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:117:8 + --> $DIR/unsupported.rs:116:8 | LL | extern "vectorcall" fn vectorcall() {} | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:119:29 + --> $DIR/unsupported.rs:118:29 | LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) { | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:123:8 + --> $DIR/unsupported.rs:122:8 | LL | extern "vectorcall" {} | ^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -150,7 +150,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -160,7 +160,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -170,7 +170,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.i686.stderr b/tests/ui/abi/unsupported.i686.stderr index 65a8e44d06b4b..11084099308c8 100644 --- a/tests/ui/abi/unsupported.i686.stderr +++ b/tests/ui/abi/unsupported.i686.stderr @@ -1,83 +1,83 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.riscv32.stderr b/tests/ui/abi/unsupported.riscv32.stderr index de7f5e436154e..584a7769fd4a2 100644 --- a/tests/ui/abi/unsupported.riscv32.stderr +++ b/tests/ui/abi/unsupported.riscv32.stderr @@ -1,83 +1,83 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:71:8 + --> $DIR/unsupported.rs:70:8 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -85,7 +85,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -93,7 +93,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -101,7 +101,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -109,49 +109,49 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:117:8 + --> $DIR/unsupported.rs:116:8 | LL | extern "vectorcall" fn vectorcall() {} | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:119:29 + --> $DIR/unsupported.rs:118:29 | LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) { | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:123:8 + --> $DIR/unsupported.rs:122:8 | LL | extern "vectorcall" {} | ^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -162,7 +162,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -172,7 +172,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -182,7 +182,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.riscv64.stderr b/tests/ui/abi/unsupported.riscv64.stderr index de7f5e436154e..584a7769fd4a2 100644 --- a/tests/ui/abi/unsupported.riscv64.stderr +++ b/tests/ui/abi/unsupported.riscv64.stderr @@ -1,83 +1,83 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:71:8 + --> $DIR/unsupported.rs:70:8 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -85,7 +85,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -93,7 +93,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -101,7 +101,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -109,49 +109,49 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:117:8 + --> $DIR/unsupported.rs:116:8 | LL | extern "vectorcall" fn vectorcall() {} | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:119:29 + --> $DIR/unsupported.rs:118:29 | LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) { | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:123:8 + --> $DIR/unsupported.rs:122:8 | LL | extern "vectorcall" {} | ^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -162,7 +162,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -172,7 +172,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -182,7 +182,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.rs b/tests/ui/abi/unsupported.rs index a0b9e14b912e5..4d67d1b4f6019 100644 --- a/tests/ui/abi/unsupported.rs +++ b/tests/ui/abi/unsupported.rs @@ -32,8 +32,7 @@ abi_riscv_interrupt, abi_cmse_nonsecure_call, abi_vectorcall, - cmse_nonsecure_entry, - abi_custom + cmse_nonsecure_entry )] extern crate minicore; diff --git a/tests/ui/abi/unsupported.wasm32.stderr b/tests/ui/abi/unsupported.wasm32.stderr index 826658ba7de87..ff38ef8cfbf88 100644 --- a/tests/ui/abi/unsupported.wasm32.stderr +++ b/tests/ui/abi/unsupported.wasm32.stderr @@ -1,89 +1,89 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:71:8 + --> $DIR/unsupported.rs:70:8 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -91,7 +91,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -99,7 +99,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -107,7 +107,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -115,61 +115,61 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:117:8 + --> $DIR/unsupported.rs:116:8 | LL | extern "vectorcall" fn vectorcall() {} | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:119:29 + --> $DIR/unsupported.rs:118:29 | LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) { | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:123:8 + --> $DIR/unsupported.rs:122:8 | LL | extern "vectorcall" {} | ^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "custom" is not a supported ABI for the current target - --> $DIR/unsupported.rs:146:32 + --> $DIR/unsupported.rs:145:32 | LL | fn custom_ptr(f: unsafe extern "custom" fn()) { | ^^^^^^^^ error[E0570]: "custom" is not a supported ABI for the current target - --> $DIR/unsupported.rs:150:8 + --> $DIR/unsupported.rs:149:8 | LL | extern "custom" {} | ^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -180,7 +180,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -190,7 +190,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -200,7 +200,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.wasm64.stderr b/tests/ui/abi/unsupported.wasm64.stderr index 826658ba7de87..ff38ef8cfbf88 100644 --- a/tests/ui/abi/unsupported.wasm64.stderr +++ b/tests/ui/abi/unsupported.wasm64.stderr @@ -1,89 +1,89 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:71:8 + --> $DIR/unsupported.rs:70:8 | LL | extern "x86-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -91,7 +91,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -99,7 +99,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -107,7 +107,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -115,61 +115,61 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:117:8 + --> $DIR/unsupported.rs:116:8 | LL | extern "vectorcall" fn vectorcall() {} | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:119:29 + --> $DIR/unsupported.rs:118:29 | LL | fn vectorcall_ptr(f: extern "vectorcall" fn()) { | ^^^^^^^^^^^^ error[E0570]: "vectorcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:123:8 + --> $DIR/unsupported.rs:122:8 | LL | extern "vectorcall" {} | ^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "custom" is not a supported ABI for the current target - --> $DIR/unsupported.rs:146:32 + --> $DIR/unsupported.rs:145:32 | LL | fn custom_ptr(f: unsafe extern "custom" fn()) { | ^^^^^^^^ error[E0570]: "custom" is not a supported ABI for the current target - --> $DIR/unsupported.rs:150:8 + --> $DIR/unsupported.rs:149:8 | LL | extern "custom" {} | ^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -180,7 +180,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -190,7 +190,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -200,7 +200,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.x64.stderr b/tests/ui/abi/unsupported.x64.stderr index a1233e2c13cf3..a664651a80867 100644 --- a/tests/ui/abi/unsupported.x64.stderr +++ b/tests/ui/abi/unsupported.x64.stderr @@ -1,83 +1,83 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:8 + --> $DIR/unsupported.rs:82:8 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^ @@ -85,7 +85,7 @@ LL | extern "stdcall" fn stdcall() {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:26 + --> $DIR/unsupported.rs:86:26 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^ @@ -93,7 +93,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:8 + --> $DIR/unsupported.rs:92:8 | LL | extern "stdcall" {} | ^^^^^^^^^ @@ -101,7 +101,7 @@ LL | extern "stdcall" {} = help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"` error[E0570]: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:8 + --> $DIR/unsupported.rs:96:8 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^ @@ -109,31 +109,31 @@ LL | extern "stdcall-unwind" {} = help: if you need `extern "stdcall-unwind"` on win32 and `extern "C-unwind"` everywhere else, use `extern "system-unwind"` error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -144,7 +144,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -154,7 +154,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -164,7 +164,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/unsupported.x64_win.stderr b/tests/ui/abi/unsupported.x64_win.stderr index a011fcf4a06fb..5a6d2f148d470 100644 --- a/tests/ui/abi/unsupported.x64_win.stderr +++ b/tests/ui/abi/unsupported.x64_win.stderr @@ -1,107 +1,107 @@ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:42:8 + --> $DIR/unsupported.rs:41:8 | LL | extern "ptx-kernel" fn ptx() {} | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:44:22 + --> $DIR/unsupported.rs:43:22 | LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) { | ^^^^^^^^^^^^ error[E0570]: "ptx-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:48:8 + --> $DIR/unsupported.rs:47:8 | LL | extern "ptx-kernel" {} | ^^^^^^^^^^^^ error[E0570]: "gpu-kernel" is not a supported ABI for the current target - --> $DIR/unsupported.rs:50:8 + --> $DIR/unsupported.rs:49:8 | LL | extern "gpu-kernel" fn gpu() {} | ^^^^^^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:53:8 + --> $DIR/unsupported.rs:52:8 | LL | extern "aapcs" fn aapcs() {} | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:55:24 + --> $DIR/unsupported.rs:54:24 | LL | fn aapcs_ptr(f: extern "aapcs" fn()) { | ^^^^^^^ error[E0570]: "aapcs" is not a supported ABI for the current target - --> $DIR/unsupported.rs:59:8 + --> $DIR/unsupported.rs:58:8 | LL | extern "aapcs" {} | ^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:62:8 + --> $DIR/unsupported.rs:61:8 | LL | extern "msp430-interrupt" {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/unsupported.rs:65:8 + --> $DIR/unsupported.rs:64:8 | LL | extern "avr-interrupt" {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/unsupported.rs:68:8 + --> $DIR/unsupported.rs:67:8 | LL | extern "riscv-interrupt-m" {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:74:8 + --> $DIR/unsupported.rs:73:8 | LL | extern "thiscall" fn thiscall() {} | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:76:27 + --> $DIR/unsupported.rs:75:27 | LL | fn thiscall_ptr(f: extern "thiscall" fn()) { | ^^^^^^^^^^ error[E0570]: "thiscall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:80:8 + --> $DIR/unsupported.rs:79:8 | LL | extern "thiscall" {} | ^^^^^^^^^^ error[E0570]: "cmse-nonsecure-call" is not a supported ABI for the current target - --> $DIR/unsupported.rs:126:28 + --> $DIR/unsupported.rs:125:28 | LL | fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:131:8 + --> $DIR/unsupported.rs:130:8 | LL | extern "cmse-nonsecure-entry" fn cmse_entry() {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:133:29 + --> $DIR/unsupported.rs:132:29 | LL | fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0570]: "cmse-nonsecure-entry" is not a supported ABI for the current target - --> $DIR/unsupported.rs:137:8 + --> $DIR/unsupported.rs:136:8 | LL | extern "cmse-nonsecure-entry" {} | ^^^^^^^^^^^^^^^^^^^^^^ warning: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:87:19 + --> $DIR/unsupported.rs:86:19 | LL | fn stdcall_ptr(f: extern "stdcall" fn()) { | ^^^^^^^^^^^^^^^^^^^^^ @@ -112,7 +112,7 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) { = note: `#[warn(unsupported_calling_conventions)]` (part of `#[warn(future_incompatible)]`) on by default warning: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:93:1 + --> $DIR/unsupported.rs:92:1 | LL | extern "stdcall" {} | ^^^^^^^^^^^^^^^^^^^ @@ -122,7 +122,7 @@ LL | extern "stdcall" {} = note: for more information, see issue #137018 warning: "stdcall-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:97:1 + --> $DIR/unsupported.rs:96:1 | LL | extern "stdcall-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -132,7 +132,7 @@ LL | extern "stdcall-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:105:17 + --> $DIR/unsupported.rs:104:17 | LL | fn cdecl_ptr(f: extern "cdecl" fn()) { | ^^^^^^^^^^^^^^^^^^^ @@ -142,7 +142,7 @@ LL | fn cdecl_ptr(f: extern "cdecl" fn()) { = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:110:1 + --> $DIR/unsupported.rs:109:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -152,7 +152,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "cdecl-unwind" is not a supported ABI for the current target - --> $DIR/unsupported.rs:113:1 + --> $DIR/unsupported.rs:112:1 | LL | extern "cdecl-unwind" {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -162,7 +162,7 @@ LL | extern "cdecl-unwind" {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:142:1 + --> $DIR/unsupported.rs:141:1 | LL | extern "cdecl" {} | ^^^^^^^^^^^^^^^^^ @@ -172,7 +172,7 @@ LL | extern "cdecl" {} = note: for more information, see issue #137018 warning: "stdcall" is not a supported ABI for the current target - --> $DIR/unsupported.rs:83:1 + --> $DIR/unsupported.rs:82:1 | LL | extern "stdcall" fn stdcall() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -182,7 +182,7 @@ LL | extern "stdcall" fn stdcall() {} = note: for more information, see issue #137018 warning: "cdecl" is not a supported ABI for the current target - --> $DIR/unsupported.rs:102:1 + --> $DIR/unsupported.rs:101:1 | LL | extern "cdecl" fn cdecl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/asm/naked-functions/naked-functions.rs b/tests/ui/asm/naked-functions/naked-functions.rs index a6ed7d69a0866..d994b1151514a 100644 --- a/tests/ui/asm/naked-functions/naked-functions.rs +++ b/tests/ui/asm/naked-functions/naked-functions.rs @@ -3,7 +3,7 @@ //@ ignore-spirv //@ reference: attributes.codegen.naked.body -#![feature(asm_unwind, linkage, rustc_attrs, cfg_target_object_format, abi_custom)] +#![feature(asm_unwind, linkage, rustc_attrs, cfg_target_object_format)] #![crate_type = "lib"] use std::arch::{asm, naked_asm}; diff --git a/tests/ui/consts/const-fn-vec-box-dyn-any-84170.rs b/tests/ui/consts/const-fn-vec-box-dyn-any-84170.rs deleted file mode 100644 index 64de852f46d6f..0000000000000 --- a/tests/ui/consts/const-fn-vec-box-dyn-any-84170.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Regression test for #84170: a `const fn` returning `Vec>` was rejected -// with E0723 "trait bounds other than `Sized` on const fn parameters are unstable" even -// though no trait object value is created. -//@ check-pass - -#![allow(dead_code)] - -const fn newv() -> Vec> { - Vec::new() -} - -const fn new(_val: &Vec>) {} - -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-abi-custom.rs b/tests/ui/feature-gates/feature-gate-abi-custom.rs deleted file mode 100644 index f5e3c8e28b47c..0000000000000 --- a/tests/ui/feature-gates/feature-gate-abi-custom.rs +++ /dev/null @@ -1,51 +0,0 @@ -//@ add-minicore -//@ needs-asm-support -#![no_core] -#![feature(no_core, lang_items)] -#![crate_type = "rlib"] - -extern crate minicore; -use minicore::*; - -#[unsafe(naked)] -unsafe extern "custom" fn f7() { - //~^ ERROR "custom" ABI is experimental - naked_asm!("") -} -trait Tr { - extern "custom" fn m7(); - //~^ ERROR "custom" ABI is experimental - //~| ERROR functions with the "custom" ABI must be unsafe - #[unsafe(naked)] - extern "custom" fn dm7() { - //~^ ERROR "custom" ABI is experimental - //~| ERROR functions with the "custom" ABI must be unsafe - naked_asm!("") - } -} - -struct S; - -// Methods in trait impl -impl Tr for S { - #[unsafe(naked)] - extern "custom" fn m7() { - //~^ ERROR "custom" ABI is experimental - //~| ERROR functions with the "custom" ABI must be unsafe - naked_asm!("") - } -} - -// Methods in inherent impl -impl S { - #[unsafe(naked)] - extern "custom" fn im7() { - //~^ ERROR "custom" ABI is experimental - //~| ERROR functions with the "custom" ABI must be unsafe - naked_asm!("") - } -} - -type A7 = unsafe extern "custom" fn(); //~ ERROR "custom" ABI is experimental - -extern "custom" {} //~ ERROR "custom" ABI is experimental diff --git a/tests/ui/feature-gates/feature-gate-abi-custom.stderr b/tests/ui/feature-gates/feature-gate-abi-custom.stderr deleted file mode 100644 index cee258d843b8e..0000000000000 --- a/tests/ui/feature-gates/feature-gate-abi-custom.stderr +++ /dev/null @@ -1,117 +0,0 @@ -error: functions with the "custom" ABI must be unsafe - --> $DIR/feature-gate-abi-custom.rs:16:5 - | -LL | extern "custom" fn m7(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: add the `unsafe` keyword to this definition - | -LL | unsafe extern "custom" fn m7(); - | ++++++ - -error: functions with the "custom" ABI must be unsafe - --> $DIR/feature-gate-abi-custom.rs:20:5 - | -LL | extern "custom" fn dm7() { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: add the `unsafe` keyword to this definition - | -LL | unsafe extern "custom" fn dm7() { - | ++++++ - -error: functions with the "custom" ABI must be unsafe - --> $DIR/feature-gate-abi-custom.rs:32:5 - | -LL | extern "custom" fn m7() { - | ^^^^^^^^^^^^^^^^^^^^^^^ - | -help: add the `unsafe` keyword to this definition - | -LL | unsafe extern "custom" fn m7() { - | ++++++ - -error: functions with the "custom" ABI must be unsafe - --> $DIR/feature-gate-abi-custom.rs:42:5 - | -LL | extern "custom" fn im7() { - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: add the `unsafe` keyword to this definition - | -LL | unsafe extern "custom" fn im7() { - | ++++++ - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:11:15 - | -LL | unsafe extern "custom" fn f7() { - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:16:12 - | -LL | extern "custom" fn m7(); - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:20:12 - | -LL | extern "custom" fn dm7() { - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:32:12 - | -LL | extern "custom" fn m7() { - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:42:12 - | -LL | extern "custom" fn im7() { - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:49:25 - | -LL | type A7 = unsafe extern "custom" fn(); - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the extern "custom" ABI is experimental and subject to change - --> $DIR/feature-gate-abi-custom.rs:51:8 - | -LL | extern "custom" {} - | ^^^^^^^^ - | - = note: see issue #140829 for more information - = help: add `#![feature(abi_custom)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 11 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/rust-2018/async-ident-allowed.rs b/tests/ui/rust-2018/async-ident-allowed.rs index 342fafc67e20a..2c76dd7bf0fc1 100644 --- a/tests/ui/rust-2018/async-ident-allowed.rs +++ b/tests/ui/rust-2018/async-ident-allowed.rs @@ -1,4 +1,5 @@ //@ edition:2015 +//@ reference: lex.keywords.strict.edition2018 #![deny(rust_2018_compatibility)] diff --git a/tests/ui/rust-2018/async-ident-allowed.stderr b/tests/ui/rust-2018/async-ident-allowed.stderr index 1bdfc7bae1028..a83421a98c429 100644 --- a/tests/ui/rust-2018/async-ident-allowed.stderr +++ b/tests/ui/rust-2018/async-ident-allowed.stderr @@ -1,5 +1,5 @@ error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident-allowed.rs:9:9 + --> $DIR/async-ident-allowed.rs:10:9 | LL | let async = 3; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -7,7 +7,7 @@ LL | let async = 3; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see note: the lint level is defined here - --> $DIR/async-ident-allowed.rs:3:9 + --> $DIR/async-ident-allowed.rs:4:9 | LL | #![deny(rust_2018_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2018/async-ident.fixed b/tests/ui/rust-2018/async-ident.fixed index 639a8a245fb41..90600200f066e 100644 --- a/tests/ui/rust-2018/async-ident.fixed +++ b/tests/ui/rust-2018/async-ident.fixed @@ -3,6 +3,8 @@ //@ edition:2015 //@ run-rustfix +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.strict.edition2018 fn r#async() {} //~ ERROR async //~^ WARN this is accepted in the current edition diff --git a/tests/ui/rust-2018/async-ident.rs b/tests/ui/rust-2018/async-ident.rs index 7921f05f48126..2c948b6fab812 100644 --- a/tests/ui/rust-2018/async-ident.rs +++ b/tests/ui/rust-2018/async-ident.rs @@ -3,6 +3,8 @@ //@ edition:2015 //@ run-rustfix +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.strict.edition2018 fn async() {} //~ ERROR async //~^ WARN this is accepted in the current edition diff --git a/tests/ui/rust-2018/async-ident.stderr b/tests/ui/rust-2018/async-ident.stderr index 2c4cb7e1d96e1..c9a5e29ef95ea 100644 --- a/tests/ui/rust-2018/async-ident.stderr +++ b/tests/ui/rust-2018/async-ident.stderr @@ -1,5 +1,5 @@ error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:7:4 + --> $DIR/async-ident.rs:9:4 | LL | fn async() {} | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -14,7 +14,7 @@ LL | #![deny(keyword_idents)] = note: `#[deny(keyword_idents_2018)]` implied by `#[deny(keyword_idents)]` error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:12:19 + --> $DIR/async-ident.rs:14:19 | LL | ($async:expr, async) => {}; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -23,7 +23,7 @@ LL | ($async:expr, async) => {}; = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:17:6 + --> $DIR/async-ident.rs:19:6 | LL | foo!(async); | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -32,7 +32,7 @@ LL | foo!(async); = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:26:11 + --> $DIR/async-ident.rs:28:11 | LL | trait async {} | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -41,7 +41,7 @@ LL | trait async {} = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:30:10 + --> $DIR/async-ident.rs:32:10 | LL | impl async for MyStruct {} | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -50,7 +50,7 @@ LL | impl async for MyStruct {} = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:36:12 + --> $DIR/async-ident.rs:38:12 | LL | static async: u32 = 0; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -59,7 +59,7 @@ LL | static async: u32 = 0; = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:42:11 + --> $DIR/async-ident.rs:44:11 | LL | const async: u32 = 0; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -68,7 +68,7 @@ LL | const async: u32 = 0; = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:48:15 + --> $DIR/async-ident.rs:50:15 | LL | impl Foo { fn async() {} } | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -77,7 +77,7 @@ LL | impl Foo { fn async() {} } = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:53:12 + --> $DIR/async-ident.rs:55:12 | LL | struct async {} | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -86,7 +86,7 @@ LL | struct async {} = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:56:9 + --> $DIR/async-ident.rs:58:9 | LL | let async: async = async {}; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -95,7 +95,7 @@ LL | let async: async = async {}; = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:56:16 + --> $DIR/async-ident.rs:58:16 | LL | let async: async = async {}; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -104,7 +104,7 @@ LL | let async: async = async {}; = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:56:24 + --> $DIR/async-ident.rs:58:24 | LL | let async: async = async {}; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -113,7 +113,7 @@ LL | let async: async = async {}; = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:67:19 + --> $DIR/async-ident.rs:69:19 | LL | () => (pub fn async() {}) | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` @@ -122,7 +122,7 @@ LL | () => (pub fn async() {}) = note: for more information, see error: `async` is a keyword in the 2018 edition - --> $DIR/async-ident.rs:74:6 + --> $DIR/async-ident.rs:76:6 | LL | (async) => (1) | ^^^^^ help: you can use a raw identifier to stay compatible: `r#async` diff --git a/tests/ui/rust-2018/dyn-keyword.fixed b/tests/ui/rust-2018/dyn-keyword.fixed index e0233382e85ed..27421a52cbbc9 100644 --- a/tests/ui/rust-2018/dyn-keyword.fixed +++ b/tests/ui/rust-2018/dyn-keyword.fixed @@ -1,5 +1,7 @@ //@ edition:2015 //@ run-rustfix +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.strict.edition2018 #![allow(unused_variables)] #![deny(keyword_idents)] diff --git a/tests/ui/rust-2018/dyn-keyword.rs b/tests/ui/rust-2018/dyn-keyword.rs index 876e83b5e89e6..69e419d4b7430 100644 --- a/tests/ui/rust-2018/dyn-keyword.rs +++ b/tests/ui/rust-2018/dyn-keyword.rs @@ -1,5 +1,7 @@ //@ edition:2015 //@ run-rustfix +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.strict.edition2018 #![allow(unused_variables)] #![deny(keyword_idents)] diff --git a/tests/ui/rust-2018/dyn-keyword.stderr b/tests/ui/rust-2018/dyn-keyword.stderr index 733583f32b9b9..5e9f2e22ffd47 100644 --- a/tests/ui/rust-2018/dyn-keyword.stderr +++ b/tests/ui/rust-2018/dyn-keyword.stderr @@ -1,5 +1,5 @@ error: `dyn` is a keyword in the 2018 edition - --> $DIR/dyn-keyword.rs:8:9 + --> $DIR/dyn-keyword.rs:10:9 | LL | let dyn = (); | ^^^ help: you can use a raw identifier to stay compatible: `r#dyn` @@ -7,7 +7,7 @@ LL | let dyn = (); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see note: the lint level is defined here - --> $DIR/dyn-keyword.rs:5:9 + --> $DIR/dyn-keyword.rs:7:9 | LL | #![deny(keyword_idents)] | ^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed index d685c4944baf1..d0a18b911da09 100644 --- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed +++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed @@ -1,5 +1,6 @@ //@ edition: 2015 //@ run-rustfix +//@ reference: paths.qualifiers.global-root.edition2018 #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs index 7a5ecf2720a5b..0271a30197ed2 100644 --- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs +++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs @@ -1,5 +1,6 @@ //@ edition: 2015 //@ run-rustfix +//@ reference: paths.qualifiers.global-root.edition2018 #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr index b59604f6427e3..218a6fa58b46d 100644 --- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr +++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-fully-qualified-paths.rs:19:25 + --> $DIR/edition-lint-fully-qualified-paths.rs:20:25 | LL | let _: ::Bar = (); | ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo` @@ -7,13 +7,13 @@ LL | let _: ::Bar = (); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see note: the lint level is defined here - --> $DIR/edition-lint-fully-qualified-paths.rs:4:9 + --> $DIR/edition-lint-fully-qualified-paths.rs:5:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-fully-qualified-paths.rs:19:25 + --> $DIR/edition-lint-fully-qualified-paths.rs:20:25 | LL | let _: ::Bar = (); | ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo` @@ -23,7 +23,7 @@ LL | let _: ::Bar = (); = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-fully-qualified-paths.rs:25:13 + --> $DIR/edition-lint-fully-qualified-paths.rs:26:13 | LL | let _: <::foo::Baz as foo::Foo>::Bar = (); | ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz` diff --git a/tests/ui/rust-2018/edition-lint-paths.fixed b/tests/ui/rust-2018/edition-lint-paths.fixed index 9664b461161ad..2a690a9635564 100644 --- a/tests/ui/rust-2018/edition-lint-paths.fixed +++ b/tests/ui/rust-2018/edition-lint-paths.fixed @@ -1,6 +1,7 @@ //@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix +//@ reference: paths.qualifiers.global-root.edition2018 #![deny(absolute_paths_not_starting_with_crate)] #![allow(unused)] diff --git a/tests/ui/rust-2018/edition-lint-paths.rs b/tests/ui/rust-2018/edition-lint-paths.rs index 39cdad3ab98b2..4ae636d9b4de5 100644 --- a/tests/ui/rust-2018/edition-lint-paths.rs +++ b/tests/ui/rust-2018/edition-lint-paths.rs @@ -1,6 +1,7 @@ //@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix +//@ reference: paths.qualifiers.global-root.edition2018 #![deny(absolute_paths_not_starting_with_crate)] #![allow(unused)] diff --git a/tests/ui/rust-2018/edition-lint-paths.stderr b/tests/ui/rust-2018/edition-lint-paths.stderr index 26db6e402a9e2..d4313ae484f7f 100644 --- a/tests/ui/rust-2018/edition-lint-paths.stderr +++ b/tests/ui/rust-2018/edition-lint-paths.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:12:9 + --> $DIR/edition-lint-paths.rs:13:9 | LL | use bar::Bar; | ^^^^^^^^ help: use `crate`: `crate::bar::Bar` @@ -7,13 +7,13 @@ LL | use bar::Bar; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see note: the lint level is defined here - --> $DIR/edition-lint-paths.rs:5:9 + --> $DIR/edition-lint-paths.rs:6:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:19:9 + --> $DIR/edition-lint-paths.rs:20:9 | LL | use bar; | ^^^ help: use `crate`: `crate::bar` @@ -22,7 +22,7 @@ LL | use bar; = note: for more information, see error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:25:9 + --> $DIR/edition-lint-paths.rs:26:9 | LL | use {main, Bar as SomethingElse}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}` @@ -31,7 +31,7 @@ LL | use {main, Bar as SomethingElse}; = note: for more information, see error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:25:9 + --> $DIR/edition-lint-paths.rs:26:9 | LL | use {main, Bar as SomethingElse}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}` @@ -41,7 +41,7 @@ LL | use {main, Bar as SomethingElse}; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:25:9 + --> $DIR/edition-lint-paths.rs:26:9 | LL | use {main, Bar as SomethingElse}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}` @@ -51,7 +51,7 @@ LL | use {main, Bar as SomethingElse}; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:40:5 + --> $DIR/edition-lint-paths.rs:41:5 | LL | use bar::Bar; | ^^^^^^^^ help: use `crate`: `crate::bar::Bar` @@ -60,7 +60,7 @@ LL | use bar::Bar; = note: for more information, see error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:52:9 + --> $DIR/edition-lint-paths.rs:53:9 | LL | use *; | ^ help: use `crate`: `crate::*` @@ -69,7 +69,7 @@ LL | use *; = note: for more information, see error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:57:6 + --> $DIR/edition-lint-paths.rs:58:6 | LL | impl ::foo::SomeTrait for u32 {} | ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::SomeTrait` @@ -78,7 +78,7 @@ LL | impl ::foo::SomeTrait for u32 {} = note: for more information, see error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:62:13 + --> $DIR/edition-lint-paths.rs:63:13 | LL | let x = ::bar::Bar; | ^^^^^^^^^^ help: use `crate`: `crate::bar::Bar` diff --git a/tests/ui/rust-2018/try-ident.fixed b/tests/ui/rust-2018/try-ident.fixed index b514c6d075654..47b4f3325ad94 100644 --- a/tests/ui/rust-2018/try-ident.fixed +++ b/tests/ui/rust-2018/try-ident.fixed @@ -1,6 +1,8 @@ //@ edition: 2015 //@ run-rustfix //@ check-pass +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.reserved.edition2018 #![warn(rust_2018_compatibility)] diff --git a/tests/ui/rust-2018/try-ident.rs b/tests/ui/rust-2018/try-ident.rs index 2b8bb9234e559..01f23b9b3c0ac 100644 --- a/tests/ui/rust-2018/try-ident.rs +++ b/tests/ui/rust-2018/try-ident.rs @@ -1,6 +1,8 @@ //@ edition: 2015 //@ run-rustfix //@ check-pass +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.reserved.edition2018 #![warn(rust_2018_compatibility)] diff --git a/tests/ui/rust-2018/try-ident.stderr b/tests/ui/rust-2018/try-ident.stderr index 3af2196ce35bf..0bc9dd438b1fb 100644 --- a/tests/ui/rust-2018/try-ident.stderr +++ b/tests/ui/rust-2018/try-ident.stderr @@ -1,5 +1,5 @@ warning: `try` is a keyword in the 2018 edition - --> $DIR/try-ident.rs:8:5 + --> $DIR/try-ident.rs:10:5 | LL | try(); | ^^^ help: you can use a raw identifier to stay compatible: `r#try` @@ -7,14 +7,14 @@ LL | try(); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see note: the lint level is defined here - --> $DIR/try-ident.rs:5:9 + --> $DIR/try-ident.rs:7:9 | LL | #![warn(rust_2018_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(keyword_idents_2018)]` implied by `#[warn(rust_2018_compatibility)]` warning: `try` is a keyword in the 2018 edition - --> $DIR/try-ident.rs:13:4 + --> $DIR/try-ident.rs:15:4 | LL | fn try() { | ^^^ help: you can use a raw identifier to stay compatible: `r#try` diff --git a/tests/ui/rust-2018/try-macro.fixed b/tests/ui/rust-2018/try-macro.fixed index f2d8cf2bd9a5f..0ba6e7dcd877c 100644 --- a/tests/ui/rust-2018/try-macro.fixed +++ b/tests/ui/rust-2018/try-macro.fixed @@ -3,6 +3,8 @@ //@ edition: 2015 //@ run-rustfix //@ check-pass +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.reserved.edition2018 #![warn(rust_2018_compatibility)] #![allow(dead_code)] diff --git a/tests/ui/rust-2018/try-macro.rs b/tests/ui/rust-2018/try-macro.rs index fec8eaa1786b3..705e3cdde7fae 100644 --- a/tests/ui/rust-2018/try-macro.rs +++ b/tests/ui/rust-2018/try-macro.rs @@ -3,6 +3,8 @@ //@ edition: 2015 //@ run-rustfix //@ check-pass +//@ reference: ident.raw.allowed +//@ reference: lex.keywords.reserved.edition2018 #![warn(rust_2018_compatibility)] #![allow(dead_code)] diff --git a/tests/ui/rust-2018/try-macro.stderr b/tests/ui/rust-2018/try-macro.stderr index 89366381c8c6e..c2e2b5b7438f6 100644 --- a/tests/ui/rust-2018/try-macro.stderr +++ b/tests/ui/rust-2018/try-macro.stderr @@ -1,5 +1,5 @@ warning: `try` is a keyword in the 2018 edition - --> $DIR/try-macro.rs:13:5 + --> $DIR/try-macro.rs:15:5 | LL | try!(x); | ^^^ help: you can use a raw identifier to stay compatible: `r#try` @@ -7,7 +7,7 @@ LL | try!(x); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see note: the lint level is defined here - --> $DIR/try-macro.rs:7:9 + --> $DIR/try-macro.rs:9:9 | LL | #![warn(rust_2018_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/union/access_union_field.rs b/tests/ui/union/access_union_field.rs index 4183119725eca..2fbb924e390e0 100644 --- a/tests/ui/union/access_union_field.rs +++ b/tests/ui/union/access_union_field.rs @@ -1,3 +1,5 @@ +//@ reference: items.union.fields.read-safety +//@ reference: type.union.safety #![allow(unused_variables)] union Foo { diff --git a/tests/ui/union/access_union_field.stderr b/tests/ui/union/access_union_field.stderr index 4c46bb44a1d33..c56a6067e45bc 100644 --- a/tests/ui/union/access_union_field.stderr +++ b/tests/ui/union/access_union_field.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/access_union_field.rs:10:13 + --> $DIR/access_union_field.rs:12:13 | LL | let a = foo.bar; | ^^^^^^^ access to union field @@ -7,7 +7,7 @@ LL | let a = foo.bar; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/access_union_field.rs:11:13 + --> $DIR/access_union_field.rs:13:13 | LL | let b = foo.baz; | ^^^^^^^ access to union field diff --git a/tests/ui/union/field_checks.rs b/tests/ui/union/field_checks.rs index bb4eccb4cf896..551ae2d6fbcbe 100644 --- a/tests/ui/union/field_checks.rs +++ b/tests/ui/union/field_checks.rs @@ -1,3 +1,10 @@ +//@ reference: items.union.drop +//@ reference: items.union.field-restrictions +//@ reference: items.union.field-copy +//@ reference: items.union.field-references +//@ reference: items.union.field-manually-drop +//@ reference: items.union.field-tuple +//@ reference: type.union.constraint use std::mem::ManuallyDrop; union U1 { // OK diff --git a/tests/ui/union/field_checks.stderr b/tests/ui/union/field_checks.stderr index 32407a749709c..b9440a12602db 100644 --- a/tests/ui/union/field_checks.stderr +++ b/tests/ui/union/field_checks.stderr @@ -1,5 +1,5 @@ error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/field_checks.rs:24:5 + --> $DIR/field_checks.rs:31:5 | LL | a: String, | ^^^^^^^^^ @@ -11,7 +11,7 @@ LL | a: std::mem::ManuallyDrop, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/field_checks.rs:28:5 + --> $DIR/field_checks.rs:35:5 | LL | a: std::cell::RefCell, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | a: std::mem::ManuallyDrop>, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/field_checks.rs:32:5 + --> $DIR/field_checks.rs:39:5 | LL | a: T, | ^^^^ @@ -35,7 +35,7 @@ LL | a: std::mem::ManuallyDrop, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/field_checks.rs:44:5 + --> $DIR/field_checks.rs:51:5 | LL | nest: U5, | ^^^^^^^^ @@ -47,7 +47,7 @@ LL | nest: std::mem::ManuallyDrop, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/field_checks.rs:48:5 + --> $DIR/field_checks.rs:55:5 | LL | nest: [U5; 0], | ^^^^^^^^^^^^^ diff --git a/tests/ui/union/issue-41073.rs b/tests/ui/union/issue-41073.rs index f7a82b4e7cf5d..3536b9fd20375 100644 --- a/tests/ui/union/issue-41073.rs +++ b/tests/ui/union/issue-41073.rs @@ -1,3 +1,5 @@ +//@ reference: items.union.field-restrictions +//@ reference: type.union.constraint union Test { a: A, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union b: B diff --git a/tests/ui/union/issue-41073.stderr b/tests/ui/union/issue-41073.stderr index c9b6903b1bfba..d66e3753ae658 100644 --- a/tests/ui/union/issue-41073.stderr +++ b/tests/ui/union/issue-41073.stderr @@ -1,5 +1,5 @@ error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/issue-41073.rs:2:5 + --> $DIR/issue-41073.rs:4:5 | LL | a: A, | ^^^^ diff --git a/tests/ui/union/issue-81199.rs b/tests/ui/union/issue-81199.rs index 2083ee15d87bd..89460f2f4b43f 100644 --- a/tests/ui/union/issue-81199.rs +++ b/tests/ui/union/issue-81199.rs @@ -1,3 +1,5 @@ +//@ reference: items.union.field-restrictions +//@ reference: type.union.constraint #[repr(C)] union PtrRepr { const_ptr: *const T, diff --git a/tests/ui/union/issue-81199.stderr b/tests/ui/union/issue-81199.stderr index 46f5de8d4fd8a..a36aa4bf98c46 100644 --- a/tests/ui/union/issue-81199.stderr +++ b/tests/ui/union/issue-81199.stderr @@ -1,5 +1,5 @@ error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/issue-81199.rs:5:5 + --> $DIR/issue-81199.rs:7:5 | LL | components: PtrComponents, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,14 +11,14 @@ LL | components: std::mem::ManuallyDrop>, | +++++++++++++++++++++++ + error[E0277]: the trait bound `T: Pointee` is not satisfied - --> $DIR/issue-81199.rs:5:17 + --> $DIR/issue-81199.rs:7:17 | LL | components: PtrComponents, | ^^^^^^^^^^^^^^^^ the trait `Pointee` is not implemented for `T` | = note: `T` implements similarly named trait `std::ptr::Pointee`, but not `Pointee` note: required by a bound in `PtrComponents` - --> $DIR/issue-81199.rs:11:25 + --> $DIR/issue-81199.rs:13:25 | LL | struct PtrComponents { | ^^^^^^^ required by this bound in `PtrComponents` diff --git a/tests/ui/union/issue-99375.rs b/tests/ui/union/issue-99375.rs index ead083b21b1e9..cc0a7adbaf8db 100644 --- a/tests/ui/union/issue-99375.rs +++ b/tests/ui/union/issue-99375.rs @@ -1,4 +1,6 @@ //@ check-pass +//@ reference: items.union.field-copy +//@ reference: items.union.field-tuple union URes { uninit: (), diff --git a/tests/ui/union/union-assignop.rs b/tests/ui/union/union-assignop.rs index 6122aef0565e0..fdffa4a535ff0 100644 --- a/tests/ui/union/union-assignop.rs +++ b/tests/ui/union/union-assignop.rs @@ -1,3 +1,5 @@ +//@ reference: items.union.fields.read-safety +//@ reference: items.union.fields.write-safety use std::ops::AddAssign; use std::mem::ManuallyDrop; diff --git a/tests/ui/union/union-assignop.stderr b/tests/ui/union/union-assignop.stderr index 6b2ebfb509961..087c599dbc1ae 100644 --- a/tests/ui/union/union-assignop.stderr +++ b/tests/ui/union/union-assignop.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:16:5 + --> $DIR/union-assignop.rs:18:5 | LL | foo.a += 5; | ^^^^^ access to union field @@ -7,7 +7,7 @@ LL | foo.a += 5; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:17:6 + --> $DIR/union-assignop.rs:19:6 | LL | *foo.b += NonCopy; | ^^^^^ access to union field @@ -15,7 +15,7 @@ LL | *foo.b += NonCopy; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:18:6 + --> $DIR/union-assignop.rs:20:6 | LL | *foo.b = NonCopy; | ^^^^^ access to union field @@ -23,7 +23,7 @@ LL | *foo.b = NonCopy; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:20:5 + --> $DIR/union-assignop.rs:22:5 | LL | foo.a; | ^^^^^ access to union field @@ -31,7 +31,7 @@ LL | foo.a; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:22:5 + --> $DIR/union-assignop.rs:24:5 | LL | foo.b; | ^^^^^ access to union field @@ -39,7 +39,7 @@ LL | foo.b; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:24:13 + --> $DIR/union-assignop.rs:26:13 | LL | foo.b = foo.b; | ^^^^^ access to union field diff --git a/tests/ui/union/union-backcomp.rs b/tests/ui/union/union-backcomp.rs index a71813968e841..46b5eb48f0c4a 100644 --- a/tests/ui/union/union-backcomp.rs +++ b/tests/ui/union/union-backcomp.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: lex.keywords.weak.union #![allow(path_statements)] #![allow(dead_code)] diff --git a/tests/ui/union/union-borrow-move-parent-sibling.rs b/tests/ui/union/union-borrow-move-parent-sibling.rs index 5b0b44232e411..435fa7fbd1540 100644 --- a/tests/ui/union/union-borrow-move-parent-sibling.rs +++ b/tests/ui/union/union-borrow-move-parent-sibling.rs @@ -1,3 +1,4 @@ +//@ reference: items.union.ref.borrow #![allow(unused)] use std::ops::{Deref, DerefMut}; diff --git a/tests/ui/union/union-borrow-move-parent-sibling.stderr b/tests/ui/union/union-borrow-move-parent-sibling.stderr index 461ee407e2ddb..0655cd0908113 100644 --- a/tests/ui/union/union-borrow-move-parent-sibling.stderr +++ b/tests/ui/union/union-borrow-move-parent-sibling.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) - --> $DIR/union-borrow-move-parent-sibling.rs:53:13 + --> $DIR/union-borrow-move-parent-sibling.rs:54:13 | LL | let a = &mut (*u.x).0; | --- mutable borrow occurs here (via `u.x`) @@ -11,7 +11,7 @@ LL | use_borrow(a); = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x` error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec, MockVec), MockVec)>` - --> $DIR/union-borrow-move-parent-sibling.rs:59:13 + --> $DIR/union-borrow-move-parent-sibling.rs:60:13 | LL | let a = u.x.0; | ^^^^^ move occurs because value has type `(MockVec, MockVec)`, which does not implement the `Copy` trait @@ -22,7 +22,7 @@ LL | let a = &u.x.0; | + error[E0382]: use of moved value: `u` - --> $DIR/union-borrow-move-parent-sibling.rs:61:13 + --> $DIR/union-borrow-move-parent-sibling.rs:62:13 | LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) }; | - move occurs because `u` has type `U`, which does not implement the `Copy` trait @@ -33,7 +33,7 @@ LL | let b = u.y; | ^^^ value used here after move | note: if `U` implemented `Clone`, you could clone the value - --> $DIR/union-borrow-move-parent-sibling.rs:43:1 + --> $DIR/union-borrow-move-parent-sibling.rs:44:1 | LL | union U { | ^^^^^^^ consider implementing `Clone` for this type @@ -42,7 +42,7 @@ LL | let a = u.x; | --- you could clone this value error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) - --> $DIR/union-borrow-move-parent-sibling.rs:67:13 + --> $DIR/union-borrow-move-parent-sibling.rs:68:13 | LL | let a = &mut ((*u.x).0).0; | --- mutable borrow occurs here (via `u.x`) @@ -54,13 +54,13 @@ LL | use_borrow(a); = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x` error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec, MockVec), MockVec)>` - --> $DIR/union-borrow-move-parent-sibling.rs:73:13 + --> $DIR/union-borrow-move-parent-sibling.rs:74:13 | LL | let a = (u.x.0).0; | ^^^^^^^^^ move occurs because value has type `MockVec`, which does not implement the `Copy` trait | note: if `MockVec` implemented `Clone`, you could clone the value - --> $DIR/union-borrow-move-parent-sibling.rs:25:1 + --> $DIR/union-borrow-move-parent-sibling.rs:26:1 | LL | struct MockVec { | ^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type @@ -73,7 +73,7 @@ LL | let a = &(u.x.0).0; | + error[E0382]: use of moved value: `u` - --> $DIR/union-borrow-move-parent-sibling.rs:75:13 + --> $DIR/union-borrow-move-parent-sibling.rs:76:13 | LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) }; | - move occurs because `u` has type `U`, which does not implement the `Copy` trait @@ -84,7 +84,7 @@ LL | let b = u.y; | ^^^ value used here after move | note: if `U` implemented `Clone`, you could clone the value - --> $DIR/union-borrow-move-parent-sibling.rs:43:1 + --> $DIR/union-borrow-move-parent-sibling.rs:44:1 | LL | union U { | ^^^^^^^ consider implementing `Clone` for this type @@ -93,7 +93,7 @@ LL | let a = u.x; | --- you could clone this value error[E0502]: cannot borrow `u` (via `u.x`) as immutable because it is also borrowed as mutable (via `u.y`) - --> $DIR/union-borrow-move-parent-sibling.rs:81:13 + --> $DIR/union-borrow-move-parent-sibling.rs:82:13 | LL | let a = &mut *u.y; | --- mutable borrow occurs here (via `u.y`) diff --git a/tests/ui/union/union-copy.rs b/tests/ui/union/union-copy.rs index 7ad0a11c6ac6e..40b43b8f3466e 100644 --- a/tests/ui/union/union-copy.rs +++ b/tests/ui/union/union-copy.rs @@ -1,3 +1,4 @@ +//@ reference: lang-types.copy.constraint #[derive(Clone)] union U { a: u8 diff --git a/tests/ui/union/union-copy.stderr b/tests/ui/union/union-copy.stderr index bd63908b49a2c..60cb49147b659 100644 --- a/tests/ui/union/union-copy.stderr +++ b/tests/ui/union/union-copy.stderr @@ -1,5 +1,5 @@ error[E0204]: the trait `Copy` cannot be implemented for this type - --> $DIR/union-copy.rs:12:15 + --> $DIR/union-copy.rs:13:15 | LL | a: std::mem::ManuallyDrop | --------------------------------- this field does not implement `Copy` @@ -8,7 +8,7 @@ LL | impl Copy for W {} | ^ | note: the `Copy` impl for `ManuallyDrop` requires that `String: Copy` - --> $DIR/union-copy.rs:8:8 + --> $DIR/union-copy.rs:9:8 | LL | a: std::mem::ManuallyDrop | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/union/union-drop-assign.rs b/tests/ui/union/union-drop-assign.rs index 710a6f6205e01..ac3120fc2f25c 100644 --- a/tests/ui/union/union-drop-assign.rs +++ b/tests/ui/union/union-drop-assign.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: items.union.drop #![allow(unused_assignments)] // Drop works for union itself. diff --git a/tests/ui/union/union-drop.rs b/tests/ui/union/union-drop.rs index 9a2911599dfe2..4e3ce06014c82 100644 --- a/tests/ui/union/union-drop.rs +++ b/tests/ui/union/union-drop.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ reference: destructors.manually-suppressing +//@ reference: items.union.drop #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/union/union-empty.rs b/tests/ui/union/union-empty.rs index 79b7e68ee6beb..60b6668b6e245 100644 --- a/tests/ui/union/union-empty.rs +++ b/tests/ui/union/union-empty.rs @@ -1,3 +1,4 @@ +//@ reference: items.union.fieldless union U {} //~ ERROR unions cannot have zero fields fn main() {} diff --git a/tests/ui/union/union-empty.stderr b/tests/ui/union/union-empty.stderr index 03a939769c78b..aeec4eca5a996 100644 --- a/tests/ui/union/union-empty.stderr +++ b/tests/ui/union/union-empty.stderr @@ -1,5 +1,5 @@ error: unions cannot have zero fields - --> $DIR/union-empty.rs:1:1 + --> $DIR/union-empty.rs:2:1 | LL | union U {} | ^^^^^^^^^^ diff --git a/tests/ui/union/union-fields-2.rs b/tests/ui/union/union-fields-2.rs index 71b204fcdc5b8..2c4dc241bc43a 100644 --- a/tests/ui/union/union-fields-2.rs +++ b/tests/ui/union/union-fields-2.rs @@ -1,3 +1,7 @@ +//@ reference: expr.struct.field.union-constraint +//@ reference: items.union.init.intro +//@ reference: items.union.pattern.one-field +//@ reference: patterns.struct.constraint-union union U { a: u8, b: u16, diff --git a/tests/ui/union/union-fields-2.stderr b/tests/ui/union/union-fields-2.stderr index 142186885caa8..4cfd2271f3f79 100644 --- a/tests/ui/union/union-fields-2.stderr +++ b/tests/ui/union/union-fields-2.stderr @@ -1,17 +1,17 @@ error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:7:13 + --> $DIR/union-fields-2.rs:11:13 | LL | let u = U {}; | ^ error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:9:13 + --> $DIR/union-fields-2.rs:13:13 | LL | let u = U { a: 0, b: 1 }; | ^ error[E0560]: union `U` has no field named `c` - --> $DIR/union-fields-2.rs:10:29 + --> $DIR/union-fields-2.rs:14:29 | LL | let u = U { a: 0, b: 1, c: 2 }; | ^ `U` does not have this field @@ -19,61 +19,61 @@ LL | let u = U { a: 0, b: 1, c: 2 }; = note: all struct fields are already assigned error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:10:13 + --> $DIR/union-fields-2.rs:14:13 | LL | let u = U { a: 0, b: 1, c: 2 }; | ^ error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:12:13 + --> $DIR/union-fields-2.rs:16:13 | LL | let u = U { ..u }; | ^ error[E0436]: functional record update syntax requires a struct - --> $DIR/union-fields-2.rs:12:19 + --> $DIR/union-fields-2.rs:16:19 | LL | let u = U { ..u }; | ^ error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:15:9 + --> $DIR/union-fields-2.rs:19:9 | LL | let U {} = u; | ^^^^ error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:17:9 + --> $DIR/union-fields-2.rs:21:9 | LL | let U { a, b } = u; | ^^^^^^^^^^ error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:18:9 + --> $DIR/union-fields-2.rs:22:9 | LL | let U { a, b, c } = u; | ^^^^^^^^^^^^^ error[E0026]: union `U` does not have a field named `c` - --> $DIR/union-fields-2.rs:18:19 + --> $DIR/union-fields-2.rs:22:19 | LL | let U { a, b, c } = u; | ^ union `U` does not have this field error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:20:9 + --> $DIR/union-fields-2.rs:24:9 | LL | let U { .. } = u; | ^^^^^^^^ error: `..` cannot be used in union patterns - --> $DIR/union-fields-2.rs:20:9 + --> $DIR/union-fields-2.rs:24:9 | LL | let U { .. } = u; | ^^^^^^^^ error: `..` cannot be used in union patterns - --> $DIR/union-fields-2.rs:22:9 + --> $DIR/union-fields-2.rs:26:9 | LL | let U { a, .. } = u; | ^^^^^^^^^^^ diff --git a/tests/ui/union/union-inherent-method.rs b/tests/ui/union/union-inherent-method.rs index a3f962fb87211..86a62ff18cd3d 100644 --- a/tests/ui/union/union-inherent-method.rs +++ b/tests/ui/union/union-inherent-method.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: items.impl.inherent.associated-items.allowed-items union U { a: u8, diff --git a/tests/ui/union/union-manuallydrop-rpass.rs b/tests/ui/union/union-manuallydrop-rpass.rs index c1be39c20e613..f69fc2d36fe1e 100644 --- a/tests/ui/union/union-manuallydrop-rpass.rs +++ b/tests/ui/union/union-manuallydrop-rpass.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ reference: items.union.field-copy +//@ reference: items.union.field-manually-drop #![allow(dead_code)] use std::mem::needs_drop; diff --git a/tests/ui/union/union-overwrite.rs b/tests/ui/union/union-overwrite.rs index cd9a370ff6663..5cb6152ced33a 100644 --- a/tests/ui/union/union-overwrite.rs +++ b/tests/ui/union/union-overwrite.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ reference: items.union.common-storage +//@ reference: items.union.fields.read #[repr(C)] #[derive(Copy, Clone)] diff --git a/tests/ui/union/union-packed.rs b/tests/ui/union/union-packed.rs index b1ab211eae829..790c82364060f 100644 --- a/tests/ui/union/union-packed.rs +++ b/tests/ui/union/union-packed.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: layout.repr.alignment.intro #![allow(dead_code)] #![allow(non_snake_case)] diff --git a/tests/ui/union/union-pat-in-param.rs b/tests/ui/union/union-pat-in-param.rs index 8454bfb20dcb8..6a65a5c060006 100644 --- a/tests/ui/union/union-pat-in-param.rs +++ b/tests/ui/union/union-pat-in-param.rs @@ -1,3 +1,4 @@ +//@ reference: items.union.pattern.safety union U { a: &'static i32, b: usize, diff --git a/tests/ui/union/union-pat-in-param.stderr b/tests/ui/union/union-pat-in-param.stderr index b9709b7cc9bf1..b1eb70f79bcaf 100644 --- a/tests/ui/union/union-pat-in-param.stderr +++ b/tests/ui/union/union-pat-in-param.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-pat-in-param.rs:6:12 + --> $DIR/union-pat-in-param.rs:7:12 | LL | fn fun(U { a }: U) { | ^ access to union field @@ -7,7 +7,7 @@ LL | fn fun(U { a }: U) { = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-pat-in-param.rs:14:24 + --> $DIR/union-pat-in-param.rs:15:24 | LL | let closure = |U { a }| { | ^ access to union field diff --git a/tests/ui/union/union-pat-refutability.rs b/tests/ui/union/union-pat-refutability.rs index 826bd42cd2113..3f4c06f1e03e5 100644 --- a/tests/ui/union/union-pat-refutability.rs +++ b/tests/ui/union/union-pat-refutability.rs @@ -1,4 +1,7 @@ //@ run-pass +//@ reference: items.union.pattern.intro +//@ reference: items.union.pattern.safety +//@ reference: patterns.struct.refutable #![allow(dead_code)] diff --git a/tests/ui/union/union-trait-impl.rs b/tests/ui/union/union-trait-impl.rs index d48ae18dd0e5e..238189ea82a81 100644 --- a/tests/ui/union/union-trait-impl.rs +++ b/tests/ui/union/union-trait-impl.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: items.union.ref.use use std::fmt; diff --git a/tests/ui/union/union-transmute.rs b/tests/ui/union/union-transmute.rs index 72ac4a85d593b..879ee7a23dbd8 100644 --- a/tests/ui/union/union-transmute.rs +++ b/tests/ui/union/union-transmute.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ reference: items.union.common-storage +//@ reference: type.union.access union U { a: (u8, u8), diff --git a/tests/ui/union/union-unsafe.rs b/tests/ui/union/union-unsafe.rs index beb074f4e8ebc..62d307927cccd 100644 --- a/tests/ui/union/union-unsafe.rs +++ b/tests/ui/union/union-unsafe.rs @@ -1,3 +1,8 @@ +//@ reference: items.union.fields.read-safety +//@ reference: items.union.fields.write-safety +//@ reference: items.union.pattern.safety +//@ reference: safety.unsafe-union-access +//@ reference: type.union.safety use std::cell::RefCell; use std::mem::ManuallyDrop; use std::ops::Deref; diff --git a/tests/ui/union/union-unsafe.stderr b/tests/ui/union/union-unsafe.stderr index 01f4d95eb649d..36543085ba82c 100644 --- a/tests/ui/union/union-unsafe.stderr +++ b/tests/ui/union/union-unsafe.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:36:6 + --> $DIR/union-unsafe.rs:41:6 | LL | *(u.p) = 13; | ^^^^^ access to union field @@ -7,7 +7,7 @@ LL | *(u.p) = 13; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:50:26 + --> $DIR/union-unsafe.rs:55:26 | LL | let _p = &raw const *(u.p); | ^^^^^ access to union field @@ -15,7 +15,7 @@ LL | let _p = &raw const *(u.p); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:62:6 + --> $DIR/union-unsafe.rs:67:6 | LL | *u3.a = T::default(); | ^^^^ access to union field @@ -23,7 +23,7 @@ LL | *u3.a = T::default(); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:68:6 + --> $DIR/union-unsafe.rs:73:6 | LL | *u3.a = T::default(); | ^^^^ access to union field @@ -31,7 +31,7 @@ LL | *u3.a = T::default(); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:76:13 + --> $DIR/union-unsafe.rs:81:13 | LL | let a = u1.a; | ^^^^ access to union field @@ -39,7 +39,7 @@ LL | let a = u1.a; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:91:29 + --> $DIR/union-unsafe.rs:96:29 | LL | let _a = &raw const vec[u4.a]; | ^^^^ access to union field @@ -47,7 +47,7 @@ LL | let _a = &raw const vec[u4.a]; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:93:14 + --> $DIR/union-unsafe.rs:98:14 | LL | let U1 { a } = u1; | ^ access to union field @@ -55,7 +55,7 @@ LL | let U1 { a } = u1; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:94:20 + --> $DIR/union-unsafe.rs:99:20 | LL | if let U1 { a: 12 } = u1 {} | ^^ access to union field @@ -63,7 +63,7 @@ LL | if let U1 { a: 12 } = u1 {} = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:95:25 + --> $DIR/union-unsafe.rs:100:25 | LL | if let Some(U1 { a: 13 }) = Some(u1) {} | ^^ access to union field @@ -71,7 +71,7 @@ LL | if let Some(U1 { a: 13 }) = Some(u1) {} = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:100:6 + --> $DIR/union-unsafe.rs:105:6 | LL | *u2.a = String::from("new"); | ^^^^ access to union field @@ -79,7 +79,7 @@ LL | *u2.a = String::from("new"); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:104:6 + --> $DIR/union-unsafe.rs:109:6 | LL | *u3.a = 1; | ^^^^ access to union field @@ -87,7 +87,7 @@ LL | *u3.a = 1; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:108:6 + --> $DIR/union-unsafe.rs:113:6 | LL | *u3.a = String::from("new"); | ^^^^ access to union field @@ -95,7 +95,7 @@ LL | *u3.a = String::from("new"); = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:117:28 + --> $DIR/union-unsafe.rs:122:28 | LL | let _p = &raw const (**a.b).c; | ^^^ access to union field @@ -103,7 +103,7 @@ LL | let _p = &raw const (**a.b).c; = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:148:27 + --> $DIR/union-unsafe.rs:153:27 | LL | let _p = &raw const (*a.b).c; | ^^^ access to union field diff --git a/tests/ui/union/union-with-drop-fields.rs b/tests/ui/union/union-with-drop-fields.rs index ae147e9bd2b5d..949b478f2ecb4 100644 --- a/tests/ui/union/union-with-drop-fields.rs +++ b/tests/ui/union/union-with-drop-fields.rs @@ -1,3 +1,4 @@ +//@ reference: items.union.field-restrictions #![allow(dead_code)] union U { diff --git a/tests/ui/union/union-with-drop-fields.stderr b/tests/ui/union/union-with-drop-fields.stderr index 6328be565408e..290fcec201ca2 100644 --- a/tests/ui/union/union-with-drop-fields.stderr +++ b/tests/ui/union/union-with-drop-fields.stderr @@ -1,5 +1,5 @@ error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:8:5 + --> $DIR/union-with-drop-fields.rs:9:5 | LL | a: String, | ^^^^^^^^^ @@ -11,7 +11,7 @@ LL | a: std::mem::ManuallyDrop, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:16:5 + --> $DIR/union-with-drop-fields.rs:17:5 | LL | a: S, | ^^^^ @@ -23,7 +23,7 @@ LL | a: std::mem::ManuallyDrop, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:21:5 + --> $DIR/union-with-drop-fields.rs:22:5 | LL | a: T, | ^^^^ diff --git a/tests/ui/union/union_destructure.rs b/tests/ui/union/union_destructure.rs index e7095926eb164..9c445c9986296 100644 --- a/tests/ui/union/union_destructure.rs +++ b/tests/ui/union/union_destructure.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ reference: items.union.pattern.safety #![allow(unreachable_patterns)] #[derive(Copy, Clone)]