about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBoxy <supbscripter@gmail.com>2024-04-03 22:48:48 +0100
committerBoxy <supbscripter@gmail.com>2024-04-03 22:48:55 +0100
commitf090de88759ed9abc65074ff9926e03a3d550d77 (patch)
treeef08b8a92bf547ce7ecf088f0d0573590fcbe35f
parent4fa5fb684e891978303db0b8f100fab1e19eb06d (diff)
downloadrust-f090de88759ed9abc65074ff9926e03a3d550d77.tar.gz
rust-f090de88759ed9abc65074ff9926e03a3d550d77.zip
rebase oddity
-rw-r--r--src/tools/tidy/src/issues.txt1
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr12
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr18
-rw-r--r--tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs21
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.rs (renamed from tests/ui/higher-ranked/trait-bounds/issue-30786-1.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr (renamed from tests/ui/higher-ranked/trait-bounds/issue-30786-1.stderr)16
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.rs (renamed from tests/ui/higher-ranked/trait-bounds/issue-30786-2.rs)0
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr (renamed from tests/ui/higher-ranked/trait-bounds/issue-30786-2.stderr)14
8 files changed, 41 insertions, 41 deletions
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
index f6b1d45ee94..6b0573f5a3f 100644
--- a/src/tools/tidy/src/issues.txt
+++ b/src/tools/tidy/src/issues.txt
@@ -1129,7 +1129,6 @@
 "ui/generics/issue-98432.rs",
 "ui/higher-ranked/trait-bounds/issue-100689.rs",
 "ui/higher-ranked/trait-bounds/issue-102899.rs",
-"ui/higher-ranked/trait-bounds/issue-30786.rs",
 "ui/higher-ranked/trait-bounds/issue-36139-normalize-closure-sig.rs",
 "ui/higher-ranked/trait-bounds/issue-39292.rs",
 "ui/higher-ranked/trait-bounds/issue-42114.rs",
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr
index 16a6f549882..bb0b2de788e 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr
@@ -1,5 +1,5 @@
 error: implementation of `Trait` is not general enough
-  --> $DIR/candidate-from-env-universe-err-project.rs:31:5
+  --> $DIR/candidate-from-env-universe-err-project.rs:28:5
    |
 LL |     trait_bound::<T>();
    |     ^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
@@ -8,7 +8,7 @@ LL |     trait_bound::<T>();
    = note: ...but it actually implements `Trait<'static>`
 
 error: implementation of `Trait` is not general enough
-  --> $DIR/candidate-from-env-universe-err-project.rs:41:5
+  --> $DIR/candidate-from-env-universe-err-project.rs:39:5
    |
 LL |     projection_bound::<T>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
@@ -17,7 +17,7 @@ LL |     projection_bound::<T>();
    = note: ...but it actually implements `Trait<'static>`
 
 error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-project.rs:41:5
+  --> $DIR/candidate-from-env-universe-err-project.rs:39:5
    |
 LL |     projection_bound::<T>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -25,13 +25,13 @@ LL |     projection_bound::<T>();
    = note: expected associated type `<T as Trait<'static>>::Assoc`
               found associated type `<T as Trait<'a>>::Assoc`
 note: the lifetime requirement is introduced here
-  --> $DIR/candidate-from-env-universe-err-project.rs:21:42
+  --> $DIR/candidate-from-env-universe-err-project.rs:18:42
    |
 LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
    |                                          ^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-project.rs:56:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -40,7 +40,7 @@ LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
               found associated type `<T as Trait<'a>>::Assoc`
 
 error[E0308]: mismatched types
-  --> $DIR/candidate-from-env-universe-err-project.rs:56:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr
index 57f2184b611..2804d5bbe94 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `for<'a> T: Trait<'a>` is not satisfied
-  --> $DIR/candidate-from-env-universe-err-project.rs:31:19
+  --> $DIR/candidate-from-env-universe-err-project.rs:28:19
    |
 LL |     trait_bound::<T>();
    |                   ^ the trait `for<'a> Trait<'a>` is not implemented for `T`
    |
 note: required by a bound in `trait_bound`
-  --> $DIR/candidate-from-env-universe-err-project.rs:20:19
+  --> $DIR/candidate-from-env-universe-err-project.rs:17:19
    |
 LL | fn trait_bound<T: for<'a> Trait<'a>>() {}
    |                   ^^^^^^^^^^^^^^^^^ required by this bound in `trait_bound`
@@ -15,13 +15,13 @@ LL | fn function1<T: Trait<'static> + for<'a> Trait<'a>>() {
    |                                +++++++++++++++++++
 
 error[E0277]: the trait bound `for<'a> T: Trait<'a>` is not satisfied
-  --> $DIR/candidate-from-env-universe-err-project.rs:41:24
+  --> $DIR/candidate-from-env-universe-err-project.rs:39:24
    |
 LL |     projection_bound::<T>();
    |                        ^ the trait `for<'a> Trait<'a>` is not implemented for `T`
    |
 note: required by a bound in `projection_bound`
-  --> $DIR/candidate-from-env-universe-err-project.rs:21:24
+  --> $DIR/candidate-from-env-universe-err-project.rs:18:24
    |
 LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `projection_bound`
@@ -31,30 +31,30 @@ LL | fn function2<T: Trait<'static, Assoc = usize> + for<'a> Trait<'a>>() {
    |                                               +++++++++++++++++++
 
 error[E0271]: type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
-  --> $DIR/candidate-from-env-universe-err-project.rs:41:24
+  --> $DIR/candidate-from-env-universe-err-project.rs:39:24
    |
 LL |     projection_bound::<T>();
    |                        ^ type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
    |
 note: types differ
-  --> $DIR/candidate-from-env-universe-err-project.rs:17:18
+  --> $DIR/candidate-from-env-universe-err-project.rs:14:18
    |
 LL |     type Assoc = usize;
    |                  ^^^^^
 note: required by a bound in `projection_bound`
-  --> $DIR/candidate-from-env-universe-err-project.rs:21:42
+  --> $DIR/candidate-from-env-universe-err-project.rs:18:42
    |
 LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
    |                                          ^^^^^^^^^^^^^ required by this bound in `projection_bound`
 
 error: higher-ranked subtype error
-  --> $DIR/candidate-from-env-universe-err-project.rs:56:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: higher-ranked subtype error
-  --> $DIR/candidate-from-env-universe-err-project.rs:56:30
+  --> $DIR/candidate-from-env-universe-err-project.rs:55:30
    |
 LL |     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs
index 7e5e5f3a847..2f53bd019b7 100644
--- a/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs
+++ b/tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs
@@ -5,9 +5,6 @@
 // the where-bound candidate for trait goals due to the leak check, but did
 // not do so for projection candidates and during normalization.
 //
-// FIXME(-Znext-solver): We currently prefer the impl over the where-bound
-// for trait goals because the impl does not result in any constraints.
-//
 // This results in an inconsistency between `Trait` and `Projection` goals as
 // normalizing always constraints the normalized-to term.
 trait Trait<'a> {
@@ -23,13 +20,14 @@ fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
 // We use a function with a trivial where-bound which is more
 // restrictive than the impl.
 fn function1<T: Trait<'static>>() {
-    // ok
+    // err
     //
-    // Proving `for<'a> T: Trait<'a>` using the where-bound results
-    // in a leak check failure, so we use the more general impl,
-    // causing this to succeed.
+    // Proving `for<'a> T: Trait<'a>` using the where-bound does not
+    // result in a leak check failure even though it does not apply.
+    // We prefer env candidates over impl candidatescausing this to succeed.
     trait_bound::<T>();
-    //[current]~^ ERROR mismatched types
+    //[next]~^ ERROR the trait bound `for<'a> T: Trait<'a>` is not satisfied
+    //[current]~^^ ERROR implementation of `Trait` is not general enough
 }
 
 fn function2<T: Trait<'static, Assoc = usize>>() {
