Skip to content

Commit d1ac43a

Browse files
committedFeb 10, 2023
Auto merge of rust-lang#107652 - estebank:re_error, r=oli-obk
Introduce `ReError` CC rust-lang#69314 r? `@nagisa`
2 parents 9b8dbd5 + 3689295 commit d1ac43a

File tree

50 files changed

+248
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+248
-227
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
343343
let note = match closure_kind_ty.to_opt_closure_kind() {
344344
Some(ty::ClosureKind::Fn) => {
345345
"closure implements `Fn`, so references to captured variables \
346-
can't escape the closure"
346+
can't escape the closure"
347347
}
348348
Some(ty::ClosureKind::FnMut) => {
349349
"closure implements `FnMut`, so references to captured variables \
350-
can't escape the closure"
350+
can't escape the closure"
351351
}
352352
Some(ty::ClosureKind::FnOnce) => {
353353
bug!("BrEnv in a `FnOnce` closure");
@@ -364,7 +364,11 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
364364
ty::BoundRegionKind::BrAnon(..) => None,
365365
},
366366

367-
ty::ReLateBound(..) | ty::ReVar(..) | ty::RePlaceholder(..) | ty::ReErased => None,
367+
ty::ReLateBound(..)
368+
| ty::ReVar(..)
369+
| ty::RePlaceholder(..)
370+
| ty::ReErased
371+
| ty::ReError(_) => None,
368372
}
369373
}
370374

‎compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
9191
}
9292
None => {
9393
subst_regions.push(vid);
94-
infcx.tcx.sess.delay_span_bug(
94+
infcx.tcx.re_error_with_message(
9595
concrete_type.span,
9696
"opaque type with non-universal region substs",
97-
);
98-
infcx.tcx.lifetimes.re_static
97+
)
9998
}
10099
}
101100
};

0 commit comments

Comments
 (0)
Please sign in to comment.