about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2024-01-17 01:10:19 -0500
committerJack Huey <31162821+jackh726@users.noreply.github.com>2024-01-17 22:03:06 -0500
commita9e30e6cdf721df1d8085dcc3396cf14651ca69f (patch)
tree034f460ad9ecc491fca60c9c8ccf174804f07e01
parentacab76573fffe8a3c2578506f277a89ef772a05d (diff)
downloadrust-a9e30e6cdf721df1d8085dcc3396cf14651ca69f.tar.gz
rust-a9e30e6cdf721df1d8085dcc3396cf14651ca69f.zip
Don't use compat versions of implied bounds in ImpliedOutlivesBounds query
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs4
-rw-r--r--tests/ui/associated-inherent-types/issue-111404-1.rs1
-rw-r--r--tests/ui/associated-inherent-types/issue-111404-1.stderr10
-rw-r--r--tests/ui/implied-bounds/normalization-nested.lifetime.stderr10
-rw-r--r--tests/ui/implied-bounds/normalization-nested.rs5
-rw-r--r--tests/ui/inference/issue-80409.rs10
-rw-r--r--tests/ui/inference/issue-80409.stderr6
7 files changed, 28 insertions, 18 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs
index bdc53f895fe..2fdb63d7dee 100644
--- a/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs
@@ -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)
     }
 }
 
diff --git a/tests/ui/associated-inherent-types/issue-111404-1.rs b/tests/ui/associated-inherent-types/issue-111404-1.rs
index dd62e59f07d..74f9434b881 100644
--- a/tests/ui/associated-inherent-types/issue-111404-1.rs
+++ b/tests/ui/associated-inherent-types/issue-111404-1.rs
@@ -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() {}
diff --git a/tests/ui/associated-inherent-types/issue-111404-1.stderr b/tests/ui/associated-inherent-types/issue-111404-1.stderr
index cf4d4a5f19b..1613161a873 100644
--- a/tests/ui/associated-inherent-types/issue-111404-1.stderr
+++ b/tests/ui/associated-inherent-types/issue-111404-1.stderr
@@ -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
 
diff --git a/tests/ui/implied-bounds/normalization-nested.lifetime.stderr b/tests/ui/implied-bounds/normalization-nested.lifetime.stderr
deleted file mode 100644
index 041892c7542..00000000000
--- a/tests/ui/implied-bounds/normalization-nested.lifetime.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: lifetime may not live long enough
-  --> $DIR/normalization-nested.rs:38:5
-   |
-LL | pub fn test_borrowck<'x>(_: Map<Vec<&'x ()>>, s: &'x str) -> &'static str {
-   |                      -- lifetime `'x` defined here
-LL |     s
-   |     ^ returning this value requires that `'x` must outlive `'static`
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/implied-bounds/normalization-nested.rs b/tests/ui/implied-bounds/normalization-nested.rs
index 87903783a67..3f569aa1ace 100644
--- a/tests/ui/implied-bounds/normalization-nested.rs
+++ b/tests/ui/implied-bounds/normalization-nested.rs
@@ -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;
diff --git a/tests/ui/inference/issue-80409.rs b/tests/ui/inference/issue-80409.rs
index 80cad6dfc46..d36688978e9 100644
--- a/tests/ui/inference/issue-80409.rs
+++ b/tests/ui/inference/issue-80409.rs
@@ -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)]
 
diff --git a/tests/ui/inference/issue-80409.stderr b/tests/ui/inference/issue-80409.stderr
new file mode 100644
index 00000000000..7bb4786db3a
--- /dev/null
+++ b/tests/ui/inference/issue-80409.stderr
@@ -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
+