Skip to content

Commit f090de8

Browse files
committed
rebase oddity
1 parent 4fa5fb6 commit f090de8

8 files changed

+41
-41
lines changed

src/tools/tidy/src/issues.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,6 @@
11291129
"ui/generics/issue-98432.rs",
11301130
"ui/higher-ranked/trait-bounds/issue-100689.rs",
11311131
"ui/higher-ranked/trait-bounds/issue-102899.rs",
1132-
"ui/higher-ranked/trait-bounds/issue-30786.rs",
11331132
"ui/higher-ranked/trait-bounds/issue-36139-normalize-closure-sig.rs",
11341133
"ui/higher-ranked/trait-bounds/issue-39292.rs",
11351134
"ui/higher-ranked/trait-bounds/issue-42114.rs",

tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.current.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Trait` is not general enough
2-
--> $DIR/candidate-from-env-universe-err-project.rs:31:5
2+
--> $DIR/candidate-from-env-universe-err-project.rs:28:5
33
|
44
LL | trait_bound::<T>();
55
| ^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
@@ -8,7 +8,7 @@ LL | trait_bound::<T>();
88
= note: ...but it actually implements `Trait<'static>`
99

1010
error: implementation of `Trait` is not general enough
11-
--> $DIR/candidate-from-env-universe-err-project.rs:41:5
11+
--> $DIR/candidate-from-env-universe-err-project.rs:39:5
1212
|
1313
LL | projection_bound::<T>();
1414
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
@@ -17,21 +17,21 @@ LL | projection_bound::<T>();
1717
= note: ...but it actually implements `Trait<'static>`
1818

1919
error[E0308]: mismatched types
20-
--> $DIR/candidate-from-env-universe-err-project.rs:41:5
20+
--> $DIR/candidate-from-env-universe-err-project.rs:39:5
2121
|
2222
LL | projection_bound::<T>();
2323
| ^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
2424
|
2525
= note: expected associated type `<T as Trait<'static>>::Assoc`
2626
found associated type `<T as Trait<'a>>::Assoc`
2727
note: the lifetime requirement is introduced here
28-
--> $DIR/candidate-from-env-universe-err-project.rs:21:42
28+
--> $DIR/candidate-from-env-universe-err-project.rs:18:42
2929
|
3030
LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
3131
| ^^^^^^^^^^^^^
3232

3333
error[E0308]: mismatched types
34-
--> $DIR/candidate-from-env-universe-err-project.rs:56:30
34+
--> $DIR/candidate-from-env-universe-err-project.rs:55:30
3535
|
3636
LL | let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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) = |_| ();
4040
found associated type `<T as Trait<'a>>::Assoc`
4141

4242
error[E0308]: mismatched types
43-
--> $DIR/candidate-from-env-universe-err-project.rs:56:30
43+
--> $DIR/candidate-from-env-universe-err-project.rs:55:30
4444
|
4545
LL | let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
4646
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other

tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.next.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `for<'a> T: Trait<'a>` is not satisfied
2-
--> $DIR/candidate-from-env-universe-err-project.rs:31:19
2+
--> $DIR/candidate-from-env-universe-err-project.rs:28:19
33
|
44
LL | trait_bound::<T>();
55
| ^ the trait `for<'a> Trait<'a>` is not implemented for `T`
66
|
77
note: required by a bound in `trait_bound`
8-
--> $DIR/candidate-from-env-universe-err-project.rs:20:19
8+
--> $DIR/candidate-from-env-universe-err-project.rs:17:19
99
|
1010
LL | fn trait_bound<T: for<'a> Trait<'a>>() {}
1111
| ^^^^^^^^^^^^^^^^^ required by this bound in `trait_bound`
@@ -15,13 +15,13 @@ LL | fn function1<T: Trait<'static> + for<'a> Trait<'a>>() {
1515
| +++++++++++++++++++
1616

