diff options
| author | bors <bors@rust-lang.org> | 2025-06-16 00:39:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-16 00:39:47 +0000 |
| commit | e314b97ee54091b6bcf33db4770c93d82fded8bc (patch) | |
| tree | 217c635e957d5248d5c59abcd9bb481454ae3e53 /tests | |
| parent | f768dc01da9a681716724418ccf64ce55bd396c5 (diff) | |
| parent | 07048643ddcb2245ba6251fc65403f308e6c38c4 (diff) | |
| download | rust-e314b97ee54091b6bcf33db4770c93d82fded8bc.tar.gz rust-e314b97ee54091b6bcf33db4770c93d82fded8bc.zip | |
Auto merge of #142550 - fmease:rollup-fteyzcv, r=fmease
Rollup of 10 pull requests Successful merges: - rust-lang/rust#133952 (Remove wasm legacy abi) - rust-lang/rust#134661 (Reduce precedence of expressions that have an outer attr) - rust-lang/rust#141769 (Move metadata object generation for dylibs to the linker code ) - rust-lang/rust#141937 (Report never type lints in dependencies) - rust-lang/rust#142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future) - rust-lang/rust#142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`) - rust-lang/rust#142470 (Add some missing mailmap entries) - rust-lang/rust#142481 (Add `f16` inline asm support for LoongArch) - rust-lang/rust#142499 (Remove check run bootstrap) - rust-lang/rust#142543 (Suggest adding semicolon in user code rather than macro impl details) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
36 files changed, 2358 insertions, 192 deletions
diff --git a/tests/assembly/asm/loongarch-type.rs b/tests/assembly/asm/loongarch-type.rs index 86d9e03bc93..c782be19f1d 100644 --- a/tests/assembly/asm/loongarch-type.rs +++ b/tests/assembly/asm/loongarch-type.rs @@ -4,7 +4,7 @@ //@ compile-flags: -Zmerge-functions=disabled //@ needs-llvm-components: loongarch -#![feature(no_core)] +#![feature(no_core, f16)] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] @@ -69,6 +69,12 @@ check!(reg_i8, i8, reg, "move"); // CHECK: #NO_APP check!(reg_i16, i16, reg, "move"); +// CHECK-LABEL: reg_f16: +// CHECK: #APP +// CHECK: move ${{[a-z0-9]+}}, ${{[a-z0-9]+}} +// CHECK: #NO_APP +check!(reg_f16, f16, reg, "move"); + // CHECK-LABEL: reg_i32: // CHECK: #APP // CHECK: move ${{[a-z0-9]+}}, ${{[a-z0-9]+}} @@ -99,6 +105,12 @@ check!(reg_f64, f64, reg, "move"); // CHECK: #NO_APP check!(reg_ptr, ptr, reg, "move"); +// CHECK-LABEL: freg_f16: +// CHECK: #APP +// CHECK: fmov.s $f{{[a-z0-9]+}}, $f{{[a-z0-9]+}} +// CHECK: #NO_APP +check!(freg_f16, f16, freg, "fmov.s"); + // CHECK-LABEL: freg_f32: // CHECK: #APP // CHECK: fmov.s $f{{[a-z0-9]+}}, $f{{[a-z0-9]+}} @@ -123,6 +135,12 @@ check_reg!(r4_i8, i8, "$r4", "move"); // CHECK: #NO_APP check_reg!(r4_i16, i16, "$r4", "move"); +// CHECK-LABEL: r4_f16: +// CHECK: #APP +// CHECK: move $a0, $a0 +// CHECK: #NO_APP +check_reg!(r4_f16, f16, "$r4", "move"); + // CHECK-LABEL: r4_i32: // CHECK: #APP // CHECK: move $a0, $a0 @@ -153,6 +171,12 @@ check_reg!(r4_f64, f64, "$r4", "move"); // CHECK: #NO_APP check_reg!(r4_ptr, ptr, "$r4", "move"); +// CHECK-LABEL: f0_f16: +// CHECK: #APP +// CHECK: fmov.s $f{{[a-z0-9]+}}, $f{{[a-z0-9]+}} +// CHECK: #NO_APP +check_reg!(f0_f16, f16, "$f0", "fmov.s"); + // CHECK-LABEL: f0_f32: // CHECK: #APP // CHECK: fmov.s $f{{[a-z0-9]+}}, $f{{[a-z0-9]+}} diff --git a/tests/assembly/pic-relocation-model.rs b/tests/assembly/pic-relocation-model.rs index d35cd968389..15a8723f756 100644 --- a/tests/assembly/pic-relocation-model.rs +++ b/tests/assembly/pic-relocation-model.rs @@ -19,7 +19,7 @@ pub fn call_other_fn() -> u8 { } // CHECK-LABEL: other_fn: -// CHECK: callq *foreign_fn@GOTPCREL(%rip) +// CHECK: {{(jmpq|callq)}} *foreign_fn@GOTPCREL(%rip) #[no_mangle] #[inline(never)] pub fn other_fn() -> u8 { diff --git a/tests/assembly/pie-relocation-model.rs b/tests/assembly/pie-relocation-model.rs index 5c74b34eb31..cbe0001041e 100644 --- a/tests/assembly/pie-relocation-model.rs +++ b/tests/assembly/pie-relocation-model.rs @@ -22,7 +22,7 @@ pub fn call_other_fn() -> u8 { // CHECK-LABEL: other_fn: // External functions are still called through GOT, since we don't know if the symbol // is defined in the binary or in the shared library. -// CHECK: callq *foreign_fn@GOTPCREL(%rip) +// CHECK: {{(jmpq|callq)}} *foreign_fn@GOTPCREL(%rip) #[no_mangle] #[inline(never)] pub fn other_fn() -> u8 { diff --git a/tests/codegen/pie-relocation-model.rs b/tests/codegen/pie-relocation-model.rs index b10af693452..cb8de91ccd7 100644 --- a/tests/codegen/pie-relocation-model.rs +++ b/tests/codegen/pie-relocation-model.rs @@ -13,7 +13,7 @@ pub fn call_foreign_fn() -> u8 { // External functions are still marked as non-dso_local, since we don't know if the symbol // is defined in the binary or in the shared library. -// CHECK: declare zeroext i8 @foreign_fn() +// CHECK: declare i8 @foreign_fn() extern "C" { fn foreign_fn() -> u8; } diff --git a/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir new file mode 100644 index 00000000000..347e4119cd0 --- /dev/null +++ b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir @@ -0,0 +1,100 @@ +// MIR for `a::{closure#0}` 0 coroutine_drop_async + +fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) -> Poll<()> { + debug _task_context => _19; + debug x => ((*(_1.0: &mut {async fn body of a<T>()})).0: T); + let mut _0: std::task::Poll<()>; + let _3: T; + let mut _4: impl std::future::Future<Output = ()>; + let mut _5: &mut T; + let mut _6: std::pin::Pin<&mut T>; + let mut _7: &mut T; + let mut _8: *mut T; + let mut _9: (); + let mut _10: std::task::Poll<()>; + let mut _11: &mut std::task::Context<'_>; + let mut _12: &mut impl std::future::Future<Output = ()>; + let mut _13: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; + let mut _14: isize; + let mut _15: &mut std::task::Context<'_>; + let mut _16: &mut impl std::future::Future<Output = ()>; + let mut _17: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; + let mut _18: isize; + let mut _19: &mut std::task::Context<'_>; + let mut _20: u32; + scope 1 { + debug x => (((*(_1.0: &mut {async fn body of a<T>()})) as variant#4).0: T); + } + + bb0: { + _20 = discriminant((*(_1.0: &mut {async fn body of a<T>()}))); + switchInt(move _20) -> [0: bb9, 3: bb12, 4: bb13, otherwise: bb14]; + } + + bb1: { + nop; + nop; + goto -> bb2; + } + + bb2: { + _0 = Poll::<()>::Ready(const ()); + return; + } + + bb3: { + _0 = Poll::<()>::Pending; + discriminant((*(_1.0: &mut {async fn body of a<T>()}))) = 4; + return; + } + + bb4: { + StorageLive(_17); + _16 = &mut (((*(_1.0: &mut {async fn body of a<T>()})) as variant#4).1: impl std::future::Future<Output = ()>); + _17 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _16) -> [return: bb7, unwind unreachable]; + } + + bb5: { + unreachable; + } + + bb6: { + StorageDead(_17); + _18 = discriminant(_10); + switchInt(move _18) -> [0: bb1, 1: bb3, otherwise: bb5]; + } + + bb7: { + _10 = <impl Future<Output = ()> as Future>::poll(move _17, move _15) -> [return: bb6, unwind unreachable]; + } + + bb8: { + _0 = Poll::<()>::Ready(const ()); + return; + } + + bb9: { + goto -> bb11; + } + + bb10: { + goto -> bb8; + } + + bb11: { + drop(((*(_1.0: &mut {async fn body of a<T>()})).0: T)) -> [return: bb10, unwind unreachable]; + } + + bb12: { + goto -> bb4; + } + + bb13: { + goto -> bb4; + } + + bb14: { + _0 = Poll::<()>::Ready(const ()); + return; + } +} diff --git a/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir new file mode 100644 index 00000000000..b1cf5373f91 --- /dev/null +++ b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir @@ -0,0 +1,123 @@ +// MIR for `a::{closure#0}` 0 coroutine_drop_async + +fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) -> Poll<()> { + debug _task_context => _19; + debug x => ((*(_1.0: &mut {async fn body of a<T>()})).0: T); + let mut _0: std::task::Poll<()>; + let _3: T; + let mut _4: impl std::future::Future<Output = ()>; + let mut _5: &mut T; + let mut _6: std::pin::Pin<&mut T>; + let mut _7: &mut T; + let mut _8: *mut T; + let mut _9: (); + let mut _10: std::task::Poll<()>; + let mut _11: &mut std::task::Context<'_>; + let mut _12: &mut impl std::future::Future<Output = ()>; + let mut _13: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; + let mut _14: isize; + let mut _15: &mut std::task::Context<'_>; + let mut _16: &mut impl std::future::Future<Output = ()>; + let mut _17: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; + let mut _18: isize; + let mut _19: &mut std::task::Context<'_>; + let mut _20: u32; + scope 1 { + debug x => (((*(_1.0: &mut {async fn body of a<T>()})) as variant#4).0: T); + } + + bb0: { + _20 = discriminant((*(_1.0: &mut {async fn body of a<T>()}))); + switchInt(move _20) -> [0: bb12, 2: bb18, 3: bb16, 4: bb17, otherwise: bb19]; + } + + bb1: { + nop; + nop; + goto -> bb2; + } + + bb2: { + _0 = Poll::<()>::Ready(const ()); + return; + } + + bb3 (cleanup): { + nop; + nop; + goto -> bb5; + } + + bb4 (cleanup): { + goto -> bb15; + } + + bb5 (cleanup): { + goto -> bb4; + } + + bb6: { + _0 = Poll::<()>::Pending; + discriminant((*(_1.0: &mut {async fn body of a<T>()}))) = 4; + return; + } + + bb7: { + StorageLive(_17); + _16 = &mut (((*(_1.0: &mut {async fn body of a<T>()})) as variant#4).1: impl std::future::Future<Output = ()>); + _17 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _16) -> [return: bb10, unwind: bb15]; + } + + bb8: { + unreachable; + } + + bb9: { + StorageDead(_17); + _18 = discriminant(_10); + switchInt(move _18) -> [0: bb1, 1: bb6, otherwise: bb8]; + } + + bb10: { + _10 = <impl Future<Output = ()> as Future>::poll(move _17, move _15) -> [return: bb9, unwind: bb3]; + } + + bb11: { + _0 = Poll::<()>::Ready(const ()); + return; + } + + bb12: { + goto -> bb14; + } + + bb13: { + goto -> bb11; + } + + bb14: { + drop(((*(_1.0: &mut {async fn body of a<T>()})).0: T)) -> [return: bb13, unwind: bb4]; + } + + bb15 (cleanup): { + discriminant((*(_1.0: &mut {async fn body of a<T>()}))) = 2; + resume; + } + + bb16: { + goto -> bb7; + } + + bb17: { + goto -> bb7; + } + + bb18: { + assert(const false, "`async fn` resumed after panicking") -> [success: bb18, unwind continue]; + } + + bb19: { + _0 = Poll::<()>::Ready(const ()); + return; + } +} diff --git a/tests/mir-opt/async_drop_live_dead.rs b/tests/mir-opt/async_drop_live_dead.rs new file mode 100644 index 00000000000..348866bbb8c --- /dev/null +++ b/tests/mir-opt/async_drop_live_dead.rs @@ -0,0 +1,11 @@ +//@ edition:2024 +// skip-filecheck +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY + +#![feature(async_drop)] +#![allow(incomplete_features)] + +// EMIT_MIR async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.mir +async fn a<T>(x: T) {} + +fn main() {} diff --git a/tests/ui-fulldeps/auxiliary/parser.rs b/tests/ui-fulldeps/auxiliary/parser.rs index be51bd29008..8a370512460 100644 --- a/tests/ui-fulldeps/auxiliary/parser.rs +++ b/tests/ui-fulldeps/auxiliary/parser.rs @@ -7,15 +7,17 @@ extern crate rustc_parse; extern crate rustc_session; extern crate rustc_span; -use rustc_ast::ast::{DUMMY_NODE_ID, Expr}; -use rustc_ast::mut_visit::MutVisitor; +use rustc_ast::ast::{AttrKind, Attribute, DUMMY_NODE_ID, Expr}; +use rustc_ast::mut_visit::{self, MutVisitor}; use rustc_ast::node_id::NodeId; use rustc_ast::ptr::P; -use rustc_ast::token; +use rustc_ast::token::{self, Token}; +use rustc_ast::tokenstream::{AttrTokenStream, AttrTokenTree, LazyAttrTokenStream}; use rustc_errors::Diag; use rustc_parse::parser::Recovery; use rustc_session::parse::ParseSess; -use rustc_span::{DUMMY_SP, FileName, Span}; +use rustc_span::{AttrId, DUMMY_SP, FileName, Span}; +use std::sync::Arc; pub fn parse_expr(psess: &ParseSess, source_code: &str) -> Option<P<Expr>> { let parser = rustc_parse::unwrap_or_emit_fatal(rustc_parse::new_parser_from_source_str( @@ -46,4 +48,36 @@ impl MutVisitor for Normalize { fn visit_span(&mut self, span: &mut Span) { *span = DUMMY_SP; } + + fn visit_attribute(&mut self, attr: &mut Attribute) { + attr.id = AttrId::from_u32(0); + if let AttrKind::Normal(normal_attr) = &mut attr.kind { + if let Some(tokens) = &mut normal_attr.tokens { + let mut stream = tokens.to_attr_token_stream(); + normalize_attr_token_stream(&mut stream); + *tokens = LazyAttrTokenStream::new_direct(stream); + } + } + mut_visit::walk_attribute(self, attr); + } +} + +fn normalize_attr_token_stream(stream: &mut AttrTokenStream) { + Arc::make_mut(&mut stream.0) + .iter_mut() + .for_each(normalize_attr_token_tree); +} + +fn normalize_attr_token_tree(token: &mut AttrTokenTree) { + match token { + AttrTokenTree::Token(token, _spacing) => { + Normalize.visit_span(&mut token.span); + } + AttrTokenTree::Delimited(dspan, _spacing, _delim, stream) => { + normalize_attr_token_stream(stream); + Normalize.visit_span(&mut dspan.open); + Normalize.visit_span(&mut dspan.close); + } + AttrTokenTree::AttrsTarget(_) => unimplemented!("AttrTokenTree::AttrsTarget"), + } } diff --git a/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs b/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs index 656cfca1ed1..8449479287f 100644 --- a/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs +++ b/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs @@ -33,17 +33,10 @@ impl CodegenBackend for TheBackend { "" } - fn codegen_crate<'a, 'tcx>( - &self, - tcx: TyCtxt<'tcx>, - metadata: EncodedMetadata, - _need_metadata_module: bool, - ) -> Box<dyn Any> { + fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box<dyn Any> { Box::new(CodegenResults { modules: vec![], allocator_module: None, - metadata_module: None, - metadata, crate_info: CrateInfo::new(tcx, "fake_target_cpu".to_string()), }) } @@ -60,7 +53,13 @@ impl CodegenBackend for TheBackend { (*codegen_results, FxIndexMap::default()) } - fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) { + fn link( + &self, + sess: &Session, + codegen_results: CodegenResults, + _metadata: EncodedMetadata, + outputs: &OutputFilenames, + ) { use std::io::Write; use rustc_session::config::{CrateType, OutFileName}; diff --git a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs index 36916e97856..08bed40abe8 100644 --- a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs +++ b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs @@ -88,6 +88,11 @@ static EXPRS: &[&str] = &[ // expressions. "match 2 { _ => 1 - 1 }", "match 2 { _ => ({ 1 }) - 1 }", + // Expressions with an outer attr have lower precedence than expressions + // with an inner attr. + "#[attr] loop {}.field", + "(#[attr] loop {}).field", + "loop { #![attr] }.field", // Grammar restriction: break value starting with a labeled loop is not // allowed, except if the break is also labeled. "break 'outer 'inner: loop {} + 2", diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr new file mode 100644 index 00000000000..02015d2a2e5 --- /dev/null +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr @@ -0,0 +1,536 @@ +error: fn_abi_of(i8) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: i8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + true, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776123356184577, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: i8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + true, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776123356184577, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:13:1 + | +LL | pub extern "sysv64" fn i8(x: i8) -> i8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(u8) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776127651151873, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: u8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776127651151873, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:19:1 + | +LL | pub extern "sysv64" fn u8(x: u8) -> u8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(i16) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: i16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + true, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462603027808258, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: i16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + true, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462603027808258, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:25:1 + | +LL | pub extern "sysv64" fn i16(x: i16) -> i16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(u16) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + false, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462607322775554, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: u16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + false, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462607322775554, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:31:1 + | +LL | pub extern "sysv64" fn u16(x: u16) -> u16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(i32) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: i32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462603027873795, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: i32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462603027873795, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:37:1 + | +LL | pub extern "sysv64" fn i32(x: i32) -> i32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(u32) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462607322841091, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: u32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462607322841091, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:43:1 + | +LL | pub extern "sysv64" fn u32(x: u32) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr new file mode 100644 index 00000000000..9bb2ab45d98 --- /dev/null +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr @@ -0,0 +1,536 @@ +error: fn_abi_of(i8) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: i8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + true, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776123356184577, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: i8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + true, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776123356184577, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:13:1 + | +LL | pub extern "sysv64" fn i8(x: i8) -> i8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(u8) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776127651151873, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: u8, + layout: Layout { + size: Size(1 bytes), + align: AbiAlign { + abi: Align(1 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), + randomization_seed: 71776127651151873, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:19:1 + | +LL | pub extern "sysv64" fn u8(x: u8) -> u8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(i16) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: i16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + true, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462603027808258, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: i16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + true, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462603027808258, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:25:1 + | +LL | pub extern "sysv64" fn i16(x: i16) -> i16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(u16) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + false, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462607322775554, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: u16, + layout: Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + false, + ), + valid_range: 0..=65535, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 18446462607322775554, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:31:1 + | +LL | pub extern "sysv64" fn u16(x: u16) -> u16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(i32) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: i32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462603027873795, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: i32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462603027873795, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:37:1 + | +LL | pub extern "sysv64" fn i32(x: i32) -> i32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: fn_abi_of(u32) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462607322841091, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: u32, + layout: Layout { + size: Size(4 bytes), + align: AbiAlign { + abi: Align(4 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: 0..=4294967295, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), + randomization_seed: 18446462607322841091, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: None, + }, + ), + }, + c_variadic: false, + fixed_count: 1, + conv: X86( + SysV64, + ), + can_unwind: false, + } + --> $DIR/x86-64-sysv64-arg-ext.rs:43:1 + | +LL | pub extern "sysv64" fn u32(x: u32) -> u32 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.rs b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.rs new file mode 100644 index 00000000000..29a3061cfd0 --- /dev/null +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.rs @@ -0,0 +1,46 @@ +//@ only-x86_64 +//@ revisions: apple other +//@[apple] only-apple +//@[other] ignore-apple + +// Apple targets extend up to 32 bits for both arguments and returns, other targets only extend +// arguments. + +#![crate_type = "lib"] +#![feature(rustc_attrs)] + +#[rustc_abi(debug)] +pub extern "sysv64" fn i8(x: i8) -> i8 { + //~^ ERROR fn_abi_of(i8) + x +} + +#[rustc_abi(debug)] +pub extern "sysv64" fn u8(x: u8) -> u8 { + //~^ ERROR fn_abi_of(u8) + x +} + +#[rustc_abi(debug)] +pub extern "sysv64" fn i16(x: i16) -> i16 { + //~^ ERROR fn_abi_of(i16) + x +} + +#[rustc_abi(debug)] +pub extern "sysv64" fn u16(x: u16) -> u16 { + //~^ ERROR fn_abi_of(u16) + x +} + +#[rustc_abi(debug)] +pub extern "sysv64" fn i32(x: i32) -> i32 { + //~^ ERROR fn_abi_of(i32) + x +} + +#[rustc_abi(debug)] +pub extern "sysv64" fn u32(x: u32) -> u32 { + //~^ ERROR fn_abi_of(u32) + x +} diff --git a/tests/ui/async-await/async-drop/async-drop-initial.rs b/tests/ui/async-await/async-drop/async-drop-initial.rs index 263b70699f5..cd33c143fba 100644 --- a/tests/ui/async-await/async-drop/async-drop-initial.rs +++ b/tests/ui/async-await/async-drop/async-drop-initial.rs @@ -62,7 +62,7 @@ fn main() { test_async_drop(&j, 16).await; test_async_drop( AsyncStruct { b: AsyncInt(8), a: AsyncInt(7), i: 6 }, - if cfg!(panic = "unwind") { 168 } else { 136 }, + 136, ).await; test_async_drop(ManuallyDrop::new(AsyncInt(9)), 16).await; diff --git a/tests/crashes/140429.rs b/tests/ui/async-await/async-drop/live-dead-storage.rs index 041eaf86c5c..e6f25d351c3 100644 --- a/tests/crashes/140429.rs +++ b/tests/ui/async-await/async-drop/live-dead-storage.rs @@ -1,6 +1,9 @@ -//@ known-bug: #140429 +// ex-ice: #140429 //@ compile-flags: -Zlint-mir --crate-type lib //@ edition:2024 +//@ check-pass #![feature(async_drop)] +#![allow(incomplete_features)] + async fn a<T>(x: T) {} diff --git a/tests/crashes/140531.rs b/tests/ui/async-await/async-drop/live-dead-storage2.rs index f664481d440..18df870785e 100644 --- a/tests/crashes/140531.rs +++ b/tests/ui/async-await/async-drop/live-dead-storage2.rs @@ -1,7 +1,11 @@ -//@ known-bug: #140531 -//@compile-flags: -Zlint-mir --crate-type lib +// ex-ice: #140531 +//@ compile-flags: -Zlint-mir --crate-type lib //@ edition:2024 +//@ check-pass + #![feature(async_drop)] +#![allow(incomplete_features)] + async fn call_once(f: impl AsyncFnOnce()) { let fut = Box::pin(f()); } diff --git a/tests/ui/async-await/async-drop/live-dead-storage3.rs b/tests/ui/async-await/async-drop/live-dead-storage3.rs new file mode 100644 index 00000000000..d9fba5759f7 --- /dev/null +++ b/tests/ui/async-await/async-drop/live-dead-storage3.rs @@ -0,0 +1,56 @@ +// ex-ice: #141761 +//@ compile-flags: -Zlint-mir --crate-type lib +//@ edition:2024 +//@ check-pass + +#![feature(async_drop)] +#![allow(incomplete_features)] + +type BoxFuture<T> = std::pin::Pin<Box<dyn Future<Output = T>>>; +fn main() {} +async fn f() { + run("").await +} +struct InMemoryStorage; +struct User<'dep> { + dep: &'dep str, +} +impl<'a> StorageRequest<InMemoryStorage> for SaveUser<'a> { + fn execute(&self) -> BoxFuture<Result<(), String>> { + todo!() + } +} +trait Storage { + type Error; +} +impl Storage for InMemoryStorage { + type Error = String; +} +trait StorageRequestReturnType { + type Output; +} +trait StorageRequest<S: Storage>: StorageRequestReturnType { + fn execute(&self) -> BoxFuture<Result<<Self>::Output, S::Error>>; +} +struct SaveUser<'a> { + name: &'a str, +} +impl<'a> StorageRequestReturnType for SaveUser<'a> { + type Output = (); +} +impl<'dep> User<'dep> { + async fn save<S>(self) + where + S: Storage, + for<'a> SaveUser<'a>: StorageRequest<S>, + { + SaveUser { name: "" }.execute().await; + } +} +async fn run<S>(dep: &str) +where + S: Storage, + for<'a> SaveUser<'a>: StorageRequest<S>, +{ + User { dep }.save().await +} diff --git a/tests/ui/async-await/async-drop/live-dead-storage4.rs b/tests/ui/async-await/async-drop/live-dead-storage4.rs new file mode 100644 index 00000000000..d927cb96674 --- /dev/null +++ b/tests/ui/async-await/async-drop/live-dead-storage4.rs @@ -0,0 +1,56 @@ +// ex-ice: #141409 +//@ compile-flags: -Zmir-enable-passes=+Inline -Zvalidate-mir -Zlint-mir --crate-type lib +//@ edition:2024 +//@ check-pass + +#![feature(async_drop)] +#![allow(incomplete_features)] +#![allow(non_snake_case)] + +use std::mem::ManuallyDrop; +use std::{ + future::{async_drop_in_place, Future}, + pin::{pin, Pin}, + sync::{mpsc, Arc}, + task::{Context, Poll, Wake, Waker}, +}; +fn main() { + block_on(bar(0)) +} +async fn baz(ident_base: usize) {} +async fn bar(ident_base: usize) { + baz(1).await +} +fn block_on<F>(fut_unpin: F) -> F::Output +where + F: Future, +{ + let fut_pin = pin!(ManuallyDrop::new(fut_unpin)); + let mut fut = unsafe { Pin::map_unchecked_mut(fut_pin, |x| &mut **x) }; + let (waker, rx) = simple_waker(); + let mut context = Context::from_waker(&waker); + let rv = loop { + match fut.as_mut().poll(&mut context) { + Poll::Ready(out) => break out, + PollPending => (), + } + }; + let drop_fut_unpin = unsafe { async_drop_in_place(fut.get_unchecked_mut()) }; + let drop_fut = pin!(drop_fut_unpin); + loop { + match drop_fut.poll(&mut context) { + Poll => break, + } + } + rv +} +fn simple_waker() -> (Waker, mpsc::Receiver<()>) { + struct SimpleWaker { + tx: mpsc::Sender<()>, + } + impl Wake for SimpleWaker { + fn wake(self: Arc<Self>) {} + } + let (tx, rx) = mpsc::channel(); + (Waker::from(Arc::new(SimpleWaker { tx })), rx) +} diff --git a/tests/ui/borrowck/span-semicolon-issue-139049.fixed b/tests/ui/borrowck/span-semicolon-issue-139049.fixed new file mode 100644 index 00000000000..0b263b22296 --- /dev/null +++ b/tests/ui/borrowck/span-semicolon-issue-139049.fixed @@ -0,0 +1,52 @@ +// Make sure the generated suggestion suggest editing the user +// code instead of the std macro implementation + +//@ run-rustfix + +#![allow(dead_code)] + +use std::fmt::{self, Display}; + +struct Mutex; + +impl Mutex { + fn lock(&self) -> MutexGuard<'_> { + MutexGuard(self) + } +} + +struct MutexGuard<'a>(&'a Mutex); + +impl<'a> Drop for MutexGuard<'a> { + fn drop(&mut self) {} +} + +struct Out; + +impl Out { + fn write_fmt(&self, _args: fmt::Arguments) {} +} + +impl<'a> Display for MutexGuard<'a> { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + Ok(()) + } +} + +fn main() { + let _write = { + let mutex = Mutex; + write!(Out, "{}", mutex.lock()); + //~^ ERROR `mutex` does not live long enough + //~| SUGGESTION ; + }; + + let _write = { + use std::io::Write as _; + + let mutex = Mutex; + let x = write!(std::io::stdout(), "{}", mutex.lock()); x + //~^ ERROR `mutex` does not live long enough + //~| SUGGESTION let x + }; +} diff --git a/tests/ui/borrowck/span-semicolon-issue-139049.rs b/tests/ui/borrowck/span-semicolon-issue-139049.rs new file mode 100644 index 00000000000..a92742ac94b --- /dev/null +++ b/tests/ui/borrowck/span-semicolon-issue-139049.rs @@ -0,0 +1,52 @@ +// Make sure the generated suggestion suggest editing the user +// code instead of the std macro implementation + +//@ run-rustfix + +#![allow(dead_code)] + +use std::fmt::{self, Display}; + +struct Mutex; + +impl Mutex { + fn lock(&self) -> MutexGuard<'_> { + MutexGuard(self) + } +} + +struct MutexGuard<'a>(&'a Mutex); + +impl<'a> Drop for MutexGuard<'a> { + fn drop(&mut self) {} +} + +struct Out; + +impl Out { + fn write_fmt(&self, _args: fmt::Arguments) {} +} + +impl<'a> Display for MutexGuard<'a> { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + Ok(()) + } +} + +fn main() { + let _write = { + let mutex = Mutex; + write!(Out, "{}", mutex.lock()) + //~^ ERROR `mutex` does not live long enough + //~| SUGGESTION ; + }; + + let _write = { + use std::io::Write as _; + + let mutex = Mutex; + write!(std::io::stdout(), "{}", mutex.lock()) + //~^ ERROR `mutex` does not live long enough + //~| SUGGESTION let x + }; +} diff --git a/tests/ui/borrowck/span-semicolon-issue-139049.stderr b/tests/ui/borrowck/span-semicolon-issue-139049.stderr new file mode 100644 index 00000000000..123bdf4bc67 --- /dev/null +++ b/tests/ui/borrowck/span-semicolon-issue-139049.stderr @@ -0,0 +1,47 @@ +error[E0597]: `mutex` does not live long enough + --> $DIR/span-semicolon-issue-139049.rs:39:27 + | +LL | let mutex = Mutex; + | ----- binding `mutex` declared here +LL | write!(Out, "{}", mutex.lock()) + | ^^^^^------- + | | + | borrowed value does not live long enough + | a temporary with access to the borrow is created here ... +... +LL | }; + | -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard` + | | + | `mutex` dropped here while still borrowed + | +help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped + | +LL | write!(Out, "{}", mutex.lock()); + | + + +error[E0597]: `mutex` does not live long enough + --> $DIR/span-semicolon-issue-139049.rs:48:41 + | +LL | let mutex = Mutex; + | ----- binding `mutex` declared here +LL | write!(std::io::stdout(), "{}", mutex.lock()) + | ^^^^^------- + | | + | borrowed value does not live long enough + | a temporary with access to the borrow is created here ... +... +LL | }; + | -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard` + | | + | `mutex` dropped here while still borrowed + | + = note: the temporary is part of an expression at the end of a block; + consider forcing this temporary to be dropped sooner, before the block's local variables are dropped +help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block + | +LL | let x = write!(std::io::stdout(), "{}", mutex.lock()); x + | +++++++ +++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/tests/ui/editions/never-type-fallback-breaking.e2021.stderr b/tests/ui/editions/never-type-fallback-breaking.e2021.stderr index 4ca17918827..6b84a64fffe 100644 --- a/tests/ui/editions/never-type-fallback-breaking.e2021.stderr +++ b/tests/ui/editions/never-type-fallback-breaking.e2021.stderr @@ -96,3 +96,108 @@ LL | takes_apit2(mk::<()>()?); warning: 5 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/never-type-fallback-breaking.rs:18:1 + | +LL | fn m() { + | ^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/never-type-fallback-breaking.rs:22:17 + | +LL | true => Default::default(), + | ^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let x: () = match true { + | ++++ + +Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/never-type-fallback-breaking.rs:30:1 + | +LL | fn q() -> Option<()> { + | ^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/never-type-fallback-breaking.rs:37:5 + | +LL | deserialize()?; + | ^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | deserialize::<()>()?; + | ++++++ + +Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/never-type-fallback-breaking.rs:47:1 + | +LL | fn meow() -> Result<(), ()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `(): From<!>` will fail + --> $DIR/never-type-fallback-breaking.rs:50:5 + | +LL | help(1)?; + | ^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | help::<(), _>(1)?; + | +++++++++ + +Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/never-type-fallback-breaking.rs:59:1 + | +LL | pub fn fallback_return() -> Result<(), ()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/never-type-fallback-breaking.rs:62:19 + | +LL | takes_apit(|| Default::default())?; + | ^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | takes_apit::<()>(|| Default::default())?; + | ++++++ + +Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/never-type-fallback-breaking.rs:73:1 + | +LL | fn fully_apit() -> Result<(), ()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/never-type-fallback-breaking.rs:76:17 + | +LL | takes_apit2(mk()?); + | ^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | takes_apit2(mk::<()>()?); + | ++++++ + diff --git a/tests/ui/lint/wasm_c_abi_transition.rs b/tests/ui/lint/wasm_c_abi_transition.rs deleted file mode 100644 index 411772ae890..00000000000 --- a/tests/ui/lint/wasm_c_abi_transition.rs +++ /dev/null @@ -1,57 +0,0 @@ -//@ compile-flags: --target wasm32-unknown-unknown -//@ needs-llvm-components: webassembly -//@ add-core-stubs -//@ build-fail - -#![feature(no_core, repr_simd)] -#![no_core] -#![crate_type = "lib"] -#![deny(wasm_c_abi)] - -extern crate minicore; -use minicore::*; - -pub extern "C" fn my_fun_trivial(_x: i32, _y: f32) {} - -#[repr(C)] -pub struct MyType(i32, i32); -pub extern "C" fn my_fun(_x: MyType) {} //~ERROR: wasm ABI transition -//~^WARN: previously accepted - -// This one is ABI-safe as it only wraps a single field, -// and the return type can be anything. -#[repr(C)] -pub struct MySafeType(i32); -pub extern "C" fn my_fun_safe(_x: MySafeType) -> MyType { loop {} } - -// This one not ABI-safe due to the alignment. -#[repr(C, align(16))] -pub struct MyAlignedType(i32); -pub extern "C" fn my_fun_aligned(_x: MyAlignedType) {} //~ERROR: wasm ABI transition -//~^WARN: previously accepted - -// Check call-site warning -extern "C" { - fn other_fun(x: MyType); -} - -pub fn call_other_fun(x: MyType) { - unsafe { other_fun(x) } //~ERROR: wasm ABI transition - //~^WARN: previously accepted -} - -// Zero-sized types are safe in both ABIs -#[repr(C)] -pub struct MyZstType; -#[allow(improper_ctypes_definitions)] -pub extern "C" fn zst_safe(_x: (), _y: MyZstType) {} - -// The old and new wasm ABI treats simd types like `v128` the same way, so no -// wasm_c_abi warning should be emitted. -#[repr(simd)] -#[allow(non_camel_case_types)] -pub struct v128([i32; 4]); -#[target_feature(enable = "simd128")] -pub extern "C" fn my_safe_simd(x: v128) -> v128 { x } -//~^ WARN `extern` fn uses type `v128`, which is not FFI-safe -//~| WARN `extern` fn uses type `v128`, which is not FFI-safe diff --git a/tests/ui/lint/wasm_c_abi_transition.stderr b/tests/ui/lint/wasm_c_abi_transition.stderr deleted file mode 100644 index b4526bf8d68..00000000000 --- a/tests/ui/lint/wasm_c_abi_transition.stderr +++ /dev/null @@ -1,114 +0,0 @@ -warning: `extern` fn uses type `v128`, which is not FFI-safe - --> $DIR/wasm_c_abi_transition.rs:55:35 - | -LL | pub extern "C" fn my_safe_simd(x: v128) -> v128 { x } - | ^^^^ not FFI-safe - | - = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct - = note: this struct has unspecified layout -note: the type is defined here - --> $DIR/wasm_c_abi_transition.rs:53:1 - | -LL | pub struct v128([i32; 4]); - | ^^^^^^^^^^^^^^^ - = note: `#[warn(improper_ctypes_definitions)]` on by default - -warning: `extern` fn uses type `v128`, which is not FFI-safe - --> $DIR/wasm_c_abi_transition.rs:55:44 - | -LL | pub extern "C" fn my_safe_simd(x: v128) -> v128 { x } - | ^^^^ not FFI-safe - | - = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct - = note: this struct has unspecified layout -note: the type is defined here - --> $DIR/wasm_c_abi_transition.rs:53:1 - | -LL | pub struct v128([i32; 4]); - | ^^^^^^^^^^^^^^^ - -error: this function definition involves an argument of type `MyType` which is affected by the wasm ABI transition - --> $DIR/wasm_c_abi_transition.rs:18:1 - | -LL | pub extern "C" fn my_fun(_x: MyType) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762> - = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target -note: the lint level is defined here - --> $DIR/wasm_c_abi_transition.rs:9:9 - | -LL | #![deny(wasm_c_abi)] - | ^^^^^^^^^^ - -error: this function definition involves an argument of type `MyAlignedType` which is affected by the wasm ABI transition - --> $DIR/wasm_c_abi_transition.rs:30:1 - | -LL | pub extern "C" fn my_fun_aligned(_x: MyAlignedType) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762> - = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target - -error: this function call involves an argument of type `MyType` which is affected by the wasm ABI transition - --> $DIR/wasm_c_abi_transition.rs:39:14 - | -LL | unsafe { other_fun(x) } - | ^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762> - = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target - -error: aborting due to 3 previous errors; 2 warnings emitted - -Future incompatibility report: Future breakage diagnostic: -error: this function definition involves an argument of type `MyType` which is affected by the wasm ABI transition - --> $DIR/wasm_c_abi_transition.rs:18:1 - | -LL | pub extern "C" fn my_fun(_x: MyType) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762> - = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target -note: the lint level is defined here - --> $DIR/wasm_c_abi_transition.rs:9:9 - | -LL | #![deny(wasm_c_abi)] - | ^^^^^^^^^^ - -Future breakage diagnostic: -error: this function definition involves an argument of type `MyAlignedType` which is affected by the wasm ABI transition - --> $DIR/wasm_c_abi_transition.rs:30:1 - | -LL | pub extern "C" fn my_fun_aligned(_x: MyAlignedType) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762> - = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target -note: the lint level is defined here - --> $DIR/wasm_c_abi_transition.rs:9:9 - | -LL | #![deny(wasm_c_abi)] - | ^^^^^^^^^^ - -Future breakage diagnostic: -error: this function call involves an argument of type `MyType` which is affected by the wasm ABI transition - --> $DIR/wasm_c_abi_transition.rs:39:14 - | -LL | unsafe { other_fun(x) } - | ^^^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762> - = help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target -note: the lint level is defined here - --> $DIR/wasm_c_abi_transition.rs:9:9 - | -LL | #![deny(wasm_c_abi)] - | ^^^^^^^^^^ - diff --git a/tests/ui/macros/format-args-temporaries-in-write.stderr b/tests/ui/macros/format-args-temporaries-in-write.stderr index e05246cfbe3..e58a43383f6 100644 --- a/tests/ui/macros/format-args-temporaries-in-write.stderr +++ b/tests/ui/macros/format-args-temporaries-in-write.stderr @@ -14,6 +14,10 @@ LL | }; | | | `mutex` dropped here while still borrowed | +help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped + | +LL | write!(Out, "{}", mutex.lock()); /* no semicolon */ + | + error[E0597]: `mutex` does not live long enough --> $DIR/format-args-temporaries-in-write.rs:47:29 @@ -31,6 +35,10 @@ LL | }; | | | `mutex` dropped here while still borrowed | +help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped + | +LL | writeln!(Out, "{}", mutex.lock()); /* no semicolon */ + | + error: aborting due to 2 previous errors diff --git a/tests/ui/never_type/defaulted-never-note.nofallback.stderr b/tests/ui/never_type/defaulted-never-note.nofallback.stderr index 2abff61fa54..6de323ad12c 100644 --- a/tests/ui/never_type/defaulted-never-note.nofallback.stderr +++ b/tests/ui/never_type/defaulted-never-note.nofallback.stderr @@ -20,3 +20,24 @@ LL | let _x: () = return; warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/defaulted-never-note.rs:28:1 + | +LL | fn smeg() { + | ^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail + --> $DIR/defaulted-never-note.rs:32:9 + | +LL | foo(_x); + | ^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let _x: () = return; + | ++++ + diff --git a/tests/ui/never_type/dependency-on-fallback-to-unit.stderr b/tests/ui/never_type/dependency-on-fallback-to-unit.stderr index bf37cc7b4b4..be8075662e0 100644 --- a/tests/ui/never_type/dependency-on-fallback-to-unit.stderr +++ b/tests/ui/never_type/dependency-on-fallback-to-unit.stderr @@ -40,3 +40,46 @@ LL | deserialize::<()>()?; warning: 2 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/dependency-on-fallback-to-unit.rs:8:1 + | +LL | fn def() { + | ^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/dependency-on-fallback-to-unit.rs:12:19 + | +LL | false => <_>::default(), + | ^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL - false => <_>::default(), +LL + false => <()>::default(), + | + +Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/dependency-on-fallback-to-unit.rs:19:1 + | +LL | fn question_mark() -> Result<(), ()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/dependency-on-fallback-to-unit.rs:22:5 + | +LL | deserialize()?; + | ^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | deserialize::<()>()?; + | ++++++ + diff --git a/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr b/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr index 4b8a5d5e934..44ebdb43510 100644 --- a/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr +++ b/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr @@ -39,3 +39,45 @@ LL | let x: (); warning: 2 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/diverging-fallback-control-flow.rs:30:1 + | +LL | fn assignment() { + | ^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: UnitDefault` will fail + --> $DIR/diverging-fallback-control-flow.rs:36:13 + | +LL | x = UnitDefault::default(); + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let x: (); + | ++++ + +Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/diverging-fallback-control-flow.rs:42:1 + | +LL | fn assignment_rev() { + | ^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: UnitDefault` will fail + --> $DIR/diverging-fallback-control-flow.rs:50:13 + | +LL | x = UnitDefault::default(); + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let x: (); + | ++++ + diff --git a/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr b/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr index 94af02a3698..4a8dea42a4d 100644 --- a/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr +++ b/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr @@ -20,3 +20,24 @@ LL | unconstrained_arg::<()>(return); warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/diverging-fallback-no-leak.rs:14:1 + | +LL | fn main() { + | ^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Test` will fail + --> $DIR/diverging-fallback-no-leak.rs:20:23 + | +LL | unconstrained_arg(return); + | ^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unconstrained_arg::<()>(return); + | ++++++ + diff --git a/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr b/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr index 22349d39857..803af39fd86 100644 --- a/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr +++ b/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr @@ -20,3 +20,24 @@ LL | let _: () = if true { unconstrained_return() } else { panic!() }; warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/diverging-fallback-unconstrained-return.rs:28:1 + | +LL | fn main() { + | ^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: UnitReturn` will fail + --> $DIR/diverging-fallback-unconstrained-return.rs:39:23 + | +LL | let _ = if true { unconstrained_return() } else { panic!() }; + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let _: () = if true { unconstrained_return() } else { panic!() }; + | ++++ + diff --git a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr index 3fe642a8401..365e8869897 100644 --- a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr +++ b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr @@ -24,3 +24,28 @@ LL | let created: () = create_ok_default()?; error: aborting due to 1 previous error +Future incompatibility report: Future breakage diagnostic: +error: this function depends on never type fallback being `()` + --> $DIR/dont-suggest-turbofish-from-expansion.rs:10:1 + | +LL | fn main() -> Result<(), ()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23 + | +LL | let created = create_ok_default()?; + | ^^^^^^^^^^^^^^^^^^^ +note: the lint level is defined here + --> $DIR/dont-suggest-turbofish-from-expansion.rs:1:9 + | +LL | #![deny(dependency_on_unit_never_type_fallback)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use `()` annotations to avoid fallback changes + | +LL | let created: () = create_ok_default()?; + | ++++ + diff --git a/tests/ui/never_type/fallback-closure-ret.nofallback.stderr b/tests/ui/never_type/fallback-closure-ret.nofallback.stderr index d7463be6acc..cf19363a7d8 100644 --- a/tests/ui/never_type/fallback-closure-ret.nofallback.stderr +++ b/tests/ui/never_type/fallback-closure-ret.nofallback.stderr @@ -20,3 +20,24 @@ LL | foo::<()>(|| panic!()); warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/fallback-closure-ret.rs:21:1 + | +LL | fn main() { + | ^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Bar` will fail + --> $DIR/fallback-closure-ret.rs:24:5 + | +LL | foo(|| panic!()); + | ^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | foo::<()>(|| panic!()); + | ++++++ + diff --git a/tests/ui/never_type/impl_trait_fallback.stderr b/tests/ui/never_type/impl_trait_fallback.stderr index 72788a64888..7250db127cd 100644 --- a/tests/ui/never_type/impl_trait_fallback.stderr +++ b/tests/ui/never_type/impl_trait_fallback.stderr @@ -16,3 +16,20 @@ LL | fn should_ret_unit() -> impl T { warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function depends on never type fallback being `()` + --> $DIR/impl_trait_fallback.rs:8:1 + | +LL | fn should_ret_unit() -> impl T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: T` will fail + --> $DIR/impl_trait_fallback.rs:8:25 + | +LL | fn should_ret_unit() -> impl T { + | ^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default + diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr index 86786c3bfe0..945db40782e 100644 --- a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr @@ -24,3 +24,28 @@ LL | _ = foo::<()>()?; error: aborting due to 1 previous error +Future incompatibility report: Future breakage diagnostic: +error: this function depends on never type fallback being `()` + --> $DIR/lint-breaking-2024-assign-underscore.rs:10:1 + | +LL | fn test() -> Result<(), ()> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9 + | +LL | _ = foo()?; + | ^^^^^ +note: the lint level is defined here + --> $DIR/lint-breaking-2024-assign-underscore.rs:4:9 + | +LL | #![deny(dependency_on_unit_never_type_fallback)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use `()` annotations to avoid fallback changes + | +LL | _ = foo::<()>()?; + | ++++++ + diff --git a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr index 49b966f32ce..c90efd27784 100644 --- a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr +++ b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr @@ -133,3 +133,155 @@ LL | msg_send!(); warning: 10 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:12:18 + | +LL | unsafe { mem::zeroed() } + | ^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unsafe { mem::zeroed::<()>() } + | ++++++ + +Future breakage diagnostic: +warning: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:29:13 + | +LL | core::mem::transmute(Zst) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | core::mem::transmute::<_, ()>(Zst) + | +++++++++ + +Future breakage diagnostic: +warning: never type fallback affects this union access + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18 + | +LL | unsafe { Union { a: () }.b } + | ^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default + +Future breakage diagnostic: +warning: never type fallback affects this raw pointer dereference + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:57:18 + | +LL | unsafe { *ptr::from_ref(&()).cast() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unsafe { *ptr::from_ref(&()).cast::<()>() } + | ++++++ + +Future breakage diagnostic: +warning: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:78:18 + | +LL | unsafe { internally_create(x) } + | ^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unsafe { internally_create::<()>(x) } + | ++++++ + +Future breakage diagnostic: +warning: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:96:18 + | +LL | unsafe { zeroed() } + | ^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let zeroed = mem::zeroed::<()>; + | ++++++ + +Future breakage diagnostic: +warning: never type fallback affects this `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:22 + | +LL | let zeroed = mem::zeroed; + | ^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let zeroed = mem::zeroed::<()>; + | ++++++ + +Future breakage diagnostic: +warning: never type fallback affects this `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:17 + | +LL | let f = internally_create; + | ^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let f = internally_create::<()>; + | ++++++ + +Future breakage diagnostic: +warning: never type fallback affects this call to an `unsafe` method + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:139:13 + | +LL | S(marker::PhantomData).create_out_of_thin_air() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default + +Future breakage diagnostic: +warning: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:157:19 + | +LL | match send_message::<_ /* ?0 */>() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | msg_send!(); + | ----------- in this macro invocation + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default + = note: this warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr index 4d3692a7b04..858d7381eed 100644 --- a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr +++ b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr @@ -142,3 +142,155 @@ LL | unsafe { mem::zeroed() } error: aborting due to 10 previous errors; 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +error: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:12:18 + | +LL | unsafe { mem::zeroed() } + | ^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unsafe { mem::zeroed::<()>() } + | ++++++ + +Future breakage diagnostic: +error: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:29:13 + | +LL | core::mem::transmute(Zst) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | core::mem::transmute::<_, ()>(Zst) + | +++++++++ + +Future breakage diagnostic: +error: never type fallback affects this union access + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18 + | +LL | unsafe { Union { a: () }.b } + | ^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default + +Future breakage diagnostic: +error: never type fallback affects this raw pointer dereference + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:57:18 + | +LL | unsafe { *ptr::from_ref(&()).cast() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unsafe { *ptr::from_ref(&()).cast::<()>() } + | ++++++ + +Future breakage diagnostic: +error: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:78:18 + | +LL | unsafe { internally_create(x) } + | ^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | unsafe { internally_create::<()>(x) } + | ++++++ + +Future breakage diagnostic: +error: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:96:18 + | +LL | unsafe { zeroed() } + | ^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let zeroed = mem::zeroed::<()>; + | ++++++ + +Future breakage diagnostic: +error: never type fallback affects this `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:22 + | +LL | let zeroed = mem::zeroed; + | ^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let zeroed = mem::zeroed::<()>; + | ++++++ + +Future breakage diagnostic: +error: never type fallback affects this `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:17 + | +LL | let f = internally_create; + | ^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default +help: use `()` annotations to avoid fallback changes + | +LL | let f = internally_create::<()>; + | ++++++ + +Future breakage diagnostic: +error: never type fallback affects this call to an `unsafe` method + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:139:13 + | +LL | S(marker::PhantomData).create_out_of_thin_air() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default + +Future breakage diagnostic: +error: never type fallback affects this call to an `unsafe` function + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:157:19 + | +LL | match send_message::<_ /* ?0 */>() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | msg_send!(); + | ----------- in this macro invocation + | + = warning: this changes meaning in Rust 2024 and in a future release in all editions! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = help: specify the type explicitly + = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default + = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) + |
