diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index abca2ecdb060b..92922bc5b1625 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1482,7 +1482,7 @@ pub enum StatementKind<'tcx> { /// /// Note that this also is emitted for regular `let` bindings to ensure that locals that are /// never accessed still get some sanity checks for, e.g., `let x: ! = ..;` - FakeRead(FakeReadCause, Box>), + FakeRead(Box<(FakeReadCause, Place<'tcx>)>), /// Write the discriminant for a variant to the enum Place. SetDiscriminant { place: Box>, variant_index: VariantIdx }, @@ -1575,7 +1575,12 @@ pub enum FakeReadCause { /// `let x: !; match x {}` doesn't generate any read of x so we need to /// generate a read of x to check that it is initialized and safe. - ForMatchedPlace, + /// + /// If a closure pattern matches a Place starting with an Upvar, then we introduce a + /// FakeRead for that Place outside the closure, in such a case this option would be + /// Some(closure_def_id). + /// Otherwise, the value of the optional DefId will be None. + ForMatchedPlace(Option), /// A fake read of the RefWithinGuard version of a bind-by-value variable /// in a match guard to ensure that it's value hasn't change by the time @@ -1594,7 +1599,12 @@ pub enum FakeReadCause { /// but in some cases it can affect the borrow checker, as in #53695. /// Therefore, we insert a "fake read" here to ensure that we get /// appropriate errors. - ForLet, + /// + /// If a closure pattern matches a Place starting with an Upvar, then we introduce a + /// FakeRead for that Place outside the closure, in such a case this option would be + /// Some(closure_def_id). + /// Otherwise, the value of the optional DefId will be None. + ForLet(Option), /// If we have an index expression like /// @@ -1618,7 +1628,9 @@ impl Debug for Statement<'_> { use self::StatementKind::*; match self.kind { Assign(box (ref place, ref rv)) => write!(fmt, "{:?} = {:?}", place, rv), - FakeRead(ref cause, ref place) => write!(fmt, "FakeRead({:?}, {:?})", cause, place), + FakeRead(box (ref cause, ref place)) => { + write!(fmt, "FakeRead({:?}, {:?})", cause, place) + } Retag(ref kind, ref place) => write!( fmt, "Retag({}{:?})", diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index 32b4cd665d03f..fd504f8c5d5ac 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -380,7 +380,7 @@ macro_rules! make_mir_visitor { ) => { self.visit_assign(place, rvalue, location); } - StatementKind::FakeRead(_, place) => { + StatementKind::FakeRead(box (_, place)) => { self.visit_place( place, PlaceContext::NonMutatingUse(NonMutatingUseContext::Inspect), diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs index eb942b195b252..d5deec820889a 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs @@ -1728,7 +1728,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { impl<'tcx> Visitor<'tcx> for FakeReadCauseFinder<'tcx> { fn visit_statement(&mut self, statement: &Statement<'tcx>, _: Location) { match statement { - Statement { kind: StatementKind::FakeRead(cause, box place), .. } + Statement { kind: StatementKind::FakeRead(box (cause, place)), .. } if *place == self.place => { self.cause = Some(*cause); diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs index 06e3f4b91f61f..2a388b8a72bb0 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs @@ -515,7 +515,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { let block = &self.body.basic_blocks()[location.block]; let kind = if let Some(&Statement { - kind: StatementKind::FakeRead(FakeReadCause::ForLet, _), + kind: StatementKind::FakeRead(box (FakeReadCause::ForLet(_), _)), .. }) = block.statements.get(location.statement_index) { diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs index 6ea0ba0a8e1ba..577d7d53814ee 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs @@ -7,8 +7,8 @@ use rustc_hir::def_id::DefId; use rustc_hir::lang_items::LangItemGroup; use rustc_hir::GeneratorKind; use rustc_middle::mir::{ - AggregateKind, Constant, Field, Local, LocalInfo, LocalKind, Location, Operand, Place, - PlaceRef, ProjectionElem, Rvalue, Statement, StatementKind, Terminator, TerminatorKind, + AggregateKind, Constant, FakeReadCause, Field, Local, LocalInfo, LocalKind, Location, Operand, + Place, PlaceRef, ProjectionElem, Rvalue, Statement, StatementKind, Terminator, TerminatorKind, }; use rustc_middle::ty::print::Print; use rustc_middle::ty::{self, DefIdTree, Instance, Ty, TyCtxt}; @@ -795,6 +795,24 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { } } + // StatementKind::FakeRead only contains a def_id if they are introduced as a result + // of pattern matching within a closure. + if let StatementKind::FakeRead(box (cause, ref place)) = stmt.kind { + match cause { + FakeReadCause::ForMatchedPlace(Some(closure_def_id)) + | FakeReadCause::ForLet(Some(closure_def_id)) => { + debug!("move_spans: def_id={:?} place={:?}", closure_def_id, place); + let places = &[Operand::Move(*place)]; + if let Some((args_span, generator_kind, var_span)) = + self.closure_span(closure_def_id, moved_place, places) + { + return ClosureUse { generator_kind, args_span, var_span }; + } + } + _ => {} + } + } + let normal_ret = if moved_place.projection.iter().any(|p| matches!(p, ProjectionElem::Downcast(..))) { PatUse(stmt.source_info.span) diff --git a/compiler/rustc_mir/src/borrow_check/invalidation.rs b/compiler/rustc_mir/src/borrow_check/invalidation.rs index 1055e30a3a44c..9374741f83749 100644 --- a/compiler/rustc_mir/src/borrow_check/invalidation.rs +++ b/compiler/rustc_mir/src/borrow_check/invalidation.rs @@ -63,7 +63,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> { self.mutate_place(location, *lhs, Shallow(None), JustWrite); } - StatementKind::FakeRead(_, _) => { + StatementKind::FakeRead(box (_, _)) => { // Only relevant for initialized/liveness/safety checks. } StatementKind::SetDiscriminant { place, variant_index: _ } => { diff --git a/compiler/rustc_mir/src/borrow_check/mod.rs b/compiler/rustc_mir/src/borrow_check/mod.rs index 583f73d5775d1..71db6abde4351 100644 --- a/compiler/rustc_mir/src/borrow_check/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/mod.rs @@ -574,7 +574,7 @@ impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc self.mutate_place(location, (*lhs, span), Shallow(None), JustWrite, flow_state); } - StatementKind::FakeRead(_, box ref place) => { + StatementKind::FakeRead(box (_, ref place)) => { // Read for match doesn't access any memory and is used to // assert that a place is safe and live. So we don't have to // do any checks here. diff --git a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs index 52b6e9f3753be..538d8921869c3 100644 --- a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs +++ b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs @@ -293,8 +293,8 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> { } self.gather_rvalue(rval); } - StatementKind::FakeRead(_, place) => { - self.create_move_path(**place); + StatementKind::FakeRead(box (_, place)) => { + self.create_move_path(*place); } StatementKind::LlvmInlineAsm(ref asm) => { for (output, kind) in iter::zip(&*asm.outputs, &asm.asm.outputs) { diff --git a/compiler/rustc_mir/src/transform/coverage/spans.rs b/compiler/rustc_mir/src/transform/coverage/spans.rs index e7097ce861902..324d826b375c1 100644 --- a/compiler/rustc_mir/src/transform/coverage/spans.rs +++ b/compiler/rustc_mir/src/transform/coverage/spans.rs @@ -683,10 +683,10 @@ pub(super) fn filtered_statement_span( // and `_1` is the `Place` for `somenum`. // // If and when the Issue is resolved, remove this special case match pattern: - StatementKind::FakeRead(cause, _) if cause == FakeReadCause::ForGuardBinding => None, + StatementKind::FakeRead(box (cause, _)) if cause == FakeReadCause::ForGuardBinding => None, // Retain spans from all other statements - StatementKind::FakeRead(_, _) // Not including `ForGuardBinding` + StatementKind::FakeRead(box (_, _)) // Not including `ForGuardBinding` | StatementKind::CopyNonOverlapping(..) | StatementKind::Assign(_) | StatementKind::SetDiscriminant { .. } diff --git a/compiler/rustc_mir_build/src/build/cfg.rs b/compiler/rustc_mir_build/src/build/cfg.rs index e562e52f8410f..fd4a783d12a00 100644 --- a/compiler/rustc_mir_build/src/build/cfg.rs +++ b/compiler/rustc_mir_build/src/build/cfg.rs @@ -80,7 +80,7 @@ impl<'tcx> CFG<'tcx> { cause: FakeReadCause, place: Place<'tcx>, ) { - let kind = StatementKind::FakeRead(cause, box place); + let kind = StatementKind::FakeRead(box (cause, place)); let stmt = Statement { source_info, kind }; self.push(block, stmt); } diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs index 7f24a41b00bbe..822fbd91c947e 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs @@ -179,24 +179,20 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // match x { _ => () } // fake read of `x` // }; // ``` - // FIXME(RFC2229): Remove feature gate once diagnostics are improved - if this.tcx.features().capture_disjoint_fields { - for (thir_place, cause, hir_id) in fake_reads.into_iter() { - let place_builder = - unpack!(block = this.as_place_builder(block, thir_place)); - - if let Ok(place_builder_resolved) = - place_builder.try_upvars_resolved(this.tcx, this.typeck_results) - { - let mir_place = - place_builder_resolved.into_place(this.tcx, this.typeck_results); - this.cfg.push_fake_read( - block, - this.source_info(this.tcx.hir().span(*hir_id)), - *cause, - mir_place, - ); - } + for (thir_place, cause, hir_id) in fake_reads.into_iter() { + let place_builder = unpack!(block = this.as_place_builder(block, thir_place)); + + if let Ok(place_builder_resolved) = + place_builder.try_upvars_resolved(this.tcx, this.typeck_results) + { + let mir_place = + place_builder_resolved.into_place(this.tcx, this.typeck_results); + this.cfg.push_fake_read( + block, + this.source_info(this.tcx.hir().span(*hir_id)), + *cause, + mir_place, + ); } } diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index 73fd3f0feb591..0e422dc3c6378 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -139,7 +139,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // uninhabited value. If we get never patterns, those will check that // the place is initialized, and so this read would only be used to // check safety. - let cause_matched_place = FakeReadCause::ForMatchedPlace; + let cause_matched_place = FakeReadCause::ForMatchedPlace(None); let source_info = self.source_info(scrutinee_span); if let Ok(scrutinee_builder) = @@ -400,7 +400,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // Inject a fake read, see comments on `FakeReadCause::ForLet`. let source_info = self.source_info(irrefutable_pat.span); - self.cfg.push_fake_read(block, source_info, FakeReadCause::ForLet, place); + self.cfg.push_fake_read(block, source_info, FakeReadCause::ForLet(None), place); self.schedule_drop_for_binding(var, irrefutable_pat.span, OutsideGuard); block.unit() @@ -435,7 +435,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // Inject a fake read, see comments on `FakeReadCause::ForLet`. let pattern_source_info = self.source_info(irrefutable_pat.span); - let cause_let = FakeReadCause::ForLet; + let cause_let = FakeReadCause::ForLet(None); self.cfg.push_fake_read(block, pattern_source_info, cause_let, place); let ty_source_info = self.source_info(user_ty_span); diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 6540d4610473c..3692219cb6d44 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -953,7 +953,7 @@ pub fn build_target_config(opts: &Options, target_override: Option) -> T opts.error_format, &format!( "Error loading target specification: {}. \ - Use `--print target-list` for a list of built-in targets", + Run `rustc --print target-list` for a list of built-in targets", e ), ) 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 326b85e1013d6..ee933442870b1 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -28,6 +28,7 @@ use std::fmt; use super::InferCtxtPrivExt; use crate::traits::query::evaluate_obligation::InferCtxtExt as _; +use rustc_middle::ty::print::with_no_trimmed_paths; #[derive(Debug)] pub enum GeneratorInteriorOrUpvar { @@ -440,7 +441,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { { // Missing generic type parameter bound. let param_name = self_ty.to_string(); - let constraint = trait_ref.print_only_trait_path().to_string(); + let constraint = + with_no_trimmed_paths(|| trait_ref.print_only_trait_path().to_string()); if suggest_constraining_type_param( self.tcx, generics, @@ -2067,7 +2069,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { // Don't print the tuple of capture types if !is_upvar_tys_infer_tuple { - err.note(&format!("required because it appears within the type `{}`", ty)); + let msg = format!("required because it appears within the type `{}`", ty); + match ty.kind() { + ty::Adt(def, _) => match self.tcx.opt_item_name(def.did) { + Some(ident) => err.span_note(ident.span, &msg), + None => err.note(&msg), + }, + _ => err.note(&msg), + }; } obligated_types.push(ty); @@ -2089,11 +2098,36 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { ObligationCauseCode::ImplDerivedObligation(ref data) => { let mut parent_trait_ref = self.resolve_vars_if_possible(data.parent_trait_ref); let parent_def_id = parent_trait_ref.def_id(); - err.note(&format!( + let msg = format!( "required because of the requirements on the impl of `{}` for `{}`", parent_trait_ref.print_only_trait_path(), parent_trait_ref.skip_binder().self_ty() - )); + ); + let mut candidates = vec![]; + self.tcx.for_each_relevant_impl( + parent_def_id, + parent_trait_ref.self_ty().skip_binder(), + |impl_def_id| { + candidates.push(impl_def_id); + }, + ); + match &candidates[..] { + [def_id] => match self.tcx.hir().get_if_local(*def_id) { + Some(Node::Item(hir::Item { + kind: hir::ItemKind::Impl(hir::Impl { of_trait, self_ty, .. }), + .. + })) => { + let mut spans = Vec::with_capacity(2); + if let Some(trait_ref) = of_trait { + spans.push(trait_ref.path.span); + } + spans.push(self_ty.span); + err.span_note(spans, &msg) + } + _ => err.note(&msg), + }, + _ => err.note(&msg), + }; let mut parent_predicate = parent_trait_ref.without_const().to_predicate(tcx); let mut data = data; diff --git a/compiler/rustc_typeck/src/check/method/suggest.rs b/compiler/rustc_typeck/src/check/method/suggest.rs index 72eff009473a1..02fe8312c4c1f 100644 --- a/compiler/rustc_typeck/src/check/method/suggest.rs +++ b/compiler/rustc_typeck/src/check/method/suggest.rs @@ -987,59 +987,60 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ) { let mut alt_rcvr_sugg = false; if let SelfSource::MethodCall(rcvr) = source { - info!(?span, ?item_name, ?rcvr_ty, ?rcvr); - if let ty::Adt(..) = rcvr_ty.kind() { - // Try alternative arbitrary self types that could fulfill this call. - // FIXME: probe for all types that *could* be arbitrary self-types, not - // just this list. - for (rcvr_ty, post) in &[ - (rcvr_ty, ""), - (self.tcx.mk_mut_ref(&ty::ReErased, rcvr_ty), "&mut "), - (self.tcx.mk_imm_ref(&ty::ReErased, rcvr_ty), "&"), + debug!(?span, ?item_name, ?rcvr_ty, ?rcvr); + // Try alternative arbitrary self types that could fulfill this call. + // FIXME: probe for all types that *could* be arbitrary self-types, not + // just this list. + for (rcvr_ty, post) in &[ + (rcvr_ty, ""), + (self.tcx.mk_mut_ref(&ty::ReErased, rcvr_ty), "&mut "), + (self.tcx.mk_imm_ref(&ty::ReErased, rcvr_ty), "&"), + ] { + for (rcvr_ty, pre) in &[ + (self.tcx.mk_lang_item(rcvr_ty, LangItem::OwnedBox), "Box::new"), + (self.tcx.mk_lang_item(rcvr_ty, LangItem::Pin), "Pin::new"), + (self.tcx.mk_diagnostic_item(rcvr_ty, sym::Arc), "Arc::new"), + (self.tcx.mk_diagnostic_item(rcvr_ty, sym::Rc), "Rc::new"), ] { - for (rcvr_ty, pre) in &[ - (self.tcx.mk_lang_item(rcvr_ty, LangItem::OwnedBox), "Box::new"), - (self.tcx.mk_lang_item(rcvr_ty, LangItem::Pin), "Pin::new"), - (self.tcx.mk_diagnostic_item(rcvr_ty, sym::Arc), "Arc::new"), - (self.tcx.mk_diagnostic_item(rcvr_ty, sym::Rc), "Rc::new"), - ] { - if let Some(new_rcvr_t) = *rcvr_ty { - if let Ok(pick) = self.lookup_probe( - span, - item_name, - new_rcvr_t, - rcvr, - crate::check::method::probe::ProbeScope::AllTraits, - ) { - debug!("try_alt_rcvr: pick candidate {:?}", pick); - // Make sure the method is defined for the *actual* receiver: - // we don't want to treat `Box` as a receiver if - // it only works because of an autoderef to `&self` - if pick.autoderefs == 0 - // We don't want to suggest a container type when the missing method is - // `.clone()`, otherwise we'd suggest `Arc::new(foo).clone()`, which is - // far from what the user really wants. - && Some(pick.item.container.id()) != self.tcx.lang_items().clone_trait() - { - err.span_label( - pick.item.ident.span, - &format!( - "the method is available for `{}` here", - new_rcvr_t - ), - ); - err.multipart_suggestion( - "consider wrapping the receiver expression with the \ - appropriate type", - vec![ - (rcvr.span.shrink_to_lo(), format!("{}({}", pre, post)), - (rcvr.span.shrink_to_hi(), ")".to_string()), - ], - Applicability::MaybeIncorrect, - ); - // We don't care about the other suggestions. - alt_rcvr_sugg = true; - } + if let Some(new_rcvr_t) = *rcvr_ty { + if let Ok(pick) = self.lookup_probe( + span, + item_name, + new_rcvr_t, + rcvr, + crate::check::method::probe::ProbeScope::AllTraits, + ) { + debug!("try_alt_rcvr: pick candidate {:?}", pick); + let did = Some(pick.item.container.id()); + // We don't want to suggest a container type when the missing + // method is `.clone()` or `.deref()` otherwise we'd suggest + // `Arc::new(foo).clone()`, which is far from what the user wants. + let skip = [ + self.tcx.lang_items().clone_trait(), + self.tcx.lang_items().deref_trait(), + self.tcx.lang_items().deref_mut_trait(), + self.tcx.lang_items().drop_trait(), + ] + .contains(&did); + // Make sure the method is defined for the *actual* receiver: we don't + // want to treat `Box` as a receiver if it only works because of + // an autoderef to `&self` + if pick.autoderefs == 0 && !skip { + err.span_label( + pick.item.ident.span, + &format!("the method is available for `{}` here", new_rcvr_t), + ); + err.multipart_suggestion( + "consider wrapping the receiver expression with the \ + appropriate type", + vec![ + (rcvr.span.shrink_to_lo(), format!("{}({}", pre, post)), + (rcvr.span.shrink_to_hi(), ")".to_string()), + ], + Applicability::MaybeIncorrect, + ); + // We don't care about the other suggestions. + alt_rcvr_sugg = true; } } } diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_typeck/src/expr_use_visitor.rs index ab286bacd8189..02510cb6a44cf 100644 --- a/compiler/rustc_typeck/src/expr_use_visitor.rs +++ b/compiler/rustc_typeck/src/expr_use_visitor.rs @@ -280,9 +280,14 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { if needs_to_be_read { self.borrow_expr(&discr, ty::ImmBorrow); } else { + let closure_def_id = match discr_place.place.base { + PlaceBase::Upvar(upvar_id) => Some(upvar_id.closure_expr_id.to_def_id()), + _ => None, + }; + self.delegate.fake_read( discr_place.place.clone(), - FakeReadCause::ForMatchedPlace, + FakeReadCause::ForMatchedPlace(closure_def_id), discr_place.hir_id, ); @@ -578,9 +583,14 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { } fn walk_arm(&mut self, discr_place: &PlaceWithHirId<'tcx>, arm: &hir::Arm<'_>) { + let closure_def_id = match discr_place.place.base { + PlaceBase::Upvar(upvar_id) => Some(upvar_id.closure_expr_id.to_def_id()), + _ => None, + }; + self.delegate.fake_read( discr_place.place.clone(), - FakeReadCause::ForMatchedPlace, + FakeReadCause::ForMatchedPlace(closure_def_id), discr_place.hir_id, ); self.walk_pat(discr_place, &arm.pat); @@ -595,9 +605,14 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { /// Walks a pat that occurs in isolation (i.e., top-level of fn argument or /// let binding, and *not* a match arm or nested pat.) fn walk_irrefutable_pat(&mut self, discr_place: &PlaceWithHirId<'tcx>, pat: &hir::Pat<'_>) { + let closure_def_id = match discr_place.place.base { + PlaceBase::Upvar(upvar_id) => Some(upvar_id.closure_expr_id.to_def_id()), + _ => None, + }; + self.delegate.fake_read( discr_place.place.clone(), - FakeReadCause::ForLet, + FakeReadCause::ForLet(closure_def_id), discr_place.hir_id, ); self.walk_pat(discr_place, pat); diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 85e0e7200875d..fb957348bebd3 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -765,7 +765,7 @@ unsafe impl Freeze for &mut T {} /// [`pin` module]: crate::pin #[stable(feature = "pin", since = "1.33.0")] #[rustc_on_unimplemented( - on(_Self = "std::future::Future", note = "consider using `Box::pin`",), + note = "consider using `Box::pin`", message = "`{Self}` cannot be unpinned" )] #[lang = "unpin"] diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 14914287cb1b1..ecaab67034908 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -361,7 +361,7 @@ impl OsString { impl From for OsString { /// Converts a [`String`] into a [`OsString`]. /// - /// The conversion copies the data, and includes an allocation on the heap. + /// This conversion does not allocate or copy memory. #[inline] fn from(s: String) -> OsString { OsString { inner: Buf::from_string(s) } @@ -858,7 +858,7 @@ impl From> for Box { #[stable(feature = "os_string_from_box", since = "1.18.0")] impl From> for OsString { - /// Converts a [`Box`]`<`[`OsStr`]`>` into a `OsString` without copying or + /// Converts a [`Box`]`<`[`OsStr`]`>` into an [`OsString`] without copying or /// allocating. #[inline] fn from(boxed: Box) -> OsString { diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 57c892f32b193..f4020a428791e 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1467,7 +1467,7 @@ impl> From<&T> for PathBuf { #[stable(feature = "rust1", since = "1.0.0")] impl From for PathBuf { - /// Converts a `OsString` into a `PathBuf` + /// Converts an [`OsString`] into a [`PathBuf`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1478,7 +1478,7 @@ impl From for PathBuf { #[stable(feature = "from_path_buf_for_os_string", since = "1.14.0")] impl From for OsString { - /// Converts a `PathBuf` into a `OsString` + /// Converts a [`PathBuf`] into an [`OsString`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1489,7 +1489,7 @@ impl From for OsString { #[stable(feature = "rust1", since = "1.0.0")] impl From for PathBuf { - /// Converts a `String` into a `PathBuf` + /// Converts a [`String`] into a [`PathBuf`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1595,7 +1595,7 @@ impl<'a> From> for PathBuf { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Arc { - /// Converts a `PathBuf` into an `Arc` by moving the `PathBuf` data into a new `Arc` buffer. + /// Converts a [`PathBuf`] into an [`Arc`] by moving the [`PathBuf`] data into a new [`Arc`] buffer. #[inline] fn from(s: PathBuf) -> Arc { let arc: Arc = Arc::from(s.into_os_string()); @@ -1605,7 +1605,7 @@ impl From for Arc { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<&Path> for Arc { - /// Converts a `Path` into an `Arc` by copying the `Path` data into a new `Arc` buffer. + /// Converts a [`Path`] into an [`Arc`] by copying the [`Path`] data into a new [`Arc`] buffer. #[inline] fn from(s: &Path) -> Arc { let arc: Arc = Arc::from(s.as_os_str()); @@ -1615,7 +1615,7 @@ impl From<&Path> for Arc { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Rc { - /// Converts a `PathBuf` into an `Rc` by moving the `PathBuf` data into a new `Rc` buffer. + /// Converts a [`PathBuf`] into an [`Rc`] by moving the [`PathBuf`] data into a new `Rc` buffer. #[inline] fn from(s: PathBuf) -> Rc { let rc: Rc = Rc::from(s.into_os_string()); @@ -1625,7 +1625,7 @@ impl From for Rc { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<&Path> for Rc { - /// Converts a `Path` into an `Rc` by copying the `Path` data into a new `Rc` buffer. + /// Converts a [`Path`] into an [`Rc`] by copying the [`Path`] data into a new `Rc` buffer. #[inline] fn from(s: &Path) -> Rc { let rc: Rc = Rc::from(s.as_os_str()); diff --git a/src/llvm-project b/src/llvm-project index c3a26cbf6e73f..0abbcc04d8375 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit c3a26cbf6e73f2c5f8d03cee1f151d90a266ef3c +Subproject commit 0abbcc04d8375661a0637896b9ae5dc37a99dc70 diff --git a/src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir index a95681126205f..9fa478f8a826c 100644 --- a/src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir @@ -130,12 +130,12 @@ fn address_of_reborrow() -> () { StorageLive(_2); // scope 0 at $DIR/address-of.rs:4:14: 4:21 _2 = [const 0_i32; 10]; // scope 0 at $DIR/address-of.rs:4:14: 4:21 _1 = &_2; // scope 0 at $DIR/address-of.rs:4:13: 4:21 - FakeRead(ForLet, _1); // scope 0 at $DIR/address-of.rs:4:9: 4:10 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/address-of.rs:4:9: 4:10 StorageLive(_3); // scope 1 at $DIR/address-of.rs:5:9: 5:14 StorageLive(_4); // scope 1 at $DIR/address-of.rs:5:22: 5:29 _4 = [const 0_i32; 10]; // scope 1 at $DIR/address-of.rs:5:22: 5:29 _3 = &mut _4; // scope 1 at $DIR/address-of.rs:5:17: 5:29 - FakeRead(ForLet, _3); // scope 1 at $DIR/address-of.rs:5:9: 5:14 + FakeRead(ForLet(None), _3); // scope 1 at $DIR/address-of.rs:5:9: 5:14 StorageLive(_5); // scope 2 at $DIR/address-of.rs:7:5: 7:18 StorageLive(_6); // scope 2 at $DIR/address-of.rs:7:5: 7:18 _6 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:7:5: 7:6 @@ -170,25 +170,25 @@ fn address_of_reborrow() -> () { StorageDead(_13); // scope 2 at $DIR/address-of.rs:11:20: 11:21 StorageLive(_15); // scope 2 at $DIR/address-of.rs:13:9: 13:10 _15 = &raw const (*_1); // scope 2 at $DIR/address-of.rs:13:23: 13:24 - FakeRead(ForLet, _15); // scope 2 at $DIR/address-of.rs:13:9: 13:10 + FakeRead(ForLet(None), _15); // scope 2 at $DIR/address-of.rs:13:9: 13:10 AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 2 at $DIR/address-of.rs:13:12: 13:20 StorageLive(_16); // scope 3 at $DIR/address-of.rs:14:9: 14:10 _16 = &raw const (*_1); // scope 3 at $DIR/address-of.rs:14:31: 14:32 - FakeRead(ForLet, _16); // scope 3 at $DIR/address-of.rs:14:9: 14:10 + FakeRead(ForLet(None), _16); // scope 3 at $DIR/address-of.rs:14:9: 14:10 AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] }); // scope 3 at $DIR/address-of.rs:14:12: 14:28 StorageLive(_17); // scope 4 at $DIR/address-of.rs:15:9: 15:10 StorageLive(_18); // scope 4 at $DIR/address-of.rs:15:30: 15:31 _18 = &raw const (*_1); // scope 4 at $DIR/address-of.rs:15:30: 15:31 _17 = move _18 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 4 at $DIR/address-of.rs:15:30: 15:31 StorageDead(_18); // scope 4 at $DIR/address-of.rs:15:30: 15:31 - FakeRead(ForLet, _17); // scope 4 at $DIR/address-of.rs:15:9: 15:10 + FakeRead(ForLet(None), _17); // scope 4 at $DIR/address-of.rs:15:9: 15:10 AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] }); // scope 4 at $DIR/address-of.rs:15:12: 15:27 StorageLive(_19); // scope 5 at $DIR/address-of.rs:16:9: 16:10 StorageLive(_20); // scope 5 at $DIR/address-of.rs:16:27: 16:28 _20 = &raw const (*_1); // scope 5 at $DIR/address-of.rs:16:27: 16:28 _19 = move _20 as *const [i32] (Pointer(Unsize)); // scope 5 at $DIR/address-of.rs:16:27: 16:28 StorageDead(_20); // scope 5 at $DIR/address-of.rs:16:27: 16:28 - FakeRead(ForLet, _19); // scope 5 at $DIR/address-of.rs:16:9: 16:10 + FakeRead(ForLet(None), _19); // scope 5 at $DIR/address-of.rs:16:9: 16:10 AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] }); // scope 5 at $DIR/address-of.rs:16:12: 16:24 StorageLive(_21); // scope 6 at $DIR/address-of.rs:18:5: 18:18 StorageLive(_22); // scope 6 at $DIR/address-of.rs:18:5: 18:18 @@ -218,25 +218,25 @@ fn address_of_reborrow() -> () { StorageDead(_27); // scope 6 at $DIR/address-of.rs:21:22: 21:23 StorageLive(_29); // scope 6 at $DIR/address-of.rs:23:9: 23:10 _29 = &raw const (*_3); // scope 6 at $DIR/address-of.rs:23:23: 23:24 - FakeRead(ForLet, _29); // scope 6 at $DIR/address-of.rs:23:9: 23:10 + FakeRead(ForLet(None), _29); // scope 6 at $DIR/address-of.rs:23:9: 23:10 AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] }); // scope 6 at $DIR/address-of.rs:23:12: 23:20 StorageLive(_30); // scope 7 at $DIR/address-of.rs:24:9: 24:10 _30 = &raw const (*_3); // scope 7 at $DIR/address-of.rs:24:31: 24:32 - FakeRead(ForLet, _30); // scope 7 at $DIR/address-of.rs:24:9: 24:10 + FakeRead(ForLet(None), _30); // scope 7 at $DIR/address-of.rs:24:9: 24:10 AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] }); // scope 7 at $DIR/address-of.rs:24:12: 24:28 StorageLive(_31); // scope 8 at $DIR/address-of.rs:25:9: 25:10 StorageLive(_32); // scope 8 at $DIR/address-of.rs:25:30: 25:31 _32 = &raw const (*_3); // scope 8 at $DIR/address-of.rs:25:30: 25:31 _31 = move _32 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 8 at $DIR/address-of.rs:25:30: 25:31 StorageDead(_32); // scope 8 at $DIR/address-of.rs:25:30: 25:31 - FakeRead(ForLet, _31); // scope 8 at $DIR/address-of.rs:25:9: 25:10 + FakeRead(ForLet(None), _31); // scope 8 at $DIR/address-of.rs:25:9: 25:10 AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] }); // scope 8 at $DIR/address-of.rs:25:12: 25:27 StorageLive(_33); // scope 9 at $DIR/address-of.rs:26:9: 26:10 StorageLive(_34); // scope 9 at $DIR/address-of.rs:26:27: 26:28 _34 = &raw const (*_3); // scope 9 at $DIR/address-of.rs:26:27: 26:28 _33 = move _34 as *const [i32] (Pointer(Unsize)); // scope 9 at $DIR/address-of.rs:26:27: 26:28 StorageDead(_34); // scope 9 at $DIR/address-of.rs:26:27: 26:28 - FakeRead(ForLet, _33); // scope 9 at $DIR/address-of.rs:26:9: 26:10 + FakeRead(ForLet(None), _33); // scope 9 at $DIR/address-of.rs:26:9: 26:10 AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] }); // scope 9 at $DIR/address-of.rs:26:12: 26:24 StorageLive(_35); // scope 10 at $DIR/address-of.rs:28:5: 28:16 StorageLive(_36); // scope 10 at $DIR/address-of.rs:28:5: 28:16 @@ -266,25 +266,25 @@ fn address_of_reborrow() -> () { StorageDead(_41); // scope 10 at $DIR/address-of.rs:31:20: 31:21 StorageLive(_43); // scope 10 at $DIR/address-of.rs:33:9: 33:10 _43 = &raw mut (*_3); // scope 10 at $DIR/address-of.rs:33:21: 33:22 - FakeRead(ForLet, _43); // scope 10 at $DIR/address-of.rs:33:9: 33:10 + FakeRead(ForLet(None), _43); // scope 10 at $DIR/address-of.rs:33:9: 33:10 AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] }); // scope 10 at $DIR/address-of.rs:33:12: 33:18 StorageLive(_44); // scope 11 at $DIR/address-of.rs:34:9: 34:10 _44 = &raw mut (*_3); // scope 11 at $DIR/address-of.rs:34:29: 34:30 - FakeRead(ForLet, _44); // scope 11 at $DIR/address-of.rs:34:9: 34:10 + FakeRead(ForLet(None), _44); // scope 11 at $DIR/address-of.rs:34:9: 34:10 AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] }); // scope 11 at $DIR/address-of.rs:34:12: 34:26 StorageLive(_45); // scope 12 at $DIR/address-of.rs:35:9: 35:10 StorageLive(_46); // scope 12 at $DIR/address-of.rs:35:28: 35:29 _46 = &raw mut (*_3); // scope 12 at $DIR/address-of.rs:35:28: 35:29 _45 = move _46 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 12 at $DIR/address-of.rs:35:28: 35:29 StorageDead(_46); // scope 12 at $DIR/address-of.rs:35:28: 35:29 - FakeRead(ForLet, _45); // scope 12 at $DIR/address-of.rs:35:9: 35:10 + FakeRead(ForLet(None), _45); // scope 12 at $DIR/address-of.rs:35:9: 35:10 AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] }); // scope 12 at $DIR/address-of.rs:35:12: 35:25 StorageLive(_47); // scope 13 at $DIR/address-of.rs:36:9: 36:10 StorageLive(_48); // scope 13 at $DIR/address-of.rs:36:25: 36:26 _48 = &raw mut (*_3); // scope 13 at $DIR/address-of.rs:36:25: 36:26 _47 = move _48 as *mut [i32] (Pointer(Unsize)); // scope 13 at $DIR/address-of.rs:36:25: 36:26 StorageDead(_48); // scope 13 at $DIR/address-of.rs:36:25: 36:26 - FakeRead(ForLet, _47); // scope 13 at $DIR/address-of.rs:36:9: 36:10 + FakeRead(ForLet(None), _47); // scope 13 at $DIR/address-of.rs:36:9: 36:10 AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // scope 13 at $DIR/address-of.rs:36:12: 36:22 _0 = const (); // scope 0 at $DIR/address-of.rs:3:26: 37:2 StorageDead(_47); // scope 13 at $DIR/address-of.rs:37:1: 37:2 diff --git a/src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir b/src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir index e058b0aaa8f0e..195f3e2e65c64 100644 --- a/src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir @@ -24,19 +24,19 @@ fn borrow_and_cast(_1: i32) -> () { StorageLive(_3); // scope 0 at $DIR/address-of.rs:42:13: 42:15 _3 = &_1; // scope 0 at $DIR/address-of.rs:42:13: 42:15 _2 = &raw const (*_3); // scope 0 at $DIR/address-of.rs:42:13: 42:15 - FakeRead(ForLet, _2); // scope 0 at $DIR/address-of.rs:42:9: 42:10 + FakeRead(ForLet(None), _2); // scope 0 at $DIR/address-of.rs:42:9: 42:10 StorageDead(_3); // scope 0 at $DIR/address-of.rs:42:29: 42:30 StorageLive(_4); // scope 1 at $DIR/address-of.rs:43:9: 43:10 StorageLive(_5); // scope 1 at $DIR/address-of.rs:43:13: 43:19 _5 = &mut _1; // scope 1 at $DIR/address-of.rs:43:13: 43:19 _4 = &raw const (*_5); // scope 1 at $DIR/address-of.rs:43:13: 43:19 - FakeRead(ForLet, _4); // scope 1 at $DIR/address-of.rs:43:9: 43:10 + FakeRead(ForLet(None), _4); // scope 1 at $DIR/address-of.rs:43:9: 43:10 StorageDead(_5); // scope 1 at $DIR/address-of.rs:43:33: 43:34 StorageLive(_6); // scope 2 at $DIR/address-of.rs:44:9: 44:10 StorageLive(_7); // scope 2 at $DIR/address-of.rs:44:13: 44:19 _7 = &mut _1; // scope 2 at $DIR/address-of.rs:44:13: 44:19 _6 = &raw mut (*_7); // scope 2 at $DIR/address-of.rs:44:13: 44:19 - FakeRead(ForLet, _6); // scope 2 at $DIR/address-of.rs:44:9: 44:10 + FakeRead(ForLet(None), _6); // scope 2 at $DIR/address-of.rs:44:9: 44:10 StorageDead(_7); // scope 2 at $DIR/address-of.rs:44:31: 44:32 _0 = const (); // scope 0 at $DIR/address-of.rs:41:32: 45:2 StorageDead(_6); // scope 2 at $DIR/address-of.rs:45:1: 45:2 diff --git a/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir index 7e0ca3dea4b71..e751b825c0505 100644 --- a/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir @@ -28,7 +28,7 @@ fn main() -> () { bb0: { StorageLive(_1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17 _1 = const false; // scope 0 at $DIR/basic_assignment.rs:11:20: 11:25 - FakeRead(ForLet, _1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17 StorageLive(_2); // scope 1 at $DIR/basic_assignment.rs:12:9: 12:17 StorageLive(_3); // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24 _3 = _1; // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24 @@ -36,7 +36,7 @@ fn main() -> () { StorageDead(_3); // scope 2 at $DIR/basic_assignment.rs:16:23: 16:24 StorageLive(_4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15 _4 = Option::>::None; // scope 2 at $DIR/basic_assignment.rs:18:36: 18:40 - FakeRead(ForLet, _4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15 + FakeRead(ForLet(None), _4); // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15 AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/basic_assignment.rs:18:17: 18:33 StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15 StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20 diff --git a/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir index aa4f996c4b46a..93507879a6f83 100644 --- a/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir @@ -18,7 +18,7 @@ fn match_tuple(_1: (u32, bool, Option, u32)) -> u32 { } bb0: { - FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/exponential-or.rs:5:11: 5:12 + FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/exponential-or.rs:5:11: 5:12 switchInt((_1.0: u32)) -> [1_u32: bb2, 4_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:6:15: 6:16 } diff --git a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index e9e5a101a64a5..8355b2d195e14 100644 --- a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -14,7 +14,7 @@ fn main() -> () { bb0: { StorageLive(_1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25 _1 = const false; // scope 0 at $DIR/issue-38669.rs:5:28: 5:33 - FakeRead(ForLet, _1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25 goto -> bb1; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } diff --git a/src/test/mir-opt/issue_49232.main.mir_map.0.mir b/src/test/mir-opt/issue_49232.main.mir_map.0.mir index 79f5495c78828..06fbbda3d9e22 100644 --- a/src/test/mir-opt/issue_49232.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_49232.main.mir_map.0.mir @@ -24,7 +24,7 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19 StorageLive(_3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 _3 = const true; // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 - FakeRead(ForMatchedPlace, _3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 + FakeRead(ForMatchedPlace(None), _3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23 switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22 } @@ -51,7 +51,7 @@ fn main() -> () { } bb8: { - FakeRead(ForLet, _2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19 + FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19 StorageDead(_3); // scope 0 at $DIR/issue-49232.rs:12:10: 12:11 StorageLive(_5); // scope 1 at $DIR/issue-49232.rs:13:9: 13:22 StorageLive(_6); // scope 1 at $DIR/issue-49232.rs:13:14: 13:21 diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir index cf66a501e35ee..2e6783b7f3c9d 100644 --- a/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir +++ b/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir @@ -38,7 +38,7 @@ fn main() -> () { _2 = [move _3, move _4]; // scope 1 at $DIR/issue-72181.rs:26:13: 26:43 StorageDead(_4); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43 StorageDead(_3); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43 - FakeRead(ForLet, _2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10 + FakeRead(ForLet(None), _2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10 StorageLive(_5); // scope 2 at $DIR/issue-72181.rs:27:13: 27:30 StorageLive(_6); // scope 4 at $DIR/issue-72181.rs:27:24: 27:25 _6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:27:24: 27:25 diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir index cf66a501e35ee..2e6783b7f3c9d 100644 --- a/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir +++ b/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir @@ -38,7 +38,7 @@ fn main() -> () { _2 = [move _3, move _4]; // scope 1 at $DIR/issue-72181.rs:26:13: 26:43 StorageDead(_4); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43 StorageDead(_3); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43 - FakeRead(ForLet, _2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10 + FakeRead(ForLet(None), _2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10 StorageLive(_5); // scope 2 at $DIR/issue-72181.rs:27:13: 27:30 StorageLive(_6); // scope 4 at $DIR/issue-72181.rs:27:24: 27:25 _6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:27:24: 27:25 diff --git a/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir b/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir index 7571d7bb94f92..7def08ece220b 100644 --- a/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir @@ -9,7 +9,7 @@ fn f(_1: Void) -> ! { bb0: { StorageLive(_2); // scope 0 at $DIR/issue-72181-1.rs:10:20: 12:2 StorageLive(_3); // scope 0 at $DIR/issue-72181-1.rs:11:5: 11:15 - FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/issue-72181-1.rs:11:11: 11:12 + FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/issue-72181-1.rs:11:11: 11:12 unreachable; // scope 0 at $DIR/issue-72181-1.rs:11:11: 11:12 } diff --git a/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir b/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir index 1fd91c2056bf8..3c26b20c35e2d 100644 --- a/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir @@ -29,7 +29,7 @@ fn main() -> () { bb1: { StorageDead(_3); // scope 2 at $DIR/issue-72181-1.rs:17:43: 17:44 - FakeRead(ForLet, _2); // scope 0 at $DIR/issue-72181-1.rs:16:9: 16:10 + FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue-72181-1.rs:16:9: 16:10 AscribeUserType(_2, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/issue-72181-1.rs:16:12: 16:16 StorageLive(_4); // scope 1 at $DIR/issue-72181-1.rs:20:5: 20:9 StorageLive(_5); // scope 1 at $DIR/issue-72181-1.rs:20:7: 20:8 diff --git a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir index f109937dbf937..99c7ac8d5b708 100644 --- a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir +++ b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir @@ -41,7 +41,7 @@ fn main() -> () { bb4: { StorageLive(_6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 _6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18 - FakeRead(ForLet, _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 + FakeRead(ForLet(None), _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6 goto -> bb3; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 } diff --git a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 95beab2ec9af7..3395cbfbdfb3a 100644 --- a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -31,7 +31,7 @@ } bb0: { -- FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 +- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 - switchInt((_2.0: bool)) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:15:10: 15:15 + switchInt((_2.0: bool)) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:15:10: 15:15 } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir index 242138754c5d7..f57be9a1ef77d 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir +++ b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir @@ -27,7 +27,7 @@ fn full_tested_match() -> () { StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6 StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 _2 = Option::::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16 } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir index c7b1cce061bc6..a4ebf8a02466a 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir @@ -26,7 +26,7 @@ fn full_tested_match2() -> () { StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6 StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 _2 = Option::::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16 } diff --git a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir index 9b8ce2c1ed047..5de52b324f43f 100644 --- a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir @@ -37,7 +37,7 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6 StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 _2 = Option::::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26 _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17 } diff --git a/src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir index e3bc4f80f27fd..5bb910947ca25 100644 --- a/src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir @@ -21,12 +21,12 @@ fn main() -> () { bb0: { StorageLive(_1); // scope 0 at $DIR/match_test.rs:7:9: 7:10 _1 = const 3_i32; // scope 0 at $DIR/match_test.rs:7:13: 7:14 - FakeRead(ForLet, _1); // scope 0 at $DIR/match_test.rs:7:9: 7:10 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/match_test.rs:7:9: 7:10 StorageLive(_2); // scope 1 at $DIR/match_test.rs:8:9: 8:10 _2 = const true; // scope 1 at $DIR/match_test.rs:8:13: 8:17 - FakeRead(ForLet, _2); // scope 1 at $DIR/match_test.rs:8:9: 8:10 + FakeRead(ForLet(None), _2); // scope 1 at $DIR/match_test.rs:8:9: 8:10 StorageLive(_3); // scope 2 at $DIR/match_test.rs:12:5: 17:6 - FakeRead(ForMatchedPlace, _1); // scope 2 at $DIR/match_test.rs:12:11: 12:12 + FakeRead(ForMatchedPlace(None), _1); // scope 2 at $DIR/match_test.rs:12:11: 12:12 _6 = Le(const 0_i32, _1); // scope 2 at $DIR/match_test.rs:13:9: 13:14 switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:13:9: 13:14 } diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index 8c939d5fc3da5..39e6cee11b4c9 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -46,7 +46,7 @@ fn main() -> () { bb0: { StorageLive(_1); // bb0[0]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14 _1 = [const Const(Value(Scalar(0x00000001)): usize), const Const(Value(Scalar(0x00000002)): usize), const Const(Value(Scalar(0x00000003)): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:17:17: 17:26 - FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14 + FakeRead(ForLet(None), _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14 StorageLive(_2); // bb0[3]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 StorageLive(_3); // bb0[4]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 @@ -57,10 +57,10 @@ fn main() -> () { bb1: { _2 = &'_#3r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:18:13: 18:18 - FakeRead(ForLet, _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 + FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 _6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 - FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 00704baa6c19f..6021b6529f911 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -46,7 +46,7 @@ fn main() -> () { bb0: { StorageLive(_1); // bb0[0]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14 _1 = [const Const(Value(Scalar(0x0000000000000001)): usize), const Const(Value(Scalar(0x0000000000000002)): usize), const Const(Value(Scalar(0x0000000000000003)): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:17:17: 17:26 - FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14 + FakeRead(ForLet(None), _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14 StorageLive(_2); // bb0[3]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 StorageLive(_3); // bb0[4]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _3 = const Const(Value(Scalar(0x0000000000000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 @@ -57,10 +57,10 @@ fn main() -> () { bb1: { _2 = &'_#3r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:18:13: 18:18 - FakeRead(ForLet, _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 + FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10 StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 _6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 - FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 diff --git a/src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir b/src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir index d2d96ff468dfc..f54c8f8ab4a2e 100644 --- a/src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir +++ b/src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir @@ -36,7 +36,7 @@ fn main() -> () { } bb1: { - FakeRead(ForLet, _1); // scope 0 at $DIR/receiver-ptr-mutability.rs:14:9: 14:12 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/receiver-ptr-mutability.rs:14:9: 14:12 AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/receiver-ptr-mutability.rs:14:14: 14:23 StorageLive(_2); // scope 1 at $DIR/receiver-ptr-mutability.rs:15:5: 15:12 StorageLive(_3); // scope 1 at $DIR/receiver-ptr-mutability.rs:15:5: 15:8 @@ -63,7 +63,7 @@ fn main() -> () { _7 = &_8; // scope 1 at $DIR/receiver-ptr-mutability.rs:18:35: 18:41 _6 = &_7; // scope 1 at $DIR/receiver-ptr-mutability.rs:18:34: 18:41 _5 = &(*_6); // scope 1 at $DIR/receiver-ptr-mutability.rs:18:34: 18:41 - FakeRead(ForLet, _5); // scope 1 at $DIR/receiver-ptr-mutability.rs:18:9: 18:16 + FakeRead(ForLet(None), _5); // scope 1 at $DIR/receiver-ptr-mutability.rs:18:9: 18:16 AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 1 at $DIR/receiver-ptr-mutability.rs:18:18: 18:31 StorageDead(_6); // scope 1 at $DIR/receiver-ptr-mutability.rs:18:41: 18:42 StorageLive(_10); // scope 2 at $DIR/receiver-ptr-mutability.rs:19:5: 19:16 diff --git a/src/test/mir-opt/remove_fake_borrows.match_guard.CleanupNonCodegenStatements.diff b/src/test/mir-opt/remove_fake_borrows.match_guard.CleanupNonCodegenStatements.diff index 47027311b4759..4aa388fc67bd0 100644 --- a/src/test/mir-opt/remove_fake_borrows.match_guard.CleanupNonCodegenStatements.diff +++ b/src/test/mir-opt/remove_fake_borrows.match_guard.CleanupNonCodegenStatements.diff @@ -13,7 +13,7 @@ let mut _8: bool; // in scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21 bb0: { -- FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12 +- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12 + nop; // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12 _3 = discriminant(_1); // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16 switchInt(move _3) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16 diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir b/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir index 5bcb20ca72a3f..841cca7c381f7 100644 --- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir +++ b/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir @@ -5,7 +5,7 @@ fn match_bool(_1: bool) -> usize { let mut _0: usize; // return place in scope 0 at $DIR/simple-match.rs:5:27: 5:32 bb0: { - FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12 + FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12 switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 } diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir b/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir index 5bcb20ca72a3f..841cca7c381f7 100644 --- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir +++ b/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir @@ -5,7 +5,7 @@ fn match_bool(_1: bool) -> usize { let mut _0: usize; // return place in scope 0 at $DIR/simple-match.rs:5:27: 5:32 bb0: { - FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12 + FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple-match.rs:6:11: 6:12 switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13 } diff --git a/src/test/mir-opt/storage_ranges.main.nll.0.mir b/src/test/mir-opt/storage_ranges.main.nll.0.mir index 6fa83d3de6253..e02580135af38 100644 --- a/src/test/mir-opt/storage_ranges.main.nll.0.mir +++ b/src/test/mir-opt/storage_ranges.main.nll.0.mir @@ -39,7 +39,7 @@ fn main() -> () { bb0: { StorageLive(_1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10 _1 = const 0_i32; // scope 0 at $DIR/storage_ranges.rs:4:13: 4:14 - FakeRead(ForLet, _1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10 StorageLive(_2); // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6 StorageLive(_3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14 StorageLive(_4); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25 @@ -48,14 +48,14 @@ fn main() -> () { _4 = Option::::Some(move _5); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25 StorageDead(_5); // scope 1 at $DIR/storage_ranges.rs:6:24: 6:25 _3 = &_4; // scope 1 at $DIR/storage_ranges.rs:6:17: 6:25 - FakeRead(ForLet, _3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14 + FakeRead(ForLet(None), _3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14 _2 = const (); // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6 StorageDead(_4); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6 StorageDead(_3); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6 StorageDead(_2); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6 StorageLive(_6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10 _6 = const 1_i32; // scope 1 at $DIR/storage_ranges.rs:8:13: 8:14 - FakeRead(ForLet, _6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10 + FakeRead(ForLet(None), _6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10 _0 = const (); // scope 0 at $DIR/storage_ranges.rs:3:11: 9:2 StorageDead(_6); // scope 1 at $DIR/storage_ranges.rs:9:1: 9:2 StorageDead(_1); // scope 0 at $DIR/storage_ranges.rs:9:1: 9:2 diff --git a/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir index d18f6308ded84..7f81d9fc482ff 100644 --- a/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir +++ b/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir @@ -48,7 +48,7 @@ fn move_out_by_subslice() -> () { bb4: { StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27 - FakeRead(ForLet, _1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10 StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17 _6 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17 _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2 diff --git a/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir index eda8e5fd3afe7..62ab494c06628 100644 --- a/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir +++ b/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir @@ -48,7 +48,7 @@ fn move_out_from_end() -> () { bb4: { StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27 - FakeRead(ForLet, _1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10 + FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10 StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16 _6 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16 _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2 diff --git a/src/test/ui/associated-types/defaults-suitability.stderr b/src/test/ui/associated-types/defaults-suitability.stderr index 274d09fd09c86..af4e6f0a5c161 100644 --- a/src/test/ui/associated-types/defaults-suitability.stderr +++ b/src/test/ui/associated-types/defaults-suitability.stderr @@ -31,8 +31,8 @@ LL | type Bar: Clone = Vec; = note: required because of the requirements on the impl of `Clone` for `Vec` help: consider restricting type parameter `T` | -LL | trait Foo { - | ^^^^^^^ +LL | trait Foo { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `(): Foo` is not satisfied --> $DIR/defaults-suitability.rs:34:5 @@ -99,8 +99,8 @@ LL | type Baz = T; | help: consider further restricting type parameter `T` | -LL | Self::Baz: Clone, T: Clone - | ^^^^^^^^^^ +LL | Self::Baz: Clone, T: std::clone::Clone + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 8 previous errors diff --git a/src/test/ui/associated-types/impl-wf-cycle-1.stderr b/src/test/ui/associated-types/impl-wf-cycle-1.stderr index 82328048c99a3..1d8d2b0149d21 100644 --- a/src/test/ui/associated-types/impl-wf-cycle-1.stderr +++ b/src/test/ui/associated-types/impl-wf-cycle-1.stderr @@ -10,7 +10,11 @@ LL | | LL | | } | |_^ | - = note: required because of the requirements on the impl of `Grault` for `(T,)` +note: required because of the requirements on the impl of `Grault` for `(T,)` + --> $DIR/impl-wf-cycle-1.rs:15:17 + | +LL | impl Grault for (T,) + | ^^^^^^ ^^^^ = note: 1 redundant requirements hidden = note: required because of the requirements on the impl of `Grault` for `(T,)` @@ -20,7 +24,11 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _` LL | type A = (); | ^^^^^^^^^^^^ | - = note: required because of the requirements on the impl of `Grault` for `(T,)` +note: required because of the requirements on the impl of `Grault` for `(T,)` + --> $DIR/impl-wf-cycle-1.rs:15:17 + | +LL | impl Grault for (T,) + | ^^^^^^ ^^^^ = note: 1 redundant requirements hidden = note: required because of the requirements on the impl of `Grault` for `(T,)` @@ -30,7 +38,11 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _` LL | type B = bool; | ^^^^^^^^^^^^^^ | - = note: required because of the requirements on the impl of `Grault` for `(T,)` +note: required because of the requirements on the impl of `Grault` for `(T,)` + --> $DIR/impl-wf-cycle-1.rs:15:17 + | +LL | impl Grault for (T,) + | ^^^^^^ ^^^^ = note: 1 redundant requirements hidden = note: required because of the requirements on the impl of `Grault` for `(T,)` diff --git a/src/test/ui/associated-types/impl-wf-cycle-2.stderr b/src/test/ui/associated-types/impl-wf-cycle-2.stderr index 5cd18a33adf37..a17e63f28fe91 100644 --- a/src/test/ui/associated-types/impl-wf-cycle-2.stderr +++ b/src/test/ui/associated-types/impl-wf-cycle-2.stderr @@ -10,7 +10,11 @@ LL | | LL | | } | |_^ | - = note: required because of the requirements on the impl of `Grault` for `(T,)` +note: required because of the requirements on the impl of `Grault` for `(T,)` + --> $DIR/impl-wf-cycle-2.rs:7:17 + | +LL | impl Grault for (T,) + | ^^^^^^ ^^^^ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _` --> $DIR/impl-wf-cycle-2.rs:11:5 @@ -18,7 +22,11 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _` LL | type A = (); | ^^^^^^^^^^^^ | - = note: required because of the requirements on the impl of `Grault` for `(T,)` +note: required because of the requirements on the impl of `Grault` for `(T,)` + --> $DIR/impl-wf-cycle-2.rs:7:17 + | +LL | impl Grault for (T,) + | ^^^^^^ ^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr index 02396bd00a59d..b6122bd54d162 100644 --- a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr +++ b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr @@ -9,8 +9,8 @@ LL | copy::>(t) | help: consider restricting type parameter `T` | -LL | pub fn copy_any(t: &T) -> T { - | ^^^^^^ +LL | pub fn copy_any(t: &T) -> T { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-43784-associated-type.stderr b/src/test/ui/associated-types/issue-43784-associated-type.stderr index d5105ae3b5815..0e653a7d3b22f 100644 --- a/src/test/ui/associated-types/issue-43784-associated-type.stderr +++ b/src/test/ui/associated-types/issue-43784-associated-type.stderr @@ -9,8 +9,8 @@ LL | type Assoc = T; | help: consider restricting type parameter `T` | -LL | impl Complete for T { - | ^^^^^^ +LL | impl Complete for T { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index 8ef71087958ca..ca683955fc314 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -7,7 +7,11 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&()` | - = note: required because of the requirements on the impl of `Visit` for `()` +note: required because of the requirements on the impl of `Visit` for `()` + --> $DIR/issue-44153.rs:13:10 + | +LL | impl<'a> Visit for () where + | ^^^^^ ^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-65774-1.stderr b/src/test/ui/associated-types/issue-65774-1.stderr index f644eb5a1f478..fc020e40b5ad2 100644 --- a/src/test/ui/associated-types/issue-65774-1.stderr +++ b/src/test/ui/associated-types/issue-65774-1.stderr @@ -13,7 +13,11 @@ error[E0277]: the trait bound `T: MyDisplay` is not satisfied LL | let closure = |config: &mut ::MpuConfig| writer.my_write(&config); | ^^^^^^^ the trait `MyDisplay` is not implemented for `T` | - = note: required because of the requirements on the impl of `MyDisplay` for `&mut T` +note: required because of the requirements on the impl of `MyDisplay` for `&mut T` + --> $DIR/issue-65774-1.rs:5:24 + | +LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { } + | ^^^^^^^^^ ^^^^^^^^^ = note: required for the cast to the object type `dyn MyDisplay` error: aborting due to 2 previous errors diff --git a/src/test/ui/async-await/issue-70818.stderr b/src/test/ui/async-await/issue-70818.stderr index 11fca2dd8ef4c..5f39cf6dde125 100644 --- a/src/test/ui/async-await/issue-70818.stderr +++ b/src/test/ui/async-await/issue-70818.stderr @@ -11,8 +11,8 @@ LL | async { (ty, ty1) } | ^^^ has type `U` which is not `Send` help: consider restricting type parameter `U` | -LL | fn foo(ty: T, ty1: U) -> impl Future + Send { - | ^^^^^^ +LL | fn foo(ty: T, ty1: U) -> impl Future + Send { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/async-await/issue-72590-type-error-sized.stderr b/src/test/ui/async-await/issue-72590-type-error-sized.stderr index 0f90a4c336c57..50dfeffde7cf0 100644 --- a/src/test/ui/async-await/issue-72590-type-error-sized.stderr +++ b/src/test/ui/async-await/issue-72590-type-error-sized.stderr @@ -17,7 +17,11 @@ LL | async fn frob(self) {} | ^^^^ doesn't have a size known at compile-time | = help: within `Foo`, the trait `Sized` is not implemented for `str` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/issue-72590-type-error-sized.rs:5:8 + | +LL | struct Foo { + | ^^^ = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | diff --git a/src/test/ui/async-await/pin-needed-to-poll-2.rs b/src/test/ui/async-await/pin-needed-to-poll-2.rs new file mode 100644 index 0000000000000..6ce70336d0c63 --- /dev/null +++ b/src/test/ui/async-await/pin-needed-to-poll-2.rs @@ -0,0 +1,48 @@ +use std::{ + future::Future, + pin::Pin, + marker::Unpin, + task::{Context, Poll}, +}; + +struct Sleep(std::marker::PhantomPinned); + +impl Future for Sleep { + type Output = (); + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + Poll::Ready(()) + } +} + +impl Drop for Sleep { + fn drop(&mut self) {} +} + +fn sleep() -> Sleep { + Sleep(std::marker::PhantomPinned) +} + + +struct MyFuture { + sleep: Sleep, +} + +impl MyFuture { + fn new() -> Self { + Self { + sleep: sleep(), + } + } +} + +impl Future for MyFuture { + type Output = (); + + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + Pin::new(&mut self.sleep).poll(cx) + //~^ ERROR `PhantomPinned` cannot be unpinned + } +} + +fn main() {} 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 new file mode 100644 index 0000000000000..c4d21de8aaf75 --- /dev/null +++ b/src/test/ui/async-await/pin-needed-to-poll-2.stderr @@ -0,0 +1,17 @@ +error[E0277]: `PhantomPinned` cannot be unpinned + --> $DIR/pin-needed-to-poll-2.rs:43:9 + | +LL | Pin::new(&mut self.sleep).poll(cx) + | ^^^^^^^^ within `Sleep`, the trait `Unpin` is not implemented for `PhantomPinned` + | + = note: consider using `Box::pin` +note: required because it appears within the type `Sleep` + --> $DIR/pin-needed-to-poll-2.rs:8:8 + | +LL | struct Sleep(std::marker::PhantomPinned); + | ^^^^^ + = note: required by `Pin::

::new` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/bad/bad-method-typaram-kind.stderr b/src/test/ui/bad/bad-method-typaram-kind.stderr index 5b68d97a9ea55..fd3999ae6fbec 100644 --- a/src/test/ui/bad/bad-method-typaram-kind.stderr +++ b/src/test/ui/bad/bad-method-typaram-kind.stderr @@ -6,8 +6,8 @@ LL | 1.bar::(); | help: consider further restricting this bound | -LL | fn foo() { - | ^^^^^^ +LL | fn foo() { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr index 6649e67a5093c..397bdac60513e 100644 --- a/src/test/ui/block-result/issue-22645.stderr +++ b/src/test/ui/block-result/issue-22645.stderr @@ -6,7 +6,11 @@ LL | b + 3 | = help: the following implementations were found: - = note: required because of the requirements on the impl of `Add<{integer}>` for `Bob` +note: required because of the requirements on the impl of `Add<{integer}>` for `Bob` + --> $DIR/issue-22645.rs:8:19 + | +LL | impl Add for Bob { + | ^^^^^^^^^ ^^^ error[E0308]: mismatched types --> $DIR/issue-22645.rs:15:3 diff --git a/src/test/ui/bound-suggestions.fixed b/src/test/ui/bound-suggestions.fixed index be61b7dda256a..31fdd2b67e294 100644 --- a/src/test/ui/bound-suggestions.fixed +++ b/src/test/ui/bound-suggestions.fixed @@ -5,37 +5,37 @@ use std::fmt::Debug; // Rustfix should add this, or use `std::fmt::Debug` instead. #[allow(dead_code)] -fn test_impl(t: impl Sized + Debug) { +fn test_impl(t: impl Sized + std::fmt::Debug) { println!("{:?}", t); //~^ ERROR doesn't implement } #[allow(dead_code)] -fn test_no_bounds(t: T) { +fn test_no_bounds(t: T) { println!("{:?}", t); //~^ ERROR doesn't implement } #[allow(dead_code)] -fn test_one_bound(t: T) { +fn test_one_bound(t: T) { println!("{:?}", t); //~^ ERROR doesn't implement } #[allow(dead_code)] -fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, Y: Debug { +fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug { println!("{:?} {:?}", x, y); //~^ ERROR doesn't implement } #[allow(dead_code)] -fn test_one_bound_where(x: X) where X: Sized + Debug { +fn test_one_bound_where(x: X) where X: Sized + std::fmt::Debug { println!("{:?}", x); //~^ ERROR doesn't implement } #[allow(dead_code)] -fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: Debug { +fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: std::fmt::Debug { println!("{:?}", x); //~^ ERROR doesn't implement } diff --git a/src/test/ui/bound-suggestions.stderr b/src/test/ui/bound-suggestions.stderr index 12e67e90265ab..ebf43bdb2717c 100644 --- a/src/test/ui/bound-suggestions.stderr +++ b/src/test/ui/bound-suggestions.stderr @@ -8,8 +8,8 @@ LL | println!("{:?}", t); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -LL | fn test_impl(t: impl Sized + Debug) { - | ^^^^^^^ +LL | fn test_impl(t: impl Sized + std::fmt::Debug) { + | ^^^^^^^^^^^^^^^^^ error[E0277]: `T` doesn't implement `Debug` --> $DIR/bound-suggestions.rs:15:22 @@ -21,8 +21,8 @@ LL | println!("{:?}", t); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -LL | fn test_no_bounds(t: T) { - | ^^^^^^^ +LL | fn test_no_bounds(t: T) { + | ^^^^^^^^^^^^^^^^^ error[E0277]: `T` doesn't implement `Debug` --> $DIR/bound-suggestions.rs:21:22 @@ -34,8 +34,8 @@ LL | println!("{:?}", t); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -LL | fn test_one_bound(t: T) { - | ^^^^^^^ +LL | fn test_one_bound(t: T) { + | ^^^^^^^^^^^^^^^^^ error[E0277]: `Y` doesn't implement `Debug` --> $DIR/bound-suggestions.rs:27:30 @@ -47,8 +47,8 @@ LL | println!("{:?} {:?}", x, y); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting type parameter `Y` | -LL | fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, Y: Debug { - | ^^^^^^^^^^ +LL | fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug { + | ^^^^^^^^^^^^^^^^^^^^ error[E0277]: `X` doesn't implement `Debug` --> $DIR/bound-suggestions.rs:33:22 @@ -60,8 +60,8 @@ LL | println!("{:?}", x); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -LL | fn test_one_bound_where(x: X) where X: Sized + Debug { - | ^^^^^^^ +LL | fn test_one_bound_where(x: X) where X: Sized + std::fmt::Debug { + | ^^^^^^^^^^^^^^^^^ error[E0277]: `X` doesn't implement `Debug` --> $DIR/bound-suggestions.rs:39:22 @@ -73,8 +73,8 @@ LL | println!("{:?}", x); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting type parameter `X` | -LL | fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: Debug { - | ^^^^^^^^^^ +LL | fn test_many_bounds_where(x: X) where X: Sized, X: Sized, X: std::fmt::Debug { + | ^^^^^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/bound-suggestions.rs:44:46 diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr index 7e8ac113b4871..7ff986ec38109 100644 --- a/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr +++ b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr @@ -10,8 +10,8 @@ LL | impl Foo for (T,) { } = note: required because it appears within the type `(T,)` help: consider further restricting this bound | -LL | impl Foo for (T,) { } - | ^^^^^^ +LL | impl Foo for (T,) { } + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `T` cannot be shared between threads safely --> $DIR/builtin-superkinds-double-superkind.rs:9:16 @@ -25,8 +25,8 @@ LL | impl Foo for (T,T) { } = note: required because it appears within the type `(T, T)` help: consider further restricting this bound | -LL | impl Foo for (T,T) { } - | ^^^^^^ +LL | impl Foo for (T,T) { } + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr index 2b4b6e548b881..0d1d747272d18 100644 --- a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr +++ b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr @@ -9,11 +9,15 @@ LL | impl RequiresRequiresShareAndSend for X { } LL | pub trait RequiresRequiresShareAndSend : RequiresShare + Send { } | ---- required by this bound in `RequiresRequiresShareAndSend` | - = note: required because it appears within the type `X` +note: required because it appears within the type `X` + --> $DIR/builtin-superkinds-in-metadata.rs:9:8 + | +LL | struct X(T); + | ^ help: consider further restricting this bound | -LL | impl RequiresRequiresShareAndSend for X { } - | ^^^^^^ +LL | impl RequiresRequiresShareAndSend for X { } + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr index ff2cd1c4c8c75..ad80b3fa8d11f 100644 --- a/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr +++ b/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr @@ -9,8 +9,8 @@ LL | impl Foo for T { } | help: consider further restricting this bound | -LL | impl Foo for T { } - | ^^^^^^ +LL | impl Foo for T { } + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr index 48f18b1ebe957..273eae995538a 100644 --- a/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr +++ b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr @@ -9,8 +9,8 @@ LL | fn foo(blk: F) -> X where F: FnOnce() + 'static { | help: consider further restricting this bound | -LL | fn foo(blk: F) -> X where F: FnOnce() + 'static + Send { - | ^^^^^^ +LL | fn foo(blk: F) -> X where F: FnOnce() + 'static + std::marker::Send { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/closures/closure-bounds-subtype.stderr b/src/test/ui/closures/closure-bounds-subtype.stderr index d649eeccb8cc9..7df29d5a098a0 100644 --- a/src/test/ui/closures/closure-bounds-subtype.stderr +++ b/src/test/ui/closures/closure-bounds-subtype.stderr @@ -9,8 +9,8 @@ LL | take_const_owned(f); | help: consider further restricting this bound | -LL | fn give_owned(f: F) where F: FnOnce() + Send + Sync { - | ^^^^^^ +LL | fn give_owned(f: F) where F: FnOnce() + Send + std::marker::Sync { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/const-generics/const-argument-if-length.full.stderr b/src/test/ui/const-generics/const-argument-if-length.full.stderr index 5dca01f0dc078..c6088e665a232 100644 --- a/src/test/ui/const-generics/const-argument-if-length.full.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.full.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/const-argument-if-length.rs:7:28 | LL | pub const fn is_zst() -> usize { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | if std::mem::size_of::() == 0 { | ^ doesn't have a size known at compile-time | @@ -15,7 +15,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/const-argument-if-length.rs:16:12 | LL | pub struct AtLeastByte { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | value: T, | ^ doesn't have a size known at compile-time | diff --git a/src/test/ui/const-generics/const-argument-if-length.min.stderr b/src/test/ui/const-generics/const-argument-if-length.min.stderr index ea177c1974619..bc06e8d7fb123 100644 --- a/src/test/ui/const-generics/const-argument-if-length.min.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.min.stderr @@ -11,7 +11,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/const-argument-if-length.rs:16:12 | LL | pub struct AtLeastByte { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | value: T, | ^ doesn't have a size known at compile-time | diff --git a/src/test/ui/const-generics/issues/issue-61336-2.full.stderr b/src/test/ui/const-generics/issues/issue-61336-2.full.stderr index 9f8e68d211dec..ef0cafcb9bb7c 100644 --- a/src/test/ui/const-generics/issues/issue-61336-2.full.stderr +++ b/src/test/ui/const-generics/issues/issue-61336-2.full.stderr @@ -16,8 +16,8 @@ LL | [x; { N }] = note: the `Copy` trait is required because the repeated element will be copied help: consider restricting type parameter `T` | -LL | fn g(x: T) -> [T; N] { - | ^^^^^^ +LL | fn g(x: T) -> [T; N] { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr b/src/test/ui/const-generics/issues/issue-61336-2.min.stderr index 82d17a87e0af8..e5fe50513aaf7 100644 --- a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61336-2.min.stderr @@ -7,8 +7,8 @@ LL | [x; { N }] = note: the `Copy` trait is required because the repeated element will be copied help: consider restricting type parameter `T` | -LL | fn g(x: T) -> [T; N] { - | ^^^^^^ +LL | fn g(x: T) -> [T; N] { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-61336.full.stderr b/src/test/ui/const-generics/issues/issue-61336.full.stderr index 974e2af6fd2cf..fcfd39387c293 100644 --- a/src/test/ui/const-generics/issues/issue-61336.full.stderr +++ b/src/test/ui/const-generics/issues/issue-61336.full.stderr @@ -16,8 +16,8 @@ LL | [x; N] = note: the `Copy` trait is required because the repeated element will be copied help: consider restricting type parameter `T` | -LL | fn g(x: T) -> [T; N] { - | ^^^^^^ +LL | fn g(x: T) -> [T; N] { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/const-generics/issues/issue-61336.min.stderr b/src/test/ui/const-generics/issues/issue-61336.min.stderr index 19c7153582cb9..91580313e1e83 100644 --- a/src/test/ui/const-generics/issues/issue-61336.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61336.min.stderr @@ -7,8 +7,8 @@ LL | [x; N] = note: the `Copy` trait is required because the repeated element will be copied help: consider restricting type parameter `T` | -LL | fn g(x: T) -> [T; N] { - | ^^^^^^ +LL | fn g(x: T) -> [T; N] { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/did_you_mean/recursion_limit.stderr b/src/test/ui/did_you_mean/recursion_limit.stderr index c5b42416eac4a..2d52172a6fa53 100644 --- a/src/test/ui/did_you_mean/recursion_limit.stderr +++ b/src/test/ui/did_you_mean/recursion_limit.stderr @@ -8,16 +8,56 @@ LL | is_send::(); | ^^^^^^^^^^^^ | = help: consider adding a `#![recursion_limit="20"]` attribute to your crate (`recursion_limit`) - = note: required because it appears within the type `J` - = note: required because it appears within the type `I` - = note: required because it appears within the type `H` - = note: required because it appears within the type `G` - = note: required because it appears within the type `F` - = note: required because it appears within the type `E` - = note: required because it appears within the type `D` - = note: required because it appears within the type `C` - = note: required because it appears within the type `B` - = note: required because it appears within the type `A` +note: required because it appears within the type `J` + --> $DIR/recursion_limit.rs:24:9 + | +LL | link! { J, K } + | ^ +note: required because it appears within the type `I` + --> $DIR/recursion_limit.rs:23:9 + | +LL | link! { I, J } + | ^ +note: required because it appears within the type `H` + --> $DIR/recursion_limit.rs:22:9 + | +LL | link! { H, I } + | ^ +note: required because it appears within the type `G` + --> $DIR/recursion_limit.rs:21:9 + | +LL | link! { G, H } + | ^ +note: required because it appears within the type `F` + --> $DIR/recursion_limit.rs:20:9 + | +LL | link! { F, G } + | ^ +note: required because it appears within the type `E` + --> $DIR/recursion_limit.rs:19:9 + | +LL | link! { E, F } + | ^ +note: required because it appears within the type `D` + --> $DIR/recursion_limit.rs:18:9 + | +LL | link! { D, E } + | ^ +note: required because it appears within the type `C` + --> $DIR/recursion_limit.rs:17:9 + | +LL | link! { C, D } + | ^ +note: required because it appears within the type `B` + --> $DIR/recursion_limit.rs:16:9 + | +LL | link! { B, C } + | ^ +note: required because it appears within the type `A` + --> $DIR/recursion_limit.rs:15:9 + | +LL | link! { A, B } + | ^ error: aborting due to previous error diff --git a/src/test/ui/dst/dst-bad-deep.stderr b/src/test/ui/dst/dst-bad-deep.stderr index ea6b2390478ba..71e57b3e062b4 100644 --- a/src/test/ui/dst/dst-bad-deep.stderr +++ b/src/test/ui/dst/dst-bad-deep.stderr @@ -5,8 +5,16 @@ LL | let h: &Fat> = &Fat { ptr: *g }; | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `Fat>`, the trait `Sized` is not implemented for `[isize]` - = note: required because it appears within the type `Fat<[isize]>` - = note: required because it appears within the type `Fat>` +note: required because it appears within the type `Fat<[isize]>` + --> $DIR/dst-bad-deep.rs:6:8 + | +LL | struct Fat { + | ^^^ +note: required because it appears within the type `Fat>` + --> $DIR/dst-bad-deep.rs:6:8 + | +LL | struct Fat { + | ^^^ = note: structs must have a statically known size to be initialized error: aborting due to previous error diff --git a/src/test/ui/dst/dst-object-from-unsized-type.stderr b/src/test/ui/dst/dst-object-from-unsized-type.stderr index 49940112a9f63..2d12265df98ed 100644 --- a/src/test/ui/dst/dst-object-from-unsized-type.stderr +++ b/src/test/ui/dst/dst-object-from-unsized-type.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/dst-object-from-unsized-type.rs:8:23 | LL | fn test1(t: &T) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | let u: &dyn Foo = t; | ^ doesn't have a size known at compile-time | @@ -12,7 +12,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/dst-object-from-unsized-type.rs:13:23 | LL | fn test2(t: &T) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | let v: &dyn Foo = t as &dyn Foo; | ^ doesn't have a size known at compile-time | diff --git a/src/test/ui/error-codes/E0275.stderr b/src/test/ui/error-codes/E0275.stderr index 46966f22b6d1e..390c1e3e8ea4a 100644 --- a/src/test/ui/error-codes/E0275.stderr +++ b/src/test/ui/error-codes/E0275.stderr @@ -8,7 +8,11 @@ LL | impl Foo for T where Bar: Foo {} | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`E0275`) - = note: required because of the requirements on the impl of `Foo` for `Bar>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Foo` for `Bar>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/E0275.rs:5:9 + | +LL | impl Foo for T where Bar: Foo {} + | ^^^ ^ = note: 127 redundant requirements hidden = note: required because of the requirements on the impl of `Foo` for `Bar` diff --git a/src/test/ui/error-codes/E0277-2.stderr b/src/test/ui/error-codes/E0277-2.stderr index a0ab1641ca7c6..afd0e032dc3b3 100644 --- a/src/test/ui/error-codes/E0277-2.stderr +++ b/src/test/ui/error-codes/E0277-2.stderr @@ -8,9 +8,21 @@ LL | is_send::(); | ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely | = help: within `Foo`, the trait `Send` is not implemented for `*const u8` - = note: required because it appears within the type `Baz` - = note: required because it appears within the type `Bar` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Baz` + --> $DIR/E0277-2.rs:9:8 + | +LL | struct Baz { + | ^^^ +note: required because it appears within the type `Bar` + --> $DIR/E0277-2.rs:5:8 + | +LL | struct Bar { + | ^^^ +note: required because it appears within the type `Foo` + --> $DIR/E0277-2.rs:1:8 + | +LL | struct Foo { + | ^^^ error: aborting due to previous error diff --git a/src/test/ui/extern/extern-types-unsized.stderr b/src/test/ui/extern/extern-types-unsized.stderr index 278db45655720..72e4be51822e2 100644 --- a/src/test/ui/extern/extern-types-unsized.stderr +++ b/src/test/ui/extern/extern-types-unsized.stderr @@ -23,7 +23,11 @@ LL | assert_sized::(); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `Foo`, the trait `Sized` is not implemented for `A` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/extern-types-unsized.rs:9:8 + | +LL | struct Foo { + | ^^^ help: consider relaxing the implicit `Sized` restriction | LL | fn assert_sized() {} @@ -39,7 +43,11 @@ LL | assert_sized::>(); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `Bar`, the trait `Sized` is not implemented for `A` - = note: required because it appears within the type `Bar` +note: required because it appears within the type `Bar` + --> $DIR/extern-types-unsized.rs:14:8 + | +LL | struct Bar { + | ^^^ help: consider relaxing the implicit `Sized` restriction | LL | fn assert_sized() {} @@ -55,8 +63,16 @@ LL | assert_sized::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `Bar>`, the trait `Sized` is not implemented for `A` - = note: required because it appears within the type `Bar` - = note: required because it appears within the type `Bar>` +note: required because it appears within the type `Bar` + --> $DIR/extern-types-unsized.rs:14:8 + | +LL | struct Bar { + | ^^^ +note: required because it appears within the type `Bar>` + --> $DIR/extern-types-unsized.rs:14:8 + | +LL | struct Bar { + | ^^^ help: consider relaxing the implicit `Sized` restriction | LL | fn assert_sized() {} diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr index 266008cc0def4..4afbde5021f91 100644 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr +++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr @@ -69,8 +69,8 @@ LL | type Pointer2 = Box; | help: consider restricting type parameter `U32` | -LL | type Pointer2 = Box; - | ^^^^^^^ +LL | type Pointer2 = Box; + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 8 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-trivial_bounds.stderr b/src/test/ui/feature-gates/feature-gate-trivial_bounds.stderr index f3fa641209563..78904b383f49a 100644 --- a/src/test/ui/feature-gates/feature-gate-trivial_bounds.stderr +++ b/src/test/ui/feature-gates/feature-gate-trivial_bounds.stderr @@ -107,7 +107,11 @@ LL | | } | |_^ doesn't have a size known at compile-time | = help: within `Dst<(dyn A + 'static)>`, the trait `Sized` is not implemented for `(dyn A + 'static)` - = note: required because it appears within the type `Dst<(dyn A + 'static)>` +note: required because it appears within the type `Dst<(dyn A + 'static)>` + --> $DIR/feature-gate-trivial_bounds.rs:48:8 + | +LL | struct Dst { + | ^^^ = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable diff --git a/src/test/ui/generator/static-not-unpin.stderr b/src/test/ui/generator/static-not-unpin.stderr index 881064d2f8418..74ac53a7f9407 100644 --- a/src/test/ui/generator/static-not-unpin.stderr +++ b/src/test/ui/generator/static-not-unpin.stderr @@ -6,6 +6,8 @@ LL | fn assert_unpin(_: T) { ... LL | assert_unpin(generator); | ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6]` + | + = note: consider using `Box::pin` error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr index 645d292714562..e3d3de8bf9417 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.stderr +++ b/src/test/ui/generic-associated-types/impl_bounds.stderr @@ -51,8 +51,8 @@ LL | type C where Self: Copy = String; = note: the requirement `Fooy: Copy` appears on the associated impl type but not on the corresponding associated trait type help: consider restricting type parameter `T` | -LL | impl Foo for Fooy { - | ^^^^^^ +LL | impl Foo for Fooy { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr index b380f0da2ea40..c92800c3746ad 100644 --- a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr +++ b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr @@ -18,8 +18,8 @@ LL | type Item<'a> = T; | help: consider restricting type parameter `T` | -LL | impl UnsafeCopy for T { - | ^^^^^^ +LL | impl UnsafeCopy for T { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr index 61950478c32a8..e44547b10c17b 100644 --- a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr +++ b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr @@ -19,8 +19,8 @@ LL | type F<'a> = Self; = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` help: consider restricting type parameter `T` | -LL | impl> Fun for T { - | ^^^^^^^^ +LL | impl> Fun for T { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr index 13980618987be..fd0b4733d9359 100644 --- a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr +++ b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr @@ -19,8 +19,8 @@ LL | type F<'a> = Self; = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` help: consider restricting type parameter `T` | -LL | impl> Fun for T { - | ^^^^^^^^ +LL | impl> Fun for T { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr index 8112425146959..0c23c870f0106 100644 --- a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr +++ b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr @@ -19,8 +19,8 @@ LL | type F<'a> = Self; = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` help: consider restricting type parameter `T` | -LL | impl> Fun for T { - | ^^^^^^^^ +LL | impl> Fun for T { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr index 22f50b3949828..85d8d3f8e936e 100644 --- a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr +++ b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr @@ -19,8 +19,8 @@ LL | type F<'a> = Self; = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` help: consider restricting type parameter `T` | -LL | impl> Fun for T { - | ^^^^^^^^ +LL | impl> Fun for T { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/generic-associated-types/issue-74824.stderr b/src/test/ui/generic-associated-types/issue-74824.stderr index 34a2c1932ebcc..7a7b5fd4f1c55 100644 --- a/src/test/ui/generic-associated-types/issue-74824.stderr +++ b/src/test/ui/generic-associated-types/issue-74824.stderr @@ -19,8 +19,8 @@ LL | type Copy: Copy = Box; = note: required because of the requirements on the impl of `Clone` for `Box` help: consider restricting type parameter `T` | -LL | type Copy: Copy = Box; - | ^^^^^^^ +LL | type Copy: Copy = Box; + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr index 2342a4f6e172a..7b81beeed4167 100644 --- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr +++ b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr @@ -15,7 +15,11 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42 LL | let v = Unit2.m( | ^ expected struct `Unit4`, found struct `Unit3` | - = note: required because of the requirements on the impl of `for<'r> T0<'r, (>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` +note: required because of the requirements on the impl of `for<'r> T0<'r, (>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` + --> $DIR/issue-62203-hrtb-ice.rs:17:16 + | +LL | impl<'a, A, T> T0<'a, A> for L + | ^^^^^^^^^ ^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr b/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr index 5195333884a83..67a500f34d8e7 100644 --- a/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr +++ b/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr @@ -25,8 +25,8 @@ LL | type E = impl Copy; = note: required because it appears within the type `(S, T)` help: consider further restricting this bound | -LL | impl Bar for S { - | ^^^^^^ +LL | impl Bar for S { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` --> $DIR/issue-55872-1.rs:14:14 @@ -37,8 +37,8 @@ LL | type E = impl Copy; = note: required because it appears within the type `(S, T)` help: consider further restricting this bound | -LL | fn foo() -> Self::E { - | ^^^^^^ +LL | fn foo() -> Self::E { + | ^^^^^^^^^^^^^^^^^^^ error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias --> $DIR/issue-55872-1.rs:18:37 diff --git a/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr b/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr index 26fc200c2a2d5..90225d249d759 100644 --- a/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr +++ b/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr @@ -16,8 +16,8 @@ LL | type E = impl Copy; = note: required because it appears within the type `(S, T)` help: consider further restricting this bound | -LL | impl Bar for S { - | ^^^^^^ +LL | impl Bar for S { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` --> $DIR/issue-55872-1.rs:14:14 @@ -28,8 +28,8 @@ LL | type E = impl Copy; = note: required because it appears within the type `(S, T)` help: consider further restricting this bound | -LL | fn foo() -> Self::E { - | ^^^^^^ +LL | fn foo() -> Self::E { + | ^^^^^^^^^^^^^^^^^^^ error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias --> $DIR/issue-55872-1.rs:18:37 diff --git a/src/test/ui/issues/issue-18400.stderr b/src/test/ui/issues/issue-18400.stderr index 3bd9c656e8bd5..92d53088442e6 100644 --- a/src/test/ui/issues/issue-18400.stderr +++ b/src/test/ui/issues/issue-18400.stderr @@ -5,7 +5,11 @@ LL | 0.contains(bits); | ^^^^^^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_18400`) - = note: required because of the requirements on the impl of `Set<&[_]>` for `{integer}` +note: required because of the requirements on the impl of `Set<&[_]>` for `{integer}` + --> $DIR/issue-18400.rs:6:16 + | +LL | impl<'a, T, S> Set<&'a [T]> for S where + | ^^^^^^^^^^^^ ^ = note: 128 redundant requirements hidden = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` diff --git a/src/test/ui/issues/issue-20413.stderr b/src/test/ui/issues/issue-20413.stderr index b167bb77b5101..7fb1e3f2bba4f 100644 --- a/src/test/ui/issues/issue-20413.stderr +++ b/src/test/ui/issues/issue-20413.stderr @@ -16,7 +16,11 @@ LL | impl Foo for T where NoData: Foo { | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`) - = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:8:9 + | +LL | impl Foo for T where NoData: Foo { + | ^^^ ^ = note: 127 redundant requirements hidden = note: required because of the requirements on the impl of `Foo` for `NoData` @@ -30,8 +34,16 @@ LL | impl Bar for T where EvenLessData: Baz { | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`) - = note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - = note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:28:9 + | +LL | impl Bar for T where EvenLessData: Baz { + | ^^^ ^ +note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:36:9 + | +LL | impl Baz for T where AlmostNoData: Bar { + | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Baz` for `EvenLessData` @@ -45,8 +57,16 @@ LL | impl Baz for T where AlmostNoData: Bar { | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`) - = note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - = note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:36:9 + | +LL | impl Baz for T where AlmostNoData: Bar { + | ^^^ ^ +note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:28:9 + | +LL | impl Bar for T where EvenLessData: Baz { + | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Bar` for `AlmostNoData` @@ -60,7 +80,11 @@ LL | impl Foo for T where NoData: Foo { | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`) - = note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Foo` for `NoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:8:9 + | +LL | impl Foo for T where NoData: Foo { + | ^^^ ^ = note: 127 redundant requirements hidden = note: required because of the requirements on the impl of `Foo` for `NoData` @@ -74,8 +98,16 @@ LL | impl Bar for T where EvenLessData: Baz { | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`) - = note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - = note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:28:9 + | +LL | impl Bar for T where EvenLessData: Baz { + | ^^^ ^ +note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:36:9 + | +LL | impl Baz for T where AlmostNoData: Bar { + | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Baz` for `EvenLessData` @@ -89,8 +121,16 @@ LL | impl Baz for T where AlmostNoData: Bar { | ^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`) - = note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` - = note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required because of the requirements on the impl of `Baz` for `EvenLessData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:36:9 + | +LL | impl Baz for T where AlmostNoData: Bar { + | ^^^ ^ +note: required because of the requirements on the impl of `Bar` for `AlmostNoData>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-20413.rs:28:9 + | +LL | impl Bar for T where EvenLessData: Baz { + | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Bar` for `AlmostNoData` diff --git a/src/test/ui/issues/issue-22872.stderr b/src/test/ui/issues/issue-22872.stderr index c65a97d999998..fd3db9546991c 100644 --- a/src/test/ui/issues/issue-22872.stderr +++ b/src/test/ui/issues/issue-22872.stderr @@ -5,7 +5,11 @@ LL | let _: Box Wrap<'b>> = Box::new(Wrapper(process)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `

>::Item` is not an iterator | = help: the trait `Iterator` is not implemented for `

>::Item` - = note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for `Wrapper

` +note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for `Wrapper

` + --> $DIR/issue-22872.rs:7:13 + | +LL | impl<'b, P> Wrap<'b> for Wrapper

+ | ^^^^^^^^ ^^^^^^^^^^ = note: required for the cast to the object type `dyn for<'b> Wrap<'b>` help: consider further restricting the associated type | diff --git a/src/test/ui/issues/issue-23122-2.stderr b/src/test/ui/issues/issue-23122-2.stderr index ce3bffe602ca0..5008a499986d4 100644 --- a/src/test/ui/issues/issue-23122-2.stderr +++ b/src/test/ui/issues/issue-23122-2.stderr @@ -5,7 +5,11 @@ LL | type Next = as Next>::Next; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_23122_2`) - = note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` +note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` + --> $DIR/issue-23122-2.rs:8:15 + | +LL | impl Next for GetNext { + | ^^^^ ^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27060-2.stderr b/src/test/ui/issues/issue-27060-2.stderr index c4faecbdf2f9e..5dbcc96e87488 100644 --- a/src/test/ui/issues/issue-27060-2.stderr +++ b/src/test/ui/issues/issue-27060-2.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/issue-27060-2.rs:3:11 | LL | pub struct Bad { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | data: T, | ^ doesn't have a size known at compile-time | diff --git a/src/test/ui/issues/issue-38821.stderr b/src/test/ui/issues/issue-38821.stderr index e355094261de1..296efab7512f1 100644 --- a/src/test/ui/issues/issue-38821.stderr +++ b/src/test/ui/issues/issue-38821.stderr @@ -4,7 +4,11 @@ error[E0277]: the trait bound `::SqlType: NotNull` is not sat LL | #[derive(Debug, Copy, Clone)] | ^^^^ the trait `NotNull` is not implemented for `::SqlType` | - = note: required because of the requirements on the impl of `IntoNullable` for `::SqlType` +note: required because of the requirements on the impl of `IntoNullable` for `::SqlType` + --> $DIR/issue-38821.rs:9:18 + | +LL | impl IntoNullable for T { + | ^^^^^^^^^^^^ ^ = note: this error originates in a derive macro (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-39970.stderr b/src/test/ui/issues/issue-39970.stderr index 6f342b459c076..4aec388ab6f7f 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -7,7 +7,11 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected `&()`, found `()` | - = note: required because of the requirements on the impl of `Visit` for `()` +note: required because of the requirements on the impl of `Visit` for `()` + --> $DIR/issue-39970.rs:13:6 + | +LL | impl Visit for () where + | ^^^^^ ^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40827.stderr b/src/test/ui/issues/issue-40827.stderr index 95cacbc32ab69..38c3af935c564 100644 --- a/src/test/ui/issues/issue-40827.stderr +++ b/src/test/ui/issues/issue-40827.stderr @@ -8,9 +8,17 @@ LL | f(Foo(Arc::new(Bar::B(None)))); | ^ `Rc` cannot be shared between threads safely | = help: within `Bar`, the trait `Sync` is not implemented for `Rc` - = note: required because it appears within the type `Bar` +note: required because it appears within the type `Bar` + --> $DIR/issue-40827.rs:6:6 + | +LL | enum Bar { + | ^^^ = note: required because of the requirements on the impl of `Send` for `Arc` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/issue-40827.rs:4:8 + | +LL | struct Foo(Arc); + | ^^^ error[E0277]: `Rc` cannot be sent between threads safely --> $DIR/issue-40827.rs:14:5 @@ -22,9 +30,17 @@ LL | f(Foo(Arc::new(Bar::B(None)))); | ^ `Rc` cannot be sent between threads safely | = help: within `Bar`, the trait `Send` is not implemented for `Rc` - = note: required because it appears within the type `Bar` +note: required because it appears within the type `Bar` + --> $DIR/issue-40827.rs:6:6 + | +LL | enum Bar { + | ^^^ = note: required because of the requirements on the impl of `Send` for `Arc` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/issue-40827.rs:4:8 + | +LL | struct Foo(Arc); + | ^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-43784-supertrait.stderr b/src/test/ui/issues/issue-43784-supertrait.stderr index c73536ba97332..45a2350ddfd0e 100644 --- a/src/test/ui/issues/issue-43784-supertrait.stderr +++ b/src/test/ui/issues/issue-43784-supertrait.stderr @@ -9,8 +9,8 @@ LL | impl Complete for T {} | help: consider restricting type parameter `T` | -LL | impl Complete for T {} - | ^^^^^^ +LL | impl Complete for T {} + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-5883.stderr b/src/test/ui/issues/issue-5883.stderr index 5798733e04be0..48879eb798f06 100644 --- a/src/test/ui/issues/issue-5883.stderr +++ b/src/test/ui/issues/issue-5883.stderr @@ -21,7 +21,11 @@ LL | Struct { r: r } | --------------- this returned value is of type `Struct` | = help: within `Struct`, the trait `Sized` is not implemented for `(dyn A + 'static)` - = note: required because it appears within the type `Struct` +note: required because it appears within the type `Struct` + --> $DIR/issue-5883.rs:3:8 + | +LL | struct Struct { + | ^^^^^^ = note: the return type of a function must have a statically known size error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-7013.stderr b/src/test/ui/issues/issue-7013.stderr index 5f3156a540271..98ed67507b1d8 100644 --- a/src/test/ui/issues/issue-7013.stderr +++ b/src/test/ui/issues/issue-7013.stderr @@ -6,7 +6,11 @@ LL | let a = A {v: box B{v: None} as Box}; | = help: within `B`, the trait `Send` is not implemented for `Rc>` = note: required because it appears within the type `Option>>` - = note: required because it appears within the type `B` +note: required because it appears within the type `B` + --> $DIR/issue-7013.rs:10:8 + | +LL | struct B { + | ^ = note: required for the cast to the object type `dyn Foo + Send` error: aborting due to previous error diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.stderr b/src/test/ui/kindck/kindck-impl-type-params-2.stderr index 7e0f6e0b2de91..c635ebdbb7f46 100644 --- a/src/test/ui/kindck/kindck-impl-type-params-2.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params-2.stderr @@ -7,7 +7,11 @@ LL | fn take_param(foo: &T) { } LL | take_param(&x); | ^^ the trait `Copy` is not implemented for `Box<{integer}>` | - = note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` +note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` + --> $DIR/kindck-impl-type-params-2.rs:6:14 + | +LL | impl Foo for T { + | ^^^ ^ error: aborting due to previous error diff --git a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr index b01b8258e735f..e9002ec36f43d 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr @@ -8,8 +8,8 @@ LL | let a = &t as &dyn Gettable; = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn f(val: T) { - | ^^^^^^ +LL | fn f(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:18:13 @@ -21,8 +21,8 @@ LL | let a = &t as &dyn Gettable; = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn f(val: T) { - | ^^^^^^ +LL | fn f(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `T` cannot be sent between threads safely --> $DIR/kindck-impl-type-params.rs:25:31 @@ -34,8 +34,8 @@ LL | let a: &dyn Gettable = &t; = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn g(val: T) { - | ^^^^^^ +LL | fn g(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:25:31 @@ -47,8 +47,8 @@ LL | let a: &dyn Gettable = &t; = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn g(val: T) { - | ^^^^^^ +LL | fn g(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:38:13 diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr index ddf8adf3637b3..241fe367fd339 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params.stderr @@ -4,12 +4,16 @@ error[E0277]: `T` cannot be sent between threads safely LL | let a = &t as &dyn Gettable; | ^^ `T` cannot be sent between threads safely | - = note: required because of the requirements on the impl of `Gettable` for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:14:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn f(val: T) { - | ^^^^^^ +LL | fn f(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:18:13 @@ -17,12 +21,16 @@ error[E0277]: the trait bound `T: Copy` is not satisfied LL | let a = &t as &dyn Gettable; | ^^ the trait `Copy` is not implemented for `T` | - = note: required because of the requirements on the impl of `Gettable` for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:14:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn f(val: T) { - | ^^^^^^ +LL | fn f(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `T` cannot be sent between threads safely --> $DIR/kindck-impl-type-params.rs:25:31 @@ -30,12 +38,16 @@ error[E0277]: `T` cannot be sent between threads safely LL | let a: &dyn Gettable = &t; | ^^ `T` cannot be sent between threads safely | - = note: required because of the requirements on the impl of `Gettable` for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:14:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn g(val: T) { - | ^^^^^^ +LL | fn g(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:25:31 @@ -43,12 +55,16 @@ error[E0277]: the trait bound `T: Copy` is not satisfied LL | let a: &dyn Gettable = &t; | ^^ the trait `Copy` is not implemented for `T` | - = note: required because of the requirements on the impl of `Gettable` for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:14:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` help: consider restricting type parameter `T` | -LL | fn g(val: T) { - | ^^^^^^ +LL | fn g(val: T) { + | ^^^^^^^^^^^^^^^^^^^ error[E0477]: the type `&'a isize` does not fulfill the required lifetime --> $DIR/kindck-impl-type-params.rs:32:13 @@ -64,7 +80,11 @@ error[E0277]: the trait bound `String: Copy` is not satisfied LL | let a = t as Box>; | ^ the trait `Copy` is not implemented for `String` | - = note: required because of the requirements on the impl of `Gettable` for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:14:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` error[E0277]: the trait bound `Foo: Copy` is not satisfied @@ -73,7 +93,11 @@ error[E0277]: the trait bound `Foo: Copy` is not satisfied LL | let a: Box> = t; | ^ the trait `Copy` is not implemented for `Foo` | - = note: required because of the requirements on the impl of `Gettable` for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:14:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` error: aborting due to 7 previous errors diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr index 64e56f8c79043..86eaca83f2040 100644 --- a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr +++ b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr @@ -7,7 +7,11 @@ LL | fn take_param(foo: &T) { } LL | take_param(&x); | ^^ the trait `Copy` is not implemented for `Box<{integer}>` | - = note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` +note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` + --> $DIR/kindck-inherited-copy-bound.rs:14:14 + | +LL | impl Foo for T { + | ^^^ ^ error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/kindck-inherited-copy-bound.rs:28:19 diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr index 57f7551fd4018..49c5cd40b589a 100644 --- a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr +++ b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr @@ -7,7 +7,11 @@ LL | fn take_param(foo: &T) { } LL | take_param(&x); | ^^ the trait `Copy` is not implemented for `Box<{integer}>` | - = note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` +note: required because of the requirements on the impl of `Foo` for `Box<{integer}>` + --> $DIR/kindck-inherited-copy-bound.rs:14:14 + | +LL | impl Foo for T { + | ^^^ ^ error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/kindck-inherited-copy-bound.rs:28:13 diff --git a/src/test/ui/mut/mutable-enum-indirect.stderr b/src/test/ui/mut/mutable-enum-indirect.stderr index 3be6acb41a947..5b26f94115ac9 100644 --- a/src/test/ui/mut/mutable-enum-indirect.stderr +++ b/src/test/ui/mut/mutable-enum-indirect.stderr @@ -8,7 +8,11 @@ LL | bar(&x); | ^^^ `NoSync` cannot be shared between threads safely | = help: within `&Foo`, the trait `Sync` is not implemented for `NoSync` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/mutable-enum-indirect.rs:11:6 + | +LL | enum Foo { A(NoSync) } + | ^^^ = note: required because it appears within the type `&Foo` 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 ef7fb4ad7b266..2ee32029b40dc 100644 --- a/src/test/ui/no-send-res-ports.stderr +++ b/src/test/ui/no-send-res-ports.stderr @@ -17,8 +17,16 @@ LL | F: Send + 'static, | ---- required by this bound in `spawn` | = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`, the trait `Send` is not implemented for `Rc<()>` - = note: required because it appears within the type `Port<()>` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Port<()>` + --> $DIR/no-send-res-ports.rs:5:8 + | +LL | struct Port(Rc); + | ^^^^ +note: required because it appears within the type `Foo` + --> $DIR/no-send-res-ports.rs:9:12 + | +LL | struct Foo { + | ^^^ = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]` error: aborting due to previous error diff --git a/src/test/ui/no_send-enum.stderr b/src/test/ui/no_send-enum.stderr index b617fe410fa9b..9d755839d37c1 100644 --- a/src/test/ui/no_send-enum.stderr +++ b/src/test/ui/no_send-enum.stderr @@ -8,7 +8,11 @@ LL | bar(x); | ^^^ `NoSend` cannot be sent between threads safely | = help: within `Foo`, the trait `Send` is not implemented for `NoSend` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/no_send-enum.rs:8:6 + | +LL | enum Foo { + | ^^^ error: aborting due to previous error diff --git a/src/test/ui/no_share-enum.stderr b/src/test/ui/no_share-enum.stderr index 4a93edc100ec6..a8ab69200ecf1 100644 --- a/src/test/ui/no_share-enum.stderr +++ b/src/test/ui/no_share-enum.stderr @@ -8,7 +8,11 @@ LL | bar(x); | ^^^ `NoSync` cannot be shared between threads safely | = help: within `Foo`, the trait `Sync` is not implemented for `NoSync` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/no_share-enum.rs:8:6 + | +LL | enum Foo { A(NoSync) } + | ^^^ error: aborting due to previous error diff --git a/src/test/ui/phantom-auto-trait.stderr b/src/test/ui/phantom-auto-trait.stderr index 779919f9d643f..de13176ddc2a5 100644 --- a/src/test/ui/phantom-auto-trait.stderr +++ b/src/test/ui/phantom-auto-trait.stderr @@ -7,13 +7,21 @@ LL | fn is_zen(_: T) {} LL | is_zen(x) | ^ `T` cannot be shared between threads safely | - = note: required because of the requirements on the impl of `Zen` for `&T` +note: required because of the requirements on the impl of `Zen` for `&T` + --> $DIR/phantom-auto-trait.rs:10:24 + | +LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} + | ^^^ ^^^^^ = note: required because it appears within the type `PhantomData<&T>` - = note: required because it appears within the type `Guard<'_, T>` +note: required because it appears within the type `Guard<'_, T>` + --> $DIR/phantom-auto-trait.rs:12:8 + | +LL | struct Guard<'a, T: 'a> { + | ^^^^^ help: consider restricting type parameter `T` | -LL | fn not_sync(x: Guard) { - | ^^^^^^ +LL | fn not_sync(x: Guard) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `T` cannot be shared between threads safely --> $DIR/phantom-auto-trait.rs:26:12 @@ -24,14 +32,26 @@ LL | fn is_zen(_: T) {} LL | is_zen(x) | ^ `T` cannot be shared between threads safely | - = note: required because of the requirements on the impl of `Zen` for `&T` +note: required because of the requirements on the impl of `Zen` for `&T` + --> $DIR/phantom-auto-trait.rs:10:24 + | +LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} + | ^^^ ^^^^^ = note: required because it appears within the type `PhantomData<&T>` - = note: required because it appears within the type `Guard<'_, T>` - = note: required because it appears within the type `Nested>` +note: required because it appears within the type `Guard<'_, T>` + --> $DIR/phantom-auto-trait.rs:12:8 + | +LL | struct Guard<'a, T: 'a> { + | ^^^^^ +note: required because it appears within the type `Nested>` + --> $DIR/phantom-auto-trait.rs:16:8 + | +LL | struct Nested(T); + | ^^^^^^ help: consider restricting type parameter `T` | -LL | fn nested_not_sync(x: Nested>) { - | ^^^^^^ +LL | fn nested_not_sync(x: Nested>) { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/recursion/recursive-requirements.stderr b/src/test/ui/recursion/recursive-requirements.stderr index 6c0be0f7f8d77..0518cc507b50b 100644 --- a/src/test/ui/recursion/recursive-requirements.stderr +++ b/src/test/ui/recursion/recursive-requirements.stderr @@ -8,7 +8,11 @@ LL | let _: AssertSync = unimplemented!(); | ^^^^^^^^^^^^^^^ `*const Bar` cannot be shared between threads safely | = help: within `Foo`, the trait `Sync` is not implemented for `*const Bar` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/recursive-requirements.rs:5:12 + | +LL | pub struct Foo { + | ^^^ error[E0277]: `*const Foo` cannot be shared between threads safely --> $DIR/recursive-requirements.rs:16:12 @@ -20,9 +24,17 @@ LL | let _: AssertSync = unimplemented!(); | ^^^^^^^^^^^^^^^ `*const Foo` cannot be shared between threads safely | = help: within `Foo`, the trait `Sync` is not implemented for `*const Foo` - = note: required because it appears within the type `Bar` +note: required because it appears within the type `Bar` + --> $DIR/recursive-requirements.rs:10:12 + | +LL | pub struct Bar { + | ^^^ = note: required because it appears within the type `PhantomData` - = note: required because it appears within the type `Foo` +note: required because it appears within the type `Foo` + --> $DIR/recursive-requirements.rs:5:12 + | +LL | pub struct Foo { + | ^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr b/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr index b5a1877ea1931..eb5d80bc4dda6 100644 --- a/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr +++ b/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr @@ -28,8 +28,8 @@ LL | default type U<'a> = &'a T; = note: required because of the requirements on the impl of `PartialEq` for `&'a T` help: consider further restricting this bound | -LL | impl X for T { - | ^^^^^^^^^^^ +LL | impl X for T { + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 2 warnings emitted diff --git a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr index 57b90c457cb77..e416f30cb415d 100644 --- a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr +++ b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr @@ -19,8 +19,8 @@ LL | default impl Foo<'static, U> for () {} | help: consider restricting type parameter `U` | -LL | default impl Foo<'static, U> for () {} - | ^^^^ +LL | default impl Foo<'static, U> for () {} + | ^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/specialization/issue-38091-2.stderr b/src/test/ui/specialization/issue-38091-2.stderr index bd5ed498d92ca..a93f27ff051fc 100644 --- a/src/test/ui/specialization/issue-38091-2.stderr +++ b/src/test/ui/specialization/issue-38091-2.stderr @@ -10,7 +10,11 @@ LL | #![feature(specialization)] error[E0275]: overflow evaluating the requirement `i32: Check` | - = note: required because of the requirements on the impl of `Iterate` for `i32` +note: required because of the requirements on the impl of `Iterate` for `i32` + --> $DIR/issue-38091-2.rs:11:13 + | +LL | impl<'a, T> Iterate<'a> for T + | ^^^^^^^^^^^ ^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/specialization/issue-39448.stderr b/src/test/ui/specialization/issue-39448.stderr index 98e49b1bab3b7..c4fc44c737ec1 100644 --- a/src/test/ui/specialization/issue-39448.stderr +++ b/src/test/ui/specialization/issue-39448.stderr @@ -14,8 +14,16 @@ error[E0275]: overflow evaluating the requirement `T: FromA` LL | x.foo(y.to()).to() | ^^ | - = note: required because of the requirements on the impl of `FromA` for `T` - = note: required because of the requirements on the impl of `ToA` for `U` +note: required because of the requirements on the impl of `FromA` for `T` + --> $DIR/issue-39448.rs:24:29 + | +LL | impl> FromA for U { + | ^^^^^^^^ ^ +note: required because of the requirements on the impl of `ToA` for `U` + --> $DIR/issue-39448.rs:34:12 + | +LL | impl ToA for T + | ^^^^^^ ^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/specialization/issue-68830-spurious-diagnostics.rs b/src/test/ui/specialization/issue-68830-spurious-diagnostics.rs new file mode 100644 index 0000000000000..d11ec79833217 --- /dev/null +++ b/src/test/ui/specialization/issue-68830-spurious-diagnostics.rs @@ -0,0 +1,23 @@ +// A regression test for #68830. This checks we don't emit +// a verbose `conflicting implementations` error. + +#![feature(specialization)] +#![allow(incomplete_features)] + +struct BadStruct { + err: MissingType //~ ERROR: cannot find type `MissingType` in this scope +} + +trait MyTrait { + fn foo(); +} + +impl MyTrait for D { + default fn foo() {} +} + +impl MyTrait for BadStruct { + fn foo() {} +} + +fn main() {} diff --git a/src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr b/src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr new file mode 100644 index 0000000000000..833f61dca8cac --- /dev/null +++ b/src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `MissingType` in this scope + --> $DIR/issue-68830-spurious-diagnostics.rs:8:10 + | +LL | err: MissingType + | ^^^^^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index 89be3d29e0cff..5bbf4225812b6 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -80,7 +80,11 @@ LL | >::bar; | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str` +note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str` + --> $DIR/substs-ppaux.rs:11:17 + | +LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} + | ^^^^^^^^^^^^^^ ^ error: aborting due to 5 previous errors diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index e37d087fcc958..20d7655337448 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -80,7 +80,11 @@ LL | >::bar; | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str` +note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str` + --> $DIR/substs-ppaux.rs:11:17 + | +LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} + | ^^^^^^^^^^^^^^ ^ error: aborting due to 5 previous errors diff --git a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr b/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr index 9437fbe61cc7e..5cb3a404037a7 100644 --- a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr +++ b/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr @@ -5,7 +5,7 @@ LL | struct X(T); | - required by this bound in `X` ... LL | struct Struct5{ - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | _t: X, | ^^^^ doesn't have a size known at compile-time | diff --git a/src/test/ui/suggestions/restrict-type-argument.stderr b/src/test/ui/suggestions/restrict-type-argument.stderr index 7a7242a6369df..33af13d943f74 100644 --- a/src/test/ui/suggestions/restrict-type-argument.stderr +++ b/src/test/ui/suggestions/restrict-type-argument.stderr @@ -9,8 +9,8 @@ LL | is_send(val); | help: consider further restricting this bound | -LL | fn use_impl_sync(val: impl Sync + Send) { - | ^^^^^^ +LL | fn use_impl_sync(val: impl Sync + std::marker::Send) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `S` cannot be sent between threads safely --> $DIR/restrict-type-argument.rs:8:13 @@ -23,8 +23,8 @@ LL | is_send(val); | help: consider further restricting this bound | -LL | fn use_where(val: S) where S: Sync + Send { - | ^^^^^^ +LL | fn use_where(val: S) where S: Sync + std::marker::Send { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `S` cannot be sent between threads safely --> $DIR/restrict-type-argument.rs:12:13 @@ -37,8 +37,8 @@ LL | is_send(val); | help: consider further restricting this bound | -LL | fn use_bound(val: S) { - | ^^^^^^ +LL | fn use_bound(val: S) { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `S` cannot be sent between threads safely --> $DIR/restrict-type-argument.rs:20:13 @@ -51,8 +51,8 @@ LL | is_send(val); | help: consider further restricting this bound | -LL | Sync + Send - | ^^^^^^ +LL | Sync + std::marker::Send + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `S` cannot be sent between threads safely --> $DIR/restrict-type-argument.rs:24:13 @@ -65,8 +65,8 @@ LL | is_send(val); | help: consider further restricting this bound | -LL | fn use_bound_and_where(val: S) where S: std::fmt::Debug + Send { - | ^^^^^^ +LL | fn use_bound_and_where(val: S) where S: std::fmt::Debug + std::marker::Send { + | ^^^^^^^^^^^^^^^^^^^ error[E0277]: `S` cannot be sent between threads safely --> $DIR/restrict-type-argument.rs:28:13 @@ -79,8 +79,8 @@ LL | is_send(val); | help: consider restricting type parameter `S` | -LL | fn use_unbound(val: S) { - | ^^^^^^ +LL | fn use_unbound(val: S) { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/trait-impl-bound-suggestions.fixed b/src/test/ui/trait-impl-bound-suggestions.fixed index db3a95f5c4f61..744e7bef04e97 100644 --- a/src/test/ui/trait-impl-bound-suggestions.fixed +++ b/src/test/ui/trait-impl-bound-suggestions.fixed @@ -10,7 +10,7 @@ struct ConstrainedStruct { } #[allow(dead_code)] -trait InsufficientlyConstrainedGeneric where X: Copy { +trait InsufficientlyConstrainedGeneric where X: std::marker::Copy { fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct { //~^ ERROR the trait bound `X: Copy` is not satisfied ConstrainedStruct { x } diff --git a/src/test/ui/trait-impl-bound-suggestions.stderr b/src/test/ui/trait-impl-bound-suggestions.stderr index 3a21e9c6b2ad4..110ca79908079 100644 --- a/src/test/ui/trait-impl-bound-suggestions.stderr +++ b/src/test/ui/trait-impl-bound-suggestions.stderr @@ -9,8 +9,8 @@ LL | fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct { | help: consider further restricting type parameter `X` | -LL | trait InsufficientlyConstrainedGeneric where X: Copy { - | ^^^^^^^^^^^^^ +LL | trait InsufficientlyConstrainedGeneric where X: std::marker::Copy { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr index b2702d977f8b6..40386f706132b 100644 --- a/src/test/ui/traits/cycle-cache-err-60010.stderr +++ b/src/test/ui/traits/cycle-cache-err-60010.stderr @@ -10,9 +10,21 @@ LL | SourceDatabase::parse(db); = note: required because it appears within the type `*const SalsaStorage` = note: required because it appears within the type `Unique` = note: required because it appears within the type `Box` - = note: required because it appears within the type `Runtime` - = note: required because it appears within the type `RootDatabase` - = note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase` +note: required because it appears within the type `Runtime` + --> $DIR/cycle-cache-err-60010.rs:23:8 + | +LL | struct Runtime { + | ^^^^^^^ +note: required because it appears within the type `RootDatabase` + --> $DIR/cycle-cache-err-60010.rs:20:8 + | +LL | struct RootDatabase { + | ^^^^^^^^^^^^ +note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase` + --> $DIR/cycle-cache-err-60010.rs:43:9 + | +LL | impl SourceDatabase for T + | ^^^^^^^^^^^^^^ ^ error: aborting due to previous error diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs index 205d50a2ed9ce..e23dfa57cd0d4 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.rs +++ b/src/test/ui/traits/inductive-overflow/lifetime.rs @@ -16,7 +16,7 @@ struct C<'a>(&'a ()); struct X(T::P); impl NotAuto for Box {} -impl NotAuto for X where T::P: NotAuto {} +impl NotAuto for X where T::P: NotAuto {} //~ NOTE: required impl<'a> NotAuto for C<'a> {} fn is_send() {} @@ -26,5 +26,4 @@ fn main() { // Should only be a few notes. is_send::>>(); //~^ ERROR overflow evaluating - //~| NOTE: required } diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr index 659f9e26e3e62..752154b35cabe 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.stderr +++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr @@ -7,7 +7,11 @@ LL | fn is_send() {} LL | is_send::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: required because of the requirements on the impl of `NotAuto` for `X>` +note: required because of the requirements on the impl of `NotAuto` for `X>` + --> $DIR/lifetime.rs:19:12 + | +LL | impl NotAuto for X where T::P: NotAuto {} + | ^^^^^^^ ^^^^ error: aborting due to previous error diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr index 88e0631eeb27a..94a255fcb84de 100644 --- a/src/test/ui/traits/inductive-overflow/simultaneous.stderr +++ b/src/test/ui/traits/inductive-overflow/simultaneous.stderr @@ -7,7 +7,11 @@ LL | fn is_ee(t: T) { LL | is_ee(4); | ^^^^^ | - = note: required because of the requirements on the impl of `Combo` for `{integer}` +note: required because of the requirements on the impl of `Combo` for `{integer}` + --> $DIR/simultaneous.rs:11:34 + | +LL | impl Combo for T {} + | ^^^^^ ^ error: aborting due to previous error diff --git a/src/test/ui/traits/inductive-overflow/supertrait.stderr b/src/test/ui/traits/inductive-overflow/supertrait.stderr index dfb967601e987..5ed1c2cc2da6f 100644 --- a/src/test/ui/traits/inductive-overflow/supertrait.stderr +++ b/src/test/ui/traits/inductive-overflow/supertrait.stderr @@ -7,7 +7,11 @@ LL | fn copy(x: T) -> (T, T) { (x, x) } LL | let (a, b) = copy(NoClone); | ^^^^ | - = note: required because of the requirements on the impl of `Magic` for `NoClone` +note: required because of the requirements on the impl of `Magic` for `NoClone` + --> $DIR/supertrait.rs:5:16 + | +LL | impl Magic for T {} + | ^^^^^ ^ error: aborting due to previous error diff --git a/src/test/ui/traits/inductive-overflow/two-traits.stderr b/src/test/ui/traits/inductive-overflow/two-traits.stderr index d3f2931f25d47..508a12d859a62 100644 --- a/src/test/ui/traits/inductive-overflow/two-traits.stderr +++ b/src/test/ui/traits/inductive-overflow/two-traits.stderr @@ -9,8 +9,8 @@ LL | type X = Self; | help: consider further restricting this bound | -LL | impl Magic for T { - | ^^^^^^ +LL | impl Magic for T { + | ^^^^^^^^^^^^^^^^^^^ error[E0275]: overflow evaluating the requirement `*mut (): Magic` --> $DIR/two-traits.rs:20:5 diff --git a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr index 83b1b83d1939d..4f7d1be793891 100644 --- a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr +++ b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr @@ -69,7 +69,11 @@ LL | is_send(Box::new(Outer2(TestType))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `dummy3::TestType` cannot be sent between threads safely | = help: within `Outer2`, the trait `Send` is not implemented for `dummy3::TestType` - = note: required because it appears within the type `Outer2` +note: required because it appears within the type `Outer2` + --> $DIR/negated-auto-traits-error.rs:12:8 + | +LL | struct Outer2(T); + | ^^^^^^ = note: required because of the requirements on the impl of `Send` for `Unique>` = note: required because it appears within the type `Box>` @@ -86,7 +90,11 @@ LL | is_sync(Outer2(TestType)); | help: consider borrowing here: `&Outer2(TestType)` | = note: the trait bound `main::TestType: Sync` is not satisfied - = note: required because of the requirements on the impl of `Sync` for `Outer2` +note: required because of the requirements on the impl of `Sync` for `Outer2` + --> $DIR/negated-auto-traits-error.rs:14:22 + | +LL | unsafe impl Sync for Outer2 {} + | ^^^^ ^^^^^^^^^ error: aborting due to 7 previous errors diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr index 86d589ffa9e31..025706480821d 100644 --- a/src/test/ui/traits/suggest-where-clause.stderr +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim --> $DIR/suggest-where-clause.rs:7:20 | LL | fn check() { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | // suggest a where-clause, if needed LL | mem::size_of::(); | ^ doesn't have a size known at compile-time @@ -16,7 +16,7 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim --> $DIR/suggest-where-clause.rs:10:5 | LL | fn check() { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | mem::size_of::>(); | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -26,7 +26,11 @@ LL | mem::size_of::>(); LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` | - = note: required because it appears within the type `Misc` +note: required because it appears within the type `Misc` + --> $DIR/suggest-where-clause.rs:3:8 + | +LL | struct Misc(T); + | ^^^^ error[E0277]: the trait bound `u64: From` is not satisfied --> $DIR/suggest-where-clause.rs:15:5 diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr index 871ef22f3ebcf..cfb1fe9c19a8b 100644 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr @@ -15,8 +15,8 @@ LL | type X = impl Clone; | help: consider restricting type parameter `T` | -LL | type X = impl Clone; - | ^^^^^^^ +LL | type X = impl Clone; + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr index 20656e5e55320..735b96d5df98e 100644 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr @@ -6,8 +6,8 @@ LL | type X = impl Clone; | help: consider restricting type parameter `T` | -LL | type X = impl Clone; - | ^^^^^^^ +LL | type X = impl Clone; + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr index 8a0c411c7754a..aab64e72b7bca 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr @@ -28,8 +28,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, U)` help: consider restricting type parameter `T` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error[E0277]: `U` doesn't implement `Debug` --> $DIR/generic_duplicate_param_use5.rs:11:18 @@ -40,8 +40,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, U)` help: consider restricting type parameter `U` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr index 35115ccb2d678..5c8c5b8977906 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr @@ -19,8 +19,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, U)` help: consider restricting type parameter `T` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error[E0277]: `U` doesn't implement `Debug` --> $DIR/generic_duplicate_param_use5.rs:11:18 @@ -31,8 +31,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, U)` help: consider restricting type parameter `U` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr index 8f72c333e817c..a69e99bf8b05f 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr @@ -28,8 +28,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, T)` help: consider restricting type parameter `T` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr index 922c9a7420848..a377ef2d87322 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr @@ -19,8 +19,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, T)` help: consider restricting type parameter `T` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr index a93321d4d0508..e73ac88500e03 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr @@ -28,8 +28,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, u32)` help: consider restricting type parameter `T` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr index 25ac60799f668..d7edce7a491de 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr @@ -19,8 +19,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(T, u32)` help: consider restricting type parameter `T` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr index 098be7929d6f2..0b3d72d67b242 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr @@ -40,8 +40,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` help: consider restricting type parameter `A` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error[E0277]: `B` doesn't implement `Debug` --> $DIR/generic_duplicate_param_use9.rs:10:18 @@ -52,8 +52,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` help: consider restricting type parameter `B` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr index b59e10c1b06f1..fd1081d7b71de 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr @@ -31,8 +31,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` help: consider restricting type parameter `A` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error[E0277]: `B` doesn't implement `Debug` --> $DIR/generic_duplicate_param_use9.rs:10:18 @@ -43,8 +43,8 @@ LL | type Two = impl Debug; = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` help: consider restricting type parameter `B` | -LL | type Two = impl Debug; - | ^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr index ca263ba4f5b41..7ab73d24274ce 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr @@ -30,8 +30,8 @@ LL | fn underconstrained(_: U) -> Underconstrained { | help: consider restricting type parameter `U` | -LL | fn underconstrained(_: U) -> Underconstrained { - | ^^^^^^^ +LL | fn underconstrained(_: U) -> Underconstrained { + | ^^^^^^^^^^^^^^^^^ error[E0277]: `V` doesn't implement `Debug` --> $DIR/generic_underconstrained2.rs:21:43 @@ -44,8 +44,8 @@ LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { | help: consider restricting type parameter `V` | -LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { - | ^^^^^^^ +LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { + | ^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr index 6ce32f457e3ec..a4f5f4b8645b1 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr @@ -21,8 +21,8 @@ LL | fn underconstrained(_: U) -> Underconstrained { | help: consider restricting type parameter `U` | -LL | fn underconstrained(_: U) -> Underconstrained { - | ^^^^^^^ +LL | fn underconstrained(_: U) -> Underconstrained { + | ^^^^^^^^^^^^^^^^^ error[E0277]: `V` doesn't implement `Debug` --> $DIR/generic_underconstrained2.rs:21:43 @@ -35,8 +35,8 @@ LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { | help: consider restricting type parameter `V` | -LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { - | ^^^^^^^ +LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { + | ^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr index 14f4f62d7a5f7..35ac0993b29ca 100644 --- a/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr @@ -15,8 +15,8 @@ LL | type Foo = impl Default; | help: consider restricting type parameter `T` | -LL | type Foo = impl Default; - | ^^^^^^^^^ +LL | type Foo = impl Default; + | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr index 6dda27f515e79..9fb760f34c19a 100644 --- a/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr @@ -6,8 +6,8 @@ LL | type Foo = impl Default; | help: consider restricting type parameter `T` | -LL | type Foo = impl Default; - | ^^^^^^^^^ +LL | type Foo = impl Default; + | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr index d8c7f595e62ef..ddfa31cf62448 100644 --- a/src/test/ui/type/type-check-defaults.stderr +++ b/src/test/ui/type/type-check-defaults.stderr @@ -56,8 +56,8 @@ LL | trait Base: Super { } | help: consider further restricting type parameter `T` | -LL | trait Base: Super where T: Copy { } - | ^^^^^^^^^^^^^ +LL | trait Base: Super where T: std::marker::Copy { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: cannot add `u8` to `i32` --> $DIR/type-check-defaults.rs:24:66 diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr index 1f21e12597001..a9b49ee32630b 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr @@ -19,7 +19,11 @@ LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell` cannot be shared between threads safely | = help: within `MyTypeWUnsafe`, the trait `Sync` is not implemented for `UnsafeCell` - = note: required because it appears within the type `MyTypeWUnsafe` +note: required because it appears within the type `MyTypeWUnsafe` + --> $DIR/typeck-default-trait-impl-negation-sync.rs:21:8 + | +LL | struct MyTypeWUnsafe { + | ^^^^^^^^^^^^^ error[E0277]: `Managed` cannot be shared between threads safely --> $DIR/typeck-default-trait-impl-negation-sync.rs:39:5 @@ -31,7 +35,11 @@ LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely | = help: within `MyTypeManaged`, the trait `Sync` is not implemented for `Managed` - = note: required because it appears within the type `MyTypeManaged` +note: required because it appears within the type `MyTypeManaged` + --> $DIR/typeck-default-trait-impl-negation-sync.rs:25:8 + | +LL | struct MyTypeManaged { + | ^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr index 4fb423b9a2c38..7398b48a238d1 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr @@ -9,8 +9,8 @@ LL | fn is_send() { | help: consider restricting type parameter `T` | -LL | fn foo() { - | ^^^^^^ +LL | fn foo() { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/typeck/typeck-unsafe-always-share.stderr b/src/test/ui/typeck/typeck-unsafe-always-share.stderr index 2a6ae736d7a8d..91585e78d4b93 100644 --- a/src/test/ui/typeck/typeck-unsafe-always-share.stderr +++ b/src/test/ui/typeck/typeck-unsafe-always-share.stderr @@ -30,7 +30,11 @@ LL | test(ms); | ^^^^ `UnsafeCell` cannot be shared between threads safely | = help: within `MySync`, the trait `Sync` is not implemented for `UnsafeCell` - = note: required because it appears within the type `MySync` +note: required because it appears within the type `MySync` + --> $DIR/typeck-unsafe-always-share.rs:8:8 + | +LL | struct MySync { + | ^^^^^^ error[E0277]: `NoSync` cannot be shared between threads safely --> $DIR/typeck-unsafe-always-share.rs:30:10 diff --git a/src/test/ui/union/union-sized-field.stderr b/src/test/ui/union/union-sized-field.stderr index cebeeb59a7829..b916bbe8ad10a 100644 --- a/src/test/ui/union/union-sized-field.stderr +++ b/src/test/ui/union/union-sized-field.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/union-sized-field.rs:4:12 | LL | union Foo { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | value: T, | ^ doesn't have a size known at compile-time | @@ -21,7 +21,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/union-sized-field.rs:9:12 | LL | struct Foo2 { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | value: T, | ^ doesn't have a size known at compile-time | @@ -40,7 +40,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/union-sized-field.rs:15:11 | LL | enum Foo3 { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | Value(T), | ^ doesn't have a size known at compile-time | diff --git a/src/test/ui/unsized-locals/issue-50940-with-feature.stderr b/src/test/ui/unsized-locals/issue-50940-with-feature.stderr index 1b1a584a01ff1..4523d41b60060 100644 --- a/src/test/ui/unsized-locals/issue-50940-with-feature.stderr +++ b/src/test/ui/unsized-locals/issue-50940-with-feature.stderr @@ -14,7 +14,11 @@ LL | A as fn(str) -> A; | ^ doesn't have a size known at compile-time | = help: within `A`, the trait `Sized` is not implemented for `str` - = note: required because it appears within the type `A` +note: required because it appears within the type `A` + --> $DIR/issue-50940-with-feature.rs:5:12 + | +LL | struct A(X); + | ^ = note: the return type of a function must have a statically known size error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/unsized-locals/unsized-exprs.stderr b/src/test/ui/unsized-locals/unsized-exprs.stderr index 9fb401aec2cfa..a7f57e3fd1566 100644 --- a/src/test/ui/unsized-locals/unsized-exprs.stderr +++ b/src/test/ui/unsized-locals/unsized-exprs.stderr @@ -15,7 +15,11 @@ LL | udrop::>(A { 0: *foo() }); | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]` - = note: required because it appears within the type `A<[u8]>` +note: required because it appears within the type `A<[u8]>` + --> $DIR/unsized-exprs.rs:3:8 + | +LL | struct A(X); + | ^ = note: structs must have a statically known size to be initialized error[E0277]: the size for values of type `[u8]` cannot be known at compilation time @@ -25,7 +29,11 @@ LL | udrop::>(A(*foo())); | ^ doesn't have a size known at compile-time | = help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]` - = note: required because it appears within the type `A<[u8]>` +note: required because it appears within the type `A<[u8]>` + --> $DIR/unsized-exprs.rs:3:8 + | +LL | struct A(X); + | ^ = note: the return type of a function must have a statically known size error: aborting due to 3 previous errors diff --git a/src/test/ui/unsized/unsized-bare-typaram.stderr b/src/test/ui/unsized/unsized-bare-typaram.stderr index b2ff3159c9591..19978ae24cacb 100644 --- a/src/test/ui/unsized/unsized-bare-typaram.stderr +++ b/src/test/ui/unsized/unsized-bare-typaram.stderr @@ -6,7 +6,7 @@ LL | fn bar() { } LL | fn foo() { bar::() } | - ^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` error: aborting due to previous error diff --git a/src/test/ui/unsized/unsized-enum.stderr b/src/test/ui/unsized/unsized-enum.stderr index 3057d4789bd81..601db7d1cd983 100644 --- a/src/test/ui/unsized/unsized-enum.stderr +++ b/src/test/ui/unsized/unsized-enum.stderr @@ -7,7 +7,7 @@ LL | fn foo1() { not_sized::>() } // Hunky dory. LL | fn foo2() { not_sized::>() } | - ^^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | help: you could relax the implicit `Sized` bound on `U` if it were used through indirection like `&U` or `Box` --> $DIR/unsized-enum.rs:4:10 diff --git a/src/test/ui/unsized/unsized-enum2.stderr b/src/test/ui/unsized/unsized-enum2.stderr index 0a0896638e072..1b6c85858159d 100644 --- a/src/test/ui/unsized/unsized-enum2.stderr +++ b/src/test/ui/unsized/unsized-enum2.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `W` cannot be known at compilation tim --> $DIR/unsized-enum2.rs:23:8 | LL | enum E { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | // parameter LL | VA(W), | ^ doesn't have a size known at compile-time @@ -22,7 +22,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized-enum2.rs:25:11 | LL | enum E { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | VB{x: X}, | ^ doesn't have a size known at compile-time @@ -42,7 +42,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim --> $DIR/unsized-enum2.rs:27:15 | LL | enum E { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | VC(isize, Y), | ^ doesn't have a size known at compile-time @@ -62,7 +62,7 @@ error[E0277]: the size for values of type `Z` cannot be known at compilation tim --> $DIR/unsized-enum2.rs:29:21 | LL | enum E { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | VD{u: isize, x: Z}, | ^ doesn't have a size known at compile-time @@ -301,7 +301,11 @@ LL | VI(Path1), | ^^^^^ doesn't have a size known at compile-time | = help: within `Path1`, the trait `Sized` is not implemented for `(dyn PathHelper1 + 'static)` - = note: required because it appears within the type `Path1` +note: required because it appears within the type `Path1` + --> $DIR/unsized-enum2.rs:16:8 + | +LL | struct Path1(dyn PathHelper1); + | ^^^^^ = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -320,7 +324,11 @@ LL | VJ{x: Path2}, | ^^^^^ doesn't have a size known at compile-time | = help: within `Path2`, the trait `Sized` is not implemented for `(dyn PathHelper2 + 'static)` - = note: required because it appears within the type `Path2` +note: required because it appears within the type `Path2` + --> $DIR/unsized-enum2.rs:17:8 + | +LL | struct Path2(dyn PathHelper2); + | ^^^^^ = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -339,7 +347,11 @@ LL | VK(isize, Path3), | ^^^^^ doesn't have a size known at compile-time | = help: within `Path3`, the trait `Sized` is not implemented for `(dyn PathHelper3 + 'static)` - = note: required because it appears within the type `Path3` +note: required because it appears within the type `Path3` + --> $DIR/unsized-enum2.rs:18:8 + | +LL | struct Path3(dyn PathHelper3); + | ^^^^^ = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -358,7 +370,11 @@ LL | VL{u: isize, x: Path4}, | ^^^^^ doesn't have a size known at compile-time | = help: within `Path4`, the trait `Sized` is not implemented for `(dyn PathHelper4 + 'static)` - = note: required because it appears within the type `Path4` +note: required because it appears within the type `Path4` + --> $DIR/unsized-enum2.rs:19:8 + | +LL | struct Path4(dyn PathHelper4); + | ^^^^^ = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size diff --git a/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr b/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr index 9d8a1c67734a4..9d072eda4e81c 100644 --- a/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr +++ b/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr @@ -7,7 +7,7 @@ LL | LL | impl S5 { | - ^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box` --> $DIR/unsized-inherent-impl-self-type.rs:5:11 diff --git a/src/test/ui/unsized/unsized-struct.stderr b/src/test/ui/unsized/unsized-struct.stderr index 6661cf358b3ab..e38375bff46cf 100644 --- a/src/test/ui/unsized/unsized-struct.stderr +++ b/src/test/ui/unsized/unsized-struct.stderr @@ -7,7 +7,7 @@ LL | fn foo1() { not_sized::>() } // Hunky dory. LL | fn foo2() { not_sized::>() } | - ^^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box` --> $DIR/unsized-struct.rs:4:12 @@ -26,9 +26,13 @@ LL | fn is_sized() { } LL | fn bar2() { is_sized::>() } | - ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | - = note: required because it appears within the type `Bar` +note: required because it appears within the type `Bar` + --> $DIR/unsized-struct.rs:11:8 + | +LL | struct Bar { data: T } + | ^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/unsized/unsized-trait-impl-self-type.stderr b/src/test/ui/unsized/unsized-trait-impl-self-type.stderr index d1b590d813307..aef0d0cbb8395 100644 --- a/src/test/ui/unsized/unsized-trait-impl-self-type.stderr +++ b/src/test/ui/unsized/unsized-trait-impl-self-type.stderr @@ -7,7 +7,7 @@ LL | LL | impl T3 for S5 { | - ^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box` --> $DIR/unsized-trait-impl-self-type.rs:8:11 diff --git a/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr b/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr index 17fe16ed4fc05..f48d4ef9f1461 100644 --- a/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr +++ b/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr @@ -7,7 +7,7 @@ LL | trait T2 { LL | impl T2 for S4 { | - ^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | help: consider relaxing the implicit `Sized` restriction | diff --git a/src/test/ui/unsized3.stderr b/src/test/ui/unsized3.stderr index 7ed43c38f1d38..bd36008aca044 100644 --- a/src/test/ui/unsized3.stderr +++ b/src/test/ui/unsized3.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized3.rs:7:13 | LL | fn f1(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f2::(x); | ^ doesn't have a size known at compile-time ... @@ -18,7 +18,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized3.rs:18:13 | LL | fn f3(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f4::(x); | ^ doesn't have a size known at compile-time ... @@ -37,11 +37,15 @@ LL | fn f5(x: &Y) {} | - required by this bound in `f5` ... LL | fn f8(x1: &S, x2: &S) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f5(x1); | ^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `S` +note: required because it appears within the type `S` + --> $DIR/unsized3.rs:28:8 + | +LL | struct S { + | ^ help: consider relaxing the implicit `Sized` restriction | LL | fn f5(x: &Y) {} @@ -51,22 +55,30 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized3.rs:40:8 | LL | fn f9(x1: Box>) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f5(&(*x1, 34)); | ^^^^^^^^^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `S` +note: required because it appears within the type `S` + --> $DIR/unsized3.rs:28:8 + | +LL | struct S { + | ^ = note: only the last element of a tuple may have a dynamically sized type error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized3.rs:45:9 | LL | fn f10(x1: Box>) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f5(&(32, *x1)); | ^^^^^^^^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `S` +note: required because it appears within the type `S` + --> $DIR/unsized3.rs:28:8 + | +LL | struct S { + | ^ = note: required because it appears within the type `({integer}, S)` = note: tuples must have a statically known size to be initialized @@ -77,11 +89,15 @@ LL | fn f5(x: &Y) {} | - required by this bound in `f5` ... LL | fn f10(x1: Box>) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f5(&(32, *x1)); | ^^^^^^^^^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `S` +note: required because it appears within the type `S` + --> $DIR/unsized3.rs:28:8 + | +LL | struct S { + | ^ = note: required because it appears within the type `({integer}, S)` help: consider relaxing the implicit `Sized` restriction | diff --git a/src/test/ui/unsized5.stderr b/src/test/ui/unsized5.stderr index a7539b0672afe..0bfd4565529aa 100644 --- a/src/test/ui/unsized5.stderr +++ b/src/test/ui/unsized5.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized5.rs:4:9 | LL | struct S1 { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f1: X, | ^ doesn't have a size known at compile-time | @@ -21,7 +21,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized5.rs:10:8 | LL | struct S2 { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | f: isize, LL | g: X, | ^ doesn't have a size known at compile-time @@ -77,7 +77,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized5.rs:25:8 | LL | enum E { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | V1(X, isize), | ^ doesn't have a size known at compile-time | @@ -96,7 +96,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized5.rs:29:12 | LL | enum F { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | V2{f1: X, f: isize}, | ^ doesn't have a size known at compile-time | diff --git a/src/test/ui/unsized6.stderr b/src/test/ui/unsized6.stderr index 71dac236fa316..f9f7877d5426a 100644 --- a/src/test/ui/unsized6.stderr +++ b/src/test/ui/unsized6.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim --> $DIR/unsized6.rs:9:9 | LL | fn f1(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let y: Y; | ^ doesn't have a size known at compile-time @@ -14,7 +14,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:7:12 | LL | fn f1(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | let _: W; // <-- this is OK, no bindings created, no initializer. LL | let _: (isize, (X, isize)); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -25,7 +25,7 @@ error[E0277]: the size for values of type `Z` cannot be known at compilation tim --> $DIR/unsized6.rs:11:12 | LL | fn f1(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let y: (isize, (Z, usize)); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -36,7 +36,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:15:9 | LL | fn f2(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | let y: X; | ^ doesn't have a size known at compile-time | @@ -47,7 +47,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim --> $DIR/unsized6.rs:17:12 | LL | fn f2(x: &X) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let y: (isize, (Y, isize)); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -58,7 +58,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:22:9 | LL | fn f3(x1: Box, x2: Box, x3: Box) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | let y: X = *x1; | ^ doesn't have a size known at compile-time | @@ -69,7 +69,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:24:9 | LL | fn f3(x1: Box, x2: Box, x3: Box) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let y = *x2; | ^ doesn't have a size known at compile-time @@ -81,7 +81,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:26:10 | LL | fn f3(x1: Box, x2: Box, x3: Box) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let (y, z) = (*x3, 4); | ^ doesn't have a size known at compile-time @@ -93,7 +93,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:30:9 | LL | fn f4(x1: Box, x2: Box, x3: Box) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` LL | let y: X = *x1; | ^ doesn't have a size known at compile-time | @@ -104,7 +104,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:32:9 | LL | fn f4(x1: Box, x2: Box, x3: Box) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let y = *x2; | ^ doesn't have a size known at compile-time @@ -116,7 +116,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized6.rs:34:10 | LL | fn f4(x1: Box, x2: Box, x3: Box) { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` ... LL | let (y, z) = (*x3, 4); | ^ doesn't have a size known at compile-time @@ -130,7 +130,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim LL | fn g1(x: X) {} | - ^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size @@ -144,7 +144,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim LL | fn g2(x: X) {} | - ^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size diff --git a/src/test/ui/unsized7.stderr b/src/test/ui/unsized7.stderr index 5f9a2604ed5b0..7dbddd4ed2443 100644 --- a/src/test/ui/unsized7.stderr +++ b/src/test/ui/unsized7.stderr @@ -7,7 +7,7 @@ LL | trait T1 { LL | impl T1 for S3 { | - ^^^^^ doesn't have a size known at compile-time | | - | this type parameter needs to be `Sized` + | this type parameter needs to be `std::marker::Sized` | help: consider relaxing the implicit `Sized` restriction | diff --git a/src/test/ui/wf/wf-enum-bound.stderr b/src/test/ui/wf/wf-enum-bound.stderr index e7bc858225139..7819110dd98b5 100644 --- a/src/test/ui/wf/wf-enum-bound.stderr +++ b/src/test/ui/wf/wf-enum-bound.stderr @@ -9,8 +9,8 @@ LL | where T: ExtraCopy | help: consider further restricting type parameter `U` | -LL | where T: ExtraCopy, U: Copy - | ^^^^^^^^^ +LL | where T: ExtraCopy, U: std::marker::Copy + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr b/src/test/ui/wf/wf-enum-fields-struct-variant.stderr index c97ce53885b72..4bfb2413fe99f 100644 --- a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr +++ b/src/test/ui/wf/wf-enum-fields-struct-variant.stderr @@ -9,8 +9,8 @@ LL | f: IsCopy | help: consider restricting type parameter `A` | -LL | enum AnotherEnum { - | ^^^^^^ +LL | enum AnotherEnum { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-enum-fields.stderr b/src/test/ui/wf/wf-enum-fields.stderr index 85da1bf5839a3..c8a75afbab7cb 100644 --- a/src/test/ui/wf/wf-enum-fields.stderr +++ b/src/test/ui/wf/wf-enum-fields.stderr @@ -9,8 +9,8 @@ LL | SomeVariant(IsCopy) | help: consider restricting type parameter `A` | -LL | enum SomeEnum { - | ^^^^^^ +LL | enum SomeEnum { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-fn-where-clause.stderr b/src/test/ui/wf/wf-fn-where-clause.stderr index 22598e58bd744..e463e3db887a5 100644 --- a/src/test/ui/wf/wf-fn-where-clause.stderr +++ b/src/test/ui/wf/wf-fn-where-clause.stderr @@ -9,8 +9,8 @@ LL | fn foo() where T: ExtraCopy | help: consider further restricting type parameter `U` | -LL | fn foo() where T: ExtraCopy, U: Copy - | ^^^^^^^^^ +LL | fn foo() where T: ExtraCopy, U: std::marker::Copy + | ^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time --> $DIR/wf-fn-where-clause.rs:12:16 diff --git a/src/test/ui/wf/wf-in-fn-arg.stderr b/src/test/ui/wf/wf-in-fn-arg.stderr index d6010d1d79e93..9687658feba43 100644 --- a/src/test/ui/wf/wf-in-fn-arg.stderr +++ b/src/test/ui/wf/wf-in-fn-arg.stderr @@ -9,8 +9,8 @@ LL | fn bar(_: &MustBeCopy) | help: consider restricting type parameter `T` | -LL | fn bar(_: &MustBeCopy) - | ^^^^^^ +LL | fn bar(_: &MustBeCopy) + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-in-fn-ret.stderr b/src/test/ui/wf/wf-in-fn-ret.stderr index c22252657f12e..f9a962578e650 100644 --- a/src/test/ui/wf/wf-in-fn-ret.stderr +++ b/src/test/ui/wf/wf-in-fn-ret.stderr @@ -9,8 +9,8 @@ LL | fn bar() -> MustBeCopy | help: consider restricting type parameter `T` | -LL | fn bar() -> MustBeCopy - | ^^^^^^ +LL | fn bar() -> MustBeCopy + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-in-fn-type-arg.stderr b/src/test/ui/wf/wf-in-fn-type-arg.stderr index 6d249f5f918d3..33300b3964258 100644 --- a/src/test/ui/wf/wf-in-fn-type-arg.stderr +++ b/src/test/ui/wf/wf-in-fn-type-arg.stderr @@ -9,8 +9,8 @@ LL | x: fn(MustBeCopy) | help: consider restricting type parameter `T` | -LL | struct Bar { - | ^^^^^^ +LL | struct Bar { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-in-fn-type-ret.stderr b/src/test/ui/wf/wf-in-fn-type-ret.stderr index 30ff365b116ec..1ffc47e6d826c 100644 --- a/src/test/ui/wf/wf-in-fn-type-ret.stderr +++ b/src/test/ui/wf/wf-in-fn-type-ret.stderr @@ -9,8 +9,8 @@ LL | x: fn() -> MustBeCopy | help: consider restricting type parameter `T` | -LL | struct Foo { - | ^^^^^^ +LL | struct Foo { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-in-fn-where-clause.stderr b/src/test/ui/wf/wf-in-fn-where-clause.stderr index 64e9694c0e16b..7cb9af11d799b 100644 --- a/src/test/ui/wf/wf-in-fn-where-clause.stderr +++ b/src/test/ui/wf/wf-in-fn-where-clause.stderr @@ -9,8 +9,8 @@ LL | where T: MustBeCopy | help: consider further restricting type parameter `U` | -LL | where T: MustBeCopy, U: Copy - | ^^^^^^^^^ +LL | where T: MustBeCopy, U: std::marker::Copy + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-in-obj-type-trait.stderr b/src/test/ui/wf/wf-in-obj-type-trait.stderr index 55ea08ccbe7ff..8606eabf59c14 100644 --- a/src/test/ui/wf/wf-in-obj-type-trait.stderr +++ b/src/test/ui/wf/wf-in-obj-type-trait.stderr @@ -9,8 +9,8 @@ LL | x: dyn Object> | help: consider restricting type parameter `T` | -LL | struct Bar { - | ^^^^^^ +LL | struct Bar { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr index 7bbdd4bcf2428..8e0ce557e6b43 100644 --- a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr +++ b/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr @@ -9,8 +9,8 @@ LL | fn foo(self) where T: ExtraCopy | help: consider restricting type parameter `U` | -LL | impl Foo { - | ^^^^^^ +LL | impl Foo { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-where-clause.stderr index 2a44e1cdc7162..bf8077ba88f6b 100644 --- a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr +++ b/src/test/ui/wf/wf-inherent-impl-where-clause.stderr @@ -9,8 +9,8 @@ LL | impl Foo where T: ExtraCopy | help: consider further restricting type parameter `U` | -LL | impl Foo where T: ExtraCopy, U: Copy - | ^^^^^^^^^ +LL | impl Foo where T: ExtraCopy, U: std::marker::Copy + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-struct-bound.stderr b/src/test/ui/wf/wf-struct-bound.stderr index 948693ac6f87d..e85f3591438a9 100644 --- a/src/test/ui/wf/wf-struct-bound.stderr +++ b/src/test/ui/wf/wf-struct-bound.stderr @@ -9,8 +9,8 @@ LL | where T: ExtraCopy | help: consider further restricting type parameter `U` | -LL | where T: ExtraCopy, U: Copy - | ^^^^^^^^^ +LL | where T: ExtraCopy, U: std::marker::Copy + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-struct-field.stderr b/src/test/ui/wf/wf-struct-field.stderr index 04e62a7fcb776..62ef6bb60c7a2 100644 --- a/src/test/ui/wf/wf-struct-field.stderr +++ b/src/test/ui/wf/wf-struct-field.stderr @@ -9,8 +9,8 @@ LL | data: IsCopy | help: consider restricting type parameter `A` | -LL | struct SomeStruct { - | ^^^^^^ +LL | struct SomeStruct { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-trait-associated-type-bound.stderr b/src/test/ui/wf/wf-trait-associated-type-bound.stderr index 166e3626f094e..51adfdb6bd2a9 100644 --- a/src/test/ui/wf/wf-trait-associated-type-bound.stderr +++ b/src/test/ui/wf/wf-trait-associated-type-bound.stderr @@ -9,8 +9,8 @@ LL | type Type1: ExtraCopy; | help: consider restricting type parameter `T` | -LL | trait SomeTrait { - | ^^^^^^ +LL | trait SomeTrait { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-trait-bound.stderr b/src/test/ui/wf/wf-trait-bound.stderr index abb97adcfd4cd..c9e818f8e7dc8 100644 --- a/src/test/ui/wf/wf-trait-bound.stderr +++ b/src/test/ui/wf/wf-trait-bound.stderr @@ -9,8 +9,8 @@ LL | where T: ExtraCopy | help: consider further restricting type parameter `U` | -LL | where T: ExtraCopy, U: Copy - | ^^^^^^^^^ +LL | where T: ExtraCopy, U: std::marker::Copy + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/wf/wf-trait-superbound.stderr b/src/test/ui/wf/wf-trait-superbound.stderr index db337a7c6d0fd..6926983527178 100644 --- a/src/test/ui/wf/wf-trait-superbound.stderr +++ b/src/test/ui/wf/wf-trait-superbound.stderr @@ -9,8 +9,8 @@ LL | trait SomeTrait: ExtraCopy { | help: consider restricting type parameter `T` | -LL | trait SomeTrait: ExtraCopy { - | ^^^^^^ +LL | trait SomeTrait: ExtraCopy { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr index 916c6dc6d53a4..356ba347cc36a 100644 --- a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr +++ b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr @@ -9,8 +9,8 @@ LL | require_copy(self.x); | help: consider restricting type parameter `T` | -LL | impl Foo { - | ^^^^^^ +LL | impl Foo { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr index 8814018964aa6..d84242cfe12b8 100644 --- a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr +++ b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr @@ -9,8 +9,8 @@ LL | require_copy(self.x); | help: consider restricting type parameter `T` | -LL | impl Foo for Bar { - | ^^^^^^ +LL | impl Foo for Bar { + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs index 1391f7505e27c..dac4d93499dc2 100644 --- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs +++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs @@ -212,7 +212,7 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen check_rvalue(tcx, body, def_id, rval, span) } - StatementKind::FakeRead(_, place) | + StatementKind::FakeRead(box (_, place)) => check_place(tcx, *place, span, body), // just an assignment StatementKind::SetDiscriminant { place, .. } => check_place(tcx, **place, span, body),