From 3d7aa163d656389b6e7c41ed0b38b23c2bac2a77 Mon Sep 17 00:00:00 2001 From: Wiktor Przetacznik <85874198+WiktorPrzetacznik@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:08:08 +0200 Subject: [PATCH 1/7] Update NonNull::align_offset quarantees Update NonNull::align_offset quarantees, keeping it in sync with ptr::align_offset --- library/core/src/ptr/non_null.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs index 796c85d0cacc7..7c87f462c5793 100644 --- a/library/core/src/ptr/non_null.rs +++ b/library/core/src/ptr/non_null.rs @@ -1171,9 +1171,7 @@ impl NonNull { /// `align`. /// /// If it is not possible to align the pointer, the implementation returns - /// `usize::MAX`. It is permissible for the implementation to *always* - /// return `usize::MAX`. Only your algorithm's performance can depend - /// on getting a usable offset here, not its correctness. + /// `usize::MAX`. /// /// The offset is expressed in number of `T` elements, and not bytes. /// @@ -1181,6 +1179,15 @@ impl NonNull { /// beyond the allocation that the pointer points into. It is up to the caller to ensure that /// the returned offset is correct in all terms other than alignment. /// + /// When this is called during compile-time evaluation (which is unstable), the implementation + /// may return `usize::MAX` in cases where that can never happen at runtime. This is because the + /// actual alignment of pointers is not known yet during compile-time, so an offset with + /// guaranteed alignment can sometimes not be computed. For example, a buffer declared as `[u8; + /// N]` might be allocated at an odd or an even address, but at compile-time this is not yet + /// known, so the execution has to be correct for either choice. It is therefore impossible to + /// find an offset that is guaranteed to be 2-aligned. (This behavior is subject to change, as usual + /// for unstable APIs.) + /// /// # Panics /// /// The function panics if `align` is not a power-of-two. From 470ada2de0ec507191ad8da35b0712986646d01c Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 3 Aug 2024 14:11:31 -0400 Subject: [PATCH 2/7] Make validate_mir pull optimized/ctfe MIR for all bodies --- compiler/rustc_interface/src/passes.rs | 7 +++++++ tests/crashes/121127.rs | 2 +- tests/crashes/122909.rs | 2 +- tests/crashes/126896.rs | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 8c99b1f444766..023352156eb45 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -818,6 +818,13 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { }); sess.time("layout_testing", || layout_test::test_layout(tcx)); sess.time("abi_testing", || abi_test::test_abi(tcx)); + if tcx.sess.opts.unstable_opts.validate_mir { + sess.time("ensuring_optimized_MIR_is_computable", || { + tcx.hir().par_body_owners(|def_id| { + tcx.instance_mir(ty::InstanceKind::Item(def_id.into())); + }); + }); + } } /// Runs the type-checking, region checking and other miscellaneous analysis diff --git a/tests/crashes/121127.rs b/tests/crashes/121127.rs index 2e64bf68b82fb..e50dc7763fc65 100644 --- a/tests/crashes/121127.rs +++ b/tests/crashes/121127.rs @@ -1,5 +1,5 @@ //@ known-bug: #121127 -//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes -C debuginfo=2 +//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes -C debuginfo=2 // Note that as of PR#123949 this only crashes with debuginfo enabled #![feature(specialization)] diff --git a/tests/crashes/122909.rs b/tests/crashes/122909.rs index 90bba772b915e..9d17ed83ea99b 100644 --- a/tests/crashes/122909.rs +++ b/tests/crashes/122909.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes +//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes //@ known-bug: #122909 diff --git a/tests/crashes/126896.rs b/tests/crashes/126896.rs index 35bf9d5207ac1..49c539d7acc8a 100644 --- a/tests/crashes/126896.rs +++ b/tests/crashes/126896.rs @@ -1,5 +1,5 @@ //@ known-bug: rust-lang/rust#126896 -//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes +//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes #![feature(type_alias_impl_trait)] type Two<'a, 'b> = impl std::fmt::Debug; From 8eaef3eca04793eeb380870f8b9701c0e6727cd9 Mon Sep 17 00:00:00 2001 From: tiif Date: Sun, 4 Aug 2024 22:11:43 +0800 Subject: [PATCH 3/7] Add test --- .../using-late-bound-from-closure.rs | 16 ++++++++++++++++ .../using-late-bound-from-closure.stderr | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/ui/inline-const/using-late-bound-from-closure.rs create mode 100644 tests/ui/inline-const/using-late-bound-from-closure.stderr diff --git a/tests/ui/inline-const/using-late-bound-from-closure.rs b/tests/ui/inline-const/using-late-bound-from-closure.rs new file mode 100644 index 0000000000000..2b12b2e26a226 --- /dev/null +++ b/tests/ui/inline-const/using-late-bound-from-closure.rs @@ -0,0 +1,16 @@ +// Test for ICE: cannot convert ReLateParam to a region vid +// https://github.com/rust-lang/rust/issues/125873 + +#![feature(closure_lifetime_binder)] +fn foo() { + let a = for<'a> |b: &'a ()| -> &'a () { + const { + let awd = (); + let _: &'a () = &awd; + //~^ `awd` does not live long enough + }; + b + }; +} + +fn main() {} diff --git a/tests/ui/inline-const/using-late-bound-from-closure.stderr b/tests/ui/inline-const/using-late-bound-from-closure.stderr new file mode 100644 index 0000000000000..d6e1579aa343d --- /dev/null +++ b/tests/ui/inline-const/using-late-bound-from-closure.stderr @@ -0,0 +1,19 @@ +error[E0597]: `awd` does not live long enough + --> $DIR/using-late-bound-from-closure.rs:9:29 + | +LL | let a = for<'a> |b: &'a ()| -> &'a () { + | -- lifetime `'a` defined here +LL | const { +LL | let awd = (); + | --- binding `awd` declared here +LL | let _: &'a () = &awd; + | ------ ^^^^ borrowed value does not live long enough + | | + | type annotation requires that `awd` is borrowed for `'a` +LL | +LL | }; + | - `awd` dropped here while still borrowed + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0597`. From 8c14c3d5e9fa090f6a867a782b632aa074186c4e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 7 Aug 2024 12:36:41 -0400 Subject: [PATCH 4/7] Don't implement AsyncFn for FnDef/FnPtr that wouldnt implement Fn --- .../src/solve/assembly/structural_traits.rs | 60 ++++++++++++------- .../src/traits/select/candidate_assembly.rs | 16 ++++- .../async-closures/fn-exception.rs | 27 +++++++++ .../async-closures/fn-exception.stderr | 45 ++++++++++++++ 4 files changed, 125 insertions(+), 23 deletions(-) create mode 100644 tests/ui/async-await/async-closures/fn-exception.rs create mode 100644 tests/ui/async-await/async-closures/fn-exception.stderr diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs index e69d8d84d7d89..00837f7cdd87d 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs @@ -458,28 +458,23 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable { - let bound_sig = self_ty.fn_sig(cx); - let sig = bound_sig.skip_binder(); - let future_trait_def_id = cx.require_lang_item(TraitSolverLangItem::Future); - // `FnDef` and `FnPtr` only implement `AsyncFn*` when their - // return type implements `Future`. - let nested = vec![ - bound_sig - .rebind(ty::TraitRef::new(cx, future_trait_def_id, [sig.output()])) - .upcast(cx), - ]; - let future_output_def_id = cx.require_lang_item(TraitSolverLangItem::FutureOutput); - let future_output_ty = Ty::new_projection(cx, future_output_def_id, [sig.output()]); - Ok(( - bound_sig.rebind(AsyncCallableRelevantTypes { - tupled_inputs_ty: Ty::new_tup(cx, sig.inputs().as_slice()), - output_coroutine_ty: sig.output(), - coroutine_return_ty: future_output_ty, - }), - nested, - )) + ty::FnDef(def_id, _) => { + let sig = self_ty.fn_sig(cx); + if sig.skip_binder().is_fn_trait_compatible() && !cx.has_target_features(def_id) { + fn_item_to_async_callable(cx, sig) + } else { + Err(NoSolution) + } + } + ty::FnPtr(..) => { + let sig = self_ty.fn_sig(cx); + if sig.skip_binder().is_fn_trait_compatible() { + fn_item_to_async_callable(cx, sig) + } else { + Err(NoSolution) + } } + ty::Closure(_, args) => { let args = args.as_closure(); let bound_sig = args.sig(); @@ -563,6 +558,29 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable( + cx: I, + bound_sig: ty::Binder>, +) -> Result<(ty::Binder>, Vec), NoSolution> { + let sig = bound_sig.skip_binder(); + let future_trait_def_id = cx.require_lang_item(TraitSolverLangItem::Future); + // `FnDef` and `FnPtr` only implement `AsyncFn*` when their + // return type implements `Future`. + let nested = vec![ + bound_sig.rebind(ty::TraitRef::new(cx, future_trait_def_id, [sig.output()])).upcast(cx), + ]; + let future_output_def_id = cx.require_lang_item(TraitSolverLangItem::FutureOutput); + let future_output_ty = Ty::new_projection(cx, future_output_def_id, [sig.output()]); + Ok(( + bound_sig.rebind(AsyncCallableRelevantTypes { + tupled_inputs_ty: Ty::new_tup(cx, sig.inputs().as_slice()), + output_coroutine_ty: sig.output(), + coroutine_return_ty: future_output_ty, + }), + nested, + )) +} + /// Given a coroutine-closure, project to its returned coroutine when we are *certain* /// that the closure's kind is compatible with the goal. fn coroutine_closure_to_certain_coroutine( diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 2085d3da44341..9de62031311b7 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -467,8 +467,20 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } candidates.vec.push(AsyncClosureCandidate); } - ty::FnDef(..) | ty::FnPtr(..) => { - candidates.vec.push(AsyncClosureCandidate); + // Provide an impl, but only for suitable `fn` pointers. + ty::FnPtr(sig) => { + if sig.is_fn_trait_compatible() { + candidates.vec.push(AsyncClosureCandidate); + } + } + // Provide an impl for suitable functions, rejecting `#[target_feature]` functions (RFC 2396). + ty::FnDef(def_id, _) => { + let tcx = self.tcx(); + if tcx.fn_sig(def_id).skip_binder().is_fn_trait_compatible() + && tcx.codegen_fn_attrs(def_id).target_features.is_empty() + { + candidates.vec.push(AsyncClosureCandidate); + } } _ => {} } diff --git a/tests/ui/async-await/async-closures/fn-exception.rs b/tests/ui/async-await/async-closures/fn-exception.rs new file mode 100644 index 0000000000000..7e3d6528f953b --- /dev/null +++ b/tests/ui/async-await/async-closures/fn-exception.rs @@ -0,0 +1,27 @@ +//@ edition: 2021 + +#![feature(async_closure, target_feature_11)] +// `target_feature_11` just to test safe functions w/ target features. + +use std::pin::Pin; +use std::future::Future; + +unsafe extern "Rust" { + pub unsafe fn unsafety() -> Pin + 'static>>; +} + +unsafe extern "C" { + pub safe fn abi() -> Pin + 'static>>; +} + + +#[target_feature(enable = "sse2")] +fn target_feature() -> Pin + 'static>> { todo!() } + +fn test(f: impl async Fn()) {} + +fn main() { + test(unsafety); //~ ERROR the trait bound + test(abi); //~ ERROR the trait bound + test(target_feature); //~ ERROR the trait bound +} diff --git a/tests/ui/async-await/async-closures/fn-exception.stderr b/tests/ui/async-await/async-closures/fn-exception.stderr new file mode 100644 index 0000000000000..7c10952db229a --- /dev/null +++ b/tests/ui/async-await/async-closures/fn-exception.stderr @@ -0,0 +1,45 @@ +error[E0277]: the trait bound `unsafe fn() -> Pin + 'static)>> {unsafety}: AsyncFn<()>` is not satisfied + --> $DIR/fn-exception.rs:24:10 + | +LL | test(unsafety); + | ---- ^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `unsafe fn() -> Pin + 'static)>> {unsafety}` + | | + | required by a bound introduced by this call + | +note: required by a bound in `test` + --> $DIR/fn-exception.rs:21:17 + | +LL | fn test(f: impl async Fn()) {} + | ^^^^^^^^^^ required by this bound in `test` + +error[E0277]: the trait bound `extern "C" fn() -> Pin + 'static)>> {abi}: AsyncFn<()>` is not satisfied + --> $DIR/fn-exception.rs:25:10 + | +LL | test(abi); + | ---- ^^^ the trait `AsyncFn<()>` is not implemented for fn item `extern "C" fn() -> Pin + 'static)>> {abi}` + | | + | required by a bound introduced by this call + | +note: required by a bound in `test` + --> $DIR/fn-exception.rs:21:17 + | +LL | fn test(f: impl async Fn()) {} + | ^^^^^^^^^^ required by this bound in `test` + +error[E0277]: the trait bound `fn() -> Pin + 'static)>> {target_feature}: AsyncFn<()>` is not satisfied + --> $DIR/fn-exception.rs:26:10 + | +LL | test(target_feature); + | ---- ^^^^^^^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `fn() -> Pin + 'static)>> {target_feature}` + | | + | required by a bound introduced by this call + | +note: required by a bound in `test` + --> $DIR/fn-exception.rs:21:17 + | +LL | fn test(f: impl async Fn()) {} + | ^^^^^^^^^^ required by this bound in `test` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. From 7869400e589ca4e88cebb1da80a420f8e9042cdf Mon Sep 17 00:00:00 2001 From: Zachary S Date: Wed, 7 Aug 2024 13:04:43 -0500 Subject: [PATCH 5/7] Update E0517 message to reflect RFC 2195. --- .../src/error_codes/E0517.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0517.md b/compiler/rustc_error_codes/src/error_codes/E0517.md index ae802245bd1d7..5354a08bf31a7 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0517.md +++ b/compiler/rustc_error_codes/src/error_codes/E0517.md @@ -25,14 +25,17 @@ impl Foo { These attributes do not work on typedefs, since typedefs are just aliases. Representations like `#[repr(u8)]`, `#[repr(i64)]` are for selecting the -discriminant size for enums with no data fields on any of the variants, e.g. -`enum Color {Red, Blue, Green}`, effectively setting the size of the enum to -the size of the provided type. Such an enum can be cast to a value of the same -type as well. In short, `#[repr(u8)]` makes the enum behave like an integer -with a constrained set of allowed values. +discriminant size for enums. For enums with no data fields on any of the +variants, e.g. `enum Color {Red, Blue, Green}`, this effectively sets the size +of the enum to the size of the provided type. Such an enum can be cast to a +value of the same type as well. In short, `#[repr(u8)]` makes a field-less enum +behave like an integer with a constrained set of allowed values. -Only field-less enums can be cast to numerical primitives, so this attribute -will not apply to structs. +For a description of how `#[repr(C)]` and representations like `#[repr(u8)]` +affect the layout of enums with data fields, see [RFC 2195][rfc2195]. + +Only field-less enums can be cast to numerical primitives. Representations like +`#[repr(u8)]` will not apply to structs. `#[repr(packed)]` reduces padding to make the struct size smaller. The representation of enums isn't strictly defined in Rust, and this attribute @@ -42,3 +45,5 @@ won't work on enums. types (i.e., `u8`, `i32`, etc) a representation that permits vectorization via SIMD. This doesn't make much sense for enums since they don't consist of a single list of data. + +[rfc2195]: https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md From 9c29e0b818a157023025da233f0c411dfebb5080 Mon Sep 17 00:00:00 2001 From: bohan Date: Thu, 8 Aug 2024 20:30:20 +0800 Subject: [PATCH 6/7] rm `declared_features` field in resolver --- compiler/rustc_resolve/src/lib.rs | 5 ----- compiler/rustc_resolve/src/macros.rs | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 023e428dc1ba7..89ac839651fb1 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1129,9 +1129,6 @@ pub struct Resolver<'a, 'tcx> { /// Also includes of list of each fields visibility struct_constructors: LocalDefIdMap<(Res, ty::Visibility, Vec>)>, - /// Features declared for this crate. - declared_features: FxHashSet, - lint_buffer: LintBuffer, next_node_id: NodeId, @@ -1402,7 +1399,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { let registered_tools = tcx.registered_tools(()); - let features = tcx.features(); let pub_vis = ty::Visibility::::Public; let edition = tcx.sess.edition(); @@ -1506,7 +1502,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { multi_segment_macro_resolutions: Default::default(), builtin_attrs: Default::default(), containers_deriving_copy: Default::default(), - declared_features: features.declared_features.clone(), lint_buffer: LintBuffer::default(), next_node_id: CRATE_NODE_ID, node_id_to_def_id, diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index a6301a367a4b3..da7278175e93a 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -1001,7 +1001,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { let feature = stability.feature; let is_allowed = |feature| { - self.declared_features.contains(&feature) || span.allows_unstable(feature) + self.tcx.features().declared_features.contains(&feature) + || span.allows_unstable(feature) }; let allowed_by_implication = implied_by.is_some_and(|feature| is_allowed(feature)); if !is_allowed(feature) && !allowed_by_implication { From 9289f5691b29aa54a2c7fb596e4cf26d9ebcd53f Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Thu, 8 Aug 2024 13:09:58 +0000 Subject: [PATCH 7/7] Only suggest `#[allow]` for `--warn` and `--deny` lint level flags --- compiler/rustc_middle/src/lint.rs | 8 +++++--- tests/ui/lint/command-line-lint-group-forbid.stderr | 1 - .../cap-lints-warn-allowed-warn-by-default-lint.stderr | 1 - tests/ui/lint/force-warn/lint-group-allow-warnings.stderr | 1 - .../lint-group-allowed-cli-warn-by-default-lint.stderr | 1 - .../lint/force-warn/lint-group-allowed-lint-group.stderr | 1 - .../lint-group-allowed-warn-by-default-lint.stderr | 1 - tests/ui/lint/group-forbid-always-trumps-cli.stderr | 1 - 8 files changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index 6a9e67f74dac7..8c27cac1ea858 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -228,9 +228,11 @@ pub fn explain_lint_level_source( err.note_once(format!( "`{flag} {hyphen_case_lint_name}` implied by `{flag} {hyphen_case_flag_val}`" )); - err.help_once(format!( - "to override `{flag} {hyphen_case_flag_val}` add `#[allow({name})]`" - )); + if matches!(orig_level, Level::Warn | Level::Deny) { + err.help_once(format!( + "to override `{flag} {hyphen_case_flag_val}` add `#[allow({name})]`" + )); + } } } LintLevelSource::Node { name: lint_attr_name, span, reason, .. } => { diff --git a/tests/ui/lint/command-line-lint-group-forbid.stderr b/tests/ui/lint/command-line-lint-group-forbid.stderr index 7b527e7b8b461..ec9b6ca9664ca 100644 --- a/tests/ui/lint/command-line-lint-group-forbid.stderr +++ b/tests/ui/lint/command-line-lint-group-forbid.stderr @@ -5,7 +5,6 @@ LL | let _InappropriateCamelCasing = true; | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `_inappropriate_camel_casing` | = note: `-F non-snake-case` implied by `-F bad-style` - = help: to override `-F bad-style` add `#[allow(non_snake_case)]` error: aborting due to 1 previous error diff --git a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr index 01c2ed84c635a..d1b764b341435 100644 --- a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr @@ -7,7 +7,6 @@ LL | 0...100 => true, = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility` - = help: to override `--force-warn rust-2021-compatibility` add `#[allow(ellipsis_inclusive_range_patterns)]` warning: 1 warning emitted diff --git a/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr b/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr index e925a195fb1c4..dc7b1b7b98d0c 100644 --- a/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr +++ b/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr @@ -5,7 +5,6 @@ LL | pub fn FUNCTION() {} | ^^^^^^^^ help: convert the identifier to snake case: `function` | = note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style` - = help: to override `--force-warn nonstandard-style` add `#[allow(non_snake_case)]` warning: 1 warning emitted diff --git a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr index a74cda2239f50..dc85e8cf96179 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr @@ -7,7 +7,6 @@ LL | pub fn function(_x: Box) {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` - = help: to override `--force-warn rust-2018-idioms` add `#[allow(bare_trait_objects)]` help: if this is an object-safe trait, use `dyn` | LL | pub fn function(_x: Box) {} diff --git a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr index c9472a3b9b9d3..55cfad838f84f 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr @@ -7,7 +7,6 @@ LL | pub fn function(_x: Box) {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` - = help: to override `--force-warn rust-2018-idioms` add `#[allow(bare_trait_objects)]` help: if this is an object-safe trait, use `dyn` | LL | pub fn function(_x: Box) {} diff --git a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr index 558d5cbb53156..b7bf0c4ee212f 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr @@ -7,7 +7,6 @@ LL | pub fn function(_x: Box) {} = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` - = help: to override `--force-warn rust-2018-idioms` add `#[allow(bare_trait_objects)]` help: if this is an object-safe trait, use `dyn` | LL | pub fn function(_x: Box) {} diff --git a/tests/ui/lint/group-forbid-always-trumps-cli.stderr b/tests/ui/lint/group-forbid-always-trumps-cli.stderr index 21674ebae9cec..ed1242eacfce7 100644 --- a/tests/ui/lint/group-forbid-always-trumps-cli.stderr +++ b/tests/ui/lint/group-forbid-always-trumps-cli.stderr @@ -5,7 +5,6 @@ LL | let x = 1; | ^ help: if this is intentional, prefix it with an underscore: `_x` | = note: `-F unused-variables` implied by `-F unused` - = help: to override `-F unused` add `#[allow(unused_variables)]` error: aborting due to 1 previous error