1717
error[E0277]: the trait bound `for<'a> T: Trait<'a>` is not satisfied
18-
--> $DIR/candidate-from-env-universe-err-project.rs:41:24
18+
--> $DIR/candidate-from-env-universe-err-project.rs:39:24
1919
|
2020
LL | projection_bound::<T>();
2121
| ^ the trait `for<'a> Trait<'a>` is not implemented for `T`
2222
|
2323
note: required by a bound in `projection_bound`
24-
--> $DIR/candidate-from-env-universe-err-project.rs:21:24
24+
--> $DIR/candidate-from-env-universe-err-project.rs:18:24
2525
|
2626
LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `projection_bound`
@@ -31,30 +31,30 @@ LL | fn function2<T: Trait<'static, Assoc = usize> + for<'a> Trait<'a>>() {
3131
| +++++++++++++++++++
3232

3333
error[E0271]: type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
34-
--> $DIR/candidate-from-env-universe-err-project.rs:41:24
34+
--> $DIR/candidate-from-env-universe-err-project.rs:39:24
3535
|
3636
LL | projection_bound::<T>();
3737
| ^ type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
3838
|
3939
note: types differ
40-
--> $DIR/candidate-from-env-universe-err-project.rs:17:18
40+
--> $DIR/candidate-from-env-universe-err-project.rs:14:18
4141
|
4242
LL | type Assoc = usize;
4343
| ^^^^^
4444
note: required by a bound in `projection_bound`
45-
--> $DIR/candidate-from-env-universe-err-project.rs:21:42
45+
--> $DIR/candidate-from-env-universe-err-project.rs:18:42
4646
|
4747
LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
4848
| ^^^^^^^^^^^^^ required by this bound in `projection_bound`
4949

5050
error: higher-ranked subtype error
51-
--> $DIR/candidate-from-env-universe-err-project.rs:56:30
51+
--> $DIR/candidate-from-env-universe-err-project.rs:55:30
5252
|
5353
LL | let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
5454
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5555

5656
error: higher-ranked subtype error
57-
--> $DIR/candidate-from-env-universe-err-project.rs:56:30
57+
--> $DIR/candidate-from-env-universe-err-project.rs:55:30
5858
|
5959
LL | let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/higher-ranked/leak-check/candidate-from-env-universe-err-project.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// the where-bound candidate for trait goals due to the leak check, but did
66
// not do so for projection candidates and during normalization.
77
//
8-
// FIXME(-Znext-solver): We currently prefer the impl over the where-bound
9-
// for trait goals because the impl does not result in any constraints.
10-
//
118
// This results in an inconsistency between `Trait` and `Projection` goals as
129
// normalizing always constraints the normalized-to term.
1310
trait Trait<'a> {
@@ -23,13 +20,14 @@ fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
2320
// We use a function with a trivial where-bound which is more
2421
// restrictive than the impl.
2522
fn function1<T: Trait<'static>>() {
26-
// ok
23+
// err
2724
//
28-
// Proving `for<'a> T: Trait<'a>` using the where-bound results
29-
// in a leak check failure, so we use the more general impl,
30-
// causing this to succeed.
25+
// Proving `for<'a> T: Trait<'a>` using the where-bound does not
26+
// result in a leak check failure even though it does not apply.
27+
// We prefer env candidates over impl candidatescausing this to succeed.
3128
trait_bound::<T>();
32-
//[current]~^ ERROR mismatched types
29+
//[next]~^ ERROR the trait bound `for<'a> T: Trait<'a>` is not satisfied
30+
//[current]~^^ ERROR implementation of `Trait` is not general enough
3331
}
3432

3533
fn function2<T: Trait<'static, Assoc = usize>>() {
@@ -40,7 +38,8 @@ fn function2<T: Trait<'static, Assoc = usize>>() {
4038
// to prefer it over the impl, resulting in a placeholder error.
4139
projection_bound::<T>();
4240
//[next]~^ ERROR type mismatch resolving `<T as Trait<'a>>::Assoc == usize`
43-
//[current]~^^ ERROR mismatched types
41+
//[next]~| ERROR the trait bound `for<'a> T: Trait<'a>` is not satisfied
42+
//[current]~^^^ ERROR implementation of `Trait` is not general enough
4443
//[current]~| ERROR mismatched types
4544
}
4645

