Skip to content

Commit

Permalink
Don't use compat versions of implied bounds in ImpliedOutlivesBounds …
Browse files Browse the repository at this point in the history
…query
  • Loading branch information
jackh726 committed Jan 18, 2024
1 parent acab765 commit a9e30e6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ImpliedOutlivesBounds<'tcx> {
param_env.and(ty)
});

tcx.implied_outlives_bounds_compat(canonicalized)
tcx.implied_outlives_bounds(canonicalized)
}

fn perform_locally_with_next_solver(
ocx: &ObligationCtxt<'_, 'tcx>,
key: ParamEnvAnd<'tcx, Self>,
) -> Result<Self::QueryResponse, NoSolution> {
compute_implied_outlives_bounds_compat_inner(ocx, key.param_env, key.value.ty)
compute_implied_outlives_bounds_inner(ocx, key.param_env, key.value.ty)
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/ui/associated-inherent-types/issue-111404-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ impl<'a> Foo<fn(&'a ())> {
fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
//~^ ERROR higher-ranked subtype error
//~| ERROR higher-ranked subtype error
//~| ERROR higher-ranked subtype error

fn main() {}
10 changes: 9 additions & 1 deletion tests/ui/associated-inherent-types/issue-111404-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@ LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 2 previous errors
error: higher-ranked subtype error
--> $DIR/issue-111404-1.rs:10:1
|
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 3 previous errors

10 changes: 0 additions & 10 deletions tests/ui/implied-bounds/normalization-nested.lifetime.stderr

This file was deleted.

5 changes: 1 addition & 4 deletions tests/ui/implied-bounds/normalization-nested.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Test for normalization of projections that appear in the item bounds
// (versus those that appear directly in the input types).
// Both revisions should pass. `lifetime` revision is a bug.
//
// revisions: param_ty lifetime
// [param_ty] check-pass
// [lifetime] check-fail
// [lifetime] known-bug: #109799
// check-pass

pub trait Iter {
type Item;
Expand Down
10 changes: 9 additions & 1 deletion tests/ui/inference/issue-80409.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// check-pass
// This should not pass, because `usize: Fsm` does not hold. However, it currently ICEs.

// check-fail
// known-bug: #80409
// failure-status: 101
// normalize-stderr-test "note: .*\n\n" -> ""
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
// normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
// rustc-env:RUST_BACKTRACE=0

#![allow(unreachable_code, unused)]

Expand Down
6 changes: 6 additions & 0 deletions tests/ui/inference/issue-80409.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ImpliedOutlivesBounds { ty: &'?2 mut StateContext<'?3, usize> } }
|
= query stack during panic:
end of query stack
error: aborting due to 1 previous error

0 comments on commit a9e30e6

Please sign in to comment.