rebase oddity

This commit is contained in:
Boxy 2024-04-03 22:48:48 +01:00
parent 4fa5fb684e
commit f090de8875
8 changed files with 41 additions and 41 deletions

View File

@ -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",

View File

@ -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

View File

@ -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) = |_| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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
}

View File

@ -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
| ^^^^^^^^^^^^^^^^^^^

View File

@ -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
| ^^^^^^^^^^^^^^^^^^^