@@ -54,7 +53,9 @@ fn function3<T: Trait<'static, Assoc = usize>>() {
5453
// leak check during candidate selection for normalization, this
5554
// case would still not compile.
5655
let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
57-
//[current]~^ ERROR mismatched types
56+
//[next]~^ ERROR higher-ranked subtype error
57+
//[next]~| ERROR higher-ranked subtype error
58+
//[current]~^^^ ERROR mismatched types
5859
//[current]~| ERROR mismatched types
5960
}
6061

tests/ui/higher-ranked/trait-bounds/issue-30786-1.stderr renamed to tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@issue-30786-1.rs:115:27}>`, but its trait bounds were not satisfied
2-
--> $DIR/issue-30786-1.rs:116:22
1+
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
2+
--> $DIR/hrtb-doesnt-borrow-self-1.rs:116:22
33
|
44
LL | pub struct Map<S, F> {
55
| -------------------- method `filterx` not found for this struct because it doesn't satisfy `_: StreamExt`
66
...
77
LL | let filter = map.filterx(|x: &_| true);
8-
| ^^^^^^^ method cannot be called on `Map<Repeat, {[email protected]:115:27}>` due to unsatisfied trait bounds
8+
| ^^^^^^^ method cannot be called due to unsatisfied trait bounds
99
|
1010
note: the following trait bounds were not satisfied:
11-
`&'a mut &Map<Repeat, {closure@$DIR/issue-30786-1.rs:115:27: 115:34}>: Stream`
12-
`&'a mut &mut Map<Repeat, {closure@$DIR/issue-30786-1.rs:115:27: 115:34}>: Stream`
13-
`&'a mut Map<Repeat, {closure@$DIR/issue-30786-1.rs:115:27: 115:34}>: Stream`
14-
--> $DIR/issue-30786-1.rs:98:50
11+
`&'a mut &Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
12+
`&'a mut &mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
13+
`&'a mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
14+
--> $DIR/hrtb-doesnt-borrow-self-1.rs:98:50
1515
|
1616
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
1717
| --------- - ^^^^^^ unsatisfied trait bound introduced here
1818
= help: items from traits can only be used if the trait is implemented and in scope
1919
note: `StreamExt` defines an item `filterx`, perhaps you need to implement it
20-
--> $DIR/issue-30786-1.rs:66:1
20+
--> $DIR/hrtb-doesnt-borrow-self-1.rs:66:1
2121
|
2222
LL | pub trait StreamExt
2323
| ^^^^^^^^^^^^^^^^^^^

tests/ui/higher-ranked/trait-bounds/issue-30786-2.stderr renamed to tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
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
2-
--> $DIR/issue-30786-2.rs:112:24
1+
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
2+
--> $DIR/hrtb-doesnt-borrow-self-2.rs:112:24
33
|
44
LL | pub struct Filter<S, F> {
55
| ----------------------- method `countx` not found for this struct because it doesn't satisfy `_: StreamExt`
@@ -8,16 +8,16 @@ LL | let count = filter.countx();
88
| ^^^^^^ method cannot be called due to unsatisfied trait bounds
99
|
1010
note: the following trait bounds were not satisfied:
11-
`&'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`
12-
`&'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`
13-
`&'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`
14-
--> $DIR/issue-30786-2.rs:98:50
11+
`&'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`
12+
`&'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`
13+
`&'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`
14+
--> $DIR/hrtb-doesnt-borrow-self-2.rs:98:50
1515
|
1616
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
1717
| --------- - ^^^^^^ unsatisfied trait bound introduced here
1818
= help: items from traits can only be used if the trait is implemented and in scope
1919
note: `StreamExt` defines an item `countx`, perhaps you need to implement it
20-
--> $DIR/issue-30786-2.rs:66:1
20+
--> $DIR/hrtb-doesnt-borrow-self-2.rs:66:1
2121
|
2222
LL | pub trait StreamExt
2323
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)