@@ -40,7 +38,8 @@ fn function2<T: Trait<'static, Assoc = usize>>() {
     // to prefer it over the impl, resulting in a placeholder error.
     projection_bound::<T>();
     //[next]~^ ERROR type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
-    //[current]~^^ ERROR mismatched types
+    //[next]~| ERROR the trait bound `for<'a> T: Trait<'a>` is not satisfied
+    //[current]~^^^ ERROR implementation of `Trait` is not general enough
     //[current]~| ERROR mismatched types
 }
 
@@ -54,7 +53,9 @@ fn function3<T: Trait<'static, Assoc = usize>>() {
     // leak check during candidate selection for normalization, this
     // case would still not compile.
     let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
-    //[current]~^ ERROR mismatched types
+    //[next]~^ ERROR higher-ranked subtype error
+    //[next]~| ERROR higher-ranked subtype error
+    //[current]~^^^ ERROR mismatched types
     //[current]~| ERROR mismatched types
 }
 
diff --git a/tests/ui/higher-ranked/trait-bounds/issue-30786-1.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.rs
index 799df8cae9f..799df8cae9f 100644
--- a/tests/ui/higher-ranked/trait-bounds/issue-30786-1.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.rs
diff --git a/tests/ui/higher-ranked/trait-bounds/issue-30786-1.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr
index 56dfd124c5c..ae364de8cc0 100644
--- a/tests/ui/higher-ranked/trait-bounds/issue-30786-1.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr
@@ -1,23 +1,23 @@
-error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@issue-30786-1.rs:115:27}>`, but its trait bounds were not satisfied
-  --> $DIR/issue-30786-1.rs:116:22
+error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@hrtb-doesnt-borrow-self-1.rs:115:27}>`, but its trait bounds were not satisfied
+  --> $DIR/hrtb-doesnt-borrow-self-1.rs:116:22
    |
 LL | pub struct Map<S, F> {
    | -------------------- method `filterx` not found for this struct because it doesn't satisfy `_: StreamExt`
 ...
 LL |     let filter = map.filterx(|x: &_| true);
-   |                      ^^^^^^^ method cannot be called on `Map<Repeat, {closure@issue-30786-1.rs:115:27}>` due to unsatisfied trait bounds
+   |                      ^^^^^^^ method cannot be called due to unsatisfied trait bounds
    |
 note: the following trait bounds were not satisfied:
-      `&'a mut &Map<Repeat, {closure@$DIR/issue-30786-1.rs:115:27: 115:34}>: Stream`
-      `&'a mut &mut Map<Repeat, {closure@$DIR/issue-30786-1.rs:115:27: 115:34}>: Stream`
-      `&'a mut Map<Repeat, {closure@$DIR/issue-30786-1.rs:115:27: 115:34}>: Stream`
-  --> $DIR/issue-30786-1.rs:98:50
+      `&'a mut &Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
+      `&'a mut &mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
+      `&'a mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
+  --> $DIR/hrtb-doesnt-borrow-self-1.rs:98:50
    |
 LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
    |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `StreamExt` defines an item `filterx`, perhaps you need to implement it
-  --> $DIR/issue-30786-1.rs:66:1
+  --> $DIR/hrtb-doesnt-borrow-self-1.rs:66:1
    |
 LL | pub trait StreamExt
    | ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/higher-ranked/trait-bounds/issue-30786-2.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.rs
index 92e2e7f796e..92e2e7f796e 100644
--- a/tests/ui/higher-ranked/trait-bounds/issue-30786-2.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.rs
diff --git a/tests/ui/higher-ranked/trait-bounds/issue-30786-2.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr
index 36e420ce0a3..eeb4e12fa8b 100644
--- a/tests/ui/higher-ranked/trait-bounds/issue-30786-2.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr
@@ -1,5 +1,5 @@
-error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, {closure@issue-30786-2.rs:111:30}>`, but its trait bounds were not satisfied
-  --> $DIR/issue-30786-2.rs:112:24
+error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, {closure@hrtb-doesnt-borrow-self-2.rs:111:30}>`, but its trait bounds were not satisfied
+  --> $DIR/hrtb-doesnt-borrow-self-2.rs:112:24
    |
 LL | pub struct Filter<S, F> {
    | ----------------------- method `countx` not found for this struct because it doesn't satisfy `_: StreamExt`
@@ -8,16 +8,16 @@ LL |     let count = filter.countx();
    |                        ^^^^^^ method cannot be called due to unsatisfied trait bounds
    |
 note: the following trait bounds were not satisfied:
-      `&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/issue-30786-2.rs:111:30: 111:37}>: Stream`
-      `&'a mut &mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/issue-30786-2.rs:111:30: 111:37}>: Stream`
-      `&'a mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/issue-30786-2.rs:111:30: 111:37}>: Stream`
-  --> $DIR/issue-30786-2.rs:98:50
+      `&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:111:30: 111:37}>: Stream`
+      `&'a mut &mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:111:30: 111:37}>: Stream`
+      `&'a mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:111:30: 111:37}>: Stream`
+  --> $DIR/hrtb-doesnt-borrow-self-2.rs:98:50
    |
 LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
    |         ---------     -                          ^^^^^^ unsatisfied trait bound introduced here
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `StreamExt` defines an item `countx`, perhaps you need to implement it
-  --> $DIR/issue-30786-2.rs:66:1
+  --> $DIR/hrtb-doesnt-borrow-self-2.rs:66:1
    |
 LL | pub trait StreamExt
    | ^^^^^^^^^^^^^^^^^^^