From cb26b35b12d810d7a8215869d9e434c4b0c7f25c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Fri, 9 Dec 2022 15:56:23 +0000 Subject: [PATCH 1/8] Make some diagnostics not depend on the source of what they reference being available --- compiler/rustc_metadata/src/rmeta/decoder.rs | 16 ++-- compiler/rustc_privacy/src/lib.rs | 10 +-- .../src/traits/error_reporting/suggestions.rs | 21 +++-- .../diagnostic-derive.stderr | 3 +- ...alloc-error-handler-bad-signature-2.stderr | 3 - .../associated-type-bounds/issue-99828.stderr | 3 - .../ui/associated-types/defaults-wf.stderr | 3 - ...with-supertraits-needing-sized-self.stderr | 3 - src/test/ui/async-await/generator-desc.stderr | 3 - src/test/ui/async-await/issue-72442.stderr | 3 - .../ui/async-await/issues/issue-65159.stderr | 5 -- .../async-await/pin-needed-to-poll-2.stderr | 3 - .../ui/async-await/pin-needed-to-poll.stderr | 6 +- src/test/ui/binop/binop-consume-args.stderr | 60 +++++++------- src/test/ui/binop/binop-move-semantics.stderr | 16 ++-- src/test/ui/binop/issue-28837.stderr | 27 ------- src/test/ui/binop/issue-3820.stderr | 3 - ...k-move-out-of-overloaded-auto-deref.stderr | 3 - src/test/ui/borrowck/issue-83760.stderr | 6 -- .../reborrow-sugg-move-then-borrow.stderr | 3 - .../suggest-as-ref-on-mut-closure.stderr | 3 - ...ove-upvar-from-non-once-ref-closure.stderr | 3 - src/test/ui/box/into-boxed-slice-fail.stderr | 6 -- src/test/ui/c-variadic/issue-86053-1.stderr | 6 +- src/test/ui/chalkify/bugs/async.stderr | 6 -- src/test/ui/closures/closure-expected.stderr | 6 +- src/test/ui/closures/closure-move-sync.stderr | 14 ++-- .../closures/coerce-unsafe-to-closure.stderr | 6 +- src/test/ui/closures/issue-78720.stderr | 6 +- src/test/ui/closures/issue-87461.stderr | 9 --- src/test/ui/closures/issue-90871.stderr | 6 +- src/test/ui/codemap_tests/tab_3.stderr | 3 - .../generic_arg_infer/issue-91614.stderr | 3 - .../generic_const_exprs/issue-80742.stderr | 18 +---- .../invalid-const-arg-for-type-param.stderr | 5 -- .../invalid-constant-in-args.stderr | 6 -- .../const-ptr/forbidden_slices.32bit.stderr | 78 +++---------------- .../const-ptr/forbidden_slices.64bit.stderr | 78 +++---------------- .../ui/const-ptr/out_of_bounds_read.stderr | 24 +----- .../const-float-bits-reject-conv.stderr | 36 +-------- src/test/ui/consts/const-fn-error.stderr | 3 - src/test/ui/consts/const-for.stderr | 3 - .../consts/const_unsafe_unreachable_ub.stderr | 6 +- .../detect-extra-ub.with_flag.stderr | 9 +-- src/test/ui/consts/issue-miri-1910.stderr | 9 +-- .../consts/miri_unleashed/assoc_const.stderr | 9 +-- src/test/ui/consts/miri_unleashed/drop.stderr | 6 +- .../ui/consts/missing_span_in_backtrace.rs | 2 +- src/test/ui/consts/offset_from_ub.stderr | 18 +---- src/test/ui/consts/offset_ub.stderr | 72 +++-------------- src/test/ui/consts/ptr_comparisons.stderr | 6 +- ...derives-span-Eq-enum-struct-variant.stderr | 3 - .../ui/derives/derives-span-Eq-enum.stderr | 3 - .../ui/derives/derives-span-Eq-struct.stderr | 3 - .../derives-span-Eq-tuple-struct.stderr | 3 - .../deriving-meta-unknown-trait.stderr | 12 +-- src/test/ui/deriving/issue-103157.stderr | 3 - .../note-unsupported.stderr | 3 - src/test/ui/dst/dst-rvalue.stderr | 6 -- src/test/ui/error-codes/E0004-2.stderr | 11 +-- src/test/ui/error-codes/E0005.stderr | 7 +- src/test/ui/error-codes/E0059.stderr | 3 - src/test/ui/error-codes/E0297.stderr | 7 +- src/test/ui/error-festival.stderr | 3 - .../ruby_style_closure.stderr | 6 +- .../feature-gate-exhaustive-patterns.stderr | 7 +- src/test/ui/fmt/ifmt-bad-arg.stderr | 6 -- src/test/ui/fmt/ifmt-unimpl.stderr | 3 - src/test/ui/generator/issue-102645.stderr | 3 - src/test/ui/generator/sized-yield.stderr | 3 - .../ui/generics/wrong-number-of-args.stderr | 64 --------------- .../impl-trait/impl-generic-mismatch.stderr | 6 +- .../ui/impl-trait/in-trait/wf-bounds.stderr | 3 - .../ui/impl-trait/issues/issue-92305.stderr | 5 -- ...e-extern-crate-restricted-shadowing.stderr | 5 +- src/test/ui/inference/issue-71732.stderr | 6 +- .../interior-mutability.stderr | 3 - .../intrinsics/const-eval-select-bad.stderr | 28 ++++--- src/test/ui/issues/issue-14091-2.stderr | 3 - src/test/ui/issues/issue-14092.stderr | 7 -- src/test/ui/issues/issue-16966.stderr | 5 -- src/test/ui/issues/issue-17546.stderr | 12 +-- src/test/ui/issues/issue-17651.stderr | 3 - src/test/ui/issues/issue-18423.stderr | 6 -- src/test/ui/issues/issue-20162.stderr | 5 +- src/test/ui/issues/issue-20433.stderr | 3 - src/test/ui/issues/issue-23024.stderr | 5 -- src/test/ui/issues/issue-23966.stderr | 6 +- src/test/ui/issues/issue-27033.stderr | 6 +- src/test/ui/issues/issue-3044.stderr | 3 - src/test/ui/issues/issue-31173.stderr | 18 ++--- src/test/ui/issues/issue-32655.stderr | 12 +-- src/test/ui/issues/issue-33941.stderr | 6 +- src/test/ui/issues/issue-34334.stderr | 5 +- src/test/ui/issues/issue-38857.stderr | 3 - src/test/ui/issues/issue-48364.stderr | 3 - src/test/ui/issues/issue-51154.stderr | 3 - src/test/ui/issues/issue-61108.stderr | 3 - src/test/ui/issues/issue-64559.stderr | 3 - ...e-66923-show-error-for-correct-call.stderr | 10 +-- src/test/ui/issues/issue-7607-1.stderr | 6 +- src/test/ui/issues/issue-83924.stderr | 3 - .../ui/iterators/collect-into-array.stderr | 5 +- .../ui/iterators/collect-into-slice.stderr | 10 +-- .../iterators/invalid-iterator-chain.stderr | 35 ++++----- .../ui/iterators/vec-on-unimplemented.stderr | 6 +- .../branches.stderr | 5 +- .../recursion4.stderr | 10 +-- src/test/ui/limits/issue-55878.stderr | 6 -- src/test/ui/lint/invalid_value.stderr | 3 - .../ui/lint/lint-const-item-mutation.stderr | 3 - src/test/ui/loops/issue-82916.stderr | 3 - .../format-args-temporaries-in-write.stderr | 10 --- src/test/ui/macros/macro-name-typo.stderr | 6 +- .../macros/macro-path-prelude-fail-3.stderr | 6 +- src/test/ui/macros/unknown-builtin.stderr | 3 - .../malformed/malformed-derive-entry.stderr | 6 -- .../ui/methods/method-call-err-msg.stderr | 3 - ...ethod-call-lifetime-args-unresolved.stderr | 6 +- .../assignment-operator-unimplemented.stderr | 3 - .../mismatched_types/closure-arg-count.stderr | 24 +++--- .../closure-arg-type-mismatch.stderr | 18 ++--- .../ui/mismatched_types/issue-35030.stderr | 3 - .../ui/mismatched_types/issue-36053-2.stderr | 12 ++- .../mismatched_types/issue-47706-trait.stderr | 6 +- .../ui/mismatched_types/issue-47706.stderr | 6 +- .../issue-74918-missing-lifetime.stderr | 6 +- .../method-help-unsatisfied-bound.stderr | 5 +- .../ui/mismatched_types/similar_paths.stderr | 3 - .../ui/moves/move-fn-self-receiver.stderr | 9 +-- ...moves-based-on-type-access-to-field.stderr | 3 - .../ui/moves/moves-based-on-type-exprs.stderr | 6 -- src/test/ui/never_type/issue-52443.stderr | 3 - src/test/ui/never_type/issue-96335.stderr | 3 - src/test/ui/no-capture-arc.stderr | 5 -- src/test/ui/no-reuse-move-arc.stderr | 5 -- src/test/ui/no-send-res-ports.stderr | 7 +- src/test/ui/on-unimplemented/sum.stderr | 12 +-- .../or-patterns-syntactic-fail.stderr | 3 - .../overloaded-calls-nontuple.stderr | 6 -- src/test/ui/parser/issues/issue-62894.stderr | 6 +- src/test/ui/parser/kw-in-trait-bounds.stderr | 24 ++---- ...-missing-pattern-excluding-comments.stderr | 7 +- .../doc-hidden-non-exhaustive.stderr | 7 +- .../ui/pattern/usefulness/issue-35609.stderr | 3 +- .../ui/pattern/usefulness/issue-3601.stderr | 9 +-- .../usefulness/match-arm-statics-2.stderr | 11 +-- .../usefulness/match-privately-empty.stderr | 7 +- .../usefulness/non-exhaustive-match.stderr | 7 +- .../privacy/associated-item-privacy-trait.rs | 4 +- .../associated-item-privacy-trait.stderr | 4 +- .../ui/privacy/private-inferred-type-3.rs | 2 +- .../ui/privacy/private-inferred-type-3.stderr | 2 +- .../issue-104884-trait-impl-sugg-err.stderr | 9 --- .../ui/proc-macro/parent-source-spans.stderr | 18 ++--- src/test/ui/proc-macro/resolve-error.stderr | 12 +-- src/test/ui/proc-macro/signature.stderr | 7 +- src/test/ui/proc-macro/span-api-tests.rs | 1 + src/test/ui/range/range-1.stderr | 3 - ...recursive-types-are-not-uninhabited.stderr | 7 +- src/test/ui/resolve/levenshtein.stderr | 6 +- .../resolve/resolve-primitive-fallback.stderr | 3 - .../termination-trait-test-wrong-type.stderr | 3 - .../dbg-macro-move-semantics.stderr | 5 -- src/test/ui/span/issue-39018.stderr | 3 - src/test/ui/span/issue-71363.rs | 2 +- src/test/ui/span/missing-unit-argument.stderr | 3 - .../stability-in-private-module.stderr | 3 - src/test/ui/str/str-idx.stderr | 6 -- src/test/ui/str/str-mut-idx.stderr | 9 +-- .../args-instead-of-tuple-errors.stderr | 12 --- .../suggestions/args-instead-of-tuple.stderr | 15 ---- src/test/ui/suggestions/as-ref-2.stderr | 3 - .../ui/suggestions/attribute-typos.stderr | 6 +- .../suggestions/borrow-for-loop-head.stderr | 3 - .../ui/suggestions/bound-suggestions.stderr | 15 ---- .../ui/suggestions/derive-clone-for-eq.stderr | 3 - .../derive-trait-for-method-call.stderr | 15 +--- ...-to-add-suggestions-with-no-changes.stderr | 6 +- .../expected-boxed-future-isnt-pinned.stderr | 12 --- src/test/ui/suggestions/for-i-in-vec.stderr | 6 -- .../suggestions/imm-ref-trait-object.stderr | 6 +- .../import-trait-for-method-call.stderr | 6 +- src/test/ui/suggestions/issue-104287.stderr | 6 -- src/test/ui/suggestions/issue-62843.stderr | 3 - src/test/ui/suggestions/issue-89064.stderr | 5 -- .../mut-borrow-needed-by-trait.stderr | 12 +-- .../ui/suggestions/option-content-move.stderr | 6 -- .../restrict-type-not-param.stderr | 3 - .../suggestions/sugg-else-for-closure.stderr | 3 - .../ui/suggestions/suggest-change-mut.stderr | 9 +-- .../suggest-tryinto-edition-change.stderr | 6 +- ...-ascription-instead-of-path-in-type.stderr | 5 -- .../alias/generic-default-in-dyn.stderr | 12 +-- src/test/ui/traits/alias/object-fail.stderr | 3 +- .../assoc_type_bound_with_struct.stderr | 30 +++---- src/test/ui/traits/bad-sized.stderr | 9 --- src/test/ui/traits/issue-77982.stderr | 6 +- .../mutual-recursion-issue-75860.stderr | 3 - .../suggest-deferences/issue-39029.stderr | 3 - .../suggest-deferences/root-obligation.stderr | 3 - .../ui/traits/suggest-where-clause.stderr | 12 --- .../ui/transmutability/issue-101739-2.stderr | 6 -- src/test/ui/tuple/wrong_argument_ice-3.stderr | 3 - src/test/ui/tuple/wrong_argument_ice.stderr | 3 - .../ui/type/ascription/issue-34255-1.stderr | 5 -- ...e-ascription-instead-of-initializer.stderr | 3 - .../ui/type/type-ascription-precedence.stderr | 3 - src/test/ui/type_length_limit.stderr | 3 - src/test/ui/typeck/issue-46112.stderr | 3 - src/test/ui/typeck/issue-75883.stderr | 10 --- src/test/ui/typeck/issue-83693.stderr | 6 +- src/test/ui/typeck/issue-84768.stderr | 3 - .../ui/typeck/struct-enum-wrong-args.stderr | 9 --- ...ypeck-builtin-bound-type-parameters.stderr | 36 --------- .../ui/ufcs/ufcs-qpath-self-mismatch.stderr | 6 -- .../non-tupled-arg-mismatch.stderr | 3 - .../uninhabited-matches-feature-gated.stderr | 21 ++--- .../union-derive-clone.mirunsafeck.stderr | 3 - .../union-derive-clone.thirunsafeck.stderr | 3 - .../union/union-derive-eq.mirunsafeck.stderr | 3 - .../union/union-derive-eq.thirunsafeck.stderr | 3 - src/test/ui/unique-object-noncopyable.stderr | 12 +-- src/test/ui/unique-pinned-nocopy.stderr | 12 +-- src/test/ui/unop-move-semantics.stderr | 12 +-- .../ui/wf/hir-wf-check-erase-regions.stderr | 6 -- src/test/ui/wf/wf-impl-self-type.stderr | 3 - src/tools/compiletest/src/runtest.rs | 8 ++ 228 files changed, 417 insertions(+), 1504 deletions(-) diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index af7b0793a9574..4370d4bd758d2 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -1527,13 +1527,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { if let Some(virtual_dir) = &sess.opts.unstable_opts.simulate_remapped_rust_src_base { if let Some(real_dir) = &sess.opts.real_rust_source_base_dir { - if let rustc_span::FileName::Real(ref mut old_name) = name { - if let rustc_span::RealFileName::LocalPath(local) = old_name { - if let Ok(rest) = local.strip_prefix(real_dir) { - *old_name = rustc_span::RealFileName::Remapped { - local_path: None, - virtual_name: virtual_dir.join(rest), - }; + for subdir in ["library", "compiler"] { + if let rustc_span::FileName::Real(ref mut old_name) = name { + if let rustc_span::RealFileName::LocalPath(local) = old_name { + if let Ok(rest) = local.strip_prefix(real_dir.join(subdir)) { + *old_name = rustc_span::RealFileName::Remapped { + local_path: None, + virtual_name: virtual_dir.join(subdir).join(rest), + }; + } } } } diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index a254c892478cf..2c89f4add2e70 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -1308,15 +1308,15 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> { let is_local_static = if let DefKind::Static(_) = kind { def_id.is_local() } else { false }; if !self.item_is_accessible(def_id) && !is_local_static { - let sess = self.tcx.sess; - let sm = sess.source_map(); - let name = match qpath { - hir::QPath::Resolved(..) | hir::QPath::LangItem(..) => { - sm.span_to_snippet(qpath.span()).ok() + let name = match *qpath { + hir::QPath::LangItem(it, ..) => { + self.tcx.lang_items().get(it).map(|did| self.tcx.def_path_str(did)) } + hir::QPath::Resolved(_, path) => Some(self.tcx.def_path_str(path.res.def_id())), hir::QPath::TypeRelative(_, segment) => Some(segment.ident.to_string()), }; let kind = kind.descr(def_id); + let sess = self.tcx.sess; let _ = match name { Some(name) => { sess.emit_err(ItemIsPrivate { span, kind, descr: (&name).into() }) diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 40c8102547112..e45794ebc426e 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -2179,15 +2179,15 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { format!("does not implement `{}`", trait_pred.print_modifiers_and_trait_path()) }; - let mut explain_yield = |interior_span: Span, - yield_span: Span, - scope_span: Option| { - let mut span = MultiSpan::from_span(yield_span); - if let Ok(snippet) = source_map.span_to_snippet(interior_span) { - // #70935: If snippet contains newlines, display "the value" instead - // so that we do not emit complex diagnostics. - let snippet = &format!("`{}`", snippet); - let snippet = if snippet.contains('\n') { "the value" } else { snippet }; + let mut explain_yield = + |interior_span: Span, yield_span: Span, scope_span: Option| { + let mut span = MultiSpan::from_span(yield_span); + let snippet = match source_map.span_to_snippet(interior_span) { + // #70935: If snippet contains newlines, display "the value" instead + // so that we do not emit complex diagnostics. + Ok(snippet) if !snippet.contains('\n') => format!("`{}`", snippet), + _ => "the value".to_string(), + }; // note: future is not `Send` as this value is used across an await // --> $DIR/issue-70935-complex-spans.rs:13:9 // | @@ -2234,8 +2234,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { if let Some((span, msg)) = scope_note { err.span_note(span, &msg); } - } - }; + }; match interior_or_upvar_span { GeneratorInteriorOrUpvar::Interior(interior_span, interior_extra_info) => { if let Some((scope_span, yield_span, expr, from_awaited_ty)) = interior_extra_info { diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr index b4c211db47cd9..467b3ce7c77fd 100644 --- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr +++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr @@ -661,8 +661,7 @@ LL | #[derive(Diagnostic)] note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg` --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC | -LL | arg: impl IntoDiagnosticArg, - | ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg` + = note: required by this bound in `DiagnosticBuilder::<'a, G>::set_arg` = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 83 previous errors diff --git a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr index adb652fe61659..2673ee9f937fb 100644 --- a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr +++ b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr @@ -17,9 +17,6 @@ LL | | } = note: struct `core::alloc::Layout` and struct `Layout` have similar names, but are actually distinct types note: struct `core::alloc::Layout` is defined in crate `core` --> $SRC_DIR/core/src/alloc/layout.rs:LL:COL - | -LL | pub struct Layout { - | ^^^^^^^^^^^^^^^^^ note: struct `Layout` is defined in the current crate --> $DIR/alloc-error-handler-bad-signature-2.rs:7:1 | diff --git a/src/test/ui/associated-type-bounds/issue-99828.stderr b/src/test/ui/associated-type-bounds/issue-99828.stderr index 1c20ead055659..dc93c47dace23 100644 --- a/src/test/ui/associated-type-bounds/issue-99828.stderr +++ b/src/test/ui/associated-type-bounds/issue-99828.stderr @@ -15,9 +15,6 @@ LL | fn get_iter(vec: &[i32]) -> impl Iterator + '_ { | note: associated type defined here --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | type Item; - | ^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/defaults-wf.stderr b/src/test/ui/associated-types/defaults-wf.stderr index 8455f88f18e7a..fc830b8d67686 100644 --- a/src/test/ui/associated-types/defaults-wf.stderr +++ b/src/test/ui/associated-types/defaults-wf.stderr @@ -7,9 +7,6 @@ LL | type Ty = Vec<[u8]>; = help: the trait `Sized` is not implemented for `[u8]` note: required by a bound in `Vec` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^ required by this bound in `Vec` error: aborting due to previous error diff --git a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr index 0edc9a556b7f6..8e7cf86c4066f 100644 --- a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr +++ b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr @@ -6,9 +6,6 @@ LL | trait ArithmeticOps: Add + Sub + Mul | note: required by a bound in `Add` --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Add { - | ^^^^^^^^^^ required by this bound in `Add` help: consider further restricting `Self` | LL | trait ArithmeticOps: Add + Sub + Mul + Div + Sized {} diff --git a/src/test/ui/async-await/generator-desc.stderr b/src/test/ui/async-await/generator-desc.stderr index 1686153acf9a6..963c6ba57adf8 100644 --- a/src/test/ui/async-await/generator-desc.stderr +++ b/src/test/ui/async-await/generator-desc.stderr @@ -12,9 +12,6 @@ LL | fun(async {}, async {}); found `async` block `[async block@$DIR/generator-desc.rs:10:19: 10:27]` note: function defined here --> $SRC_DIR/core/src/future/mod.rs:LL:COL - | -LL | pub const fn identity_future>(f: Fut) -> Fut { - | ^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/generator-desc.rs:12:16 diff --git a/src/test/ui/async-await/issue-72442.stderr b/src/test/ui/async-await/issue-72442.stderr index 919abf646037d..4a1705715cacc 100644 --- a/src/test/ui/async-await/issue-72442.stderr +++ b/src/test/ui/async-await/issue-72442.stderr @@ -8,9 +8,6 @@ LL | let mut f = File::open(path.to_str())?; | note: required by a bound in `File::open` --> $SRC_DIR/std/src/fs.rs:LL:COL - | -LL | pub fn open>(path: P) -> io::Result { - | ^^^^^^^^^^^ required by this bound in `File::open` error: aborting due to previous error diff --git a/src/test/ui/async-await/issues/issue-65159.stderr b/src/test/ui/async-await/issues/issue-65159.stderr index 45f5ec40cd758..40c0e72b20391 100644 --- a/src/test/ui/async-await/issues/issue-65159.stderr +++ b/src/test/ui/async-await/issues/issue-65159.stderr @@ -6,11 +6,6 @@ LL | async fn copy() -> Result<()> | | | expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic argument | LL | async fn copy() -> Result<(), E> diff --git a/src/test/ui/async-await/pin-needed-to-poll-2.stderr b/src/test/ui/async-await/pin-needed-to-poll-2.stderr index 83d1a02c876b1..0a6f705e255ae 100644 --- a/src/test/ui/async-await/pin-needed-to-poll-2.stderr +++ b/src/test/ui/async-await/pin-needed-to-poll-2.stderr @@ -14,9 +14,6 @@ LL | struct Sleep(std::marker::PhantomPinned); | ^^^^^ note: required by a bound in `Pin::

::new` --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | impl> Pin

{ - | ^^^^^ required by this bound in `Pin::

::new` error: aborting due to previous error diff --git a/src/test/ui/async-await/pin-needed-to-poll.stderr b/src/test/ui/async-await/pin-needed-to-poll.stderr index 2e8723b2743a7..b1f4a73aafeab 100644 --- a/src/test/ui/async-await/pin-needed-to-poll.stderr +++ b/src/test/ui/async-await/pin-needed-to-poll.stderr @@ -6,11 +6,9 @@ LL | struct Sleep; ... LL | self.sleep.poll(cx) | ^^^^ method not found in `Sleep` + --> $SRC_DIR/core/src/future/future.rs:LL:COL | - ::: $SRC_DIR/core/src/future/future.rs:LL:COL - | -LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll; - | ---- the method is available for `Pin<&mut Sleep>` here + = note: the method is available for `Pin<&mut Sleep>` here | help: consider wrapping the receiver expression with the appropriate type | diff --git a/src/test/ui/binop/binop-consume-args.stderr b/src/test/ui/binop/binop-consume-args.stderr index c734f8c1e17e3..2a992d26fd147 100644 --- a/src/test/ui/binop/binop-consume-args.stderr +++ b/src/test/ui/binop/binop-consume-args.stderr @@ -9,10 +9,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-consume-args.rs:6:5 | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs + rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn add + Copy, B>(lhs: A, rhs: B) { @@ -45,10 +45,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-consume-args.rs:12:5 | -LL | fn sub(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs - rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn sub + Copy, B>(lhs: A, rhs: B) { @@ -81,10 +81,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-consume-args.rs:18:5 | -LL | fn mul(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs * rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn mul + Copy, B>(lhs: A, rhs: B) { @@ -117,10 +117,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-consume-args.rs:24:5 | -LL | fn div(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs / rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn div + Copy, B>(lhs: A, rhs: B) { @@ -153,10 +153,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-consume-args.rs:30:5 | -LL | fn rem(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs % rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn rem + Copy, B>(lhs: A, rhs: B) { @@ -189,10 +189,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/binop-consume-args.rs:36:5 | -LL | fn bitand(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs & rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn bitand + Copy, B>(lhs: A, rhs: B) { @@ -225,10 +225,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/binop-consume-args.rs:42:5 | -LL | fn bitor(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs | rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn bitor + Copy, B>(lhs: A, rhs: B) { @@ -261,10 +261,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/binop-consume-args.rs:48:5 | -LL | fn bitxor(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs ^ rhs; + | ^^^^^^^^^ help: consider further restricting this bound | LL | fn bitxor + Copy, B>(lhs: A, rhs: B) { @@ -297,10 +297,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/binop-consume-args.rs:54:5 | -LL | fn shl(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs << rhs; + | ^^^^^^^^^^ help: consider further restricting this bound | LL | fn shl + Copy, B>(lhs: A, rhs: B) { @@ -333,10 +333,10 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/binop-consume-args.rs:60:5 | -LL | fn shr(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | lhs >> rhs; + | ^^^^^^^^^^ help: consider further restricting this bound | LL | fn shr + Copy, B>(lhs: A, rhs: B) { diff --git a/src/test/ui/binop/binop-move-semantics.stderr b/src/test/ui/binop/binop-move-semantics.stderr index 994eaf9d8c778..ceb8beec77039 100644 --- a/src/test/ui/binop/binop-move-semantics.stderr +++ b/src/test/ui/binop/binop-move-semantics.stderr @@ -12,10 +12,12 @@ LL | | x; | `x` moved due to usage in operator | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-move-semantics.rs:6:5 | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | / x +LL | | + +LL | | x; + | |_____^ help: consider further restricting this bound | LL | fn double_move + Copy>(x: T) { @@ -77,10 +79,12 @@ LL | | *n; | |______- `*m` moved due to usage in operator | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/binop-move-semantics.rs:30:5 | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | / *m +LL | | + +LL | | *n; + | |______^ error[E0507]: cannot move out of `*n` which is behind a shared reference --> $DIR/binop-move-semantics.rs:32:5 diff --git a/src/test/ui/binop/issue-28837.stderr b/src/test/ui/binop/issue-28837.stderr index b9c7e1bea706a..89355edf74d78 100644 --- a/src/test/ui/binop/issue-28837.stderr +++ b/src/test/ui/binop/issue-28837.stderr @@ -13,9 +13,6 @@ LL | struct A; | ^^^^^^^^ must implement `Add<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Add { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot subtract `A` from `A` --> $DIR/issue-28837.rs:8:7 @@ -32,9 +29,6 @@ LL | struct A; | ^^^^^^^^ must implement `Sub<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Sub { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot multiply `A` by `A` --> $DIR/issue-28837.rs:10:7 @@ -51,9 +45,6 @@ LL | struct A; | ^^^^^^^^ must implement `Mul<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Mul { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot divide `A` by `A` --> $DIR/issue-28837.rs:12:7 @@ -70,9 +61,6 @@ LL | struct A; | ^^^^^^^^ must implement `Div<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Div { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot mod `A` by `A` --> $DIR/issue-28837.rs:14:7 @@ -89,9 +77,6 @@ LL | struct A; | ^^^^^^^^ must implement `Rem<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Rem { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A & A` --> $DIR/issue-28837.rs:16:7 @@ -108,9 +93,6 @@ LL | struct A; | ^^^^^^^^ must implement `BitAnd<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait BitAnd { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A | A` --> $DIR/issue-28837.rs:18:7 @@ -127,9 +109,6 @@ LL | struct A; | ^^^^^^^^ must implement `BitOr<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait BitOr { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A << A` --> $DIR/issue-28837.rs:20:7 @@ -146,9 +125,6 @@ LL | struct A; | ^^^^^^^^ must implement `Shl<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait Shl { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: no implementation for `A >> A` --> $DIR/issue-28837.rs:22:7 @@ -165,9 +141,6 @@ LL | struct A; | ^^^^^^^^ must implement `Shr<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait Shr { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: binary operation `==` cannot be applied to type `A` --> $DIR/issue-28837.rs:24:7 diff --git a/src/test/ui/binop/issue-3820.stderr b/src/test/ui/binop/issue-3820.stderr index f21f890691120..9bf178d1f856c 100644 --- a/src/test/ui/binop/issue-3820.stderr +++ b/src/test/ui/binop/issue-3820.stderr @@ -13,9 +13,6 @@ LL | struct Thing { | ^^^^^^^^^^^^ must implement `Mul<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Mul { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr index 800f30b34e589..4bc75c08b2588 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr @@ -9,9 +9,6 @@ LL | let _x = Rc::new(vec![1, 2]).into_iter(); | note: this function takes ownership of the receiver `self`, which moves value --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-83760.stderr b/src/test/ui/borrowck/issue-83760.stderr index 2552fff860cd3..a049b10fec15a 100644 --- a/src/test/ui/borrowck/issue-83760.stderr +++ b/src/test/ui/borrowck/issue-83760.stderr @@ -29,9 +29,6 @@ LL | let _y = foo; | note: this function takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn unwrap(self) -> T { - | ^^^^ error[E0382]: use of moved value: `foo` --> $DIR/issue-83760.rs:37:14 @@ -57,9 +54,6 @@ LL | foo = Some(Struct); | ^^^^^^^^^^^^^^^^^^ note: this function takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn unwrap(self) -> T { - | ^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr index 13a2005e2ef4c..27415a981a15f 100644 --- a/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr +++ b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr @@ -11,9 +11,6 @@ LL | fill_segment(state); | note: this function takes ownership of the receiver `self`, which moves `state` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider creating a fresh reborrow of `state` here | LL | for _ in &mut *state {} diff --git a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr index b1af090aec2b0..49aeaa83b6368 100644 --- a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr +++ b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr @@ -10,9 +10,6 @@ LL | cb.map(|cb| cb()); | note: this function takes ownership of the receiver `self`, which moves `*cb` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn map(self, f: F) -> Option - | ^^^^ error[E0596]: cannot borrow `*cb` as mutable, as it is behind a `&` reference --> $DIR/suggest-as-ref-on-mut-closure.rs:12:26 diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr index 0c151b097077e..ee12adb8ce50e 100644 --- a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr @@ -12,9 +12,6 @@ LL | y.into_iter(); | note: this function takes ownership of the receiver `self`, which moves `y` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ error: aborting due to previous error diff --git a/src/test/ui/box/into-boxed-slice-fail.stderr b/src/test/ui/box/into-boxed-slice-fail.stderr index de654fdc1a4b5..f102f666dc276 100644 --- a/src/test/ui/box/into-boxed-slice-fail.stderr +++ b/src/test/ui/box/into-boxed-slice-fail.stderr @@ -9,9 +9,6 @@ LL | let _ = Box::into_boxed_slice(boxed_slice); = help: the trait `Sized` is not implemented for `[u8]` note: required by a bound in `Box::::into_boxed_slice` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | impl Box { - | ^ required by this bound in `Box::::into_boxed_slice` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/into-boxed-slice-fail.rs:7:13 @@ -33,9 +30,6 @@ LL | let _ = Box::into_boxed_slice(boxed_trait); = help: the trait `Sized` is not implemented for `dyn Debug` note: required by a bound in `Box::::into_boxed_slice` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | impl Box { - | ^ required by this bound in `Box::::into_boxed_slice` error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time --> $DIR/into-boxed-slice-fail.rs:11:13 diff --git a/src/test/ui/c-variadic/issue-86053-1.stderr b/src/test/ui/c-variadic/issue-86053-1.stderr index 075bd1fc488e6..d1f13d52362da 100644 --- a/src/test/ui/c-variadic/issue-86053-1.stderr +++ b/src/test/ui/c-variadic/issue-86053-1.stderr @@ -63,11 +63,9 @@ error[E0412]: cannot find type `F` in this scope | LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^ + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here | help: a trait with a similar name exists | diff --git a/src/test/ui/chalkify/bugs/async.stderr b/src/test/ui/chalkify/bugs/async.stderr index 4804df133401b..eda867f4159ff 100644 --- a/src/test/ui/chalkify/bugs/async.stderr +++ b/src/test/ui/chalkify/bugs/async.stderr @@ -14,9 +14,6 @@ LL | | } = note: [async fn body@$DIR/async.rs:7:29: 9:2] must be a future or must implement `IntoFuture` to be awaited note: required by a bound in `identity_future` --> $SRC_DIR/core/src/future/mod.rs:LL:COL - | -LL | pub const fn identity_future>(f: Fut) -> Fut { - | ^^^^^^^^^^^^^^^^^^ required by this bound in `identity_future` error[E0277]: the size for values of type `<[async fn body@$DIR/async.rs:7:29: 9:2] as Future>::Output` cannot be known at compilation time --> $DIR/async.rs:7:29 @@ -30,9 +27,6 @@ LL | | } = help: the trait `Sized` is not implemented for `<[async fn body@$DIR/async.rs:7:29: 9:2] as Future>::Output` note: required by a bound in `identity_future` --> $SRC_DIR/core/src/future/mod.rs:LL:COL - | -LL | pub const fn identity_future>(f: Fut) -> Fut { - | ^ required by this bound in `identity_future` error[E0277]: `[async fn body@$DIR/async.rs:7:29: 9:2]` is not a future --> $DIR/async.rs:7:25 diff --git a/src/test/ui/closures/closure-expected.stderr b/src/test/ui/closures/closure-expected.stderr index 7ffe3c1ef954a..8671f4048cea5 100644 --- a/src/test/ui/closures/closure-expected.stderr +++ b/src/test/ui/closures/closure-expected.stderr @@ -10,9 +10,9 @@ LL | let y = x.or_else(4); = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Option::::or_else` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | F: ~const FnOnce() -> Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::::or_else` +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr index a2ca06b4e6e1a..3dc761a630393 100644 --- a/src/test/ui/closures/closure-move-sync.stderr +++ b/src/test/ui/closures/closure-move-sync.stderr @@ -19,9 +19,10 @@ LL | let t = thread::spawn(|| { | ^^ note: required by a bound in `spawn` --> $SRC_DIR/std/src/thread/mod.rs:LL:COL - | -LL | F: Send + 'static, - | ^^^^ required by this bound in `spawn` +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL error[E0277]: `Sender<()>` cannot be shared between threads safely --> $DIR/closure-move-sync.rs:18:19 @@ -40,9 +41,10 @@ LL | thread::spawn(|| tx.send(()).unwrap()); | ^^ note: required by a bound in `spawn` --> $SRC_DIR/std/src/thread/mod.rs:LL:COL - | -LL | F: Send + 'static, - | ^^^^ required by this bound in `spawn` +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/closures/coerce-unsafe-to-closure.stderr b/src/test/ui/closures/coerce-unsafe-to-closure.stderr index 6ce63e829b314..7144a18aea21b 100644 --- a/src/test/ui/closures/coerce-unsafe-to-closure.stderr +++ b/src/test/ui/closures/coerce-unsafe-to-closure.stderr @@ -10,9 +10,9 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `Option::::map` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | F: ~const FnOnce(T) -> U, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::::map` +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/closures/issue-78720.stderr b/src/test/ui/closures/issue-78720.stderr index da3f539a0071d..1e860d32b2a06 100644 --- a/src/test/ui/closures/issue-78720.stderr +++ b/src/test/ui/closures/issue-78720.stderr @@ -9,11 +9,9 @@ error[E0412]: cannot find type `F` in this scope | LL | _func: F, | ^ + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here | help: a trait with a similar name exists | diff --git a/src/test/ui/closures/issue-87461.stderr b/src/test/ui/closures/issue-87461.stderr index 0e788a16eb041..72337892734e6 100644 --- a/src/test/ui/closures/issue-87461.stderr +++ b/src/test/ui/closures/issue-87461.stderr @@ -8,9 +8,6 @@ LL | Ok(()) | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ error[E0308]: mismatched types --> $DIR/issue-87461.rs:17:8 @@ -22,9 +19,6 @@ LL | Ok(()) | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ error[E0308]: mismatched types --> $DIR/issue-87461.rs:26:12 @@ -36,9 +30,6 @@ LL | Ok(()) | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/closures/issue-90871.stderr b/src/test/ui/closures/issue-90871.stderr index a482750fbd016..4a578b4d7f536 100644 --- a/src/test/ui/closures/issue-90871.stderr +++ b/src/test/ui/closures/issue-90871.stderr @@ -3,11 +3,9 @@ error[E0412]: cannot find type `n` in this scope | LL | type_ascribe!(2, n([u8; || 1])) | ^ help: a trait with a similar name exists: `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error[E0308]: mismatched types --> $DIR/issue-90871.rs:4:29 diff --git a/src/test/ui/codemap_tests/tab_3.stderr b/src/test/ui/codemap_tests/tab_3.stderr index 080f6c39449f0..922adc609bc14 100644 --- a/src/test/ui/codemap_tests/tab_3.stderr +++ b/src/test/ui/codemap_tests/tab_3.stderr @@ -11,9 +11,6 @@ LL | println!("{:?}", some_vec); | note: this function takes ownership of the receiver `self`, which moves `some_vec` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider cloning the value if the performance cost is acceptable | diff --git a/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr b/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr index 688db695fa848..293ca6232b14e 100644 --- a/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr +++ b/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr @@ -7,9 +7,6 @@ LL | let y = Mask::<_, _>::splat(false); = note: cannot satisfy `_: MaskElement` note: required by a bound in `Mask::::splat` --> $SRC_DIR/core/src/../../portable-simd/crates/core_simd/src/masks.rs:LL:COL - | -LL | T: MaskElement, - | ^^^^^^^^^^^ required by this bound in `Mask::::splat` help: consider giving `y` an explicit type, where the type for type parameter `T` is specified | LL | let y: Mask<_, LANES> = Mask::<_, _>::splat(false); diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr index bf1b411ee7ccf..a08c9912527c7 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -1,14 +1,10 @@ error[E0080]: evaluation of `Inline::::{constant#0}` failed --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ size_of called on unsized type `dyn Debug` + = note: size_of called on unsized type `dyn Debug` | note: inside `std::mem::size_of::` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `Inline::::{constant#0}` --> $DIR/issue-80742.rs:22:10 | @@ -23,11 +19,9 @@ LL | struct Inline ... LL | let dst = Inline::::new(0); | ^^^ function or associated item cannot be called on `Inline` due to unsatisfied trait bounds + --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | pub trait Debug { - | --------------- doesn't satisfy `dyn Debug: Sized` + = note: doesn't satisfy `dyn Debug: Sized` | = note: the following trait bounds were not satisfied: `dyn Debug: Sized` @@ -35,14 +29,10 @@ LL | pub trait Debug { error[E0080]: evaluation of `Inline::::{constant#0}` failed --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ size_of called on unsized type `dyn Debug` + = note: size_of called on unsized type `dyn Debug` | note: inside `std::mem::size_of::` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `Inline::::{constant#0}` --> $DIR/issue-80742.rs:14:10 | diff --git a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr index d955b4f9651da..8c76ca6902962 100644 --- a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr +++ b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr @@ -4,11 +4,6 @@ error[E0107]: this associated function takes 0 generic arguments but 1 generic a LL | let _: u32 = 5i32.try_into::<32>().unwrap(); | ^^^^^^^^ expected 0 generic arguments | -note: associated function defined here, with 0 generic parameters - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn try_into(self) -> Result; - | ^^^^^^^^ help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument | LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap(); diff --git a/src/test/ui/const-generics/invalid-constant-in-args.stderr b/src/test/ui/const-generics/invalid-constant-in-args.stderr index 1400d2bf5a7ba..993b63518e44c 100644 --- a/src/test/ui/const-generics/invalid-constant-in-args.stderr +++ b/src/test/ui/const-generics/invalid-constant-in-args.stderr @@ -5,12 +5,6 @@ LL | let _: Cell<&str, "a"> = Cell::new(""); | ^^^^ --- help: remove this generic argument | | | expected 1 generic argument - | -note: struct defined here, with 1 generic parameter: `T` - --> $SRC_DIR/core/src/cell.rs:LL:COL - | -LL | pub struct Cell { - | ^^^^ - error: aborting due to previous error diff --git a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr index 563f3ffd6744f..3a58a7cd7ef05 100644 --- a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr +++ b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr @@ -1,14 +1,10 @@ error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) + = note: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) | note: inside `std::slice::from_raw_parts::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S0` --> $DIR/forbidden_slices.rs:18:34 | @@ -18,14 +14,10 @@ LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) }; error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) + = note: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) | note: inside `std::slice::from_raw_parts::<'_, ()>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S1` --> $DIR/forbidden_slices.rs:19:33 | @@ -35,14 +27,10 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) }; error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds + = note: dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds | note: inside `std::slice::from_raw_parts::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S2` --> $DIR/forbidden_slices.rs:22:34 | @@ -97,14 +85,10 @@ LL | pub static S7: &[u16] = unsafe { error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds + = note: dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds | note: inside `std::slice::from_raw_parts::<'_, u64>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S8` --> $DIR/forbidden_slices.rs:43:5 | @@ -114,19 +98,12 @@ LL | from_raw_parts(ptr, 1) error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) + = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R0` --> $DIR/forbidden_slices.rs:46:34 | @@ -136,19 +113,12 @@ LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) } error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + = note: the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, ()>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R1` --> $DIR/forbidden_slices.rs:47:33 | @@ -159,19 +129,12 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }; error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds + = note: out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::add` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { self.offset(count as isize) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R2` --> $DIR/forbidden_slices.rs:50:25 | @@ -226,19 +189,12 @@ LL | pub static R7: &[u16] = unsafe { error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds + = note: out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::add` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { self.offset(count as isize) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R8` --> $DIR/forbidden_slices.rs:74:25 | @@ -248,19 +204,12 @@ LL | from_ptr_range(ptr..ptr.add(1)) error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations + = note: `ptr_offset_from_unsigned` called on pointers into different allocations | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R9` --> $DIR/forbidden_slices.rs:79:34 | @@ -270,19 +219,12 @@ LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).ad error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations + = note: `ptr_offset_from_unsigned` called on pointers into different allocations | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R10` --> $DIR/forbidden_slices.rs:80:35 | diff --git a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr index 43529d57f4021..4e929e3525c20 100644 --- a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr +++ b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr @@ -1,14 +1,10 @@ error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) + = note: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) | note: inside `std::slice::from_raw_parts::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S0` --> $DIR/forbidden_slices.rs:18:34 | @@ -18,14 +14,10 @@ LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) }; error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) + = note: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance) | note: inside `std::slice::from_raw_parts::<'_, ()>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S1` --> $DIR/forbidden_slices.rs:19:33 | @@ -35,14 +27,10 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) }; error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds + = note: dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds | note: inside `std::slice::from_raw_parts::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S2` --> $DIR/forbidden_slices.rs:22:34 | @@ -97,14 +85,10 @@ LL | pub static S7: &[u16] = unsafe { error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/slice/raw.rs:LL:COL | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds + = note: dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds | note: inside `std::slice::from_raw_parts::<'_, u64>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | &*ptr::slice_from_raw_parts(data, len) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `S8` --> $DIR/forbidden_slices.rs:43:5 | @@ -114,19 +98,12 @@ LL | from_raw_parts(ptr, 1) error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) + = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R0` --> $DIR/forbidden_slices.rs:46:34 | @@ -136,19 +113,12 @@ LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) } error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + = note: the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, ()>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R1` --> $DIR/forbidden_slices.rs:47:33 | @@ -159,19 +129,12 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }; error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds + = note: out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::add` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { self.offset(count as isize) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R2` --> $DIR/forbidden_slices.rs:50:25 | @@ -226,19 +189,12 @@ LL | pub static R7: &[u16] = unsafe { error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds + = note: out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::add` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { self.offset(count as isize) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R8` --> $DIR/forbidden_slices.rs:74:25 | @@ -248,19 +204,12 @@ LL | from_ptr_range(ptr..ptr.add(1)) error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations + = note: `ptr_offset_from_unsigned` called on pointers into different allocations | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R9` --> $DIR/forbidden_slices.rs:79:34 | @@ -270,19 +219,12 @@ LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).ad error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations + = note: `ptr_offset_from_unsigned` called on pointers into different allocations | note: inside `ptr::const_ptr::::sub_ptr` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL - | -LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `R10` --> $DIR/forbidden_slices.rs:80:35 | diff --git a/src/test/ui/const-ptr/out_of_bounds_read.stderr b/src/test/ui/const-ptr/out_of_bounds_read.stderr index bca29b4688136..3e7b09a5982d9 100644 --- a/src/test/ui/const-ptr/out_of_bounds_read.stderr +++ b/src/test/ui/const-ptr/out_of_bounds_read.stderr @@ -1,14 +1,10 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds + = note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds | note: inside `std::ptr::read::` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `_READ` --> $DIR/out_of_bounds_read.rs:12:33 | @@ -18,19 +14,12 @@ LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) }; error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds + = note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds | note: inside `std::ptr::read::` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::read` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { read(self) } - | ^^^^^^^^^^ note: inside `_CONST_READ` --> $DIR/out_of_bounds_read.rs:13:39 | @@ -40,19 +29,12 @@ LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() }; error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds + = note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds | note: inside `std::ptr::read::` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::mut_ptr::::read` --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - | -LL | unsafe { read(self) } - | ^^^^^^^^^^ note: inside `_MUT_READ` --> $DIR/out_of_bounds_read.rs:14:37 | diff --git a/src/test/ui/consts/const-float-bits-reject-conv.stderr b/src/test/ui/consts/const-float-bits-reject-conv.stderr index 195a087ffa5b0..7ad0225209420 100644 --- a/src/test/ui/consts/const-float-bits-reject-conv.stderr +++ b/src/test/ui/consts/const-float-bits-reject-conv.stderr @@ -1,19 +1,12 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/num/f32.rs:LL:COL | -LL | panic!("const-eval error: cannot use f32::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL + = note: the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL | note: inside `core::f32::::to_bits::ct_f32_to_u32` --> $SRC_DIR/core/src/num/f32.rs:LL:COL - | -LL | panic!("const-eval error: cannot use f32::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `core::f32::::to_bits` --> $SRC_DIR/core/src/num/f32.rs:LL:COL - | -LL | unsafe { intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f32_to_u32) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `f32::MASKED_NAN1` --> $DIR/const-float-bits-reject-conv.rs:28:30 | @@ -24,19 +17,12 @@ LL | const MASKED_NAN1: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA; error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/num/f32.rs:LL:COL | -LL | panic!("const-eval error: cannot use f32::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL + = note: the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL | note: inside `core::f32::::to_bits::ct_f32_to_u32` --> $SRC_DIR/core/src/num/f32.rs:LL:COL - | -LL | panic!("const-eval error: cannot use f32::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `core::f32::::to_bits` --> $SRC_DIR/core/src/num/f32.rs:LL:COL - | -LL | unsafe { intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f32_to_u32) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `f32::MASKED_NAN2` --> $DIR/const-float-bits-reject-conv.rs:30:30 | @@ -71,19 +57,12 @@ LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/num/f64.rs:LL:COL | -LL | panic!("const-eval error: cannot use f64::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL + = note: the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL | note: inside `core::f64::::to_bits::ct_f64_to_u64` --> $SRC_DIR/core/src/num/f64.rs:LL:COL - | -LL | panic!("const-eval error: cannot use f64::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `core::f64::::to_bits` --> $SRC_DIR/core/src/num/f64.rs:LL:COL - | -LL | unsafe { intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f64_to_u64) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `f64::MASKED_NAN1` --> $DIR/const-float-bits-reject-conv.rs:50:30 | @@ -94,19 +73,12 @@ LL | const MASKED_NAN1: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA; error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/num/f64.rs:LL:COL | -LL | panic!("const-eval error: cannot use f64::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL + = note: the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL | note: inside `core::f64::::to_bits::ct_f64_to_u64` --> $SRC_DIR/core/src/num/f64.rs:LL:COL - | -LL | panic!("const-eval error: cannot use f64::to_bits on a NaN") - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `core::f64::::to_bits` --> $SRC_DIR/core/src/num/f64.rs:LL:COL - | -LL | unsafe { intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f64_to_u64) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `f64::MASKED_NAN2` --> $DIR/const-float-bits-reject-conv.rs:52:30 | diff --git a/src/test/ui/consts/const-fn-error.stderr b/src/test/ui/consts/const-fn-error.stderr index 02960b363e78f..f6b532fb65865 100644 --- a/src/test/ui/consts/const-fn-error.stderr +++ b/src/test/ui/consts/const-fn-error.stderr @@ -21,9 +21,6 @@ LL | for i in 0..x { | note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | impl const IntoIterator for I { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants error[E0658]: mutable references are not allowed in constant functions diff --git a/src/test/ui/consts/const-for.stderr b/src/test/ui/consts/const-for.stderr index 11e4ae309c01f..294ea627d8544 100644 --- a/src/test/ui/consts/const-for.stderr +++ b/src/test/ui/consts/const-for.stderr @@ -6,9 +6,6 @@ LL | for _ in 0..5 {} | note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | impl const IntoIterator for I { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constants are limited to constant functions, tuple structs and tuple variants error[E0015]: cannot call non-const fn ` as Iterator>::next` in constants diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr index cbc7cac937ae1..593a51bfe8fea 100644 --- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr @@ -1,14 +1,10 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/hint.rs:LL:COL | -LL | intrinsics::unreachable() - | ^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code + = note: entering unreachable code | note: inside `unreachable_unchecked` --> $SRC_DIR/core/src/hint.rs:LL:COL - | -LL | intrinsics::unreachable() - | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `foo` --> $DIR/const_unsafe_unreachable_ub.rs:6:18 | diff --git a/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr b/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr index 2603a73583ebd..51eec78336565 100644 --- a/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr +++ b/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr @@ -31,19 +31,12 @@ LL | let _x: &u32 = transmute(&[0u8; 4]); error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment 1, but alignment 4 is required + = note: accessing memory with alignment 1, but alignment 4 is required | note: inside `std::ptr::read::` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::read` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { read(self) } - | ^^^^^^^^^^ note: inside `INNER` --> $DIR/detect-extra-ub.rs:38:9 | diff --git a/src/test/ui/consts/issue-miri-1910.stderr b/src/test/ui/consts/issue-miri-1910.stderr index 1f82e1777af5b..61865b1dad764 100644 --- a/src/test/ui/consts/issue-miri-1910.stderr +++ b/src/test/ui/consts/issue-miri-1910.stderr @@ -1,21 +1,14 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to copy parts of a pointer from memory at ALLOC + = note: unable to copy parts of a pointer from memory at ALLOC | = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported note: inside `std::ptr::read::` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ptr::const_ptr::::read` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { read(self) } - | ^^^^^^^^^^ note: inside `C` --> $DIR/issue-miri-1910.rs:8:5 | diff --git a/src/test/ui/consts/miri_unleashed/assoc_const.stderr b/src/test/ui/consts/miri_unleashed/assoc_const.stderr index b26f121dba061..e1da43c3aea41 100644 --- a/src/test/ui/consts/miri_unleashed/assoc_const.stderr +++ b/src/test/ui/consts/miri_unleashed/assoc_const.stderr @@ -1,19 +1,12 @@ error[E0080]: evaluation of `, std::string::String>>::F` failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | pub unsafe fn drop_in_place(to_drop: *mut T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function ` as Drop>::drop` + = note: calling non-const function ` as Drop>::drop` | note: inside `std::ptr::drop_in_place::> - shim(Some(Vec))` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | pub unsafe fn drop_in_place(to_drop: *mut T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `std::ptr::drop_in_place::<(Vec, u32)> - shim(Some((Vec, u32)))` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | pub unsafe fn drop_in_place(to_drop: *mut T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `, String>>::F` --> $DIR/assoc_const.rs:12:31 | diff --git a/src/test/ui/consts/miri_unleashed/drop.stderr b/src/test/ui/consts/miri_unleashed/drop.stderr index e2e2f16d5a025..4f60b8820691b 100644 --- a/src/test/ui/consts/miri_unleashed/drop.stderr +++ b/src/test/ui/consts/miri_unleashed/drop.stderr @@ -1,14 +1,10 @@ error[E0080]: could not evaluate static initializer --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL | -LL | pub unsafe fn drop_in_place(to_drop: *mut T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function ` as Drop>::drop` + = note: calling non-const function ` as Drop>::drop` | note: inside `std::ptr::drop_in_place::> - shim(Some(Vec))` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | -LL | pub unsafe fn drop_in_place(to_drop: *mut T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `TEST_BAD` --> $DIR/drop.rs:17:1 | diff --git a/src/test/ui/consts/missing_span_in_backtrace.rs b/src/test/ui/consts/missing_span_in_backtrace.rs index c4930b73aaab8..dd2b81c5af2bc 100644 --- a/src/test/ui/consts/missing_span_in_backtrace.rs +++ b/src/test/ui/consts/missing_span_in_backtrace.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ui-testing=no +// compile-flags: -Z ui-testing=no // normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID" #![feature(const_swap)] diff --git a/src/test/ui/consts/offset_from_ub.stderr b/src/test/ui/consts/offset_from_ub.stderr index 9578d90ea9d88..fff4729689f54 100644 --- a/src/test/ui/consts/offset_from_ub.stderr +++ b/src/test/ui/consts/offset_from_ub.stderr @@ -7,14 +7,10 @@ LL | let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) }; error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on pointers into different allocations + = note: `ptr_offset_from` called on pointers into different allocations | note: inside `ptr::const_ptr::::offset_from` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `NOT_PTR` --> $DIR/offset_from_ub.rs:24:14 | @@ -90,14 +86,10 @@ LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) } error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) + = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) | note: inside `ptr::const_ptr::::offset_from` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `OFFSET_VERY_FAR1` --> $DIR/offset_from_ub.rs:115:14 | @@ -107,14 +99,10 @@ LL | unsafe { ptr2.offset_from(ptr1) } error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::ptr_offset_from(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) + = note: out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) | note: inside `ptr::const_ptr::::offset_from` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::ptr_offset_from(self, origin) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `OFFSET_VERY_FAR2` --> $DIR/offset_from_ub.rs:121:14 | diff --git a/src/test/ui/consts/offset_ub.stderr b/src/test/ui/consts/offset_ub.stderr index 7938f70a2695e..c0c851df5076e 100644 --- a/src/test/ui/consts/offset_ub.stderr +++ b/src/test/ui/consts/offset_ub.stderr @@ -1,14 +1,10 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic + = note: overflowing in-bounds pointer arithmetic | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `BEFORE_START` --> $DIR/offset_ub.rs:7:46 | @@ -18,14 +14,10 @@ LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: allocN has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds + = note: out-of-bounds pointer arithmetic: allocN has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `AFTER_END` --> $DIR/offset_ub.rs:8:43 | @@ -35,14 +27,10 @@ LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) }; error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: allocN has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds + = note: out-of-bounds pointer arithmetic: allocN has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `AFTER_ARRAY` --> $DIR/offset_ub.rs:9:45 | @@ -52,14 +40,10 @@ LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic + = note: overflowing in-bounds pointer arithmetic | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `OVERFLOW` --> $DIR/offset_ub.rs:11:43 | @@ -69,14 +53,10 @@ LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize:: error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic + = note: overflowing in-bounds pointer arithmetic | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `UNDERFLOW` --> $DIR/offset_ub.rs:12:44 | @@ -86,14 +66,10 @@ LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize: error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic + = note: overflowing in-bounds pointer arithmetic | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `OVERFLOW_ADDRESS_SPACE` --> $DIR/offset_ub.rs:13:56 | @@ -103,14 +79,10 @@ LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *cons error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing in-bounds pointer arithmetic + = note: overflowing in-bounds pointer arithmetic | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `UNDERFLOW_ADDRESS_SPACE` --> $DIR/offset_ub.rs:14:57 | @@ -120,14 +92,10 @@ LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).of error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: allocN has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds + = note: out-of-bounds pointer arithmetic: allocN has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `NEGATIVE_OFFSET` --> $DIR/offset_ub.rs:15:49 | @@ -137,14 +105,10 @@ LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: allocN has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds + = note: out-of-bounds pointer arithmetic: allocN has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `ZERO_SIZED_ALLOC` --> $DIR/offset_ub.rs:17:50 | @@ -154,14 +118,10 @@ LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1 error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) as *mut T } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: 0x1[noalloc] is a dangling pointer (it has no provenance) + = note: out-of-bounds pointer arithmetic: 0x1[noalloc] is a dangling pointer (it has no provenance) | note: inside `ptr::mut_ptr::::offset` --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) as *mut T } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `DANGLING` --> $DIR/offset_ub.rs:18:42 | @@ -171,14 +131,10 @@ LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::::dangling().as_ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: null pointer is a dangling pointer (it has no provenance) + = note: out-of-bounds pointer arithmetic: null pointer is a dangling pointer (it has no provenance) | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `NULL_OFFSET_ZERO` --> $DIR/offset_ub.rs:21:50 | @@ -188,14 +144,10 @@ LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::().offset(0 error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: 0x7f..f[noalloc] is a dangling pointer (it has no provenance) + = note: out-of-bounds pointer arithmetic: 0x7f..f[noalloc] is a dangling pointer (it has no provenance) | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `UNDERFLOW_ABS` --> $DIR/offset_ub.rs:24:47 | diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr index 274753ef1bc23..fea924d12e54e 100644 --- a/src/test/ui/consts/ptr_comparisons.stderr +++ b/src/test/ui/consts/ptr_comparisons.stderr @@ -1,14 +1,10 @@ error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds + = note: out-of-bounds pointer arithmetic: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds | note: inside `ptr::const_ptr::::offset` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | -LL | unsafe { intrinsics::offset(self, count) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `_` --> $DIR/ptr_comparisons.rs:50:34 | diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr index e3fb234b96e41..2be69a30b1c12 100644 --- a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr @@ -9,9 +9,6 @@ LL | x: Error | note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(Eq)]` | diff --git a/src/test/ui/derives/derives-span-Eq-enum.stderr b/src/test/ui/derives/derives-span-Eq-enum.stderr index 4e10c3f69e735..4f4f821cca3e7 100644 --- a/src/test/ui/derives/derives-span-Eq-enum.stderr +++ b/src/test/ui/derives/derives-span-Eq-enum.stderr @@ -9,9 +9,6 @@ LL | Error | note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(Eq)]` | diff --git a/src/test/ui/derives/derives-span-Eq-struct.stderr b/src/test/ui/derives/derives-span-Eq-struct.stderr index bfdab052a2ed4..f15659c3e166c 100644 --- a/src/test/ui/derives/derives-span-Eq-struct.stderr +++ b/src/test/ui/derives/derives-span-Eq-struct.stderr @@ -9,9 +9,6 @@ LL | x: Error | note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(Eq)]` | diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr index 26b8be343336b..4e5659b35f47a 100644 --- a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr @@ -9,9 +9,6 @@ LL | Error | note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Error` with `#[derive(Eq)]` | diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index f3ff95a85da1a..053d34f68251a 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -3,22 +3,18 @@ error: cannot find derive macro `Eqr` in this scope | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` + --> $SRC_DIR/core/src/cmp.rs:LL:COL | - ::: $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub macro Eq($item:item) { - | ------------ similarly named derive macro `Eq` defined here + = note: similarly named derive macro `Eq` defined here error: cannot find derive macro `Eqr` in this scope --> $DIR/deriving-meta-unknown-trait.rs:1:10 | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` + --> $SRC_DIR/core/src/cmp.rs:LL:COL | - ::: $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub macro Eq($item:item) { - | ------------ similarly named derive macro `Eq` defined here + = note: similarly named derive macro `Eq` defined here error: aborting due to 2 previous errors diff --git a/src/test/ui/deriving/issue-103157.stderr b/src/test/ui/deriving/issue-103157.stderr index ee3528fe1062d..b18e1e5098b34 100644 --- a/src/test/ui/deriving/issue-103157.stderr +++ b/src/test/ui/deriving/issue-103157.stderr @@ -20,9 +20,6 @@ LL | Float(Option), = note: required for `Option` to implement `Eq` note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/destructuring-assignment/note-unsupported.stderr b/src/test/ui/destructuring-assignment/note-unsupported.stderr index e45344aa51fc3..3b546115a505c 100644 --- a/src/test/ui/destructuring-assignment/note-unsupported.stderr +++ b/src/test/ui/destructuring-assignment/note-unsupported.stderr @@ -51,9 +51,6 @@ LL | struct S { x: u8, y: u8 } | ^^^^^^^^ must implement `AddAssign<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait AddAssign { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0067]: invalid left-hand side of assignment --> $DIR/note-unsupported.rs:17:22 diff --git a/src/test/ui/dst/dst-rvalue.stderr b/src/test/ui/dst/dst-rvalue.stderr index 727f4d843033f..8d0a82b707dda 100644 --- a/src/test/ui/dst/dst-rvalue.stderr +++ b/src/test/ui/dst/dst-rvalue.stderr @@ -9,9 +9,6 @@ LL | let _x: Box = Box::new(*"hello world"); = help: the trait `Sized` is not implemented for `str` note: required by a bound in `Box::::new` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | impl Box { - | ^ required by this bound in `Box::::new` error[E0277]: the size for values of type `[isize]` cannot be known at compilation time --> $DIR/dst-rvalue.rs:8:37 @@ -24,9 +21,6 @@ LL | let _x: Box<[isize]> = Box::new(*array); = help: the trait `Sized` is not implemented for `[isize]` note: required by a bound in `Box::::new` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | impl Box { - | ^ required by this bound in `Box::::new` error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr index 6f5bb4309c350..200b5235259e7 100644 --- a/src/test/ui/error-codes/E0004-2.stderr +++ b/src/test/ui/error-codes/E0004-2.stderr @@ -7,14 +7,9 @@ LL | match x { } note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | None, - | ^^^^ not covered -... -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index de8e6bac486c1..762654671e092 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -9,11 +9,8 @@ LL | let Some(y) = x; note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | None, - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/error-codes/E0059.stderr b/src/test/ui/error-codes/E0059.stderr index f331d0142260e..4f6abb22ab2f0 100644 --- a/src/test/ui/error-codes/E0059.stderr +++ b/src/test/ui/error-codes/E0059.stderr @@ -6,9 +6,6 @@ LL | fn foo>(f: F) -> F::Output { f(3) } | note: required by a bound in `Fn` --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | ^^^^^ required by this bound in `Fn` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr index 693b079238d71..4d4bdfc09e97d 100644 --- a/src/test/ui/error-codes/E0297.stderr +++ b/src/test/ui/error-codes/E0297.stderr @@ -7,11 +7,8 @@ LL | for Some(x) in xs {} note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | None, - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` error: aborting due to previous error diff --git a/src/test/ui/error-festival.stderr b/src/test/ui/error-festival.stderr index 43122c13efba8..5ff7ec952c129 100644 --- a/src/test/ui/error-festival.stderr +++ b/src/test/ui/error-festival.stderr @@ -43,9 +43,6 @@ LL | enum Question { | ^^^^^^^^^^^^^ must implement `Not` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait Not { - | ^^^^^^^^^^^^^ error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/error-festival.rs:25:5 diff --git a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr index c7ed8e0de384c..88909cc5c639f 100644 --- a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr +++ b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr @@ -22,9 +22,9 @@ LL | | }); = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` note: required by a bound in `Option::::and_then` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | F: ~const FnOnce(T) -> Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::::and_then` +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index 5ced344f13f38..fe1f247adc057 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -9,11 +9,8 @@ LL | let Ok(_x) = foo(); note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | pub enum Result { - | --------------------- -... -LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | ^^^ not covered + = note: +$SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/fmt/ifmt-bad-arg.stderr b/src/test/ui/fmt/ifmt-bad-arg.stderr index 1b595a50e9984..a8a2a47fe46e1 100644 --- a/src/test/ui/fmt/ifmt-bad-arg.stderr +++ b/src/test/ui/fmt/ifmt-bad-arg.stderr @@ -309,9 +309,6 @@ LL | println!("{} {:.*} {}", 1, 3.2, 4); found reference `&{float}` note: associated function defined here --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> { - | ^^^^^^^^^^ = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types @@ -327,9 +324,6 @@ LL | println!("{} {:07$.*} {}", 1, 3.2, 4); found reference `&{float}` note: associated function defined here --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> { - | ^^^^^^^^^^ = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 38 previous errors diff --git a/src/test/ui/fmt/ifmt-unimpl.stderr b/src/test/ui/fmt/ifmt-unimpl.stderr index 0e34f913511a3..be321c3c5c08f 100644 --- a/src/test/ui/fmt/ifmt-unimpl.stderr +++ b/src/test/ui/fmt/ifmt-unimpl.stderr @@ -17,9 +17,6 @@ LL | format!("{:X}", "3"); = note: required for `&str` to implement `UpperHex` note: required by a bound in `ArgumentV1::<'a>::new_upper_hex` --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | arg_new!(new_upper_hex, UpperHex); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ArgumentV1::<'a>::new_upper_hex` = note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `arg_new` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/generator/issue-102645.stderr b/src/test/ui/generator/issue-102645.stderr index 7b4d502132517..afb39c9e594d1 100644 --- a/src/test/ui/generator/issue-102645.stderr +++ b/src/test/ui/generator/issue-102645.stderr @@ -6,9 +6,6 @@ LL | Pin::new(&mut b).resume(); | note: associated function defined here --> $SRC_DIR/core/src/ops/generator.rs:LL:COL - | -LL | fn resume(self: Pin<&mut Self>, arg: R) -> GeneratorState; - | ^^^^^^ help: provide the argument | LL | Pin::new(&mut b).resume(()); diff --git a/src/test/ui/generator/sized-yield.stderr b/src/test/ui/generator/sized-yield.stderr index ea2a48d13cee6..fb34540d969da 100644 --- a/src/test/ui/generator/sized-yield.stderr +++ b/src/test/ui/generator/sized-yield.stderr @@ -20,9 +20,6 @@ LL | Pin::new(&mut gen).resume(()); = help: the trait `Sized` is not implemented for `str` note: required by a bound in `GeneratorState` --> $SRC_DIR/core/src/ops/generator.rs:LL:COL - | -LL | pub enum GeneratorState { - | ^ required by this bound in `GeneratorState` error: aborting due to 2 previous errors diff --git a/src/test/ui/generics/wrong-number-of-args.stderr b/src/test/ui/generics/wrong-number-of-args.stderr index 0475eb908a779..b48966a1a1ed0 100644 --- a/src/test/ui/generics/wrong-number-of-args.stderr +++ b/src/test/ui/generics/wrong-number-of-args.stderr @@ -889,11 +889,6 @@ error[E0107]: missing generics for struct `HashMap` LL | type A = HashMap; | ^^^^^^^ expected at least 2 generic arguments | -note: struct defined here, with at least 2 generic parameters: `K`, `V` - --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | pub struct HashMap { - | ^^^^^^^ - - help: add missing generic arguments | LL | type A = HashMap; @@ -907,11 +902,6 @@ LL | type B = HashMap; | | | expected at least 2 generic arguments | -note: struct defined here, with at least 2 generic parameters: `K`, `V` - --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | pub struct HashMap { - | ^^^^^^^ - - help: add missing generic argument | LL | type B = HashMap; @@ -924,12 +914,6 @@ LL | type C = HashMap<'static>; | ^^^^^^^--------- help: remove these generics | | | expected 0 lifetime arguments - | -note: struct defined here, with 0 lifetime parameters - --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | pub struct HashMap { - | ^^^^^^^ error[E0107]: this struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:318:18 @@ -937,11 +921,6 @@ error[E0107]: this struct takes at least 2 generic arguments but 0 generic argum LL | type C = HashMap<'static>; | ^^^^^^^ expected at least 2 generic arguments | -note: struct defined here, with at least 2 generic parameters: `K`, `V` - --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | pub struct HashMap { - | ^^^^^^^ - - help: add missing generic arguments | LL | type C = HashMap<'static, K, V>; @@ -954,12 +933,6 @@ LL | type D = HashMap; | ^^^^^^^ --- help: remove this generic argument | | | expected at most 3 generic arguments - | -note: struct defined here, with at most 3 generic parameters: `K`, `V`, `S` - --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | pub struct HashMap { - | ^^^^^^^ - - --------------- error[E0107]: this struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:328:18 @@ -967,11 +940,6 @@ error[E0107]: this struct takes at least 2 generic arguments but 0 generic argum LL | type E = HashMap<>; | ^^^^^^^ expected at least 2 generic arguments | -note: struct defined here, with at least 2 generic parameters: `K`, `V` - --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | pub struct HashMap { - | ^^^^^^^ - - help: add missing generic arguments | LL | type E = HashMap; @@ -983,11 +951,6 @@ error[E0107]: missing generics for enum `Result` LL | type A = Result; | ^^^^^^ expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic arguments | LL | type A = Result; @@ -1001,11 +964,6 @@ LL | type B = Result; | | | expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic argument | LL | type B = Result; @@ -1018,12 +976,6 @@ LL | type C = Result<'static>; | ^^^^^^--------- help: remove these generics | | | expected 0 lifetime arguments - | -note: enum defined here, with 0 lifetime parameters - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ error[E0107]: this enum takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:342:18 @@ -1031,11 +983,6 @@ error[E0107]: this enum takes 2 generic arguments but 0 generic arguments were s LL | type C = Result<'static>; | ^^^^^^ expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic arguments | LL | type C = Result<'static, T, E>; @@ -1048,12 +995,6 @@ LL | type D = Result; | ^^^^^^ ---- help: remove this generic argument | | | expected 2 generic arguments - | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - error[E0107]: this enum takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:352:18 @@ -1061,11 +1002,6 @@ error[E0107]: this enum takes 2 generic arguments but 0 generic arguments were s LL | type E = Result<>; | ^^^^^^ expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic arguments | LL | type E = Result; diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr index 542f02d7ec567..973b65bfd625a 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr +++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr @@ -46,11 +46,9 @@ error[E0643]: method `hash` has incompatible signature for trait | LL | fn hash(&self, hasher: &mut impl Hasher) {} | ^^^^^^^^^^^ expected generic parameter, found `impl Trait` + --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL - | -LL | fn hash(&self, state: &mut H); - | - declaration in trait here + = note: declaration in trait here error: aborting due to 4 previous errors diff --git a/src/test/ui/impl-trait/in-trait/wf-bounds.stderr b/src/test/ui/impl-trait/in-trait/wf-bounds.stderr index 92e36841b70c2..03cc4c2b93bed 100644 --- a/src/test/ui/impl-trait/in-trait/wf-bounds.stderr +++ b/src/test/ui/impl-trait/in-trait/wf-bounds.stderr @@ -7,9 +7,6 @@ LL | fn nya() -> impl Wf>; = help: the trait `Sized` is not implemented for `[u8]` note: required by a bound in `Vec` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^ required by this bound in `Vec` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/wf-bounds.rs:12:23 diff --git a/src/test/ui/impl-trait/issues/issue-92305.stderr b/src/test/ui/impl-trait/issues/issue-92305.stderr index 34d5c2d61dc41..f09c14d3df1df 100644 --- a/src/test/ui/impl-trait/issues/issue-92305.stderr +++ b/src/test/ui/impl-trait/issues/issue-92305.stderr @@ -4,11 +4,6 @@ error[E0107]: missing generics for struct `Vec` LL | fn f(data: &[T]) -> impl Iterator { | ^^^ expected at least 1 generic argument | -note: struct defined here, with at least 1 generic parameter: `T` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^^^ - help: add missing generic argument | LL | fn f(data: &[T]) -> impl Iterator> { diff --git a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr index c31c884038153..ade479ed10221 100644 --- a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr +++ b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr @@ -24,11 +24,8 @@ LL | extern crate std as Vec; ... LL | define_vec!(); | ------------- in this macro invocation -note: `Vec` could also refer to the struct defined here +note: `Vec` could also refer to a struct from prelude --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL - | -LL | pub use super::v1::*; - | ^^^^^^^^^^^^ = note: this error originates in the macro `define_vec` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/inference/issue-71732.stderr b/src/test/ui/inference/issue-71732.stderr index 79bee33280d2e..22bbfa479f6d8 100644 --- a/src/test/ui/inference/issue-71732.stderr +++ b/src/test/ui/inference/issue-71732.stderr @@ -12,9 +12,9 @@ LL | .get(&"key".into()) where T: ?Sized; note: required by a bound in `HashMap::::get` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | K: Borrow, - | ^^^^^^^^^ required by this bound in `HashMap::::get` +$SRC_DIR/std/src/collections/hash/map.rs:LL:COL +$SRC_DIR/std/src/collections/hash/map.rs:LL:COL +$SRC_DIR/std/src/collections/hash/map.rs:LL:COL help: consider specifying the generic argument | LL | .get::(&"key".into()) diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr index 94f41c9259886..034d22591b38a 100644 --- a/src/test/ui/interior-mutability/interior-mutability.stderr +++ b/src/test/ui/interior-mutability/interior-mutability.stderr @@ -16,9 +16,6 @@ LL | catch_unwind(|| { x.set(23); }); | ^^ note: required by a bound in `catch_unwind` --> $SRC_DIR/std/src/panic.rs:LL:COL - | -LL | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { - | ^^^^^^^^^^ required by this bound in `catch_unwind` error: aborting due to previous error diff --git a/src/test/ui/intrinsics/const-eval-select-bad.stderr b/src/test/ui/intrinsics/const-eval-select-bad.stderr index 3720528ad4e40..565e740ec3770 100644 --- a/src/test/ui/intrinsics/const-eval-select-bad.stderr +++ b/src/test/ui/intrinsics/const-eval-select-bad.stderr @@ -37,9 +37,10 @@ LL | const_eval_select((), 42, 0xDEADBEEF); = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL - | -LL | F: FnOnce; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select` +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL error: this argument must be a function item --> $DIR/const-eval-select-bad.rs:10:31 @@ -62,9 +63,10 @@ LL | const_eval_select((), 42, 0xDEADBEEF); = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL - | -LL | G: FnOnce, - | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select` +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL error[E0271]: expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool` --> $DIR/const-eval-select-bad.rs:32:34 @@ -76,9 +78,10 @@ LL | const_eval_select((1,), foo, bar); | note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL - | -LL | G: FnOnce, - | ^^^^^^^^^^^^ required by this bound in `const_eval_select` +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL error[E0631]: type mismatch in function arguments --> $DIR/const-eval-select-bad.rs:37:32 @@ -95,9 +98,10 @@ LL | const_eval_select((true,), foo, baz); found function signature `fn(i32) -> _` note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL - | -LL | F: FnOnce; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select` +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL +$SRC_DIR/core/src/intrinsics.rs:LL:COL error: this argument must be a `const fn` --> $DIR/const-eval-select-bad.rs:42:29 diff --git a/src/test/ui/issues/issue-14091-2.stderr b/src/test/ui/issues/issue-14091-2.stderr index a191afd7980c6..2e164f7c53e2d 100644 --- a/src/test/ui/issues/issue-14091-2.stderr +++ b/src/test/ui/issues/issue-14091-2.stderr @@ -11,9 +11,6 @@ LL | pub struct BytePos(pub u32); | ^^^^^^^^^^^^^^^^^^ must implement `Not` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait Not { - | ^^^^^^^^^^^^^ = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-14092.stderr b/src/test/ui/issues/issue-14092.stderr index 7928b3fba2785..132e2b101a5ff 100644 --- a/src/test/ui/issues/issue-14092.stderr +++ b/src/test/ui/issues/issue-14092.stderr @@ -4,13 +4,6 @@ error[E0107]: missing generics for struct `Box` LL | fn fn1(0: Box) {} | ^^^ expected at least 1 generic argument | -note: struct defined here, with at least 1 generic parameter: `T` - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | pub struct Box< - | ^^^ -LL | T: ?Sized, - | - help: add missing generic argument | LL | fn fn1(0: Box) {} diff --git a/src/test/ui/issues/issue-16966.stderr b/src/test/ui/issues/issue-16966.stderr index 8524a62a0a42d..60f5190dbd0d6 100644 --- a/src/test/ui/issues/issue-16966.stderr +++ b/src/test/ui/issues/issue-16966.stderr @@ -5,11 +5,6 @@ LL | panic!(std::default::Default::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `M` declared on the function `begin_panic` | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider specifying the generic argument - --> $SRC_DIR/std/src/panic.rs:LL:COL - | -LL | $crate::rt::begin_panic::($msg) - | +++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr index 16678c8c8a902..81592320a2791 100644 --- a/src/test/ui/issues/issue-17546.stderr +++ b/src/test/ui/issues/issue-17546.stderr @@ -3,11 +3,9 @@ error[E0573]: expected type, found variant `NoResult` | LL | fn new() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^ + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | --------------------- similarly named enum `Result` defined here + = note: similarly named enum `Result` defined here | help: try using the variant's enum | @@ -57,11 +55,9 @@ error[E0573]: expected type, found variant `NoResult` | LL | fn newer() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | --------------------- similarly named enum `Result` defined here + = note: similarly named enum `Result` defined here | help: try using the variant's enum | diff --git a/src/test/ui/issues/issue-17651.stderr b/src/test/ui/issues/issue-17651.stderr index efaaeeda2fab6..b37811e19559c 100644 --- a/src/test/ui/issues/issue-17651.stderr +++ b/src/test/ui/issues/issue-17651.stderr @@ -9,9 +9,6 @@ LL | (|| Box::new(*(&[0][..])))(); = help: the trait `Sized` is not implemented for `[{integer}]` note: required by a bound in `Box::::new` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | impl Box { - | ^ required by this bound in `Box::::new` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-18423.stderr b/src/test/ui/issues/issue-18423.stderr index 4711a3f3ce07e..bbf79366244a0 100644 --- a/src/test/ui/issues/issue-18423.stderr +++ b/src/test/ui/issues/issue-18423.stderr @@ -5,12 +5,6 @@ LL | x: Box<'a, isize> | ^^^ -- help: remove this lifetime argument | | | expected 0 lifetime arguments - | -note: struct defined here, with 0 lifetime parameters - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | pub struct Box< - | ^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20162.stderr b/src/test/ui/issues/issue-20162.stderr index d70bf6e1d921c..6f2709a482af6 100644 --- a/src/test/ui/issues/issue-20162.stderr +++ b/src/test/ui/issues/issue-20162.stderr @@ -6,9 +6,8 @@ LL | b.sort(); | note: required by a bound in `slice::::sort` --> $SRC_DIR/alloc/src/slice.rs:LL:COL - | -LL | T: Ord, - | ^^^ required by this bound in `slice::::sort` +$SRC_DIR/alloc/src/slice.rs:LL:COL +$SRC_DIR/alloc/src/slice.rs:LL:COL help: consider annotating `X` with `#[derive(Ord)]` | LL | #[derive(Ord)] diff --git a/src/test/ui/issues/issue-20433.stderr b/src/test/ui/issues/issue-20433.stderr index 9d3bb8b924d61..3ae952546a62d 100644 --- a/src/test/ui/issues/issue-20433.stderr +++ b/src/test/ui/issues/issue-20433.stderr @@ -7,9 +7,6 @@ LL | fn iceman(c: Vec<[i32]>) {} = help: the trait `Sized` is not implemented for `[i32]` note: required by a bound in `Vec` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^ required by this bound in `Vec` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr index dc8b34a70c324..014eb2897b488 100644 --- a/src/test/ui/issues/issue-23024.stderr +++ b/src/test/ui/issues/issue-23024.stderr @@ -13,11 +13,6 @@ error[E0107]: missing generics for trait `Fn` LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); | ^^ expected 1 generic argument | -note: trait defined here, with 1 generic parameter: `Args` - --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | ^^ ---- help: add missing generic argument | LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); diff --git a/src/test/ui/issues/issue-23966.stderr b/src/test/ui/issues/issue-23966.stderr index 22c4055f54be3..c48d21eb3c4e3 100644 --- a/src/test/ui/issues/issue-23966.stderr +++ b/src/test/ui/issues/issue-23966.stderr @@ -9,9 +9,9 @@ LL | "".chars().fold(|_, _| (), ()); = help: the trait `FnMut<(_, char)>` is not implemented for `()` note: required by a bound in `fold` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(B, Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::fold` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27033.stderr b/src/test/ui/issues/issue-27033.stderr index 9a38d49cd0c96..7a0ca888d7471 100644 --- a/src/test/ui/issues/issue-27033.stderr +++ b/src/test/ui/issues/issue-27033.stderr @@ -3,11 +3,9 @@ error[E0530]: match bindings cannot shadow unit variants | LL | None @ _ => {} | ^^^^ cannot be named the same as a unit variant + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL | - ::: $SRC_DIR/std/src/prelude/mod.rs:LL:COL - | -LL | pub use super::v1::*; - | ------------ the unit variant `None` is defined here + = note: the unit variant `None` is defined here error[E0530]: match bindings cannot shadow constants --> $DIR/issue-27033.rs:7:9 diff --git a/src/test/ui/issues/issue-3044.stderr b/src/test/ui/issues/issue-3044.stderr index a4c455ca1927e..2b142f688ecb9 100644 --- a/src/test/ui/issues/issue-3044.stderr +++ b/src/test/ui/issues/issue-3044.stderr @@ -9,9 +9,6 @@ LL | | }); | note: associated function defined here --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn fold(mut self, init: B, mut f: F) -> B - | ^^^^ help: provide the argument | LL ~ needlesArr.iter().fold(|x, y| { diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 62d841f37893f..b0dea3696b9a5 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -8,25 +8,21 @@ LL | .cloned() found type `u8` note: required by a bound in `cloned` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | Self: Sized + Iterator, - | ^^^^^^^^^^^^ required by this bound in `Iterator::cloned` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0599]: the method `collect` exists for struct `Cloned, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>`, but its trait bounds were not satisfied --> $DIR/issue-31173.rs:12:10 | LL | .collect(); | ^^^^^^^ method cannot be called on `Cloned, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>` due to unsatisfied trait bounds + --> $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL | - ::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL - | -LL | pub struct TakeWhile { - | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_` - | - ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL + = note: doesn't satisfy `<_ as Iterator>::Item = &_` + --> $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL | -LL | pub struct Cloned { - | -------------------- doesn't satisfy `_: Iterator` + = note: doesn't satisfy `_: Iterator` | = note: the following trait bounds were not satisfied: `, [closure@$DIR/issue-31173.rs:7:21: 7:25]> as Iterator>::Item = &_` diff --git a/src/test/ui/issues/issue-32655.stderr b/src/test/ui/issues/issue-32655.stderr index 5a758c7002b92..b8362499b2d0a 100644 --- a/src/test/ui/issues/issue-32655.stderr +++ b/src/test/ui/issues/issue-32655.stderr @@ -6,11 +6,9 @@ LL | #[derive_Clone] ... LL | foo!(); | ------ in this macro invocation + --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | pub macro derive_const($item:item) { - | ---------------------- similarly named attribute macro `derive_const` defined here + = note: similarly named attribute macro `derive_const` defined here | = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -19,11 +17,9 @@ error: cannot find attribute `derive_Clone` in this scope | LL | #[derive_Clone] | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` + --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | pub macro derive_const($item:item) { - | ---------------------- similarly named attribute macro `derive_const` defined here + = note: similarly named attribute macro `derive_const` defined here error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index 73a9b786fe2b5..13d4a43fa8578 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -8,9 +8,9 @@ LL | for _ in HashMap::new().iter().cloned() {} found tuple `(&_, &_)` note: required by a bound in `cloned` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | Self: Sized + Iterator, - | ^^^^^^^^^^^^ required by this bound in `Iterator::cloned` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` --> $DIR/issue-33941.rs:6:14 diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index b610e5c136668..2635b16f83c71 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -32,9 +32,8 @@ LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_rece | `Iterator::Item` is `&(_, _, _)` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-38857.stderr b/src/test/ui/issues/issue-38857.stderr index 23090c1ed7866..4d505784b8654 100644 --- a/src/test/ui/issues/issue-38857.stderr +++ b/src/test/ui/issues/issue-38857.stderr @@ -12,9 +12,6 @@ LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() | note: the module `sys` is defined here --> $SRC_DIR/std/src/lib.rs:LL:COL - | -LL | mod sys; - | ^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index 7fd36676df8c1..da3e62e35dc81 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -10,9 +10,6 @@ LL | b"".starts_with(stringify!(foo)) found reference `&'static str` note: associated function defined here --> $SRC_DIR/core/src/slice/mod.rs:LL:COL - | -LL | pub fn starts_with(&self, needle: &[T]) -> bool - | ^^^^^^^^^^^ = note: this error originates in the macro `stringify` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-51154.stderr b/src/test/ui/issues/issue-51154.stderr index 44ec626dea5fc..d8a833a86f511 100644 --- a/src/test/ui/issues/issue-51154.stderr +++ b/src/test/ui/issues/issue-51154.stderr @@ -13,9 +13,6 @@ LL | let _: Box = Box::new(|| ()); = help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F` note: associated function defined here --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | pub fn new(x: T) -> Self { - | ^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61108.stderr b/src/test/ui/issues/issue-61108.stderr index e5b671d7b7ab0..48ce67442ec14 100644 --- a/src/test/ui/issues/issue-61108.stderr +++ b/src/test/ui/issues/issue-61108.stderr @@ -11,9 +11,6 @@ LL | bad_letters.push('s'); | note: this function takes ownership of the receiver `self`, which moves `bad_letters` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | LL | for l in &bad_letters { diff --git a/src/test/ui/issues/issue-64559.stderr b/src/test/ui/issues/issue-64559.stderr index ef178bbd15538..0674874ead072 100644 --- a/src/test/ui/issues/issue-64559.stderr +++ b/src/test/ui/issues/issue-64559.stderr @@ -12,9 +12,6 @@ LL | let _closure = || orig; | note: this function takes ownership of the receiver `self`, which moves `orig` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | LL | for _val in &orig {} diff --git a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr index c6352978613aa..f9a73239f5939 100644 --- a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr +++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr @@ -15,9 +15,8 @@ LL | let x2: Vec = x1.into_iter().collect(); | ^^^^^^^^^^^ `Iterator::Item` is `&f64` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `Vec` cannot be built from an iterator over elements of type `&f64` --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29 @@ -37,9 +36,8 @@ LL | let x3 = x1.into_iter().collect::>(); | ^^^^^^^^^^^ `Iterator::Item` is `&f64` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr index f1ab0ad26d708..c983026995b20 100644 --- a/src/test/ui/issues/issue-7607-1.stderr +++ b/src/test/ui/issues/issue-7607-1.stderr @@ -3,11 +3,9 @@ error[E0412]: cannot find type `Fo` in this scope | LL | impl Fo { | ^^ help: a trait with a similar name exists: `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-83924.stderr b/src/test/ui/issues/issue-83924.stderr index 767571cddbeea..b89ba1a6285f6 100644 --- a/src/test/ui/issues/issue-83924.stderr +++ b/src/test/ui/issues/issue-83924.stderr @@ -12,9 +12,6 @@ LL | for n in v { | note: this function takes ownership of the receiver `self`, which moves `v` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider creating a fresh reborrow of `v` here | LL | for n in &mut *v { diff --git a/src/test/ui/iterators/collect-into-array.stderr b/src/test/ui/iterators/collect-into-array.stderr index 7a07fed1fae3a..0b2f8f6a14954 100644 --- a/src/test/ui/iterators/collect-into-array.stderr +++ b/src/test/ui/iterators/collect-into-array.stderr @@ -7,9 +7,8 @@ LL | let whatever: [u32; 10] = (0..10).collect(); = help: the trait `FromIterator<{integer}>` is not implemented for `[u32; 10]` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/iterators/collect-into-slice.stderr b/src/test/ui/iterators/collect-into-slice.stderr index 58da222e0397b..b59a5e57775ef 100644 --- a/src/test/ui/iterators/collect-into-slice.stderr +++ b/src/test/ui/iterators/collect-into-slice.stderr @@ -17,9 +17,8 @@ LL | let some_generated_vec = (0..10).collect(); = help: the trait `Sized` is not implemented for `[i32]` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a slice of type `[i32]` cannot be built since `[i32]` has no definite size --> $DIR/collect-into-slice.rs:6:38 @@ -30,9 +29,8 @@ LL | let some_generated_vec = (0..10).collect(); = help: the trait `FromIterator<{integer}>` is not implemented for `[i32]` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 3 previous errors diff --git a/src/test/ui/iterators/invalid-iterator-chain.stderr b/src/test/ui/iterators/invalid-iterator-chain.stderr index 49651b20fb16d..27ce4a19b0701 100644 --- a/src/test/ui/iterators/invalid-iterator-chain.stderr +++ b/src/test/ui/iterators/invalid-iterator-chain.stderr @@ -22,9 +22,9 @@ LL | | }); | |__________^ `Iterator::Item` changed to `()` here note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | S: Sum, - | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()` --> $DIR/invalid-iterator-chain.rs:18:14 @@ -57,9 +57,9 @@ LL | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ `Iterator::Item` changed to `()` here note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | S: Sum, - | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `f64` --> $DIR/invalid-iterator-chain.rs:28:14 @@ -88,9 +88,9 @@ LL | .map(|x| { x + 1.0 }) | -------------------- `Iterator::Item` remains `f64` here note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | S: Sum, - | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()` --> $DIR/invalid-iterator-chain.rs:30:54 @@ -112,9 +112,9 @@ LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::()); | this expression has type `Vec<{integer}>` note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | S: Sum, - | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()` --> $DIR/invalid-iterator-chain.rs:31:40 @@ -135,9 +135,9 @@ LL | println!("{}", vec![(), ()].iter().sum::()); | this expression has type `Vec<()>` note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | S: Sum, - | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `Vec` cannot be built from an iterator over elements of type `()` --> $DIR/invalid-iterator-chain.rs:40:25 @@ -167,9 +167,8 @@ LL | let f = e.filter(|_| false); | ----------------- `Iterator::Item` remains `()` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 6 previous errors diff --git a/src/test/ui/iterators/vec-on-unimplemented.stderr b/src/test/ui/iterators/vec-on-unimplemented.stderr index afcce5c30ca02..a7d9c481a1a66 100644 --- a/src/test/ui/iterators/vec-on-unimplemented.stderr +++ b/src/test/ui/iterators/vec-on-unimplemented.stderr @@ -3,11 +3,9 @@ error[E0599]: `Vec` is not an iterator | LL | vec![true, false].map(|v| !v).collect::>(); | ^^^ `Vec` is not an iterator; try calling `.into_iter()` or `.iter()` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | - ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Iterator` + = note: doesn't satisfy `Vec: Iterator` | = note: the following trait bounds were not satisfied: `Vec: Iterator` diff --git a/src/test/ui/lazy-type-alias-impl-trait/branches.stderr b/src/test/ui/lazy-type-alias-impl-trait/branches.stderr index c66069c4d2570..2b7213450ed26 100644 --- a/src/test/ui/lazy-type-alias-impl-trait/branches.stderr +++ b/src/test/ui/lazy-type-alias-impl-trait/branches.stderr @@ -7,9 +7,8 @@ LL | std::iter::empty().collect() = help: the trait `FromIterator<_>` is not implemented for `Bar` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr b/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr index a92c3a6809eae..5c84a2570d8db 100644 --- a/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr +++ b/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr @@ -7,9 +7,8 @@ LL | x = std::iter::empty().collect(); = help: the trait `FromIterator<_>` is not implemented for `Foo` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `impl Debug` cannot be built from an iterator over elements of type `_` --> $DIR/recursion4.rs:19:28 @@ -20,9 +19,8 @@ LL | x = std::iter::empty().collect(); = help: the trait `FromIterator<_>` is not implemented for `impl Debug` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn collect>(self) -> B - | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/limits/issue-55878.stderr b/src/test/ui/limits/issue-55878.stderr index f17f8141b909a..f455dcb06f79d 100644 --- a/src/test/ui/limits/issue-55878.stderr +++ b/src/test/ui/limits/issue-55878.stderr @@ -1,14 +1,8 @@ error[E0080]: values of the type `[u8; SIZE]` are too big for the current architecture --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | note: inside `std::mem::size_of::<[u8; SIZE]>` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `main` --> $DIR/issue-55878.rs:7:26 | diff --git a/src/test/ui/lint/invalid_value.stderr b/src/test/ui/lint/invalid_value.stderr index 5370660d6c185..48fd4169da7c9 100644 --- a/src/test/ui/lint/invalid_value.stderr +++ b/src/test/ui/lint/invalid_value.stderr @@ -604,9 +604,6 @@ LL | let _val: Result = mem::uninitialized(); | note: enums with multiple inhabited variants have to be initialized to a variant --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^^^^^^^^^^^^^^^^ error: the type `&i32` does not permit zero-initialization --> $DIR/invalid_value.rs:152:34 diff --git a/src/test/ui/lint/lint-const-item-mutation.stderr b/src/test/ui/lint/lint-const-item-mutation.stderr index 9f4360e676382..747c38b800764 100644 --- a/src/test/ui/lint/lint-const-item-mutation.stderr +++ b/src/test/ui/lint/lint-const-item-mutation.stderr @@ -108,9 +108,6 @@ LL | VEC.push(0); = note: the mutable reference will refer to this temporary, not the original `const` item note: mutable reference created due to call to this method --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub fn push(&mut self, value: T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:31:1 | diff --git a/src/test/ui/loops/issue-82916.stderr b/src/test/ui/loops/issue-82916.stderr index 57d76016c4539..548da51aa399d 100644 --- a/src/test/ui/loops/issue-82916.stderr +++ b/src/test/ui/loops/issue-82916.stderr @@ -11,9 +11,6 @@ LL | let z = x; | note: this function takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | LL | for y in &x { diff --git a/src/test/ui/macros/format-args-temporaries-in-write.stderr b/src/test/ui/macros/format-args-temporaries-in-write.stderr index 03ecc4b4418c6..287cd7d67044e 100644 --- a/src/test/ui/macros/format-args-temporaries-in-write.stderr +++ b/src/test/ui/macros/format-args-temporaries-in-write.stderr @@ -12,11 +12,6 @@ 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 - --> $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | $dst.write_fmt($crate::format_args!($($arg)*)); - | + error[E0597]: `mutex` does not live long enough --> $DIR/format-args-temporaries-in-write.rs:47:29 @@ -32,11 +27,6 @@ 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 - --> $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | $dst.write_fmt($crate::format_args_nl!($($arg)*)); - | + error: aborting due to 2 previous errors diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index 3e8cfb3f0e97f..d7c8aaae22e1e 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -3,11 +3,9 @@ error: cannot find macro `printlx` in this scope | LL | printlx!("oh noes!"); | ^^^^^^^ help: a macro with a similar name exists: `println` + --> $SRC_DIR/std/src/macros.rs:LL:COL | - ::: $SRC_DIR/std/src/macros.rs:LL:COL - | -LL | macro_rules! println { - | -------------------- similarly named macro `println` defined here + = note: similarly named macro `println` defined here error: aborting due to previous error diff --git a/src/test/ui/macros/macro-path-prelude-fail-3.stderr b/src/test/ui/macros/macro-path-prelude-fail-3.stderr index 70900a6bc81d3..f1c3512bc9b8e 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr @@ -3,11 +3,9 @@ error: cannot find macro `inline` in this scope | LL | inline!(); | ^^^^^^ help: a macro with a similar name exists: `line` + --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | macro_rules! line { - | ----------------- similarly named macro `line` defined here + = note: similarly named macro `line` defined here | = note: `inline` is in scope, but it is an attribute: `#[inline]` diff --git a/src/test/ui/macros/unknown-builtin.stderr b/src/test/ui/macros/unknown-builtin.stderr index 8f9dba16578eb..22f54e04e54c3 100644 --- a/src/test/ui/macros/unknown-builtin.stderr +++ b/src/test/ui/macros/unknown-builtin.stderr @@ -7,9 +7,6 @@ LL | macro_rules! unknown { () => () } error[E0773]: attempted to define built-in macro more than once --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | -LL | macro_rules! line { - | ^^^^^^^^^^^^^^^^^ - | note: previously defined here --> $DIR/unknown-builtin.rs:9:1 | diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr index 803883460f08f..6ff6fbabb4a5f 100644 --- a/src/test/ui/malformed/malformed-derive-entry.stderr +++ b/src/test/ui/malformed/malformed-derive-entry.stderr @@ -24,9 +24,6 @@ LL | #[derive(Copy(Bad))] | note: required by a bound in `Copy` --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^^ required by this bound in `Copy` = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Test1` with `#[derive(Clone)]` | @@ -41,9 +38,6 @@ LL | #[derive(Copy="bad")] | note: required by a bound in `Copy` --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^^ required by this bound in `Copy` = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Test2` with `#[derive(Clone)]` | diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index a4ffb864dad9c..13d07ea2e49f6 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -63,9 +63,6 @@ LL | .take() which is required by `&mut Foo: Iterator` note: the following trait must be implemented --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | pub trait Iterator { - | ^^^^^^^^^^^^^^^^^^ = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `take`, perhaps you need to implement it: candidate #1: `Iterator` diff --git a/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr b/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr index 62f20d6d50c04..25ad360b329aa 100644 --- a/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr +++ b/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr @@ -11,11 +11,9 @@ warning: cannot specify lifetime arguments explicitly if late bound lifetime par | LL | 0.clone::<'a>(); | ^^ + --> $SRC_DIR/core/src/clone.rs:LL:COL | - ::: $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | - the late bound lifetime parameter is introduced here + = note: the late bound lifetime parameter is introduced here | = 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 #42868 diff --git a/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr b/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr index ffd95b48ac2b7..53937d290774a 100644 --- a/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr +++ b/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr @@ -13,9 +13,6 @@ LL | struct Foo; | ^^^^^^^^^^ must implement `AddAssign<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait AddAssign { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr index a2bf2e8d5b7b3..b7d29151d6c05 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.stderr +++ b/src/test/ui/mismatched_types/closure-arg-count.stderr @@ -128,9 +128,9 @@ LL | fn foo() {} | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments --> $DIR/closure-arg-count.rs:27:57 @@ -144,9 +144,9 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar); | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments --> $DIR/closure-arg-count.rs:29:57 @@ -161,9 +161,9 @@ LL | fn qux(x: usize, y: usize) {} | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: function is expected to take 1 argument, but it takes 2 arguments --> $DIR/closure-arg-count.rs:32:45 @@ -175,9 +175,9 @@ LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add); | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/closure-arg-count.rs:35:10 diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index f2e2a4c7fd5fe..596b1fe046dc8 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -10,9 +10,9 @@ LL | a.iter().map(|_: (u32, u32)| 45); found closure signature `fn((u32, u32)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:4:14 @@ -26,9 +26,9 @@ LL | a.iter().map(|_: &(u16, u16)| 45); found closure signature `for<'a> fn(&'a (u16, u16)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:5:14 @@ -42,9 +42,9 @@ LL | a.iter().map(|_: (u16, u16)| 45); found closure signature `fn((u16, u16)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | F: FnMut(Self::Item) -> B, - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 3 previous errors diff --git a/src/test/ui/mismatched_types/issue-35030.stderr b/src/test/ui/mismatched_types/issue-35030.stderr index 5ea9bcfc122cb..680aff1726f9f 100644 --- a/src/test/ui/mismatched_types/issue-35030.stderr +++ b/src/test/ui/mismatched_types/issue-35030.stderr @@ -13,9 +13,6 @@ LL | Some(true) found type `bool` (`bool`) note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index b3509abbf84eb..c944b13224ff1 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -10,9 +10,9 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); found closure signature `for<'a> fn(&'a str) -> _` note: required by a bound in `filter` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | P: FnMut(&Self::Item) -> bool, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::filter` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0599]: the method `count` exists for struct `Filter>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied --> $DIR/issue-36053-2.rs:7:55 @@ -22,11 +22,9 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); | | | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool` | doesn't satisfy `_: FnMut<(&&str,)>` + --> $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL | - ::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL - | -LL | pub struct Filter { - | ----------------------- doesn't satisfy `_: Iterator` + = note: doesn't satisfy `_: Iterator` | = note: the following trait bounds were not satisfied: `<[closure@$DIR/issue-36053-2.rs:7:39: 7:48] as FnOnce<(&&str,)>>::Output = bool` diff --git a/src/test/ui/mismatched_types/issue-47706-trait.stderr b/src/test/ui/mismatched_types/issue-47706-trait.stderr index d596b4a69f34a..9e8d4c6dec7fd 100644 --- a/src/test/ui/mismatched_types/issue-47706-trait.stderr +++ b/src/test/ui/mismatched_types/issue-47706-trait.stderr @@ -10,9 +10,9 @@ LL | None::<()>.map(Self::f); | note: required by a bound in `Option::::map` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | F: ~const FnOnce(T) -> U, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::::map` +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/issue-47706.stderr b/src/test/ui/mismatched_types/issue-47706.stderr index 8b8563684014d..c4185d732fe9b 100644 --- a/src/test/ui/mismatched_types/issue-47706.stderr +++ b/src/test/ui/mismatched_types/issue-47706.stderr @@ -11,9 +11,9 @@ LL | self.foo.map(Foo::new) | note: required by a bound in `Option::::map` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | F: ~const FnOnce(T) -> U, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::::map` +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL +$SRC_DIR/core/src/option.rs:LL:COL error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/issue-47706.rs:27:9 diff --git a/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr index 94a9c97576f67..b75c7a99fdd33 100644 --- a/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr +++ b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr @@ -14,11 +14,9 @@ error: `impl` item signature doesn't match `trait` item signature | LL | fn next(&mut self) -> Option> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 mut ChunkingIterator) -> Option>` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | - ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn next(&mut self) -> Option; - | ----------------------------------------- expected `fn(&'1 mut ChunkingIterator) -> Option>` + = note: expected `fn(&'1 mut ChunkingIterator) -> Option>` | = note: expected `fn(&'1 mut ChunkingIterator) -> Option>` found `fn(&'1 mut ChunkingIterator) -> Option>` diff --git a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr index c2515c40b1d77..9e11ca2e3ed4d 100644 --- a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr +++ b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr @@ -8,9 +8,8 @@ LL | a.unwrap(); = note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo` note: required by a bound in `Result::::unwrap` --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | E: fmt::Debug, - | ^^^^^^^^^^ required by this bound in `Result::::unwrap` +$SRC_DIR/core/src/result.rs:LL:COL +$SRC_DIR/core/src/result.rs:LL:COL help: consider annotating `Foo` with `#[derive(Debug)]` | LL | #[derive(Debug)] diff --git a/src/test/ui/mismatched_types/similar_paths.stderr b/src/test/ui/mismatched_types/similar_paths.stderr index e65ae58d4ce96..46a383325526d 100644 --- a/src/test/ui/mismatched_types/similar_paths.stderr +++ b/src/test/ui/mismatched_types/similar_paths.stderr @@ -9,9 +9,6 @@ LL | Some(42_u8) = note: enum `std::option::Option` and enum `Option` have similar names, but are actually distinct types note: enum `std::option::Option` is defined in crate `core` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub enum Option { - | ^^^^^^^^^^^^^^^^^^ note: enum `Option` is defined in the current crate --> $DIR/similar_paths.rs:1:1 | diff --git a/src/test/ui/moves/move-fn-self-receiver.stderr b/src/test/ui/moves/move-fn-self-receiver.stderr index c13dc58826eb8..d8e360af418b2 100644 --- a/src/test/ui/moves/move-fn-self-receiver.stderr +++ b/src/test/ui/moves/move-fn-self-receiver.stderr @@ -8,9 +8,6 @@ LL | val.0; | note: this function takes ownership of the receiver `self`, which moves `val.0` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ = note: move occurs because `val.0` has type `Vec`, which does not implement the `Copy` trait error[E0382]: use of moved value: `foo` @@ -112,10 +109,10 @@ LL | foo_add; | ^^^^^^^ value used here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + --> $DIR/move-fn-self-receiver.rs:58:5 | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^^ +LL | foo_add + Foo; + | ^^^^^^^^^^^^^ error[E0382]: use of moved value: `implicit_into_iter` --> $DIR/move-fn-self-receiver.rs:63:5 diff --git a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr index a49ee31b46622..75ba29be62360 100644 --- a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr +++ b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr @@ -10,9 +10,6 @@ LL | touch(&x[0]); | note: this function takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider cloning the value if the performance cost is acceptable | LL | consume(x.clone().into_iter().next().unwrap()); diff --git a/src/test/ui/moves/moves-based-on-type-exprs.stderr b/src/test/ui/moves/moves-based-on-type-exprs.stderr index 838b1282cb4ed..e4c157725c79a 100644 --- a/src/test/ui/moves/moves-based-on-type-exprs.stderr +++ b/src/test/ui/moves/moves-based-on-type-exprs.stderr @@ -162,9 +162,6 @@ LL | touch(&x); | note: this function takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider cloning the value if the performance cost is acceptable | LL | let _y = x.clone().into_iter().next().unwrap(); @@ -182,9 +179,6 @@ LL | touch(&x); | note: this function takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider cloning the value if the performance cost is acceptable | LL | let _y = [x.clone().into_iter().next().unwrap(); 1]; diff --git a/src/test/ui/never_type/issue-52443.stderr b/src/test/ui/never_type/issue-52443.stderr index 0910e9ad77a84..de5c9c5601635 100644 --- a/src/test/ui/never_type/issue-52443.stderr +++ b/src/test/ui/never_type/issue-52443.stderr @@ -46,9 +46,6 @@ LL | [(); { for _ in 0usize.. {}; 0}]; | note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | impl const IntoIterator for I { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constants are limited to constant functions, tuple structs and tuple variants error[E0658]: mutable references are not allowed in constants diff --git a/src/test/ui/never_type/issue-96335.stderr b/src/test/ui/never_type/issue-96335.stderr index 168cf2f83535d..e148b983e8e9d 100644 --- a/src/test/ui/never_type/issue-96335.stderr +++ b/src/test/ui/never_type/issue-96335.stderr @@ -26,9 +26,6 @@ LL | 0.....{loop{}1}; found struct `RangeTo<{integer}>` note: associated function defined here --> $SRC_DIR/core/src/ops/range.rs:LL:COL - | -LL | pub const fn new(start: Idx, end: Idx) -> Self { - | ^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/no-capture-arc.stderr b/src/test/ui/no-capture-arc.stderr index 9ae41e78c227d..296e1fb3f26fe 100644 --- a/src/test/ui/no-capture-arc.stderr +++ b/src/test/ui/no-capture-arc.stderr @@ -13,11 +13,6 @@ LL | assert_eq!((*arc_v)[2], 3); | ^^^^^^^^ value borrowed here after move | = note: borrow occurs due to deref coercion to `Vec` -note: deref defined here - --> $SRC_DIR/alloc/src/sync.rs:LL:COL - | -LL | type Target = T; - | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/no-reuse-move-arc.stderr b/src/test/ui/no-reuse-move-arc.stderr index 564b05854740c..bcd481c33f361 100644 --- a/src/test/ui/no-reuse-move-arc.stderr +++ b/src/test/ui/no-reuse-move-arc.stderr @@ -13,11 +13,6 @@ LL | assert_eq!((*arc_v)[2], 3); | ^^^^^^^^ value borrowed here after move | = note: borrow occurs due to deref coercion to `Vec` -note: deref defined here - --> $SRC_DIR/alloc/src/sync.rs:LL:COL - | -LL | type Target = T; - | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr index c864b93dbbbe1..13cb5a6e1f7b5 100644 --- a/src/test/ui/no-send-res-ports.stderr +++ b/src/test/ui/no-send-res-ports.stderr @@ -31,9 +31,10 @@ LL | thread::spawn(move|| { | ^^^^^^ note: required by a bound in `spawn` --> $SRC_DIR/std/src/thread/mod.rs:LL:COL - | -LL | F: Send + 'static, - | ^^^^ required by this bound in `spawn` +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL +$SRC_DIR/std/src/thread/mod.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/on-unimplemented/sum.stderr b/src/test/ui/on-unimplemented/sum.stderr index 70706541ad650..d8f10603de234 100644 --- a/src/test/ui/on-unimplemented/sum.stderr +++ b/src/test/ui/on-unimplemented/sum.stderr @@ -17,9 +17,9 @@ LL | vec![(), ()].iter().sum::(); | this expression has type `Vec<()>` note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | S: Sum, - | ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator --> $DIR/sum.rs:7:25 @@ -40,9 +40,9 @@ LL | vec![(), ()].iter().product::(); | this expression has type `Vec<()>` note: required by a bound in `std::iter::Iterator::product` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | P: Product, - | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::product` +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL +$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr index 920720a4f53e2..a65ad0bb78504 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr @@ -37,9 +37,6 @@ LL | enum E { A, B } | ^^^^^^ must implement `BitOr<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - | -LL | pub trait BitOr { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/overloaded/overloaded-calls-nontuple.stderr b/src/test/ui/overloaded/overloaded-calls-nontuple.stderr index 794535aeb1105..2e16007825935 100644 --- a/src/test/ui/overloaded/overloaded-calls-nontuple.stderr +++ b/src/test/ui/overloaded/overloaded-calls-nontuple.stderr @@ -6,9 +6,6 @@ LL | impl FnMut for S { | note: required by a bound in `FnMut` --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait FnMut: FnOnce { - | ^^^^^ required by this bound in `FnMut` error[E0059]: type parameter to bare `FnOnce` trait must be a tuple --> $DIR/overloaded-calls-nontuple.rs:18:6 @@ -18,9 +15,6 @@ LL | impl FnOnce for S { | note: required by a bound in `FnOnce` --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait FnOnce { - | ^^^^^ required by this bound in `FnOnce` error[E0277]: functions with the "rust-call" ABI must take a single non-self tuple argument --> $DIR/overloaded-calls-nontuple.rs:12:5 diff --git a/src/test/ui/parser/issues/issue-62894.stderr b/src/test/ui/parser/issues/issue-62894.stderr index ae89926914eba..07a203bf416ea 100644 --- a/src/test/ui/parser/issues/issue-62894.stderr +++ b/src/test/ui/parser/issues/issue-62894.stderr @@ -42,11 +42,9 @@ LL | fn f() { assert_eq!(f(), (), assert_eq!(assert_eq! LL | LL | fn main() {} | ^^ unexpected token + --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | ($left:expr, $right:expr $(,)?) => { - | ---------- while parsing argument for this `expr` macro fragment + = note: while parsing argument for this `expr` macro fragment error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/kw-in-trait-bounds.stderr b/src/test/ui/parser/kw-in-trait-bounds.stderr index 546ad84eeee7b..79643660e8b00 100644 --- a/src/test/ui/parser/kw-in-trait-bounds.stderr +++ b/src/test/ui/parser/kw-in-trait-bounds.stderr @@ -91,44 +91,36 @@ error[E0405]: cannot find trait `r#fn` in this scope | LL | fn _f(_: impl fn(), _: &dyn fn()) | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error[E0405]: cannot find trait `r#fn` in this scope --> $DIR/kw-in-trait-bounds.rs:17:4 | LL | G: fn(), | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error[E0405]: cannot find trait `r#fn` in this scope --> $DIR/kw-in-trait-bounds.rs:3:27 | LL | fn _f(_: impl fn(), _: &dyn fn()) | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error[E0405]: cannot find trait `r#fn` in this scope --> $DIR/kw-in-trait-bounds.rs:3:41 | LL | fn _f(_: impl fn(), _: &dyn fn()) | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error[E0405]: cannot find trait `r#struct` in this scope --> $DIR/kw-in-trait-bounds.rs:24:10 diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr index f3dca9bcb07d1..635f6c86f4a5b 100644 --- a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr +++ b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr @@ -7,11 +7,8 @@ LL | match Some(1) { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | None, - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr index b450a9aeddf8d..610c86b3385b9 100644 --- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr +++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr @@ -67,11 +67,8 @@ LL | match None { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr index c9781d52e6dcf..00dad2c8b674c 100644 --- a/src/test/ui/pattern/usefulness/issue-35609.stderr +++ b/src/test/ui/pattern/usefulness/issue-35609.stderr @@ -108,8 +108,7 @@ LL | match Some(A) { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ^^^^^^^^^^^^^^^^^^ + = note: = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-3601.stderr b/src/test/ui/pattern/usefulness/issue-3601.stderr index eb8c63919b644..195703b922a6a 100644 --- a/src/test/ui/pattern/usefulness/issue-3601.stderr +++ b/src/test/ui/pattern/usefulness/issue-3601.stderr @@ -6,12 +6,9 @@ LL | box NodeKind::Element(ed) => match ed.kind { | note: `Box` defined here --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | / pub struct Box< -LL | | T: ?Sized, -LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, -LL | | >(Unique, A); - | |_^ +$SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL: = note: the matched value is of type `Box` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index b0d7fe5eb6892..88277eb223f2f 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -20,14 +20,9 @@ LL | match Some(Some(North)) { note: `Option>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ - | | - | not covered - | not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered +: not covered = note: the matched value is of type `Option>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index 4607cfaae1719..0e1e125811066 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -7,11 +7,8 @@ LL | match private::DATA { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index 4234600d0d02f..755333cdb7ebc 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -37,11 +37,8 @@ LL | match Some(10) { note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub enum Option { - | ------------------ -... -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ not covered + = note: +$SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/privacy/associated-item-privacy-trait.rs b/src/test/ui/privacy/associated-item-privacy-trait.rs index ad9a5e15c4e6e..c686a21772e0e 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.rs +++ b/src/test/ui/privacy/associated-item-privacy-trait.rs @@ -19,9 +19,9 @@ mod priv_trait { Pub.method(); //~^ ERROR type `for<'a> fn(&'a Self) {::method}` is private ::CONST; - //~^ ERROR associated constant `::CONST` is private + //~^ ERROR associated constant `PrivTr::CONST` is private let _: ::AssocTy; - //~^ ERROR associated type `::AssocTy` is private + //~^ ERROR associated type `PrivTr::AssocTy` is private pub type InSignatureTy = ::AssocTy; //~^ ERROR trait `PrivTr` is private pub trait InSignatureTr: PrivTr {} diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr index c4be1a9d9a202..eb905bf7ef858 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.stderr +++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr @@ -31,7 +31,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: associated constant `::CONST` is private +error: associated constant `PrivTr::CONST` is private --> $DIR/associated-item-privacy-trait.rs:21:9 | LL | ::CONST; @@ -42,7 +42,7 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: associated type `::AssocTy` is private +error: associated type `PrivTr::AssocTy` is private --> $DIR/associated-item-privacy-trait.rs:23:16 | LL | let _: ::AssocTy; diff --git a/src/test/ui/privacy/private-inferred-type-3.rs b/src/test/ui/privacy/private-inferred-type-3.rs index 0337aedd00881..cdbdcf60b2c54 100644 --- a/src/test/ui/privacy/private-inferred-type-3.rs +++ b/src/test/ui/privacy/private-inferred-type-3.rs @@ -1,7 +1,7 @@ // aux-build:private-inferred-type.rs // error-pattern:type `fn() {ext::priv_fn}` is private -// error-pattern:static `PRIV_STATIC` is private +// error-pattern:static `ext::PRIV_STATIC` is private // error-pattern:type `ext::PrivEnum` is private // error-pattern:type `fn() {::method}` is private // error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr index 00b61512de6b4..42faeb4bf341d 100644 --- a/src/test/ui/privacy/private-inferred-type-3.stderr +++ b/src/test/ui/privacy/private-inferred-type-3.stderr @@ -6,7 +6,7 @@ LL | ext::m!(); | = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info) -error: static `PRIV_STATIC` is private +error: static `ext::PRIV_STATIC` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); diff --git a/src/test/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr b/src/test/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr index ac49e04e3c0a9..14e5df21ef651 100644 --- a/src/test/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr +++ b/src/test/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr @@ -7,9 +7,6 @@ LL | #[derive(PartialOrd, AddImpl)] = help: the trait `PartialEq` is not implemented for `PriorityQueue` note: required by a bound in `PartialOrd` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait PartialOrd: PartialEq { - | ^^^^^^^^^^^^^^ required by this bound in `PartialOrd` = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `PriorityQueue: Eq` is not satisfied @@ -20,9 +17,6 @@ LL | #[derive(PartialOrd, AddImpl)] | note: required by a bound in `Ord` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait Ord: Eq + PartialOrd { - | ^^ required by this bound in `Ord` = note: this error originates in the derive macro `AddImpl` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `T` with `T` @@ -38,9 +32,6 @@ LL | #[derive(PartialOrd, AddImpl)] | ^^^^^^^^^^ note: required by a bound in `Ord` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait Ord: Eq + PartialOrd { - | ^^^^^^^^^^^^^^^^ required by this bound in `Ord` = note: this error originates in the derive macro `AddImpl` which comes from the expansion of the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index 65ce24e552296..a3b27fd7bcc1b 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -144,11 +144,9 @@ LL | parent_source_spans!($($tokens)*); ... LL | one!("hello", "world"); | ---------------------- in this macro invocation + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | -- similarly named tuple variant `Ok` defined here + = note: similarly named tuple variant `Ok` defined here | = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -160,11 +158,9 @@ LL | parent_source_spans!($($tokens)*); ... LL | two!("yay", "rust"); | ------------------- in this macro invocation + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | -- similarly named tuple variant `Ok` defined here + = note: similarly named tuple variant `Ok` defined here | = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -176,11 +172,9 @@ LL | parent_source_spans!($($tokens)*); ... LL | three!("hip", "hop"); | -------------------- in this macro invocation + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | -- similarly named tuple variant `Ok` defined here + = note: similarly named tuple variant `Ok` defined here | = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `three` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index a534b9d5377ad..3c3f24d0ff22e 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -72,22 +72,18 @@ error: cannot find derive macro `Dlone` in this scope | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` + --> $SRC_DIR/core/src/clone.rs:LL:COL | - ::: $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | pub macro Clone($item:item) { - | --------------- similarly named derive macro `Clone` defined here + = note: similarly named derive macro `Clone` defined here error: cannot find derive macro `Dlone` in this scope --> $DIR/resolve-error.rs:35:10 | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` + --> $SRC_DIR/core/src/clone.rs:LL:COL | - ::: $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | pub macro Clone($item:item) { - | --------------- similarly named derive macro `Clone` defined here + = note: similarly named derive macro `Clone` defined here error: cannot find attribute `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:32:3 diff --git a/src/test/ui/proc-macro/signature.stderr b/src/test/ui/proc-macro/signature.stderr index 59b3e44c74a52..bb59cb74a4ed4 100644 --- a/src/test/ui/proc-macro/signature.stderr +++ b/src/test/ui/proc-macro/signature.stderr @@ -14,9 +14,10 @@ LL | | } = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `ProcMacro::custom_derive` --> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL - | -LL | expand: impl Fn(crate::TokenStream) -> crate::TokenStream + Copy, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ProcMacro::custom_derive` +$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL +$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL +$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL +$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/proc-macro/span-api-tests.rs b/src/test/ui/proc-macro/span-api-tests.rs index 914ad54ed0370..3f04ba866b7d6 100644 --- a/src/test/ui/proc-macro/span-api-tests.rs +++ b/src/test/ui/proc-macro/span-api-tests.rs @@ -2,6 +2,7 @@ // ignore-pretty // aux-build:span-api-tests.rs // aux-build:span-test-macros.rs +// compile-flags: -Ztranslate-remapped-path-to-local-path=yes #[macro_use] extern crate span_test_macros; diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr index aaea91ce0cbae..3956390368f7f 100644 --- a/src/test/ui/range/range-1.stderr +++ b/src/test/ui/range/range-1.stderr @@ -32,9 +32,6 @@ LL | let range = *arr..; = help: the trait `Sized` is not implemented for `[{integer}]` note: required by a bound in `RangeFrom` --> $SRC_DIR/core/src/ops/range.rs:LL:COL - | -LL | pub struct RangeFrom { - | ^^^ required by this bound in `RangeFrom` error: aborting due to 3 previous errors diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr index f2307899d3c47..8aaaa29831843 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -9,11 +9,8 @@ LL | let Ok(x) = res; note: `Result>` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | pub enum Result { - | --------------------- -... -LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | ^^^ not covered + = note: +$SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result>` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index 9a2d61ea4054b..cf478210132ed 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -18,11 +18,9 @@ error[E0412]: cannot find type `Opiton` in this scope | LL | type B = Opiton; // Misspelled type name from the prelude. | ^^^^^^ help: an enum with a similar name exists: `Option` + --> $SRC_DIR/core/src/option.rs:LL:COL | - ::: $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub enum Option { - | ------------------ similarly named enum `Option` defined here + = note: similarly named enum `Option` defined here error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:16:14 diff --git a/src/test/ui/resolve/resolve-primitive-fallback.stderr b/src/test/ui/resolve/resolve-primitive-fallback.stderr index 6d5d5bad9fe1a..964302e924c8a 100644 --- a/src/test/ui/resolve/resolve-primitive-fallback.stderr +++ b/src/test/ui/resolve/resolve-primitive-fallback.stderr @@ -28,9 +28,6 @@ LL | std::mem::size_of(u16); | note: function defined here --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^^^^^^^ help: remove the extra argument | LL | std::mem::size_of(); diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr index 9577952119adb..a19750cc73aa5 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr @@ -9,9 +9,6 @@ LL | fn can_parse_zero_as_f32() -> Result { = note: required for `Result` to implement `Termination` note: required by a bound in `assert_test_result` --> $SRC_DIR/test/src/lib.rs:LL:COL - | -LL | pub fn assert_test_result(result: T) -> Result<(), String> { - | ^^^^^^^^^^^ required by this bound in `assert_test_result` = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr index 06699b947be40..e97fdcce1c18f 100644 --- a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr +++ b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr @@ -8,11 +8,6 @@ LL | let _ = dbg!(a); LL | let _ = dbg!(a); | ^ value used here after move | -help: borrow this binding in the pattern to avoid moving the value - --> $SRC_DIR/std/src/macros.rs:LL:COL - | -LL | ref tmp => { - | +++ error: aborting due to previous error diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index eea94643e0a0a..fd15f2ba9d46e 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -28,9 +28,6 @@ LL | enum World { | ^^^^^^^^^^ must implement `Add<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Add { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot add `String` to `&str` --> $DIR/issue-39018.rs:11:22 diff --git a/src/test/ui/span/issue-71363.rs b/src/test/ui/span/issue-71363.rs index f187d0efa8451..8014f3796250a 100644 --- a/src/test/ui/span/issue-71363.rs +++ b/src/test/ui/span/issue-71363.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ui-testing=no +// compile-flags: -Z ui-testing=no struct MyError; impl std::error::Error for MyError {} diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr index b76a3ab307ae4..48a2e763af615 100644 --- a/src/test/ui/span/missing-unit-argument.stderr +++ b/src/test/ui/span/missing-unit-argument.stderr @@ -6,9 +6,6 @@ LL | let _: Result<(), String> = Ok(); | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ help: provide the argument | LL | let _: Result<(), String> = Ok(()); diff --git a/src/test/ui/stability-attribute/stability-in-private-module.stderr b/src/test/ui/stability-attribute/stability-in-private-module.stderr index e64f2acbd351d..2f02a24960e01 100644 --- a/src/test/ui/stability-attribute/stability-in-private-module.stderr +++ b/src/test/ui/stability-attribute/stability-in-private-module.stderr @@ -6,9 +6,6 @@ LL | let _ = std::thread::thread_info::current_thread(); | note: the module `thread_info` is defined here --> $SRC_DIR/std/src/thread/mod.rs:LL:COL - | -LL | use crate::sys_common::thread_info; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/str/str-idx.stderr b/src/test/ui/str/str-idx.stderr index 019305def2932..cb1a6fcacfc9b 100644 --- a/src/test/ui/str/str-idx.stderr +++ b/src/test/ui/str/str-idx.stderr @@ -24,9 +24,6 @@ LL | let _ = s.get(4); = help: the trait `SliceIndex<[T]>` is implemented for `usize` note: required by a bound in `core::str::::get` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub const fn get>(&self, i: I) -> Option<&I::Output> { - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `core::str::::get` error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-idx.rs:5:29 @@ -42,9 +39,6 @@ LL | let _ = s.get_unchecked(4); = help: the trait `SliceIndex<[T]>` is implemented for `usize` note: required by a bound in `core::str::::get_unchecked` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub const unsafe fn get_unchecked>(&self, i: I) -> &I::Output { - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `core::str::::get_unchecked` error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-idx.rs:6:19 diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr index b165c482590a2..1994847b965a3 100644 --- a/src/test/ui/str/str-mut-idx.stderr +++ b/src/test/ui/str/str-mut-idx.stderr @@ -48,9 +48,6 @@ LL | s.get_mut(1); = help: the trait `SliceIndex<[T]>` is implemented for `usize` note: required by a bound in `core::str::::get_mut` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub const fn get_mut>(&mut self, i: I) -> Option<&mut I::Output> { - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `core::str::::get_mut` error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-mut-idx.rs:11:25 @@ -66,9 +63,9 @@ LL | s.get_unchecked_mut(1); = help: the trait `SliceIndex<[T]>` is implemented for `usize` note: required by a bound in `core::str::::get_unchecked_mut` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub const unsafe fn get_unchecked_mut>( - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `core::str::::get_unchecked_mut` +$SRC_DIR/core/src/str/mod.rs:LL:COL +$SRC_DIR/core/src/str/mod.rs:LL:COL +$SRC_DIR/core/src/str/mod.rs:LL:COL error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-mut-idx.rs:13:7 diff --git a/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr b/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr index 0a91c442d2c6f..44a39efdf2542 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr +++ b/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr @@ -13,9 +13,6 @@ LL | let _: Option<(i32, bool)> = Some(1, 2); found type `{integer}` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: remove the extra argument | LL | let _: Option<(i32, bool)> = Some(/* (i32, bool) */); @@ -52,9 +49,6 @@ LL | let _: Option<(i8,)> = Some(); | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: provide the argument | LL | let _: Option<(i8,)> = Some(/* (i8,) */); @@ -72,9 +66,6 @@ LL | let _: Option<(i32,)> = Some(5_usize); found type `usize` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple-errors.rs:17:34 @@ -88,9 +79,6 @@ LL | let _: Option<(i32,)> = Some((5_usize)); found type `usize` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/suggestions/args-instead-of-tuple.stderr b/src/test/ui/suggestions/args-instead-of-tuple.stderr index 20f9e5259a4e2..c8499010d6896 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple.stderr +++ b/src/test/ui/suggestions/args-instead-of-tuple.stderr @@ -6,9 +6,6 @@ LL | let _: Result<(i32, i8), ()> = Ok(1, 2); | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ help: wrap these arguments in parentheses to construct a tuple | LL | let _: Result<(i32, i8), ()> = Ok((1, 2)); @@ -22,9 +19,6 @@ LL | let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: wrap these arguments in parentheses to construct a tuple | LL | let _: Option<(i32, i8, &'static str)> = Some((1, 2, "hi")); @@ -38,9 +32,6 @@ LL | let _: Option<()> = Some(); | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: provide the argument | LL | let _: Option<()> = Some(()); @@ -58,9 +49,6 @@ LL | let _: Option<(i32,)> = Some(3); found type `{integer}` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: use a trailing comma to create a tuple with one element | LL | let _: Option<(i32,)> = Some((3,)); @@ -78,9 +66,6 @@ LL | let _: Option<(i32,)> = Some((3)); found type `{integer}` note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: use a trailing comma to create a tuple with one element | LL | let _: Option<(i32,)> = Some((3,)); diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/src/test/ui/suggestions/as-ref-2.stderr index e15e45d86b992..c924be17d1bca 100644 --- a/src/test/ui/suggestions/as-ref-2.stderr +++ b/src/test/ui/suggestions/as-ref-2.stderr @@ -12,9 +12,6 @@ LL | let _y = foo; | note: this function takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn map(self, f: F) -> Option - | ^^^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index 54122cb7360b4..b871c9b45a56c 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -15,11 +15,9 @@ error: cannot find attribute `tests` in this scope | LL | #[tests] | ^^^^^ help: an attribute macro with a similar name exists: `test` + --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | pub macro test($item:item) { - | -------------- similarly named attribute macro `test` defined here + = note: similarly named attribute macro `test` defined here error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 diff --git a/src/test/ui/suggestions/borrow-for-loop-head.stderr b/src/test/ui/suggestions/borrow-for-loop-head.stderr index 0cc8994fe1f2d..13569bd024642 100644 --- a/src/test/ui/suggestions/borrow-for-loop-head.stderr +++ b/src/test/ui/suggestions/borrow-for-loop-head.stderr @@ -18,9 +18,6 @@ LL | for j in a { | note: this function takes ownership of the receiver `self`, which moves `a` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | LL | for j in &a { diff --git a/src/test/ui/suggestions/bound-suggestions.stderr b/src/test/ui/suggestions/bound-suggestions.stderr index 4cb595c32c061..cd27947f02fad 100644 --- a/src/test/ui/suggestions/bound-suggestions.stderr +++ b/src/test/ui/suggestions/bound-suggestions.stderr @@ -78,9 +78,6 @@ LL | const SIZE: usize = core::mem::size_of::(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider further restricting `Self` | LL | trait Foo: Sized { @@ -94,9 +91,6 @@ LL | const SIZE: usize = core::mem::size_of::(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider further restricting `Self` | LL | trait Bar: std::fmt::Display + Sized { @@ -110,9 +104,6 @@ LL | const SIZE: usize = core::mem::size_of::(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider further restricting `Self` | LL | trait Baz: Sized where Self: std::fmt::Display { @@ -126,9 +117,6 @@ LL | const SIZE: usize = core::mem::size_of::(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider further restricting `Self` | LL | trait Qux: Sized where Self: std::fmt::Display { @@ -142,9 +130,6 @@ LL | const SIZE: usize = core::mem::size_of::(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider further restricting `Self` | LL | trait Bat: std::fmt::Display + Sized { diff --git a/src/test/ui/suggestions/derive-clone-for-eq.stderr b/src/test/ui/suggestions/derive-clone-for-eq.stderr index 0645f0cdde7c0..0a18b770405c1 100644 --- a/src/test/ui/suggestions/derive-clone-for-eq.stderr +++ b/src/test/ui/suggestions/derive-clone-for-eq.stderr @@ -11,9 +11,6 @@ LL | impl PartialEq for Struct | ^^^^^^^^^^^^ ^^^^^^^^^ note: required by a bound in `Eq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait Eq: PartialEq { - | ^^^^^^^^^^^^^^^ required by this bound in `Eq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | diff --git a/src/test/ui/suggestions/derive-trait-for-method-call.stderr b/src/test/ui/suggestions/derive-trait-for-method-call.stderr index 7cc372f2422ae..f07fd54e07c0b 100644 --- a/src/test/ui/suggestions/derive-trait-for-method-call.stderr +++ b/src/test/ui/suggestions/derive-trait-for-method-call.stderr @@ -22,9 +22,6 @@ LL | let y = x.test(); `CloneEnum: Default` note: the following trait must be implemented --> $SRC_DIR/core/src/default.rs:LL:COL - | -LL | pub trait Default: Sized { - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider annotating `Enum` with `#[derive(Clone)]` | LL | #[derive(Clone)] @@ -69,16 +66,12 @@ LL | struct Foo (X, Y); ... LL | let y = x.test(); | ^^^^ method cannot be called on `Foo, Instant>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/time.rs:LL:COL | - ::: $SRC_DIR/std/src/time.rs:LL:COL - | -LL | pub struct Instant(time::Instant); - | ------------------ doesn't satisfy `Instant: Default` - | - ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + = note: doesn't satisfy `Instant: Default` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | -LL | pub struct Vec { - | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Clone` + = note: doesn't satisfy `Vec: Clone` | = note: the following trait bounds were not satisfied: `Vec: Clone` diff --git a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr b/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr index 7bdc8e00f447d..0cd6267b3b313 100644 --- a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr +++ b/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr @@ -3,11 +3,9 @@ error[E0573]: expected type, found module `result` | LL | impl result { | ^^^^^^ help: an enum with a similar name exists: `Result` + --> $SRC_DIR/core/src/result.rs:LL:COL | - ::: $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | --------------------- similarly named enum `Result` defined here + = note: similarly named enum `Result` defined here error[E0573]: expected type, found variant `Err` --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:3:25 diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index 34ff59a9bb050..b1e04dab8f623 100644 --- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -41,9 +41,6 @@ LL | Pin::new(x) found type parameter `F` note: associated function defined here --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | pub const fn new(pointer: P) -> Pin

{ - | ^^^ error[E0277]: `dyn Future + Send` cannot be unpinned --> $DIR/expected-boxed-future-isnt-pinned.rs:19:14 @@ -56,9 +53,6 @@ LL | Pin::new(x) = note: consider using `Box::pin` note: required by a bound in `Pin::

::new` --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | impl> Pin

{ - | ^^^^^ required by this bound in `Pin::

::new` error[E0277]: `dyn Future + Send` cannot be unpinned --> $DIR/expected-boxed-future-isnt-pinned.rs:24:14 @@ -71,9 +65,6 @@ LL | Pin::new(Box::new(x)) = note: consider using `Box::pin` note: required by a bound in `Pin::

::new` --> $SRC_DIR/core/src/pin.rs:LL:COL - | -LL | impl> Pin

{ - | ^^^^^ required by this bound in `Pin::

::new` error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:28:5 @@ -90,9 +81,6 @@ LL | | } found `async` block `[async block@$DIR/expected-boxed-future-isnt-pinned.rs:28:5: 30:6]` note: function defined here --> $SRC_DIR/core/src/future/mod.rs:LL:COL - | -LL | pub const fn identity_future>(f: Fut) -> Fut { - | ^^^^^^^^^^^^^^^ help: you need to pin and box this expression | LL ~ Box::pin(async { diff --git a/src/test/ui/suggestions/for-i-in-vec.stderr b/src/test/ui/suggestions/for-i-in-vec.stderr index 88be9e30a7641..42d674e748867 100644 --- a/src/test/ui/suggestions/for-i-in-vec.stderr +++ b/src/test/ui/suggestions/for-i-in-vec.stderr @@ -9,9 +9,6 @@ LL | for _ in self.v { | note: this function takes ownership of the receiver `self`, which moves `self.v` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | LL | for _ in &self.v { @@ -42,9 +39,6 @@ LL | for loader in *LOADERS { | note: this function takes ownership of the receiver `self`, which moves value --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^ help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop | LL | for loader in &*LOADERS { diff --git a/src/test/ui/suggestions/imm-ref-trait-object.stderr b/src/test/ui/suggestions/imm-ref-trait-object.stderr index 42ca3a78d8f9f..7791b308d5d0e 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object.stderr +++ b/src/test/ui/suggestions/imm-ref-trait-object.stderr @@ -3,11 +3,9 @@ error: the `min` method cannot be invoked on a trait object | LL | t.min().unwrap() | ^^^ + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | - ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | Self: Sized, - | ----- this has a `Sized` requirement + = note: this has a `Sized` requirement | = note: you need `&mut dyn Iterator` instead of `&dyn Iterator` diff --git a/src/test/ui/suggestions/import-trait-for-method-call.stderr b/src/test/ui/suggestions/import-trait-for-method-call.stderr index bac8de7987256..f159b51a26969 100644 --- a/src/test/ui/suggestions/import-trait-for-method-call.stderr +++ b/src/test/ui/suggestions/import-trait-for-method-call.stderr @@ -3,11 +3,9 @@ error[E0599]: no method named `finish` found for struct `DefaultHasher` in the c | LL | h.finish() | ^^^^^^ method not found in `DefaultHasher` + --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL - | -LL | fn finish(&self) -> u64; - | ------ the method is available for `DefaultHasher` here + = note: the method is available for `DefaultHasher` here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: diff --git a/src/test/ui/suggestions/issue-104287.stderr b/src/test/ui/suggestions/issue-104287.stderr index 4b302dd650919..79812a2985ef9 100644 --- a/src/test/ui/suggestions/issue-104287.stderr +++ b/src/test/ui/suggestions/issue-104287.stderr @@ -11,12 +11,6 @@ LL | simd_gt::<()>(x); | ^^^^^^^------ help: remove these generics | | | expected 0 generic arguments - | -note: associated function defined here, with 0 generic parameters - --> $SRC_DIR/core/src/../../portable-simd/crates/core_simd/src/ord.rs:LL:COL - | -LL | fn simd_gt(self, other: Self) -> Self::Mask; - | ^^^^^^^ error[E0425]: cannot find function `simd_gt` in this scope --> $DIR/issue-104287.rs:6:5 diff --git a/src/test/ui/suggestions/issue-62843.stderr b/src/test/ui/suggestions/issue-62843.stderr index 62f0943d4c9d9..b6e271de8076c 100644 --- a/src/test/ui/suggestions/issue-62843.stderr +++ b/src/test/ui/suggestions/issue-62843.stderr @@ -10,9 +10,6 @@ LL | println!("{:?}", line.find(pattern)); = note: required for `String` to implement `Pattern<'_>` note: required by a bound in `core::str::::find` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option { - | ^^^^^^^^^^^ required by this bound in `core::str::::find` help: consider borrowing here | LL | println!("{:?}", line.find(&pattern)); diff --git a/src/test/ui/suggestions/issue-89064.stderr b/src/test/ui/suggestions/issue-89064.stderr index 8b2a388162806..93d8da226c817 100644 --- a/src/test/ui/suggestions/issue-89064.stderr +++ b/src/test/ui/suggestions/issue-89064.stderr @@ -62,11 +62,6 @@ error[E0107]: this associated function takes 0 generic arguments but 1 generic a LL | let _ = 42.into::>(); | ^^^^ expected 0 generic arguments | -note: associated function defined here, with 0 generic parameters - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn into(self) -> T; - | ^^^^ help: consider moving this generic argument to the `Into` trait, which takes up to 1 argument | LL | let _ = Into::>::into(42); diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr index d121932c842e3..2cb53ecce1040 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -9,9 +9,6 @@ LL | let fp = BufWriter::new(fp); = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` note: required by a bound in `BufWriter::::new` --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL - | -LL | impl BufWriter { - | ^^^^^ required by this bound in `BufWriter::::new` error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied --> $DIR/mut-borrow-needed-by-trait.rs:17:14 @@ -22,20 +19,15 @@ LL | let fp = BufWriter::new(fp); = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` note: required by a bound in `BufWriter` --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL - | -LL | pub struct BufWriter { - | ^^^^^ required by this bound in `BufWriter` error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn std::io::Write>`, but its trait bounds were not satisfied --> $DIR/mut-borrow-needed-by-trait.rs:21:5 | LL | writeln!(fp, "hello world").unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn std::io::Write>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL | - ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL - | -LL | pub struct BufWriter { - | ------------------------------ doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write` + = note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write` | = note: the following trait bounds were not satisfied: `&dyn std::io::Write: std::io::Write` diff --git a/src/test/ui/suggestions/option-content-move.stderr b/src/test/ui/suggestions/option-content-move.stderr index a6f1ebc975fd5..05606b8c301ac 100644 --- a/src/test/ui/suggestions/option-content-move.stderr +++ b/src/test/ui/suggestions/option-content-move.stderr @@ -9,9 +9,6 @@ LL | if selection.1.unwrap().contains(selection.0) { | note: this function takes ownership of the receiver `self`, which moves `selection.1` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn unwrap(self) -> T { - | ^^^^ error[E0507]: cannot move out of `selection.1` which is behind a shared reference --> $DIR/option-content-move.rs:27:20 @@ -24,9 +21,6 @@ LL | if selection.1.unwrap().contains(selection.0) { | note: this function takes ownership of the receiver `self`, which moves `selection.1` --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub fn unwrap(self) -> T - | ^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/restrict-type-not-param.stderr b/src/test/ui/suggestions/restrict-type-not-param.stderr index e7d9c5ecbe482..cf31c9ebcc7a1 100644 --- a/src/test/ui/suggestions/restrict-type-not-param.stderr +++ b/src/test/ui/suggestions/restrict-type-not-param.stderr @@ -13,9 +13,6 @@ LL | struct Wrapper(T); | ^^^^^^^^^^^^^^^^^ must implement `Add<_>` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Add { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | LL | fn qux(a: Wrapper, b: T) -> T where Wrapper: Add { diff --git a/src/test/ui/suggestions/sugg-else-for-closure.stderr b/src/test/ui/suggestions/sugg-else-for-closure.stderr index 55a0eee18179a..da4db46aad3d6 100644 --- a/src/test/ui/suggestions/sugg-else-for-closure.stderr +++ b/src/test/ui/suggestions/sugg-else-for-closure.stderr @@ -10,9 +10,6 @@ LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` note: associated function defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub const fn unwrap_or(self, default: T) -> T - | ^^^^^^^^^ help: try calling `unwrap_or_else` instead | LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap()); diff --git a/src/test/ui/suggestions/suggest-change-mut.stderr b/src/test/ui/suggestions/suggest-change-mut.stderr index 889b11a741084..d194afeaf931d 100644 --- a/src/test/ui/suggestions/suggest-change-mut.stderr +++ b/src/test/ui/suggestions/suggest-change-mut.stderr @@ -8,9 +8,6 @@ LL | let mut stream_reader = BufReader::new(&stream); | note: required by a bound in `BufReader::::new` --> $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL - | -LL | impl BufReader { - | ^^^^ required by this bound in `BufReader::::new` help: consider removing the leading `&`-reference | LL - let mut stream_reader = BufReader::new(&stream); @@ -30,11 +27,9 @@ error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its | LL | stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed"); | ^^^^^^^^^^ method cannot be called on `BufReader<&T>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL | - ::: $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL - | -LL | pub struct BufReader { - | ----------------------- doesn't satisfy `BufReader<&T>: BufRead` + = note: doesn't satisfy `BufReader<&T>: BufRead` | = note: the following trait bounds were not satisfied: `&T: std::io::Read` diff --git a/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr b/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr index 3d1f2492360bf..018083f9e03af 100644 --- a/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr +++ b/src/test/ui/suggestions/suggest-tryinto-edition-change.stderr @@ -52,11 +52,9 @@ error[E0599]: no method named `try_into` found for type `i32` in the current sco | LL | let _i: i16 = 0_i32.try_into().unwrap(); | ^^^^^^^^ method not found in `i32` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL | - ::: $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn try_into(self) -> Result; - | -------- the method is available for `i32` here + = note: the method is available for `i32` here | = help: items from traits can only be used if the trait is in scope = note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021 diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr b/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr index 951ff23d63563..fcff02e09dbb1 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr +++ b/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr @@ -24,11 +24,6 @@ error[E0107]: this struct takes at least 1 generic argument but 0 generic argume LL | let _: Vec = A::B; | ^^^ expected at least 1 generic argument | -note: struct defined here, with at least 1 generic parameter: `T` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^^^ - help: add missing generic argument | LL | let _: Vec = A::B; diff --git a/src/test/ui/traits/alias/generic-default-in-dyn.stderr b/src/test/ui/traits/alias/generic-default-in-dyn.stderr index 76a068e864a3c..0d3f794aa0f7a 100644 --- a/src/test/ui/traits/alias/generic-default-in-dyn.stderr +++ b/src/test/ui/traits/alias/generic-default-in-dyn.stderr @@ -12,11 +12,9 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified | LL | struct Foo(dyn SendEqAlias); | ^^^^^^^^^^^^^^ missing reference to `Rhs` + --> $SRC_DIR/core/src/cmp.rs:LL:COL | - ::: $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait PartialEq { - | --------------------------------------- type parameter `Rhs` must be specified for this + = note: type parameter `Rhs` must be specified for this | = note: because of the default `Self` reference, type parameters must be specified on object types @@ -25,11 +23,9 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified | LL | struct Bar(dyn SendEqAlias, T); | ^^^^^^^^^^^^^^ missing reference to `Rhs` + --> $SRC_DIR/core/src/cmp.rs:LL:COL | - ::: $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub trait PartialEq { - | --------------------------------------- type parameter `Rhs` must be specified for this + = note: type parameter `Rhs` must be specified for this | = note: because of the default `Self` reference, type parameters must be specified on object types diff --git a/src/test/ui/traits/alias/object-fail.stderr b/src/test/ui/traits/alias/object-fail.stderr index 325bc6d280859..048a150df8c52 100644 --- a/src/test/ui/traits/alias/object-fail.stderr +++ b/src/test/ui/traits/alias/object-fail.stderr @@ -7,8 +7,7 @@ LL | let _: &dyn EqAlias = &123; note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit --> $SRC_DIR/core/src/cmp.rs:LL:COL | -LL | pub trait Eq: PartialEq { - | ^^^^^^^^^^^^^^^ the trait cannot be made into an object because it uses `Self` as a type parameter + = note: the trait cannot be made into an object because it uses `Self` as a type parameter error[E0191]: the value of the associated type `Item` (from trait `Iterator`) must be specified --> $DIR/object-fail.rs:9:17 diff --git a/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr index 9ca446a0a891d..5be3349864182 100644 --- a/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr +++ b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr @@ -9,11 +9,9 @@ error[E0404]: expected trait, found struct `String` | LL | struct Foo where T: Bar, ::Baz: String { | ^^^^^^ not a trait + --> $SRC_DIR/alloc/src/string.rs:LL:COL | - ::: $SRC_DIR/alloc/src/string.rs:LL:COL - | -LL | pub trait ToString { - | ------------------ similarly named trait `ToString` defined here + = note: similarly named trait `ToString` defined here | help: constrain the associated type to `String` | @@ -29,11 +27,9 @@ error[E0404]: expected trait, found struct `String` | LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String { | ^^^^^^ not a trait + --> $SRC_DIR/alloc/src/string.rs:LL:COL | - ::: $SRC_DIR/alloc/src/string.rs:LL:COL - | -LL | pub trait ToString { - | ------------------ similarly named trait `ToString` defined here + = note: similarly named trait `ToString` defined here | help: constrain the associated type to `String` | @@ -49,11 +45,9 @@ error[E0404]: expected trait, found struct `String` | LL | fn foo(_: T) where ::Baz: String { | ^^^^^^ not a trait + --> $SRC_DIR/alloc/src/string.rs:LL:COL | - ::: $SRC_DIR/alloc/src/string.rs:LL:COL - | -LL | pub trait ToString { - | ------------------ similarly named trait `ToString` defined here + = note: similarly named trait `ToString` defined here | help: constrain the associated type to `String` | @@ -69,11 +63,9 @@ error[E0404]: expected trait, found struct `String` | LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { | ^^^^^^ not a trait + --> $SRC_DIR/alloc/src/string.rs:LL:COL | - ::: $SRC_DIR/alloc/src/string.rs:LL:COL - | -LL | pub trait ToString { - | ------------------ similarly named trait `ToString` defined here + = note: similarly named trait `ToString` defined here | help: constrain the associated type to `String` | @@ -89,11 +81,9 @@ error[E0404]: expected trait, found struct `String` | LL | fn issue_95327() where ::Assoc: String {} | ^^^^^^ help: a trait with a similar name exists: `ToString` + --> $SRC_DIR/alloc/src/string.rs:LL:COL | - ::: $SRC_DIR/alloc/src/string.rs:LL:COL - | -LL | pub trait ToString { - | ------------------ similarly named trait `ToString` defined here + = note: similarly named trait `ToString` defined here error: aborting due to 6 previous errors diff --git a/src/test/ui/traits/bad-sized.stderr b/src/test/ui/traits/bad-sized.stderr index 6f9113fff5161..fb9900bc57bbc 100644 --- a/src/test/ui/traits/bad-sized.stderr +++ b/src/test/ui/traits/bad-sized.stderr @@ -18,9 +18,6 @@ LL | let x: Vec = Vec::new(); = help: the trait `Sized` is not implemented for `dyn Trait` note: required by a bound in `Vec` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^ required by this bound in `Vec` error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time --> $DIR/bad-sized.rs:4:37 @@ -31,9 +28,6 @@ LL | let x: Vec = Vec::new(); = help: the trait `Sized` is not implemented for `dyn Trait` note: required by a bound in `Vec::::new` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | impl Vec { - | ^ required by this bound in `Vec::::new` error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time --> $DIR/bad-sized.rs:4:37 @@ -44,9 +38,6 @@ LL | let x: Vec = Vec::new(); = help: the trait `Sized` is not implemented for `dyn Trait` note: required by a bound in `Vec` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^ required by this bound in `Vec` error: aborting due to 4 previous errors diff --git a/src/test/ui/traits/issue-77982.stderr b/src/test/ui/traits/issue-77982.stderr index b6a04585583c9..18d0617a34609 100644 --- a/src/test/ui/traits/issue-77982.stderr +++ b/src/test/ui/traits/issue-77982.stderr @@ -12,9 +12,9 @@ LL | opts.get(opt.as_ref()); where T: ?Sized; note: required by a bound in `HashMap::::get` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | K: Borrow, - | ^^^^^^^^^ required by this bound in `HashMap::::get` +$SRC_DIR/std/src/collections/hash/map.rs:LL:COL +$SRC_DIR/std/src/collections/hash/map.rs:LL:COL +$SRC_DIR/std/src/collections/hash/map.rs:LL:COL help: consider specifying the generic argument | LL | opts.get::(opt.as_ref()); diff --git a/src/test/ui/traits/mutual-recursion-issue-75860.stderr b/src/test/ui/traits/mutual-recursion-issue-75860.stderr index 920f66121e098..23e182738f700 100644 --- a/src/test/ui/traits/mutual-recursion-issue-75860.stderr +++ b/src/test/ui/traits/mutual-recursion-issue-75860.stderr @@ -7,9 +7,6 @@ LL | iso(left, right) = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`mutual_recursion_issue_75860`) note: required by a bound in `Option` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub enum Option { - | ^ required by this bound in `Option` error: aborting due to previous error diff --git a/src/test/ui/traits/suggest-deferences/issue-39029.stderr b/src/test/ui/traits/suggest-deferences/issue-39029.stderr index eb2b88059d485..49e20c6a76ad9 100644 --- a/src/test/ui/traits/suggest-deferences/issue-39029.stderr +++ b/src/test/ui/traits/suggest-deferences/issue-39029.stderr @@ -9,9 +9,6 @@ LL | let _errors = TcpListener::bind(&bad); = note: required for `&NoToSocketAddrs` to implement `ToSocketAddrs` note: required by a bound in `TcpListener::bind` --> $SRC_DIR/std/src/net/tcp.rs:LL:COL - | -LL | pub fn bind(addr: A) -> io::Result { - | ^^^^^^^^^^^^^ required by this bound in `TcpListener::bind` help: consider dereferencing here | LL | let _errors = TcpListener::bind(&*bad); diff --git a/src/test/ui/traits/suggest-deferences/root-obligation.stderr b/src/test/ui/traits/suggest-deferences/root-obligation.stderr index 76663ace7edbd..1363fb8c47af8 100644 --- a/src/test/ui/traits/suggest-deferences/root-obligation.stderr +++ b/src/test/ui/traits/suggest-deferences/root-obligation.stderr @@ -11,9 +11,6 @@ LL | .filter(|c| "aeiou".contains(c)) = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL - | -LL | pub fn contains<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool { - | ^^^^^^^^^^^ required by this bound in `core::str::::contains` help: consider dereferencing here | LL | .filter(|c| "aeiou".contains(*c)) diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr index 9765fbd47ff46..44e63b78cce85 100644 --- a/src/test/ui/traits/suggest-where-clause.stderr +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -9,9 +9,6 @@ LL | mem::size_of::(); | note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider removing the `?Sized` bound to make the type parameter `Sized` | LL - fn check() { @@ -34,9 +31,6 @@ LL | struct Misc(T); | ^^^^ note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` help: consider removing the `?Sized` bound to make the type parameter `Sized` | LL - fn check() { @@ -80,9 +74,6 @@ LL | mem::size_of::<[T]>(); = help: the trait `Sized` is not implemented for `[T]` note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` error[E0277]: the size for values of type `[&U]` cannot be known at compilation time --> $DIR/suggest-where-clause.rs:31:20 @@ -93,9 +84,6 @@ LL | mem::size_of::<[&U]>(); = help: the trait `Sized` is not implemented for `[&U]` note: required by a bound in `std::mem::size_of` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `size_of` error: aborting due to 7 previous errors diff --git a/src/test/ui/transmutability/issue-101739-2.stderr b/src/test/ui/transmutability/issue-101739-2.stderr index 3f83d6583b09c..1b3d202590db4 100644 --- a/src/test/ui/transmutability/issue-101739-2.stderr +++ b/src/test/ui/transmutability/issue-101739-2.stderr @@ -8,12 +8,6 @@ LL | / ASSUME_LIFETIMES, LL | | ASSUME_VALIDITY, LL | | ASSUME_VISIBILITY, | |_____________________________- help: remove these generic arguments - | -note: trait defined here, with at most 3 generic parameters: `Src`, `Context`, `ASSUME` - --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL - | -LL | pub unsafe trait BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^ --- ------- ------------------------------------------ error: aborting due to previous error diff --git a/src/test/ui/tuple/wrong_argument_ice-3.stderr b/src/test/ui/tuple/wrong_argument_ice-3.stderr index f3a547fa23827..fe3712ef83917 100644 --- a/src/test/ui/tuple/wrong_argument_ice-3.stderr +++ b/src/test/ui/tuple/wrong_argument_ice-3.stderr @@ -13,9 +13,6 @@ LL | groups.push(new_group, vec![process]); found struct `Vec` note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub fn push(&mut self, value: T) { - | ^^^^ help: remove the extra argument | LL | groups.push(/* (Vec, Vec) */); diff --git a/src/test/ui/tuple/wrong_argument_ice.stderr b/src/test/ui/tuple/wrong_argument_ice.stderr index ec07f1e70cff6..452413fc51679 100644 --- a/src/test/ui/tuple/wrong_argument_ice.stderr +++ b/src/test/ui/tuple/wrong_argument_ice.stderr @@ -6,9 +6,6 @@ LL | self.acc.push_back(self.current_provides, self.current_requires); | note: associated function defined here --> $SRC_DIR/alloc/src/collections/vec_deque/mod.rs:LL:COL - | -LL | pub fn push_back(&mut self, value: T) { - | ^^^^^^^^^ help: wrap these arguments in parentheses to construct a tuple | LL | self.acc.push_back((self.current_provides, self.current_requires)); diff --git a/src/test/ui/type/ascription/issue-34255-1.stderr b/src/test/ui/type/ascription/issue-34255-1.stderr index 6819d14bb0106..fd43e1114c891 100644 --- a/src/test/ui/type/ascription/issue-34255-1.stderr +++ b/src/test/ui/type/ascription/issue-34255-1.stderr @@ -25,11 +25,6 @@ error[E0107]: missing generics for struct `Vec` LL | input_cells: Vec::new() | ^^^ expected at least 1 generic argument | -note: struct defined here, with at least 1 generic parameter: `T` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub struct Vec { - | ^^^ - help: add missing generic argument | LL | input_cells: Vec::new() diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.stderr b/src/test/ui/type/type-ascription-instead-of-initializer.stderr index de578ca93ed59..ba8d15d0b7317 100644 --- a/src/test/ui/type/type-ascription-instead-of-initializer.stderr +++ b/src/test/ui/type/type-ascription-instead-of-initializer.stderr @@ -15,9 +15,6 @@ LL | let x: Vec::with_capacity(10, 20); | note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - | -LL | pub fn with_capacity(capacity: usize) -> Self { - | ^^^^^^^^^^^^^ help: remove the extra argument | LL | let x: Vec::with_capacity(10); diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index fc85ec9331556..ecf5845ca55fe 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -35,9 +35,6 @@ LL | struct Z; | ^^^^^^^^ must implement `std::ops::Neg` note: the following trait must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | pub trait Neg { - | ^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:45:5 diff --git a/src/test/ui/type_length_limit.stderr b/src/test/ui/type_length_limit.stderr index ff48746690223..5b00d387aba5d 100644 --- a/src/test/ui/type_length_limit.stderr +++ b/src/test/ui/type_length_limit.stderr @@ -1,9 +1,6 @@ error: reached the type-length limit while instantiating `std::mem::drop::>` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL | -LL | pub fn drop(_x: T) {} - | ^^^^^^^^^^^^^^^^^^^^^ - | = help: consider adding a `#![type_length_limit="10"]` attribute to your crate = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt' diff --git a/src/test/ui/typeck/issue-46112.stderr b/src/test/ui/typeck/issue-46112.stderr index 91381e8ef4acf..f488463ae3ce9 100644 --- a/src/test/ui/typeck/issue-46112.stderr +++ b/src/test/ui/typeck/issue-46112.stderr @@ -10,9 +10,6 @@ LL | fn main() { test(Ok(())); } found unit type `()` note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ help: try wrapping the expression in `Some` | LL | fn main() { test(Ok(Some(()))); } diff --git a/src/test/ui/typeck/issue-75883.stderr b/src/test/ui/typeck/issue-75883.stderr index 3861e0507f6dd..f5adcabe3e91e 100644 --- a/src/test/ui/typeck/issue-75883.stderr +++ b/src/test/ui/typeck/issue-75883.stderr @@ -6,11 +6,6 @@ LL | pub fn run() -> Result<_> { | | | expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic argument | LL | pub fn run() -> Result<_, E> { @@ -24,11 +19,6 @@ LL | pub fn interact(&mut self) -> Result<_> { | | | expected 2 generic arguments | -note: enum defined here, with 2 generic parameters: `T`, `E` - --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | pub enum Result { - | ^^^^^^ - - help: add missing generic argument | LL | pub fn interact(&mut self) -> Result<_, E> { diff --git a/src/test/ui/typeck/issue-83693.stderr b/src/test/ui/typeck/issue-83693.stderr index 1e45c2d35dfdc..ce4f73b820a18 100644 --- a/src/test/ui/typeck/issue-83693.stderr +++ b/src/test/ui/typeck/issue-83693.stderr @@ -3,11 +3,9 @@ error[E0412]: cannot find type `F` in this scope | LL | impl F { | ^ help: a trait with a similar name exists: `Fn` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL | - ::: $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | -------------------------------------- similarly named trait `Fn` defined here + = note: similarly named trait `Fn` defined here error[E0412]: cannot find type `TestResult` in this scope --> $DIR/issue-83693.rs:9:22 diff --git a/src/test/ui/typeck/issue-84768.stderr b/src/test/ui/typeck/issue-84768.stderr index 04dc0e36520b4..00d23389720b9 100644 --- a/src/test/ui/typeck/issue-84768.stderr +++ b/src/test/ui/typeck/issue-84768.stderr @@ -16,9 +16,6 @@ LL | ::call_once(f, 1) found type `{integer}` note: associated function defined here --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; - | ^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/typeck/struct-enum-wrong-args.stderr b/src/test/ui/typeck/struct-enum-wrong-args.stderr index ea94bcbc29030..fbced928a8a9b 100644 --- a/src/test/ui/typeck/struct-enum-wrong-args.stderr +++ b/src/test/ui/typeck/struct-enum-wrong-args.stderr @@ -6,9 +6,6 @@ LL | let _ = Some(3, 2); | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^^^ help: remove the extra argument | LL | let _ = Some(3); @@ -24,9 +21,6 @@ LL | let _ = Ok(3, 6, 2); | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ help: remove the extra arguments | LL | let _ = Ok(3); @@ -40,9 +34,6 @@ LL | let _ = Ok(); | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | -LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), - | ^^ help: provide the argument | LL | let _ = Ok(/* value */); diff --git a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr index bf74dd7dec004..331540d1e4204 100644 --- a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr +++ b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr @@ -5,12 +5,6 @@ LL | fn foo1, U>(x: T) {} | ^^^^--- help: remove these generics | | | expected 0 generic arguments - | -note: trait defined here, with 0 generic parameters - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 @@ -19,12 +13,6 @@ LL | trait Trait: Copy {} | ^^^^---------- help: remove these generics | | | expected 0 generic arguments - | -note: trait defined here, with 0 generic parameters - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:7:21 @@ -33,12 +21,6 @@ LL | struct MyStruct1>; | ^^^^--- help: remove these generics | | | expected 0 generic arguments - | -note: trait defined here, with 0 generic parameters - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^ error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:10:25 @@ -47,12 +29,6 @@ LL | struct MyStruct2<'a, T: Copy<'a>>; | ^^^^---- help: remove these generics | | | expected 0 lifetime arguments - | -note: trait defined here, with 0 lifetime parameters - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^ error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:13:15 @@ -61,12 +37,6 @@ LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} | ^^^^ -- help: remove this lifetime argument | | | expected 0 lifetime arguments - | -note: trait defined here, with 0 lifetime parameters - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:13:15 @@ -75,12 +45,6 @@ LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} | ^^^^ - help: remove this generic argument | | | expected 0 generic arguments - | -note: trait defined here, with 0 generic parameters - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | pub trait Copy: Clone { - | ^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr index ed56e1cf957f5..a2fe627868aeb 100644 --- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -23,9 +23,6 @@ LL | >::add(1u32, 2); | note: associated function defined here --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^ help: change the type of the numeric literal from `u32` to `i32` | LL | >::add(1i32, 2); @@ -41,9 +38,6 @@ LL | >::add(1, 2u32); | note: associated function defined here --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^ help: change the type of the numeric literal from `u32` to `i32` | LL | >::add(1, 2i32); diff --git a/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr index 1c18eb0fc4905..cfbe1c6f2cbbc 100644 --- a/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr +++ b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr @@ -6,9 +6,6 @@ LL | fn a>(f: F) {} | note: required by a bound in `Fn` --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | pub trait Fn: FnMut { - | ^^^^^ required by this bound in `Fn` error: aborting due to previous error diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr index c7882963407f7..44d485c47cd10 100644 --- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr +++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr @@ -7,11 +7,8 @@ LL | let _ = match x { note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | pub enum Result { - | --------------------- -... -LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | ^^^ not covered + = note: +$SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -89,11 +86,8 @@ LL | let _ = match x { note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | pub enum Result { - | --------------------- -... -LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | ^^^ not covered + = note: +$SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -112,11 +106,8 @@ LL | let Ok(x) = x; note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL | -LL | pub enum Result { - | --------------------- -... -LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), - | ^^^ not covered + = note: +$SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr index 148fb5046705b..65ff72fe474b1 100644 --- a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr +++ b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr @@ -6,9 +6,6 @@ LL | #[derive(Clone)] | note: required by a bound in `AssertParamIsCopy` --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | pub struct AssertParamIsCopy { - | ^^^^ required by this bound in `AssertParamIsCopy` = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `U1` with `#[derive(Copy)]` | diff --git a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr index 148fb5046705b..65ff72fe474b1 100644 --- a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr +++ b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr @@ -6,9 +6,6 @@ LL | #[derive(Clone)] | note: required by a bound in `AssertParamIsCopy` --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | pub struct AssertParamIsCopy { - | ^^^^ required by this bound in `AssertParamIsCopy` = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `U1` with `#[derive(Copy)]` | diff --git a/src/test/ui/union/union-derive-eq.mirunsafeck.stderr b/src/test/ui/union/union-derive-eq.mirunsafeck.stderr index 99505f3163968..9e55390b54dbe 100644 --- a/src/test/ui/union/union-derive-eq.mirunsafeck.stderr +++ b/src/test/ui/union/union-derive-eq.mirunsafeck.stderr @@ -9,9 +9,6 @@ LL | a: PartialEqNotEq, | note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `PartialEqNotEq` with `#[derive(Eq)]` | diff --git a/src/test/ui/union/union-derive-eq.thirunsafeck.stderr b/src/test/ui/union/union-derive-eq.thirunsafeck.stderr index 99505f3163968..9e55390b54dbe 100644 --- a/src/test/ui/union/union-derive-eq.thirunsafeck.stderr +++ b/src/test/ui/union/union-derive-eq.thirunsafeck.stderr @@ -9,9 +9,6 @@ LL | a: PartialEqNotEq, | note: required by a bound in `AssertParamIsEq` --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | pub struct AssertParamIsEq { - | ^^ required by this bound in `AssertParamIsEq` = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `PartialEqNotEq` with `#[derive(Eq)]` | diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index 98a9bd07ed21d..59e4c3ea5a18b 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -9,14 +9,10 @@ LL | trait Foo { ... LL | let _z = y.clone(); | ^^^^^ method cannot be called on `Box` due to unsatisfied trait bounds - | - ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | / pub struct Box< -LL | | T: ?Sized, -LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, -LL | | >(Unique, A); - | |_- doesn't satisfy `Box: Clone` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL: doesn't satisfy `Box: Clone` | = note: the following trait bounds were not satisfied: `dyn Foo: Sized` diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index 7af9c684b72e3..eb7ce73454c6a 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -6,14 +6,10 @@ LL | struct R { ... LL | let _j = i.clone(); | ^^^^^ method cannot be called on `Box` due to unsatisfied trait bounds - | - ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL - | -LL | / pub struct Box< -LL | | T: ?Sized, -LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, -LL | | >(Unique, A); - | |_- doesn't satisfy `Box: Clone` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL +$SRC_DIR/alloc/src/boxed.rs:LL:COL: doesn't satisfy `Box: Clone` | = note: the following trait bounds were not satisfied: `R: Clone` diff --git a/src/test/ui/unop-move-semantics.stderr b/src/test/ui/unop-move-semantics.stderr index d52a92b8888e8..c0e615ca1a899 100644 --- a/src/test/ui/unop-move-semantics.stderr +++ b/src/test/ui/unop-move-semantics.stderr @@ -10,10 +10,10 @@ LL | x.clone(); | ^^^^^^^^^ value borrowed here after move | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/unop-move-semantics.rs:6:5 | -LL | fn not(self) -> Self::Output; - | ^^^^ +LL | !x; + | ^^ help: consider cloning the value if the performance cost is acceptable | LL | !x.clone(); @@ -56,10 +56,10 @@ LL | !*m; | `*m` moved due to usage in operator | note: calling this operator moves the left-hand side - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + --> $DIR/unop-move-semantics.rs:24:5 | -LL | fn not(self) -> Self::Output; - | ^^^^ +LL | !*m; + | ^^^ error[E0507]: cannot move out of `*n` which is behind a shared reference --> $DIR/unop-move-semantics.rs:26:6 diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.stderr b/src/test/ui/wf/hir-wf-check-erase-regions.stderr index b04588c571615..7bc19dd2e2162 100644 --- a/src/test/ui/wf/hir-wf-check-erase-regions.stderr +++ b/src/test/ui/wf/hir-wf-check-erase-regions.stderr @@ -9,9 +9,6 @@ LL | type IntoIter = std::iter::Flatten>; = note: required for `&T` to implement `IntoIterator` note: required by a bound in `Flatten` --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL - | -LL | pub struct Flatten> { - | ^^^^^^^^^^^^ required by this bound in `Flatten` error[E0277]: `&T` is not an iterator --> $DIR/hir-wf-check-erase-regions.rs:10:27 @@ -24,9 +21,6 @@ LL | fn into_iter(self) -> Self::IntoIter { = note: required for `&T` to implement `IntoIterator` note: required by a bound in `Flatten` --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL - | -LL | pub struct Flatten> { - | ^^^^^^^^^^^^ required by this bound in `Flatten` error: aborting due to 2 previous errors diff --git a/src/test/ui/wf/wf-impl-self-type.stderr b/src/test/ui/wf/wf-impl-self-type.stderr index 371321793adf8..1ca368729fe6f 100644 --- a/src/test/ui/wf/wf-impl-self-type.stderr +++ b/src/test/ui/wf/wf-impl-self-type.stderr @@ -7,9 +7,6 @@ LL | impl Foo for Option<[u8]> {} = help: the trait `Sized` is not implemented for `[u8]` note: required by a bound in `Option` --> $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub enum Option { - | ^ required by this bound in `Option` error: aborting due to previous error diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 1542b1c17ad11..72a43108dc480 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1924,7 +1924,15 @@ impl<'test> TestCx<'test> { rustc.args(&["--json", "future-incompat"]); } rustc.arg("-Ccodegen-units=1"); + // Hide line numbers to reduce churn rustc.arg("-Zui-testing"); + // Hide libstd sources from ui tests to make sure we generate the stderr + // output that users will see. + // Without this, we may be producing good diagnostics in-tree but users + // will not see half the information. + rustc.arg("-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX"); + rustc.arg("-Ztranslate-remapped-path-to-local-path=no"); + rustc.arg("-Zdeduplicate-diagnostics=no"); // FIXME: use this for other modes too, for perf? rustc.arg("-Cstrip=debuginfo"); From 717294fa04dacaa82e8efbad9021c8970bca4bb0 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 11:55:46 +0000 Subject: [PATCH 2/8] Inform the user which trait is meant in the diagnostic itself instead of relying on the span making it obvious --- .../rustc_hir_typeck/src/method/suggest.rs | 23 +++++++++++++++---- src/test/ui/binop/issue-28837.stderr | 18 +++++++-------- src/test/ui/binop/issue-3820.stderr | 2 +- .../note-unsupported.stderr | 2 +- src/test/ui/error-festival.stderr | 2 +- .../ui/impl-trait/issues/issue-62742.stderr | 2 +- src/test/ui/issues/issue-14091-2.stderr | 2 +- .../ui/methods/method-call-err-msg.stderr | 2 +- .../assignment-operator-unimplemented.stderr | 2 +- .../or-patterns-syntactic-fail.stderr | 2 +- src/test/ui/span/issue-39018.stderr | 2 +- ...pecialization-trait-not-implemented.stderr | 2 +- .../derive-trait-for-method-call.stderr | 2 +- .../restrict-type-not-param.stderr | 2 +- .../ui/type/type-ascription-precedence.stderr | 2 +- 15 files changed, 40 insertions(+), 27 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index db93cfab2c0db..2d3b4663f06ce 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -1853,7 +1853,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { )], ) { let mut derives = Vec::<(String, Span, Symbol)>::new(); - let mut traits = Vec::::new(); + let mut traits = Vec::new(); for (pred, _, _) in unsatisfied_predicates { let ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)) = pred.kind().skip_binder() else { continue }; let adt = match trait_pred.self_ty().ty_adt_def() { @@ -1892,10 +1892,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } derives.push((self_name, self_span, diagnostic_name)); } else { - traits.push(self.tcx.def_span(trait_pred.def_id())); + traits.push(trait_pred.def_id()); } } else { - traits.push(self.tcx.def_span(trait_pred.def_id())); + traits.push(trait_pred.def_id()); } } traits.sort(); @@ -1918,10 +1918,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let len = traits.len(); if len > 0 { - let span: MultiSpan = traits.into(); + let span = + MultiSpan::from_spans(traits.iter().map(|&did| self.tcx.def_span(did)).collect()); + let mut names = format!("`{}`", self.tcx.def_path_str(traits[0])); + for (i, &did) in traits.iter().enumerate().skip(1) { + if len > 2 { + names.push_str(", "); + } + if i == len - 1 { + names.push_str(" and "); + } + names.push('`'); + names.push_str(&self.tcx.def_path_str(did)); + names.push('`'); + } err.span_note( span, - &format!("the following trait{} must be implemented", pluralize!(len),), + &format!("the trait{} {} must be implemented", pluralize!(len), names), ); } diff --git a/src/test/ui/binop/issue-28837.stderr b/src/test/ui/binop/issue-28837.stderr index 89355edf74d78..6e236ca5296a1 100644 --- a/src/test/ui/binop/issue-28837.stderr +++ b/src/test/ui/binop/issue-28837.stderr @@ -11,7 +11,7 @@ note: an implementation of `Add<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Add<_>` -note: the following trait must be implemented +note: the trait `Add` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0369]: cannot subtract `A` from `A` @@ -27,7 +27,7 @@ note: an implementation of `Sub<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Sub<_>` -note: the following trait must be implemented +note: the trait `Sub` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0369]: cannot multiply `A` by `A` @@ -43,7 +43,7 @@ note: an implementation of `Mul<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Mul<_>` -note: the following trait must be implemented +note: the trait `Mul` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0369]: cannot divide `A` by `A` @@ -59,7 +59,7 @@ note: an implementation of `Div<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Div<_>` -note: the following trait must be implemented +note: the trait `Div` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0369]: cannot mod `A` by `A` @@ -75,7 +75,7 @@ note: an implementation of `Rem<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Rem<_>` -note: the following trait must be implemented +note: the trait `Rem` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0369]: no implementation for `A & A` @@ -91,7 +91,7 @@ note: an implementation of `BitAnd<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `BitAnd<_>` -note: the following trait must be implemented +note: the trait `BitAnd` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0369]: no implementation for `A | A` @@ -107,7 +107,7 @@ note: an implementation of `BitOr<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `BitOr<_>` -note: the following trait must be implemented +note: the trait `BitOr` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0369]: no implementation for `A << A` @@ -123,7 +123,7 @@ note: an implementation of `Shl<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Shl<_>` -note: the following trait must be implemented +note: the trait `Shl` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0369]: no implementation for `A >> A` @@ -139,7 +139,7 @@ note: an implementation of `Shr<_>` might be missing for `A` | LL | struct A; | ^^^^^^^^ must implement `Shr<_>` -note: the following trait must be implemented +note: the trait `Shr` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0369]: binary operation `==` cannot be applied to type `A` diff --git a/src/test/ui/binop/issue-3820.stderr b/src/test/ui/binop/issue-3820.stderr index 9bf178d1f856c..c313ed6037f3a 100644 --- a/src/test/ui/binop/issue-3820.stderr +++ b/src/test/ui/binop/issue-3820.stderr @@ -11,7 +11,7 @@ note: an implementation of `Mul<_>` might be missing for `Thing` | LL | struct Thing { | ^^^^^^^^^^^^ must implement `Mul<_>` -note: the following trait must be implemented +note: the trait `Mul` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/destructuring-assignment/note-unsupported.stderr b/src/test/ui/destructuring-assignment/note-unsupported.stderr index 3b546115a505c..8a88332b73e10 100644 --- a/src/test/ui/destructuring-assignment/note-unsupported.stderr +++ b/src/test/ui/destructuring-assignment/note-unsupported.stderr @@ -49,7 +49,7 @@ note: an implementation of `AddAssign<_>` might be missing for `S` | LL | struct S { x: u8, y: u8 } | ^^^^^^^^ must implement `AddAssign<_>` -note: the following trait must be implemented +note: the trait `AddAssign` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0067]: invalid left-hand side of assignment diff --git a/src/test/ui/error-festival.stderr b/src/test/ui/error-festival.stderr index 5ff7ec952c129..fe9956b70bdd7 100644 --- a/src/test/ui/error-festival.stderr +++ b/src/test/ui/error-festival.stderr @@ -41,7 +41,7 @@ note: an implementation of `Not` might be missing for `Question` | LL | enum Question { | ^^^^^^^^^^^^^ must implement `Not` -note: the following trait must be implemented +note: the trait `Not` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0604]: only `u8` can be cast as `char`, not `u32` diff --git a/src/test/ui/impl-trait/issues/issue-62742.stderr b/src/test/ui/impl-trait/issues/issue-62742.stderr index 34f4dc2cef37d..bc342dc46893b 100644 --- a/src/test/ui/impl-trait/issues/issue-62742.stderr +++ b/src/test/ui/impl-trait/issues/issue-62742.stderr @@ -25,7 +25,7 @@ LL | pub struct SafeImpl>(PhantomData<(A, T)>); | = note: the following trait bounds were not satisfied: `RawImpl<()>: Raw<()>` -note: the following trait must be implemented +note: the trait `Raw` must be implemented --> $DIR/issue-62742.rs:12:1 | LL | pub trait Raw { diff --git a/src/test/ui/issues/issue-14091-2.stderr b/src/test/ui/issues/issue-14091-2.stderr index 2e164f7c53e2d..f8375d4ef9014 100644 --- a/src/test/ui/issues/issue-14091-2.stderr +++ b/src/test/ui/issues/issue-14091-2.stderr @@ -9,7 +9,7 @@ note: an implementation of `Not` might be missing for `BytePos` | LL | pub struct BytePos(pub u32); | ^^^^^^^^^^^^^^^^^^ must implement `Not` -note: the following trait must be implemented +note: the trait `Not` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index 13d07ea2e49f6..3f4e647491eb7 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -61,7 +61,7 @@ LL | .take() = note: the following trait bounds were not satisfied: `Foo: Iterator` which is required by `&mut Foo: Iterator` -note: the following trait must be implemented +note: the trait `Iterator` must be implemented --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `take`, perhaps you need to implement it: diff --git a/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr b/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr index 53937d290774a..2393791a9b2a8 100644 --- a/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr +++ b/src/test/ui/mismatched_types/assignment-operator-unimplemented.stderr @@ -11,7 +11,7 @@ note: an implementation of `AddAssign<_>` might be missing for `Foo` | LL | struct Foo; | ^^^^^^^^^^ must implement `AddAssign<_>` -note: the following trait must be implemented +note: the trait `AddAssign` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr index a65ad0bb78504..10d42b7e3c0b8 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr @@ -35,7 +35,7 @@ note: an implementation of `BitOr<_>` might be missing for `E` | LL | enum E { A, B } | ^^^^^^ must implement `BitOr<_>` -note: the following trait must be implemented +note: the trait `BitOr` must be implemented --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error: aborting due to 5 previous errors diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index fd15f2ba9d46e..5d4d692b2cffb 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -26,7 +26,7 @@ note: an implementation of `Add<_>` might be missing for `World` | LL | enum World { | ^^^^^^^^^^ must implement `Add<_>` -note: the following trait must be implemented +note: the trait `Add` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0369]: cannot add `String` to `&str` diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr index 33ca7a2c210d6..37788612f4371 100644 --- a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr +++ b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr @@ -27,7 +27,7 @@ LL | default impl Foo for T { | ^^^^^^^^^^^^^^^^---^^^^^- | | | unsatisfied trait bound introduced here -note: the following trait must be implemented +note: the trait `Foo` must be implemented --> $DIR/specialization-trait-not-implemented.rs:7:1 | LL | trait Foo { diff --git a/src/test/ui/suggestions/derive-trait-for-method-call.stderr b/src/test/ui/suggestions/derive-trait-for-method-call.stderr index f07fd54e07c0b..14e8a2675dd18 100644 --- a/src/test/ui/suggestions/derive-trait-for-method-call.stderr +++ b/src/test/ui/suggestions/derive-trait-for-method-call.stderr @@ -20,7 +20,7 @@ LL | let y = x.test(); `Enum: Clone` `Enum: Default` `CloneEnum: Default` -note: the following trait must be implemented +note: the trait `Default` must be implemented --> $SRC_DIR/core/src/default.rs:LL:COL help: consider annotating `Enum` with `#[derive(Clone)]` | diff --git a/src/test/ui/suggestions/restrict-type-not-param.stderr b/src/test/ui/suggestions/restrict-type-not-param.stderr index cf31c9ebcc7a1..5434472ceecc7 100644 --- a/src/test/ui/suggestions/restrict-type-not-param.stderr +++ b/src/test/ui/suggestions/restrict-type-not-param.stderr @@ -11,7 +11,7 @@ note: an implementation of `Add<_>` might be missing for `Wrapper` | LL | struct Wrapper(T); | ^^^^^^^^^^^^^^^^^ must implement `Add<_>` -note: the following trait must be implemented +note: the trait `Add` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index ecf5845ca55fe..edc5aeffdcd65 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -33,7 +33,7 @@ note: an implementation of `std::ops::Neg` might be missing for `Z` | LL | struct Z; | ^^^^^^^^ must implement `std::ops::Neg` -note: the following trait must be implemented +note: the trait `std::ops::Neg` must be implemented --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0308]: mismatched types From 063b1675b2ed27948a7821af639a28c1a669d868 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 12:07:09 +0000 Subject: [PATCH 3/8] Clarify what "this" means --- compiler/rustc_borrowck/src/diagnostics/mod.rs | 17 +++++++++++++++-- .../rustc_const_eval/src/util/call_kind.rs | 18 +++--------------- ...ck-move-out-of-overloaded-auto-deref.stderr | 2 +- src/test/ui/borrowck/issue-83760.stderr | 4 ++-- .../reborrow-sugg-move-then-borrow.stderr | 2 +- .../suggest-as-ref-on-mut-closure.stderr | 2 +- ...move-upvar-from-non-once-ref-closure.stderr | 2 +- src/test/ui/codemap_tests/tab_3.stderr | 2 +- src/test/ui/error-codes/E0507.stderr | 2 +- src/test/ui/issues/issue-34721.stderr | 2 +- src/test/ui/issues/issue-61108.stderr | 2 +- src/test/ui/issues/issue-64559.stderr | 2 +- src/test/ui/issues/issue-83924.stderr | 2 +- src/test/ui/loops/issue-82916.stderr | 2 +- src/test/ui/moves/move-fn-self-receiver.stderr | 12 ++++++------ .../moves-based-on-type-access-to-field.stderr | 2 +- .../ui/moves/moves-based-on-type-exprs.stderr | 4 ++-- src/test/ui/suggestions/as-ref-2.stderr | 2 +- .../ui/suggestions/borrow-for-loop-head.stderr | 2 +- src/test/ui/suggestions/for-i-in-vec.stderr | 4 ++-- .../ui/suggestions/option-content-move.stderr | 4 ++-- .../ui/unsized-locals/borrow-after-move.stderr | 2 +- src/test/ui/unsized-locals/double-move.stderr | 2 +- .../use-after-move-self-based-on-type.stderr | 2 +- src/test/ui/use/use-after-move-self.stderr | 2 +- src/test/ui/walk-struct-literal-with.stderr | 2 +- 26 files changed, 51 insertions(+), 50 deletions(-) diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 4e2271a306722..1e51ab14f25ef 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -1069,7 +1069,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { ); } } - CallKind::Normal { self_arg, desugaring, is_option_or_result } => { + CallKind::Normal { self_arg, desugaring, method_did } => { let self_arg = self_arg.unwrap(); if let Some((CallDesugaringKind::ForLoopIntoIter, _)) = desugaring { let ty = moved_place.ty(self.body, self.infcx.tcx).ty; @@ -1139,14 +1139,27 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { ), ); } + let tcx = self.infcx.tcx; // Avoid pointing to the same function in multiple different // error messages. if span != DUMMY_SP && self.fn_self_span_reported.insert(self_arg.span) { + let func = tcx.def_path_str(method_did); err.span_note( self_arg.span, - &format!("this function takes ownership of the receiver `self`, which moves {}", place_name) + &format!("`{func}` takes ownership of the receiver `self`, which moves {place_name}") ); } + let parent_did = tcx.parent(method_did); + let parent_self_ty = (tcx.def_kind(parent_did) + == rustc_hir::def::DefKind::Impl) + .then_some(parent_did) + .and_then(|did| match tcx.type_of(did).kind() { + ty::Adt(def, ..) => Some(def.did()), + _ => None, + }); + let is_option_or_result = parent_self_ty.map_or(false, |def_id| { + matches!(tcx.get_diagnostic_name(def_id), Some(sym::Option | sym::Result)) + }); if is_option_or_result && maybe_reinitialized_locations_is_empty { err.span_label( var_span, diff --git a/compiler/rustc_const_eval/src/util/call_kind.rs b/compiler/rustc_const_eval/src/util/call_kind.rs index b38a6c551388e..38d9b044981cd 100644 --- a/compiler/rustc_const_eval/src/util/call_kind.rs +++ b/compiler/rustc_const_eval/src/util/call_kind.rs @@ -5,7 +5,7 @@ use rustc_hir::def_id::DefId; use rustc_hir::{lang_items, LangItem}; use rustc_middle::ty::subst::SubstsRef; -use rustc_middle::ty::{self, AssocItemContainer, DefIdTree, Instance, ParamEnv, Ty, TyCtxt}; +use rustc_middle::ty::{AssocItemContainer, Instance, ParamEnv, Ty, TyCtxt}; use rustc_span::symbol::Ident; use rustc_span::{sym, DesugaringKind, Span}; @@ -39,9 +39,7 @@ pub enum CallKind<'tcx> { Normal { self_arg: Option, desugaring: Option<(CallDesugaringKind, Ty<'tcx>)>, - /// Whether the self type of the method call has an `.as_ref()` method. - /// Used for better diagnostics. - is_option_or_result: bool, + method_did: DefId, }, /// A call to `Fn(..)::call(..)`, desugared from `my_closure(a, b, c)` FnCall { fn_trait_id: DefId, self_ty: Ty<'tcx> }, @@ -133,16 +131,6 @@ pub fn call_kind<'tcx>( } else { None }; - let parent_did = tcx.parent(method_did); - let parent_self_ty = (tcx.def_kind(parent_did) == rustc_hir::def::DefKind::Impl) - .then_some(parent_did) - .and_then(|did| match tcx.type_of(did).kind() { - ty::Adt(def, ..) => Some(def.did()), - _ => None, - }); - let is_option_or_result = parent_self_ty.map_or(false, |def_id| { - matches!(tcx.get_diagnostic_name(def_id), Some(sym::Option | sym::Result)) - }); - CallKind::Normal { self_arg, desugaring, is_option_or_result } + CallKind::Normal { self_arg, desugaring, method_did } }) } diff --git a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr index 4bc75c08b2588..ecf5382e863e0 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr @@ -7,7 +7,7 @@ LL | let _x = Rc::new(vec![1, 2]).into_iter(); | | value moved due to this method call | move occurs because value has type `Vec`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves value +note: `into_iter` takes ownership of the receiver `self`, which moves value --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-83760.stderr b/src/test/ui/borrowck/issue-83760.stderr index a049b10fec15a..a585bff0c6543 100644 --- a/src/test/ui/borrowck/issue-83760.stderr +++ b/src/test/ui/borrowck/issue-83760.stderr @@ -27,7 +27,7 @@ LL | foo = Some(Struct); LL | let _y = foo; | ^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `foo` +note: `Option::::unwrap` takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL error[E0382]: use of moved value: `foo` @@ -52,7 +52,7 @@ LL | foo = Some(Struct); LL | } else if true { LL | foo = Some(Struct); | ^^^^^^^^^^^^^^^^^^ -note: this function takes ownership of the receiver `self`, which moves `foo` +note: `Option::::unwrap` takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr index 27415a981a15f..ecd916a59fcbd 100644 --- a/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr +++ b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr @@ -9,7 +9,7 @@ LL | LL | fill_segment(state); | ^^^^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `state` +note: `into_iter` takes ownership of the receiver `self`, which moves `state` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider creating a fresh reborrow of `state` here | diff --git a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr index 49aeaa83b6368..4621d8793514a 100644 --- a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr +++ b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr @@ -8,7 +8,7 @@ LL | cb.map(|cb| cb()); | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | move occurs because `*cb` has type `Option<&mut dyn FnMut()>`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves `*cb` +note: `Option::::map` takes ownership of the receiver `self`, which moves `*cb` --> $SRC_DIR/core/src/option.rs:LL:COL error[E0596]: cannot borrow `*cb` as mutable, as it is behind a `&` reference diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr index ee12adb8ce50e..b1367c652188b 100644 --- a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr @@ -10,7 +10,7 @@ LL | y.into_iter(); | | | move occurs because `y` has type `Vec`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves `y` +note: `into_iter` takes ownership of the receiver `self`, which moves `y` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/codemap_tests/tab_3.stderr b/src/test/ui/codemap_tests/tab_3.stderr index 922adc609bc14..e0e369124a4be 100644 --- a/src/test/ui/codemap_tests/tab_3.stderr +++ b/src/test/ui/codemap_tests/tab_3.stderr @@ -9,7 +9,7 @@ LL | { LL | println!("{:?}", some_vec); | ^^^^^^^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `some_vec` +note: `into_iter` takes ownership of the receiver `self`, which moves `some_vec` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider cloning the value if the performance cost is acceptable diff --git a/src/test/ui/error-codes/E0507.stderr b/src/test/ui/error-codes/E0507.stderr index ce8d1ef03493c..03630f38987e2 100644 --- a/src/test/ui/error-codes/E0507.stderr +++ b/src/test/ui/error-codes/E0507.stderr @@ -7,7 +7,7 @@ LL | x.borrow().nothing_is_true(); | | value moved due to this method call | move occurs because value has type `TheDarkKnight`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves value +note: `TheDarkKnight::nothing_is_true` takes ownership of the receiver `self`, which moves value --> $DIR/E0507.rs:6:24 | LL | fn nothing_is_true(self) {} diff --git a/src/test/ui/issues/issue-34721.stderr b/src/test/ui/issues/issue-34721.stderr index 045819061c1b0..f2bf22227dbe4 100644 --- a/src/test/ui/issues/issue-34721.stderr +++ b/src/test/ui/issues/issue-34721.stderr @@ -13,7 +13,7 @@ LL | }; LL | x.zero() | ^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `x` +note: `Foo::zero` takes ownership of the receiver `self`, which moves `x` --> $DIR/issue-34721.rs:4:13 | LL | fn zero(self) -> Self; diff --git a/src/test/ui/issues/issue-61108.stderr b/src/test/ui/issues/issue-61108.stderr index 48ce67442ec14..3aaf5fb3f3e3a 100644 --- a/src/test/ui/issues/issue-61108.stderr +++ b/src/test/ui/issues/issue-61108.stderr @@ -9,7 +9,7 @@ LL | for l in bad_letters { LL | bad_letters.push('s'); | ^^^^^^^^^^^^^^^^^^^^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `bad_letters` +note: `into_iter` takes ownership of the receiver `self`, which moves `bad_letters` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | diff --git a/src/test/ui/issues/issue-64559.stderr b/src/test/ui/issues/issue-64559.stderr index 0674874ead072..386ac794d7db3 100644 --- a/src/test/ui/issues/issue-64559.stderr +++ b/src/test/ui/issues/issue-64559.stderr @@ -10,7 +10,7 @@ LL | let _closure = || orig; | | | value used here after move | -note: this function takes ownership of the receiver `self`, which moves `orig` +note: `into_iter` takes ownership of the receiver `self`, which moves `orig` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | diff --git a/src/test/ui/issues/issue-83924.stderr b/src/test/ui/issues/issue-83924.stderr index b89ba1a6285f6..572414df2bf9d 100644 --- a/src/test/ui/issues/issue-83924.stderr +++ b/src/test/ui/issues/issue-83924.stderr @@ -10,7 +10,7 @@ LL | for n in v { LL | for n in v { | ^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `v` +note: `into_iter` takes ownership of the receiver `self`, which moves `v` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider creating a fresh reborrow of `v` here | diff --git a/src/test/ui/loops/issue-82916.stderr b/src/test/ui/loops/issue-82916.stderr index 548da51aa399d..e6a60d7bc4072 100644 --- a/src/test/ui/loops/issue-82916.stderr +++ b/src/test/ui/loops/issue-82916.stderr @@ -9,7 +9,7 @@ LL | for y in x { LL | let z = x; | ^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `x` +note: `into_iter` takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | diff --git a/src/test/ui/moves/move-fn-self-receiver.stderr b/src/test/ui/moves/move-fn-self-receiver.stderr index d8e360af418b2..dda07934e3a0c 100644 --- a/src/test/ui/moves/move-fn-self-receiver.stderr +++ b/src/test/ui/moves/move-fn-self-receiver.stderr @@ -6,7 +6,7 @@ LL | val.0.into_iter().next(); LL | val.0; | ^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `val.0` +note: `into_iter` takes ownership of the receiver `self`, which moves `val.0` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: move occurs because `val.0` has type `Vec`, which does not implement the `Copy` trait @@ -20,7 +20,7 @@ LL | foo.use_self(); LL | foo; | ^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `foo` +note: `Foo::use_self` takes ownership of the receiver `self`, which moves `foo` --> $DIR/move-fn-self-receiver.rs:13:17 | LL | fn use_self(self) {} @@ -46,7 +46,7 @@ LL | boxed_foo.use_box_self(); LL | boxed_foo; | ^^^^^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `boxed_foo` +note: `Foo::use_box_self` takes ownership of the receiver `self`, which moves `boxed_foo` --> $DIR/move-fn-self-receiver.rs:14:21 | LL | fn use_box_self(self: Box) {} @@ -62,7 +62,7 @@ LL | pin_box_foo.use_pin_box_self(); LL | pin_box_foo; | ^^^^^^^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `pin_box_foo` +note: `Foo::use_pin_box_self` takes ownership of the receiver `self`, which moves `pin_box_foo` --> $DIR/move-fn-self-receiver.rs:15:25 | LL | fn use_pin_box_self(self: Pin>) {} @@ -88,7 +88,7 @@ LL | rc_foo.use_rc_self(); LL | rc_foo; | ^^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `rc_foo` +note: `Foo::use_rc_self` takes ownership of the receiver `self`, which moves `rc_foo` --> $DIR/move-fn-self-receiver.rs:16:20 | LL | fn use_rc_self(self: Rc) {} @@ -154,7 +154,7 @@ LL | for _val in container.custom_into_iter() {} LL | container; | ^^^^^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `container` +note: `Container::custom_into_iter` takes ownership of the receiver `self`, which moves `container` --> $DIR/move-fn-self-receiver.rs:23:25 | LL | fn custom_into_iter(self) -> impl Iterator { diff --git a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr index 75ba29be62360..0b1a623a01345 100644 --- a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr +++ b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr @@ -8,7 +8,7 @@ LL | consume(x.into_iter().next().unwrap()); LL | touch(&x[0]); | ^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `x` +note: `into_iter` takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider cloning the value if the performance cost is acceptable | diff --git a/src/test/ui/moves/moves-based-on-type-exprs.stderr b/src/test/ui/moves/moves-based-on-type-exprs.stderr index e4c157725c79a..ae76889f104c8 100644 --- a/src/test/ui/moves/moves-based-on-type-exprs.stderr +++ b/src/test/ui/moves/moves-based-on-type-exprs.stderr @@ -160,7 +160,7 @@ LL | let _y = x.into_iter().next().unwrap(); LL | touch(&x); | ^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `x` +note: `into_iter` takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider cloning the value if the performance cost is acceptable | @@ -177,7 +177,7 @@ LL | let _y = [x.into_iter().next().unwrap(); 1]; LL | touch(&x); | ^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `x` +note: `into_iter` takes ownership of the receiver `self`, which moves `x` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider cloning the value if the performance cost is acceptable | diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/src/test/ui/suggestions/as-ref-2.stderr index c924be17d1bca..e2129b4502abe 100644 --- a/src/test/ui/suggestions/as-ref-2.stderr +++ b/src/test/ui/suggestions/as-ref-2.stderr @@ -10,7 +10,7 @@ LL | let _x: Option = foo.map(|s| bar(&s)); LL | let _y = foo; | ^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `foo` +note: `Option::::map` takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/suggestions/borrow-for-loop-head.stderr b/src/test/ui/suggestions/borrow-for-loop-head.stderr index 13569bd024642..cbdb94877bdb7 100644 --- a/src/test/ui/suggestions/borrow-for-loop-head.stderr +++ b/src/test/ui/suggestions/borrow-for-loop-head.stderr @@ -16,7 +16,7 @@ LL | for i in &a { LL | for j in a { | ^ `a` moved due to this implicit call to `.into_iter()`, in previous iteration of loop | -note: this function takes ownership of the receiver `self`, which moves `a` +note: `into_iter` takes ownership of the receiver `self`, which moves `a` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | diff --git a/src/test/ui/suggestions/for-i-in-vec.stderr b/src/test/ui/suggestions/for-i-in-vec.stderr index 42d674e748867..c5b81e6b87174 100644 --- a/src/test/ui/suggestions/for-i-in-vec.stderr +++ b/src/test/ui/suggestions/for-i-in-vec.stderr @@ -7,7 +7,7 @@ LL | for _ in self.v { | `self.v` moved due to this implicit call to `.into_iter()` | move occurs because `self.v` has type `Vec`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves `self.v` +note: `into_iter` takes ownership of the receiver `self`, which moves `self.v` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider iterating over a slice of the `Vec`'s content to avoid moving into the `for` loop | @@ -37,7 +37,7 @@ LL | for loader in *LOADERS { | value moved due to this implicit call to `.into_iter()` | move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves value +note: `into_iter` takes ownership of the receiver `self`, which moves value --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop | diff --git a/src/test/ui/suggestions/option-content-move.stderr b/src/test/ui/suggestions/option-content-move.stderr index 05606b8c301ac..3e0271d02572b 100644 --- a/src/test/ui/suggestions/option-content-move.stderr +++ b/src/test/ui/suggestions/option-content-move.stderr @@ -7,7 +7,7 @@ LL | if selection.1.unwrap().contains(selection.0) { | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | move occurs because `selection.1` has type `Option`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves `selection.1` +note: `Option::::unwrap` takes ownership of the receiver `self`, which moves `selection.1` --> $SRC_DIR/core/src/option.rs:LL:COL error[E0507]: cannot move out of `selection.1` which is behind a shared reference @@ -19,7 +19,7 @@ LL | if selection.1.unwrap().contains(selection.0) { | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | move occurs because `selection.1` has type `Result`, which does not implement the `Copy` trait | -note: this function takes ownership of the receiver `self`, which moves `selection.1` +note: `Result::::unwrap` takes ownership of the receiver `self`, which moves `selection.1` --> $SRC_DIR/core/src/result.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/unsized-locals/borrow-after-move.stderr b/src/test/ui/unsized-locals/borrow-after-move.stderr index d8bffd4f9cf3e..9e3c345dd8001 100644 --- a/src/test/ui/unsized-locals/borrow-after-move.stderr +++ b/src/test/ui/unsized-locals/borrow-after-move.stderr @@ -59,7 +59,7 @@ LL | y.foo(); LL | println!("{}", &y); | ^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `y` +note: `Foo::foo` takes ownership of the receiver `self`, which moves `y` --> $DIR/borrow-after-move.rs:5:12 | LL | fn foo(self) -> String; diff --git a/src/test/ui/unsized-locals/double-move.stderr b/src/test/ui/unsized-locals/double-move.stderr index 71534818141ca..49b906bbe02b7 100644 --- a/src/test/ui/unsized-locals/double-move.stderr +++ b/src/test/ui/unsized-locals/double-move.stderr @@ -55,7 +55,7 @@ LL | y.foo(); LL | y.foo(); | ^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `y` +note: `Foo::foo` takes ownership of the receiver `self`, which moves `y` --> $DIR/double-move.rs:5:12 | LL | fn foo(self) -> String; diff --git a/src/test/ui/use/use-after-move-self-based-on-type.stderr b/src/test/ui/use/use-after-move-self-based-on-type.stderr index 7fdc4ab251fe8..1bdf49801f975 100644 --- a/src/test/ui/use/use-after-move-self-based-on-type.stderr +++ b/src/test/ui/use/use-after-move-self-based-on-type.stderr @@ -8,7 +8,7 @@ LL | self.bar(); LL | return self.x; | ^^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `self` +note: `S::bar` takes ownership of the receiver `self`, which moves `self` --> $DIR/use-after-move-self-based-on-type.rs:15:16 | LL | pub fn bar(self) {} diff --git a/src/test/ui/use/use-after-move-self.stderr b/src/test/ui/use/use-after-move-self.stderr index 073deee63b98c..59cc22eadb015 100644 --- a/src/test/ui/use/use-after-move-self.stderr +++ b/src/test/ui/use/use-after-move-self.stderr @@ -8,7 +8,7 @@ LL | self.bar(); LL | return *self.x; | ^^^^^^^ value used here after move | -note: this function takes ownership of the receiver `self`, which moves `self` +note: `S::bar` takes ownership of the receiver `self`, which moves `self` --> $DIR/use-after-move-self.rs:13:16 | LL | pub fn bar(self) {} diff --git a/src/test/ui/walk-struct-literal-with.stderr b/src/test/ui/walk-struct-literal-with.stderr index 4384e345e85c7..2b85fa9bed480 100644 --- a/src/test/ui/walk-struct-literal-with.stderr +++ b/src/test/ui/walk-struct-literal-with.stderr @@ -8,7 +8,7 @@ LL | let end = Mine{other_val:1, ..start.make_string_bar()}; LL | println!("{}", start.test); | ^^^^^^^^^^ value borrowed here after move | -note: this function takes ownership of the receiver `self`, which moves `start` +note: `Mine::make_string_bar` takes ownership of the receiver `self`, which moves `start` --> $DIR/walk-struct-literal-with.rs:7:28 | LL | fn make_string_bar(mut self) -> Mine{ From 2e2a4797a26b0effe15815b403be4ba752cc7a0b Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 12:26:16 +0000 Subject: [PATCH 4/8] Don't emit empty notes --- compiler/rustc_errors/src/emitter.rs | 36 ++++++++++--------- src/test/ui/error-codes/E0004-2.stderr | 2 -- src/test/ui/error-codes/E0005.stderr | 2 -- src/test/ui/error-codes/E0297.stderr | 2 -- .../feature-gate-exhaustive-patterns.stderr | 2 -- ...-missing-pattern-excluding-comments.stderr | 2 -- .../doc-hidden-non-exhaustive.stderr | 2 -- .../ui/pattern/usefulness/issue-35609.stderr | 2 -- .../ui/pattern/usefulness/issue-3601.stderr | 2 +- .../usefulness/match-arm-statics-2.stderr | 2 -- .../usefulness/match-privately-empty.stderr | 2 -- .../usefulness/non-exhaustive-match.stderr | 2 -- ...recursive-types-are-not-uninhabited.stderr | 2 -- .../uninhabited-matches-feature-gated.stderr | 6 ---- 14 files changed, 20 insertions(+), 46 deletions(-) diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index aaf0699f0dc41..268f17f86fe4d 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -1431,25 +1431,27 @@ impl EmitterWriter { }; for (i, annotation) in annotations.into_iter().enumerate() { if let Some(label) = &annotation.label { - let style = if annotation.is_primary { - Style::LabelPrimary - } else { - Style::LabelSecondary - }; - if annotation_id == 0 { - buffer.prepend(line_idx, " |", Style::LineNumber); - for _ in 0..max_line_num_len { - buffer.prepend(line_idx, " ", Style::NoStyle); + if !label.is_empty() { + let style = if annotation.is_primary { + Style::LabelPrimary + } else { + Style::LabelSecondary + }; + if annotation_id == 0 { + buffer.prepend(line_idx, " |", Style::LineNumber); + for _ in 0..max_line_num_len { + buffer.prepend(line_idx, " ", Style::NoStyle); + } + line_idx += 1; + buffer.append(line_idx + i, " = note: ", style); + for _ in 0..max_line_num_len { + buffer.prepend(line_idx, " ", Style::NoStyle); + } + } else { + buffer.append(line_idx + i, ": ", style); } - line_idx += 1; - buffer.append(line_idx + i, " = note: ", style); - for _ in 0..max_line_num_len { - buffer.prepend(line_idx, " ", Style::NoStyle); - } - } else { - buffer.append(line_idx + i, ": ", style); + buffer.append(line_idx + i, label, style); } - buffer.append(line_idx + i, label, style); } } } diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr index 200b5235259e7..7dd1396529bbe 100644 --- a/src/test/ui/error-codes/E0004-2.stderr +++ b/src/test/ui/error-codes/E0004-2.stderr @@ -6,8 +6,6 @@ LL | match x { } | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index 762654671e092..ef1bb60d14925 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -8,8 +8,6 @@ LL | let Some(y) = x; = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: you might want to use `if let` to ignore the variant that isn't matched diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr index 4d4bdfc09e97d..5afa25dcb72a1 100644 --- a/src/test/ui/error-codes/E0297.stderr +++ b/src/test/ui/error-codes/E0297.stderr @@ -6,8 +6,6 @@ LL | for Some(x) in xs {} | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index fe1f247adc057..b26383af72fca 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -8,8 +8,6 @@ LL | let Ok(_x) = foo(); = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | - = note: $SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr index 635f6c86f4a5b..e0c88f81eac2b 100644 --- a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr +++ b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr @@ -6,8 +6,6 @@ LL | match Some(1) { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr index 610c86b3385b9..35e0661189fa1 100644 --- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr +++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr @@ -66,8 +66,6 @@ LL | match None { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr index 00dad2c8b674c..12113957d6340 100644 --- a/src/test/ui/pattern/usefulness/issue-35609.stderr +++ b/src/test/ui/pattern/usefulness/issue-35609.stderr @@ -107,8 +107,6 @@ LL | match Some(A) { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-3601.stderr b/src/test/ui/pattern/usefulness/issue-3601.stderr index 195703b922a6a..e8cfb3e701688 100644 --- a/src/test/ui/pattern/usefulness/issue-3601.stderr +++ b/src/test/ui/pattern/usefulness/issue-3601.stderr @@ -8,7 +8,7 @@ note: `Box` defined here --> $SRC_DIR/alloc/src/boxed.rs:LL:COL $SRC_DIR/alloc/src/boxed.rs:LL:COL $SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL: +$SRC_DIR/alloc/src/boxed.rs:LL:COL = note: the matched value is of type `Box` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index 88277eb223f2f..36fc889910092 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -19,8 +19,6 @@ LL | match Some(Some(North)) { | note: `Option>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered : not covered = note: the matched value is of type `Option>` diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index 0e1e125811066..9bb15ba8a4286 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -6,8 +6,6 @@ LL | match private::DATA { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index 755333cdb7ebc..1256867a652e0 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -36,8 +36,6 @@ LL | match Some(10) { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL - | - = note: $SRC_DIR/core/src/option.rs:LL:COL: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr index 8aaaa29831843..429f0460e89e1 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -8,8 +8,6 @@ LL | let Ok(x) = res; = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Result>` defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | - = note: $SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result>` help: you might want to use `if let` to ignore the variant that isn't matched diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr index 44d485c47cd10..c375fd62877f9 100644 --- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr +++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr @@ -6,8 +6,6 @@ LL | let _ = match x { | note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | - = note: $SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown @@ -85,8 +83,6 @@ LL | let _ = match x { | note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | - = note: $SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown @@ -105,8 +101,6 @@ LL | let Ok(x) = x; = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL - | - = note: $SRC_DIR/core/src/result.rs:LL:COL: not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched From 59554a2b54c3510b062825801064541a4caa662d Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 15:25:04 +0000 Subject: [PATCH 5/8] Avoid rendering empty annotations --- compiler/rustc_errors/src/emitter.rs | 81 ++++++++++--------- src/test/ui/closures/closure-expected.stderr | 3 - src/test/ui/closures/closure-move-sync.stderr | 8 -- .../closures/coerce-unsafe-to-closure.stderr | 3 - src/test/ui/error-codes/E0004-2.stderr | 8 +- src/test/ui/error-codes/E0005.stderr | 4 +- src/test/ui/error-codes/E0297.stderr | 4 +- .../ruby_style_closure.stderr | 3 - .../feature-gate-exhaustive-patterns.stderr | 4 +- src/test/ui/inference/issue-71732.stderr | 3 - .../intrinsics/const-eval-select-bad.stderr | 16 ---- src/test/ui/issues/issue-20162.stderr | 2 - src/test/ui/issues/issue-23966.stderr | 3 - src/test/ui/issues/issue-31173.stderr | 3 - src/test/ui/issues/issue-33941.stderr | 3 - src/test/ui/issues/issue-34334.stderr | 2 - ...e-66923-show-error-for-correct-call.stderr | 4 - .../ui/iterators/collect-into-array.stderr | 2 - .../ui/iterators/collect-into-slice.stderr | 4 - .../iterators/invalid-iterator-chain.stderr | 17 ---- .../branches.stderr | 2 - .../recursion4.stderr | 4 - .../mismatched_types/closure-arg-count.stderr | 12 --- .../closure-arg-type-mismatch.stderr | 9 --- .../ui/mismatched_types/issue-36053-2.stderr | 3 - .../mismatched_types/issue-47706-trait.stderr | 3 - .../ui/mismatched_types/issue-47706.stderr | 3 - .../method-help-unsatisfied-bound.stderr | 2 - src/test/ui/no-send-res-ports.stderr | 4 - src/test/ui/on-unimplemented/sum.stderr | 6 -- ...-missing-pattern-excluding-comments.stderr | 4 +- .../doc-hidden-non-exhaustive.stderr | 4 +- .../ui/pattern/usefulness/issue-3601.stderr | 3 - .../usefulness/match-arm-statics-2.stderr | 7 +- .../usefulness/match-privately-empty.stderr | 4 +- .../usefulness/non-exhaustive-match.stderr | 4 +- src/test/ui/proc-macro/signature.stderr | 4 - ...recursive-types-are-not-uninhabited.stderr | 4 +- src/test/ui/str/str-mut-idx.stderr | 3 - src/test/ui/traits/issue-77982.stderr | 3 - .../uninhabited-matches-feature-gated.stderr | 12 ++- src/test/ui/unique-object-noncopyable.stderr | 6 +- src/test/ui/unique-pinned-nocopy.stderr | 6 +- 43 files changed, 94 insertions(+), 195 deletions(-) diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 268f17f86fe4d..c62e358e804ca 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -1408,51 +1408,58 @@ impl EmitterWriter { if !sm.ensure_source_file_source_present(annotated_file.file.clone()) { if !self.short_message { // We'll just print an unannotated message. - for (annotation_id, line) in annotated_file.lines.into_iter().enumerate() { + for (annotation_id, line) in annotated_file.lines.iter().enumerate() { let mut annotations = line.annotations.clone(); annotations.sort_by_key(|a| Reverse(a.start_col)); let mut line_idx = buffer.num_lines(); - buffer.append( - line_idx, - &format!( - "{}:{}:{}", - sm.filename_for_diagnostics(&annotated_file.file.name), - sm.doctest_offset_line(&annotated_file.file.name, line.line_index), - annotations[0].start_col + 1, - ), - Style::LineAndColumn, - ); - if annotation_id == 0 { - buffer.prepend(line_idx, "--> ", Style::LineNumber); + + let labels: Vec<_> = annotations + .iter() + .filter_map(|a| Some((a.label.as_ref()?, a.is_primary))) + .filter(|(l, _)| !l.is_empty()) + .collect(); + + if annotation_id == 0 || !labels.is_empty() { + buffer.append( + line_idx, + &format!( + "{}:{}:{}", + sm.filename_for_diagnostics(&annotated_file.file.name), + sm.doctest_offset_line( + &annotated_file.file.name, + line.line_index + ), + annotations[0].start_col + 1, + ), + Style::LineAndColumn, + ); + if annotation_id == 0 { + buffer.prepend(line_idx, "--> ", Style::LineNumber); + } else { + buffer.prepend(line_idx, "::: ", Style::LineNumber); + } for _ in 0..max_line_num_len { buffer.prepend(line_idx, " ", Style::NoStyle); } line_idx += 1; - }; - for (i, annotation) in annotations.into_iter().enumerate() { - if let Some(label) = &annotation.label { - if !label.is_empty() { - let style = if annotation.is_primary { - Style::LabelPrimary - } else { - Style::LabelSecondary - }; - if annotation_id == 0 { - buffer.prepend(line_idx, " |", Style::LineNumber); - for _ in 0..max_line_num_len { - buffer.prepend(line_idx, " ", Style::NoStyle); - } - line_idx += 1; - buffer.append(line_idx + i, " = note: ", style); - for _ in 0..max_line_num_len { - buffer.prepend(line_idx, " ", Style::NoStyle); - } - } else { - buffer.append(line_idx + i, ": ", style); - } - buffer.append(line_idx + i, label, style); - } + } + for (label, is_primary) in labels.into_iter() { + let style = if is_primary { + Style::LabelPrimary + } else { + Style::LabelSecondary + }; + buffer.prepend(line_idx, " |", Style::LineNumber); + for _ in 0..max_line_num_len { + buffer.prepend(line_idx, " ", Style::NoStyle); + } + line_idx += 1; + buffer.append(line_idx, " = note: ", style); + for _ in 0..max_line_num_len { + buffer.prepend(line_idx, " ", Style::NoStyle); } + buffer.append(line_idx, label, style); + line_idx += 1; } } } diff --git a/src/test/ui/closures/closure-expected.stderr b/src/test/ui/closures/closure-expected.stderr index 8671f4048cea5..87a5d67a420c4 100644 --- a/src/test/ui/closures/closure-expected.stderr +++ b/src/test/ui/closures/closure-expected.stderr @@ -10,9 +10,6 @@ LL | let y = x.or_else(4); = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Option::::or_else` --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr index 3dc761a630393..64e3b51ea713b 100644 --- a/src/test/ui/closures/closure-move-sync.stderr +++ b/src/test/ui/closures/closure-move-sync.stderr @@ -19,10 +19,6 @@ LL | let t = thread::spawn(|| { | ^^ note: required by a bound in `spawn` --> $SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL error[E0277]: `Sender<()>` cannot be shared between threads safely --> $DIR/closure-move-sync.rs:18:19 @@ -41,10 +37,6 @@ LL | thread::spawn(|| tx.send(()).unwrap()); | ^^ note: required by a bound in `spawn` --> $SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/closures/coerce-unsafe-to-closure.stderr b/src/test/ui/closures/coerce-unsafe-to-closure.stderr index 7144a18aea21b..449cd0b317757 100644 --- a/src/test/ui/closures/coerce-unsafe-to-closure.stderr +++ b/src/test/ui/closures/coerce-unsafe-to-closure.stderr @@ -10,9 +10,6 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `Option::::map` --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr index 7dd1396529bbe..e829bac196f79 100644 --- a/src/test/ui/error-codes/E0004-2.stderr +++ b/src/test/ui/error-codes/E0004-2.stderr @@ -6,8 +6,12 @@ LL | match x { } | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index ef1bb60d14925..0f179259356d5 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -8,7 +8,9 @@ LL | let Some(y) = x; = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr index 5afa25dcb72a1..903422f3b9b8a 100644 --- a/src/test/ui/error-codes/E0297.stderr +++ b/src/test/ui/error-codes/E0297.stderr @@ -6,7 +6,9 @@ LL | for Some(x) in xs {} | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` error: aborting due to previous error diff --git a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr index 88909cc5c639f..2f9d10d70a2fe 100644 --- a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr +++ b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr @@ -22,9 +22,6 @@ LL | | }); = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` note: required by a bound in `Option::::and_then` --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index b26383af72fca..e253e4791e8bd 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -8,7 +8,9 @@ LL | let Ok(_x) = foo(); = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/inference/issue-71732.stderr b/src/test/ui/inference/issue-71732.stderr index 22bbfa479f6d8..01b37f2acaa14 100644 --- a/src/test/ui/inference/issue-71732.stderr +++ b/src/test/ui/inference/issue-71732.stderr @@ -12,9 +12,6 @@ LL | .get(&"key".into()) where T: ?Sized; note: required by a bound in `HashMap::::get` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL -$SRC_DIR/std/src/collections/hash/map.rs:LL:COL -$SRC_DIR/std/src/collections/hash/map.rs:LL:COL -$SRC_DIR/std/src/collections/hash/map.rs:LL:COL help: consider specifying the generic argument | LL | .get::(&"key".into()) diff --git a/src/test/ui/intrinsics/const-eval-select-bad.stderr b/src/test/ui/intrinsics/const-eval-select-bad.stderr index 565e740ec3770..fd7d061b6b2e5 100644 --- a/src/test/ui/intrinsics/const-eval-select-bad.stderr +++ b/src/test/ui/intrinsics/const-eval-select-bad.stderr @@ -37,10 +37,6 @@ LL | const_eval_select((), 42, 0xDEADBEEF); = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL error: this argument must be a function item --> $DIR/const-eval-select-bad.rs:10:31 @@ -63,10 +59,6 @@ LL | const_eval_select((), 42, 0xDEADBEEF); = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL error[E0271]: expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool` --> $DIR/const-eval-select-bad.rs:32:34 @@ -78,10 +70,6 @@ LL | const_eval_select((1,), foo, bar); | note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL error[E0631]: type mismatch in function arguments --> $DIR/const-eval-select-bad.rs:37:32 @@ -98,10 +86,6 @@ LL | const_eval_select((true,), foo, baz); found function signature `fn(i32) -> _` note: required by a bound in `const_eval_select` --> $SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL -$SRC_DIR/core/src/intrinsics.rs:LL:COL error: this argument must be a `const fn` --> $DIR/const-eval-select-bad.rs:42:29 diff --git a/src/test/ui/issues/issue-20162.stderr b/src/test/ui/issues/issue-20162.stderr index 6f2709a482af6..1c5b76fbfc10b 100644 --- a/src/test/ui/issues/issue-20162.stderr +++ b/src/test/ui/issues/issue-20162.stderr @@ -6,8 +6,6 @@ LL | b.sort(); | note: required by a bound in `slice::::sort` --> $SRC_DIR/alloc/src/slice.rs:LL:COL -$SRC_DIR/alloc/src/slice.rs:LL:COL -$SRC_DIR/alloc/src/slice.rs:LL:COL help: consider annotating `X` with `#[derive(Ord)]` | LL | #[derive(Ord)] diff --git a/src/test/ui/issues/issue-23966.stderr b/src/test/ui/issues/issue-23966.stderr index c48d21eb3c4e3..8f934481d85db 100644 --- a/src/test/ui/issues/issue-23966.stderr +++ b/src/test/ui/issues/issue-23966.stderr @@ -9,9 +9,6 @@ LL | "".chars().fold(|_, _| (), ()); = help: the trait `FnMut<(_, char)>` is not implemented for `()` note: required by a bound in `fold` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index b0dea3696b9a5..b667ae0a78937 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -8,9 +8,6 @@ LL | .cloned() found type `u8` note: required by a bound in `cloned` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0599]: the method `collect` exists for struct `Cloned, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>`, but its trait bounds were not satisfied --> $DIR/issue-31173.rs:12:10 diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index 13d4a43fa8578..49702c4765863 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -8,9 +8,6 @@ LL | for _ in HashMap::new().iter().cloned() {} found tuple `(&_, &_)` note: required by a bound in `cloned` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` --> $DIR/issue-33941.rs:6:14 diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index 2635b16f83c71..9d2c315e4dbca 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -32,8 +32,6 @@ LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_rece | `Iterator::Item` is `&(_, _, _)` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr index f9a73239f5939..cec482a53baa9 100644 --- a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr +++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr @@ -15,8 +15,6 @@ LL | let x2: Vec = x1.into_iter().collect(); | ^^^^^^^^^^^ `Iterator::Item` is `&f64` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `Vec` cannot be built from an iterator over elements of type `&f64` --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29 @@ -36,8 +34,6 @@ LL | let x3 = x1.into_iter().collect::>(); | ^^^^^^^^^^^ `Iterator::Item` is `&f64` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/iterators/collect-into-array.stderr b/src/test/ui/iterators/collect-into-array.stderr index 0b2f8f6a14954..e38745cc10e1f 100644 --- a/src/test/ui/iterators/collect-into-array.stderr +++ b/src/test/ui/iterators/collect-into-array.stderr @@ -7,8 +7,6 @@ LL | let whatever: [u32; 10] = (0..10).collect(); = help: the trait `FromIterator<{integer}>` is not implemented for `[u32; 10]` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/iterators/collect-into-slice.stderr b/src/test/ui/iterators/collect-into-slice.stderr index b59a5e57775ef..29fff8c51c63b 100644 --- a/src/test/ui/iterators/collect-into-slice.stderr +++ b/src/test/ui/iterators/collect-into-slice.stderr @@ -17,8 +17,6 @@ LL | let some_generated_vec = (0..10).collect(); = help: the trait `Sized` is not implemented for `[i32]` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a slice of type `[i32]` cannot be built since `[i32]` has no definite size --> $DIR/collect-into-slice.rs:6:38 @@ -29,8 +27,6 @@ LL | let some_generated_vec = (0..10).collect(); = help: the trait `FromIterator<{integer}>` is not implemented for `[i32]` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 3 previous errors diff --git a/src/test/ui/iterators/invalid-iterator-chain.stderr b/src/test/ui/iterators/invalid-iterator-chain.stderr index 27ce4a19b0701..84bac7833f67b 100644 --- a/src/test/ui/iterators/invalid-iterator-chain.stderr +++ b/src/test/ui/iterators/invalid-iterator-chain.stderr @@ -22,9 +22,6 @@ LL | | }); | |__________^ `Iterator::Item` changed to `()` here note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()` --> $DIR/invalid-iterator-chain.rs:18:14 @@ -57,9 +54,6 @@ LL | .map(|x| { x; }) | ^^^^^^^^^^^^^^^ `Iterator::Item` changed to `()` here note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `f64` --> $DIR/invalid-iterator-chain.rs:28:14 @@ -88,9 +82,6 @@ LL | .map(|x| { x + 1.0 }) | -------------------- `Iterator::Item` remains `f64` here note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()` --> $DIR/invalid-iterator-chain.rs:30:54 @@ -112,9 +103,6 @@ LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::()); | this expression has type `Vec<{integer}>` note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()` --> $DIR/invalid-iterator-chain.rs:31:40 @@ -135,9 +123,6 @@ LL | println!("{}", vec![(), ()].iter().sum::()); | this expression has type `Vec<()>` note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `Vec` cannot be built from an iterator over elements of type `()` --> $DIR/invalid-iterator-chain.rs:40:25 @@ -167,8 +152,6 @@ LL | let f = e.filter(|_| false); | ----------------- `Iterator::Item` remains `()` here note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 6 previous errors diff --git a/src/test/ui/lazy-type-alias-impl-trait/branches.stderr b/src/test/ui/lazy-type-alias-impl-trait/branches.stderr index 2b7213450ed26..0b206f31e7b6e 100644 --- a/src/test/ui/lazy-type-alias-impl-trait/branches.stderr +++ b/src/test/ui/lazy-type-alias-impl-trait/branches.stderr @@ -7,8 +7,6 @@ LL | std::iter::empty().collect() = help: the trait `FromIterator<_>` is not implemented for `Bar` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr b/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr index 5c84a2570d8db..d8ac39a4f27a3 100644 --- a/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr +++ b/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr @@ -7,8 +7,6 @@ LL | x = std::iter::empty().collect(); = help: the trait `FromIterator<_>` is not implemented for `Foo` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `impl Debug` cannot be built from an iterator over elements of type `_` --> $DIR/recursion4.rs:19:28 @@ -19,8 +17,6 @@ LL | x = std::iter::empty().collect(); = help: the trait `FromIterator<_>` is not implemented for `impl Debug` note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr index b7d29151d6c05..2ecab9f024a12 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.stderr +++ b/src/test/ui/mismatched_types/closure-arg-count.stderr @@ -128,9 +128,6 @@ LL | fn foo() {} | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments --> $DIR/closure-arg-count.rs:27:57 @@ -144,9 +141,6 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar); | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments --> $DIR/closure-arg-count.rs:29:57 @@ -161,9 +155,6 @@ LL | fn qux(x: usize, y: usize) {} | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: function is expected to take 1 argument, but it takes 2 arguments --> $DIR/closure-arg-count.rs:32:45 @@ -175,9 +166,6 @@ LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add); | note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/closure-arg-count.rs:35:10 diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 596b1fe046dc8..ebff0c19e2bd2 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -10,9 +10,6 @@ LL | a.iter().map(|_: (u32, u32)| 45); found closure signature `fn((u32, u32)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:4:14 @@ -26,9 +23,6 @@ LL | a.iter().map(|_: &(u16, u16)| 45); found closure signature `for<'a> fn(&'a (u16, u16)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:5:14 @@ -42,9 +36,6 @@ LL | a.iter().map(|_: (u16, u16)| 45); found closure signature `fn((u16, u16)) -> _` note: required by a bound in `map` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 3 previous errors diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index c944b13224ff1..4afe0e6a664d4 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -10,9 +10,6 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); found closure signature `for<'a> fn(&'a str) -> _` note: required by a bound in `filter` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0599]: the method `count` exists for struct `Filter>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied --> $DIR/issue-36053-2.rs:7:55 diff --git a/src/test/ui/mismatched_types/issue-47706-trait.stderr b/src/test/ui/mismatched_types/issue-47706-trait.stderr index 9e8d4c6dec7fd..a5f38dd536661 100644 --- a/src/test/ui/mismatched_types/issue-47706-trait.stderr +++ b/src/test/ui/mismatched_types/issue-47706-trait.stderr @@ -10,9 +10,6 @@ LL | None::<()>.map(Self::f); | note: required by a bound in `Option::::map` --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/issue-47706.stderr b/src/test/ui/mismatched_types/issue-47706.stderr index c4185d732fe9b..d9d408844d0a4 100644 --- a/src/test/ui/mismatched_types/issue-47706.stderr +++ b/src/test/ui/mismatched_types/issue-47706.stderr @@ -11,9 +11,6 @@ LL | self.foo.map(Foo::new) | note: required by a bound in `Option::::map` --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/issue-47706.rs:27:9 diff --git a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr index 9e11ca2e3ed4d..d3b7525072ff4 100644 --- a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr +++ b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr @@ -8,8 +8,6 @@ LL | a.unwrap(); = note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo` note: required by a bound in `Result::::unwrap` --> $SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL help: consider annotating `Foo` with `#[derive(Debug)]` | LL | #[derive(Debug)] diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr index 13cb5a6e1f7b5..75561f4119aa5 100644 --- a/src/test/ui/no-send-res-ports.stderr +++ b/src/test/ui/no-send-res-ports.stderr @@ -31,10 +31,6 @@ LL | thread::spawn(move|| { | ^^^^^^ note: required by a bound in `spawn` --> $SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL -$SRC_DIR/std/src/thread/mod.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/on-unimplemented/sum.stderr b/src/test/ui/on-unimplemented/sum.stderr index d8f10603de234..2a316dba778fe 100644 --- a/src/test/ui/on-unimplemented/sum.stderr +++ b/src/test/ui/on-unimplemented/sum.stderr @@ -17,9 +17,6 @@ LL | vec![(), ()].iter().sum::(); | this expression has type `Vec<()>` note: required by a bound in `std::iter::Iterator::sum` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator --> $DIR/sum.rs:7:25 @@ -40,9 +37,6 @@ LL | vec![(), ()].iter().product::(); | this expression has type `Vec<()>` note: required by a bound in `std::iter::Iterator::product` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error: aborting due to 2 previous errors diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr index e0c88f81eac2b..2a016048f2f7a 100644 --- a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr +++ b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr @@ -6,7 +6,9 @@ LL | match Some(1) { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr index 35e0661189fa1..17e1a2304a13c 100644 --- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr +++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr @@ -66,7 +66,9 @@ LL | match None { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-3601.stderr b/src/test/ui/pattern/usefulness/issue-3601.stderr index e8cfb3e701688..59d7bcd4b5e79 100644 --- a/src/test/ui/pattern/usefulness/issue-3601.stderr +++ b/src/test/ui/pattern/usefulness/issue-3601.stderr @@ -6,9 +6,6 @@ LL | box NodeKind::Element(ed) => match ed.kind { | note: `Box` defined here --> $SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL = note: the matched value is of type `Box` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index 36fc889910092..e4dd35a59958e 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -19,8 +19,11 @@ LL | match Some(Some(North)) { | note: `Option>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered -: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + | + = note: not covered = note: the matched value is of type `Option>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index 9bb15ba8a4286..86f75d15cfde7 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -6,7 +6,9 @@ LL | match private::DATA { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index 1256867a652e0..e2260f50bfef2 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -36,7 +36,9 @@ LL | match Some(10) { | note: `Option` defined here --> $SRC_DIR/core/src/option.rs:LL:COL -$SRC_DIR/core/src/option.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/proc-macro/signature.stderr b/src/test/ui/proc-macro/signature.stderr index bb59cb74a4ed4..79f2001da0055 100644 --- a/src/test/ui/proc-macro/signature.stderr +++ b/src/test/ui/proc-macro/signature.stderr @@ -14,10 +14,6 @@ LL | | } = note: unsafe function cannot be called generically without an unsafe block note: required by a bound in `ProcMacro::custom_derive` --> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL -$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL -$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL -$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL -$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL error: aborting due to previous error diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr index 429f0460e89e1..86ad6aa847c9f 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -8,7 +8,9 @@ LL | let Ok(x) = res; = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Result>` defined here --> $SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Result>` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr index 1994847b965a3..ca4b86ba3065b 100644 --- a/src/test/ui/str/str-mut-idx.stderr +++ b/src/test/ui/str/str-mut-idx.stderr @@ -63,9 +63,6 @@ LL | s.get_unchecked_mut(1); = help: the trait `SliceIndex<[T]>` is implemented for `usize` note: required by a bound in `core::str::::get_unchecked_mut` --> $SRC_DIR/core/src/str/mod.rs:LL:COL -$SRC_DIR/core/src/str/mod.rs:LL:COL -$SRC_DIR/core/src/str/mod.rs:LL:COL -$SRC_DIR/core/src/str/mod.rs:LL:COL error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-mut-idx.rs:13:7 diff --git a/src/test/ui/traits/issue-77982.stderr b/src/test/ui/traits/issue-77982.stderr index 18d0617a34609..8ab6414d4d8e3 100644 --- a/src/test/ui/traits/issue-77982.stderr +++ b/src/test/ui/traits/issue-77982.stderr @@ -12,9 +12,6 @@ LL | opts.get(opt.as_ref()); where T: ?Sized; note: required by a bound in `HashMap::::get` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL -$SRC_DIR/std/src/collections/hash/map.rs:LL:COL -$SRC_DIR/std/src/collections/hash/map.rs:LL:COL -$SRC_DIR/std/src/collections/hash/map.rs:LL:COL help: consider specifying the generic argument | LL | opts.get::(opt.as_ref()); diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr index c375fd62877f9..d33a61ca8485c 100644 --- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr +++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr @@ -6,7 +6,9 @@ LL | let _ = match x { | note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -83,7 +85,9 @@ LL | let _ = match x { | note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Result` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -101,7 +105,9 @@ LL | let Ok(x) = x; = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html note: `Result` defined here --> $SRC_DIR/core/src/result.rs:LL:COL -$SRC_DIR/core/src/result.rs:LL:COL: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered = note: the matched value is of type `Result` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index 59e4c3ea5a18b..db42ed9baf1ed 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -10,9 +10,9 @@ LL | trait Foo { LL | let _z = y.clone(); | ^^^^^ method cannot be called on `Box` due to unsatisfied trait bounds --> $SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL: doesn't satisfy `Box: Clone` + ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL + | + = note: doesn't satisfy `Box: Clone` | = note: the following trait bounds were not satisfied: `dyn Foo: Sized` diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index eb7ce73454c6a..de6611324cac1 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -7,9 +7,9 @@ LL | struct R { LL | let _j = i.clone(); | ^^^^^ method cannot be called on `Box` due to unsatisfied trait bounds --> $SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL -$SRC_DIR/alloc/src/boxed.rs:LL:COL: doesn't satisfy `Box: Clone` + ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL + | + = note: doesn't satisfy `Box: Clone` | = note: the following trait bounds were not satisfied: `R: Clone` From 6984085088d365395690ffd148ee70d0c48b8d72 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 15:36:08 +0000 Subject: [PATCH 6/8] Stop pointing to operators if their libcore method source is not available --- .../rustc_borrowck/src/diagnostics/mod.rs | 7 +-- src/test/ui/binop/binop-consume-args.stderr | 50 ++++--------------- src/test/ui/binop/binop-move-semantics.stderr | 14 +----- .../ui/moves/move-fn-self-receiver.stderr | 5 +- src/test/ui/unop-move-semantics.stderr | 10 +--- 5 files changed, 16 insertions(+), 70 deletions(-) diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 1e51ab14f25ef..cbd590052008c 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -1059,12 +1059,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { ); if self.fn_self_span_reported.insert(fn_span) { err.span_note( - // Check whether the source is accessible - if self.infcx.tcx.sess.source_map().is_span_accessible(self_arg.span) { - self_arg.span - } else { - fn_call_span - }, + self_arg.span, "calling this operator moves the left-hand side", ); } diff --git a/src/test/ui/binop/binop-consume-args.stderr b/src/test/ui/binop/binop-consume-args.stderr index 2a992d26fd147..6fbbb55437eb2 100644 --- a/src/test/ui/binop/binop-consume-args.stderr +++ b/src/test/ui/binop/binop-consume-args.stderr @@ -9,10 +9,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:6:5 - | -LL | lhs + rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider further restricting this bound | LL | fn add + Copy, B>(lhs: A, rhs: B) { @@ -45,10 +42,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:12:5 - | -LL | lhs - rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider further restricting this bound | LL | fn sub + Copy, B>(lhs: A, rhs: B) { @@ -81,10 +75,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:18:5 - | -LL | lhs * rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider further restricting this bound | LL | fn mul + Copy, B>(lhs: A, rhs: B) { @@ -117,10 +108,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:24:5 - | -LL | lhs / rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider further restricting this bound | LL | fn div + Copy, B>(lhs: A, rhs: B) { @@ -153,10 +141,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:30:5 - | -LL | lhs % rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider further restricting this bound | LL | fn rem + Copy, B>(lhs: A, rhs: B) { @@ -189,10 +174,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:36:5 - | -LL | lhs & rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider further restricting this bound | LL | fn bitand + Copy, B>(lhs: A, rhs: B) { @@ -225,10 +207,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:42:5 - | -LL | lhs | rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider further restricting this bound | LL | fn bitor + Copy, B>(lhs: A, rhs: B) { @@ -261,10 +240,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:48:5 - | -LL | lhs ^ rhs; - | ^^^^^^^^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider further restricting this bound | LL | fn bitxor + Copy, B>(lhs: A, rhs: B) { @@ -297,10 +273,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:54:5 - | -LL | lhs << rhs; - | ^^^^^^^^^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider further restricting this bound | LL | fn shl + Copy, B>(lhs: A, rhs: B) { @@ -333,10 +306,7 @@ LL | drop(lhs); | ^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/binop-consume-args.rs:60:5 - | -LL | lhs >> rhs; - | ^^^^^^^^^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider further restricting this bound | LL | fn shr + Copy, B>(lhs: A, rhs: B) { diff --git a/src/test/ui/binop/binop-move-semantics.stderr b/src/test/ui/binop/binop-move-semantics.stderr index ceb8beec77039..dae267da05d17 100644 --- a/src/test/ui/binop/binop-move-semantics.stderr +++ b/src/test/ui/binop/binop-move-semantics.stderr @@ -12,12 +12,7 @@ LL | | x; | `x` moved due to usage in operator | note: calling this operator moves the left-hand side - --> $DIR/binop-move-semantics.rs:6:5 - | -LL | / x -LL | | + -LL | | x; - | |_____^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: consider further restricting this bound | LL | fn double_move + Copy>(x: T) { @@ -79,12 +74,7 @@ LL | | *n; | |______- `*m` moved due to usage in operator | note: calling this operator moves the left-hand side - --> $DIR/binop-move-semantics.rs:30:5 - | -LL | / *m -LL | | + -LL | | *n; - | |______^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0507]: cannot move out of `*n` which is behind a shared reference --> $DIR/binop-move-semantics.rs:32:5 diff --git a/src/test/ui/moves/move-fn-self-receiver.stderr b/src/test/ui/moves/move-fn-self-receiver.stderr index dda07934e3a0c..b3f95ee192a56 100644 --- a/src/test/ui/moves/move-fn-self-receiver.stderr +++ b/src/test/ui/moves/move-fn-self-receiver.stderr @@ -109,10 +109,7 @@ LL | foo_add; | ^^^^^^^ value used here after move | note: calling this operator moves the left-hand side - --> $DIR/move-fn-self-receiver.rs:58:5 - | -LL | foo_add + Foo; - | ^^^^^^^^^^^^^ + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL error[E0382]: use of moved value: `implicit_into_iter` --> $DIR/move-fn-self-receiver.rs:63:5 diff --git a/src/test/ui/unop-move-semantics.stderr b/src/test/ui/unop-move-semantics.stderr index c0e615ca1a899..2a3ca14433f62 100644 --- a/src/test/ui/unop-move-semantics.stderr +++ b/src/test/ui/unop-move-semantics.stderr @@ -10,10 +10,7 @@ LL | x.clone(); | ^^^^^^^^^ value borrowed here after move | note: calling this operator moves the left-hand side - --> $DIR/unop-move-semantics.rs:6:5 - | -LL | !x; - | ^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider cloning the value if the performance cost is acceptable | LL | !x.clone(); @@ -56,10 +53,7 @@ LL | !*m; | `*m` moved due to usage in operator | note: calling this operator moves the left-hand side - --> $DIR/unop-move-semantics.rs:24:5 - | -LL | !*m; - | ^^^ + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0507]: cannot move out of `*n` which is behind a shared reference --> $DIR/unop-move-semantics.rs:26:6 From 1f5cb9e50e2ccaa9bed2c8f186f933f7d3f4ad7c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 15:57:31 +0000 Subject: [PATCH 7/8] Use a label instead of a note for the drop site to create denser diagnostics --- .../src/traits/error_reporting/suggestions.rs | 11 +---------- .../async-await-let-else.drop-tracking.stderr | 10 +++------- .../async-await-let-else.no-drop-tracking.stderr | 10 +++------- .../issue-70935-complex-spans.no_drop_tracking.stderr | 10 +++------- ...sue-65436-raw-ptr-not-send.no_drop_tracking.stderr | 10 +++------- src/test/ui/async-await/issues/issue-67893.stderr | 10 +++------- 6 files changed, 16 insertions(+), 45 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index e45794ebc426e..12f9851196c0f 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -2212,17 +2212,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { interior_span, format!("has type `{}` which {}", target_ty, trait_explanation), ); - // If available, use the scope span to annotate the drop location. - let mut scope_note = None; if let Some(scope_span) = scope_span { let scope_span = source_map.end_point(scope_span); let msg = format!("{} is later dropped here", snippet); - if source_map.is_multiline(yield_span.between(scope_span)) { - span.push_span_label(scope_span, msg); - } else { - scope_note = Some((scope_span, msg)); - } + span.push_span_label(scope_span, msg); } err.span_note( span, @@ -2231,9 +2225,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { future_or_generator, trait_explanation, an_await_or_yield ), ); - if let Some((span, msg)) = scope_note { - err.span_note(span, &msg); - } }; match interior_or_upvar_span { GeneratorInteriorOrUpvar::Interior(interior_span, interior_extra_info) => { diff --git a/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr b/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr index 616623ee07759..f0f5245a3b42b 100644 --- a/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr +++ b/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr @@ -68,14 +68,10 @@ note: future is not `Send` as this value is used across an await --> $DIR/async-await-let-else.rs:33:28 | LL | (Rc::new(()), bar().await); - | ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later - | | + | ----------- ^^^^^^ - `Rc::new(())` is later dropped here + | | | + | | await occurs here, with `Rc::new(())` maybe used later | has type `Rc<()>` which is not `Send` -note: `Rc::new(())` is later dropped here - --> $DIR/async-await-let-else.rs:33:35 - | -LL | (Rc::new(()), bar().await); - | ^ note: required by a bound in `is_send` --> $DIR/async-await-let-else.rs:19:15 | diff --git a/src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr b/src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr index 7f93563e28842..d3c5e80a30df4 100644 --- a/src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr +++ b/src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr @@ -53,14 +53,10 @@ note: future is not `Send` as this value is used across an await --> $DIR/async-await-let-else.rs:33:28 | LL | (Rc::new(()), bar().await); - | ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later - | | + | ----------- ^^^^^^ - `Rc::new(())` is later dropped here + | | | + | | await occurs here, with `Rc::new(())` maybe used later | has type `Rc<()>` which is not `Send` -note: `Rc::new(())` is later dropped here - --> $DIR/async-await-let-else.rs:33:35 - | -LL | (Rc::new(()), bar().await); - | ^ note: required by a bound in `is_send` --> $DIR/async-await-let-else.rs:19:15 | diff --git a/src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr b/src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr index 34b31198e4f61..8036d82daa4a3 100644 --- a/src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr +++ b/src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr @@ -12,14 +12,10 @@ LL | baz(|| async{ | _____________- LL | | foo(tx.clone()); LL | | }).await; - | | - ^^^^^^ await occurs here, with the value maybe used later - | |_________| + | | - ^^^^^^- the value is later dropped here + | | | | + | |_________| await occurs here, with the value maybe used later | has type `[closure@$DIR/issue-70935-complex-spans.rs:17:13: 17:15]` which is not `Send` -note: the value is later dropped here - --> $DIR/issue-70935-complex-spans.rs:19:17 - | -LL | }).await; - | ^ error: aborting due to previous error diff --git a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr index ab196dca20cc4..1033fa6cc8b34 100644 --- a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr +++ b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr @@ -13,14 +13,10 @@ note: future is not `Send` as this value is used across an await --> $DIR/issue-65436-raw-ptr-not-send.rs:18:35 | LL | bar(Foo(std::ptr::null())).await; - | ---------------- ^^^^^^ await occurs here, with `std::ptr::null()` maybe used later - | | + | ---------------- ^^^^^^- `std::ptr::null()` is later dropped here + | | | + | | await occurs here, with `std::ptr::null()` maybe used later | has type `*const u8` which is not `Send` -note: `std::ptr::null()` is later dropped here - --> $DIR/issue-65436-raw-ptr-not-send.rs:18:41 - | -LL | bar(Foo(std::ptr::null())).await; - | ^ help: consider moving this into a `let` binding to create a shorter lived borrow --> $DIR/issue-65436-raw-ptr-not-send.rs:18:13 | diff --git a/src/test/ui/async-await/issues/issue-67893.stderr b/src/test/ui/async-await/issues/issue-67893.stderr index 316b6d06f932a..2ce68a782918c 100644 --- a/src/test/ui/async-await/issues/issue-67893.stderr +++ b/src/test/ui/async-await/issues/issue-67893.stderr @@ -9,14 +9,10 @@ note: future is not `Send` as this value is used across an await --> $DIR/auxiliary/issue_67893.rs:9:26 | LL | f(*x.lock().unwrap()).await; - | ----------------- ^^^^^^ await occurs here, with `x.lock().unwrap()` maybe used later - | | + | ----------------- ^^^^^^- `x.lock().unwrap()` is later dropped here + | | | + | | await occurs here, with `x.lock().unwrap()` maybe used later | has type `MutexGuard<'_, ()>` which is not `Send` -note: `x.lock().unwrap()` is later dropped here - --> $DIR/auxiliary/issue_67893.rs:9:32 - | -LL | f(*x.lock().unwrap()).await; - | ^ note: required by a bound in `g` --> $DIR/issue-67893.rs:6:14 | From 82ce70af62a2fb709ee4c19a46e8092054459a50 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 12 Dec 2022 17:32:20 +0000 Subject: [PATCH 8/8] bless fulldeps tests --- .../ui-fulldeps/session-diagnostic/diagnostic-derive.stderr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr index 467b3ce7c77fd..1b7ef4e4f19cf 100644 --- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr +++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr @@ -660,9 +660,7 @@ LL | #[derive(Diagnostic)] = help: normalized in stderr note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg` --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC - | - = note: required by this bound in `DiagnosticBuilder::<'a, G>::set_arg` - = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `Diagnostic` which comes from the expansion of the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 83 previous errors