diff options
| author | Michael Goulet <michael@errs.io> | 2024-11-23 17:36:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-11-25 17:38:40 +0000 |
| commit | 4a896e7e3ebb895bc2b4805225af4062939586e2 (patch) | |
| tree | a7f8a8a6f1b3aced09a0bfa6db5581d123733c0f | |
| parent | d3867174c0cb26cb9ee2401464aa4f871a8940b1 (diff) | |
| download | rust-4a896e7e3ebb895bc2b4805225af4062939586e2.tar.gz rust-4a896e7e3ebb895bc2b4805225af4062939586e2.zip | |
No need to store original_span in ClauseWithSupertraitSpan
| -rw-r--r-- | compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/elaborate.rs | 11 |
2 files changed, 3 insertions, 10 deletions
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs index 3841bc2bb8a..1259c5c0994 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs @@ -126,7 +126,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { for (base_trait_ref, original_span) in regular_traits_refs_spans { let base_pred: ty::Predicate<'tcx> = base_trait_ref.upcast(tcx); - for ClauseWithSupertraitSpan { pred, original_span, supertrait_span } in + for ClauseWithSupertraitSpan { pred, supertrait_span } in traits::elaborate(tcx, [ClauseWithSupertraitSpan::new(base_pred, original_span)]) .filter_only_self() { diff --git a/compiler/rustc_type_ir/src/elaborate.rs b/compiler/rustc_type_ir/src/elaborate.rs index 2c1ad9de9aa..0d574445df8 100644 --- a/compiler/rustc_type_ir/src/elaborate.rs +++ b/compiler/rustc_type_ir/src/elaborate.rs @@ -45,14 +45,12 @@ pub trait Elaboratable<I: Interner> { pub struct ClauseWithSupertraitSpan<I: Interner> { pub pred: I::Predicate, - // Span of the original elaborated predicate. - pub original_span: I::Span, // Span of the supertrait predicatae that lead to this clause. pub supertrait_span: I::Span, } impl<I: Interner> ClauseWithSupertraitSpan<I> { pub fn new(pred: I::Predicate, span: I::Span) -> Self { - ClauseWithSupertraitSpan { pred, original_span: span, supertrait_span: span } + ClauseWithSupertraitSpan { pred, supertrait_span: span } } } impl<I: Interner> Elaboratable<I> for ClauseWithSupertraitSpan<I> { @@ -63,7 +61,6 @@ impl<I: Interner> Elaboratable<I> for ClauseWithSupertraitSpan<I> { fn child(&self, clause: <I as Interner>::Clause) -> Self { ClauseWithSupertraitSpan { pred: clause.as_predicate(), - original_span: self.original_span, supertrait_span: self.supertrait_span, } } @@ -75,11 +72,7 @@ impl<I: Interner> Elaboratable<I> for ClauseWithSupertraitSpan<I> { _parent_trait_pred: crate::Binder<I, crate::TraitPredicate<I>>, _index: usize, ) -> Self { - ClauseWithSupertraitSpan { - pred: clause.as_predicate(), - original_span: self.original_span, - supertrait_span: supertrait_span, - } + ClauseWithSupertraitSpan { pred: clause.as_predicate(), supertrait_span: supertrait_span } } } |
