Skip to content

Commit 4a02504

Browse files
committed
Cleanup
1 parent d05b341 commit 4a02504

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
679679
// ```
680680
let mut predicates: Vec<Span> = traits::elaborate(
681681
tcx,
682-
tcx.predicates_of(def_id).predicates.iter().map(|(p, sp)| (p.as_predicate(), *sp)),
682+
tcx.predicates_of(def_id)
683+
.predicates
684+
.iter()
685+
.map(|(p, sp)| (p.as_predicate(), *sp))
686+
.chain(
687+
tcx.predicates_of(parent)
688+
.predicates
689+
.iter()
690+
.map(|(p, sp)| (p.as_predicate(), *sp)),
691+
),
683692
)
684-
.chain(traits::elaborate(
685-
tcx,
686-
tcx.predicates_of(parent).predicates.iter().map(|(p, sp)| (p.as_predicate(), *sp)),
687-
))
688693
.filter_map(|(pred, pred_span)| {
689694
if let ty::PredicateKind::Clause(clause) = pred.kind().skip_binder()
690695
&& let ty::ClauseKind::TypeOutlives(ty::OutlivesPredicate(pred_ty, r)) = clause
@@ -694,7 +699,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
694699
&& (self.infcx.can_eq(self.param_env, ty, pred_ty)
695700
|| matches!(
696701
pred_ty.kind(),
697-
ty::Param(name) if name.name.as_str() == "Self"))
702+
ty::Param(name) if name.name == kw::SelfUpper))
698703
{
699704
Some(pred_span)
700705
} else {

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
485485
)) = pred.kind().no_bound_vars()
486486
&& r == sub
487487
&& let ty::Param(param) = pred_ty.kind()
488-
&& param.name.as_str() == "Self"
488+
&& param.name == kw::SelfUpper
489489
{
490490
Some(*span)
491491
} else {

0 commit comments

Comments
 (0)