Rollup merge of #106521 - oskgo:remove-E0280, r=jackh726
remove E0280
After looking at #61137 I tried my hand at E0280. I'm unable to find a reasonable example that emits the error. There are a couple of old examples that compile with the current compiler ([#26217](https://github.com/rust-lang/rust/issues/26217), [#42114](https://github.com/rust-lang/rust/issues/42114), [#27113](https://github.com/rust-lang/rust/issues/27113)) and there is a [bug with chalk](b7cdb635c4/src/test/ui/chalkify/bugs/async.rs
) that makes it emit the error, with a couple more chalk bugs on zulip.
It seems like the error is supposed to be emitted from unfulfilled where bounds, of which two are related to borrow checking (error in where T: 'a or where 'a: 'b) and thus tend to emit errors like "lifetime may not live long enough" from borrow checking instead. The final case is with type equality constraints (where <T as Iterator>::Item == u32), which is unimplemented ([#20041](https://github.com/rust-lang/rust/issues/20041)). That such different problems are supposed to have the same error code also seems strange to me.
Since the error seems to only be emitted when using chalk I propose to remove it and replace it with an ICE instead. A crater run might be warranted.
Pinging `@jackh726` due to removal of chalk test that now ICEs.
This commit is contained in:
commit
12b124283c
4 changed files with 52 additions and 49 deletions
|
@ -1102,15 +1102,19 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
}
|
||||
|
||||
ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
|
||||
| ty::PredicateKind::Clause(ty::Clause::Projection(..))
|
||||
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..)) => {
|
||||
let predicate = self.resolve_vars_if_possible(obligation.predicate);
|
||||
struct_span_err!(
|
||||
self.tcx.sess,
|
||||
span_bug!(
|
||||
span,
|
||||
E0280,
|
||||
"the requirement `{}` is not satisfied",
|
||||
predicate
|
||||
"outlives clauses should not error outside borrowck. obligation: `{:?}`",
|
||||
obligation
|
||||
)
|
||||
}
|
||||
|
||||
ty::PredicateKind::Clause(ty::Clause::Projection(..)) => {
|
||||
span_bug!(
|
||||
span,
|
||||
"projection clauses should be implied from elsewhere. obligation: `{:?}`",
|
||||
obligation
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue