Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
span_bug!(span, "coerce requirement gave wrong error: `{:?}`", predicate)
}

ty::PredicateKind::Clause(ty::ClauseKind::TypeOutlives(..))
if self.next_trait_solver() =>
{
// We normalize `TypeOutlives` in the next solver, which is fallible
return self.dcx().span_delayed_bug(
span,
"type outlives claues errored outside borrowck without any other error",
);
}
ty::PredicateKind::Clause(ty::ClauseKind::RegionOutlives(..))
| ty::PredicateKind::Clause(ty::ClauseKind::TypeOutlives(..)) => {
span_bug!(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ compile-flags: -Znext-solver

// Regression test for <https://github.com/rust-lang/rust/issues/161527>

trait Z<'a, T: ?Sized>
where
T: Z<'a, ()>, //~ ERROR: the trait bound `(): Z<'a, ()>` is not satisfied
for<'b> <T as Z<'b, ()>>::W: 'a,
{
type W;
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
error[E0277]: the trait bound `(): Z<'a, ()>` is not satisfied
--> $DIR/outlives-goal-error-due-to-normalization-failure-no-ice.rs:7:8
|
LL | T: Z<'a, ()>,
| ^^^^^^^^^ the trait `Z<'a, ()>` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/outlives-goal-error-due-to-normalization-failure-no-ice.rs:5:1
|
LL | trait Z<'a, T: ?Sized>
| ^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `Z`
--> $DIR/outlives-goal-error-due-to-normalization-failure-no-ice.rs:7:8
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this trait
LL | where
LL | T: Z<'a, ()>,
| ^^^^^^^^^ required by this bound in `Z`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
Loading