diff --git a/src/librustc_trait_selection/traits/object_safety.rs b/src/librustc_trait_selection/traits/object_safety.rs index ebeb0e968b0a..7d4ad61902a9 100644 --- a/src/librustc_trait_selection/traits/object_safety.rs +++ b/src/librustc_trait_selection/traits/object_safety.rs @@ -170,7 +170,7 @@ fn object_safety_violations_for_trait( violations } -fn trait_bound_spans<'tcx>( +fn sized_trait_bound_spans<'tcx>( tcx: TyCtxt<'tcx>, bounds: hir::GenericBounds<'tcx>, ) -> impl 'tcx + Iterator { @@ -207,14 +207,14 @@ fn get_sized_bounds(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SmallVec<[Span; 1]> { // Fetch spans for trait bounds that are Sized: // `trait T where Self: Pred` - Some(trait_bound_spans(tcx, pred.bounds)) + Some(sized_trait_bound_spans(tcx, pred.bounds)) } _ => None, } }) .flatten() // Fetch spans for supertraits that are `Sized`: `trait T: Super`. - .chain(trait_bound_spans(tcx, bounds)) + .chain(sized_trait_bound_spans(tcx, bounds)) .collect::>(), ), _ => None,