Use revisions for NLL in hrtb
This commit is contained in:
parent
b16bd7c3e2
commit
b7c192e346
@ -1,5 +1,5 @@
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-conflate-regions.rs:27:10
|
||||
--> $DIR/hrtb-conflate-regions.rs:31:10
|
||||
|
|
||||
LL | fn b() { want_foo2::<SomeStruct>(); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-conflate-regions.rs:27:10
|
||||
--> $DIR/hrtb-conflate-regions.rs:31:10
|
||||
|
|
||||
LL | fn b() { want_foo2::<SomeStruct>(); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
@ -8,7 +8,7 @@ LL | fn b() { want_foo2::<SomeStruct>(); }
|
||||
= note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-conflate-regions.rs:27:10
|
||||
--> $DIR/hrtb-conflate-regions.rs:31:10
|
||||
|
|
||||
LL | fn b() { want_foo2::<SomeStruct>(); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// Test that an impl with only one bound region `'a` cannot be used to
|
||||
// satisfy a constraint where there are two bound regions.
|
||||
|
||||
@ -24,6 +28,9 @@ impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct
|
||||
}
|
||||
|
||||
fn a() { want_foo1::<SomeStruct>(); } // OK -- foo wants just one region
|
||||
fn b() { want_foo2::<SomeStruct>(); } //~ ERROR
|
||||
fn b() { want_foo2::<SomeStruct>(); }
|
||||
//[base]~^ ERROR
|
||||
//[nll]~^^ ERROR implementation of
|
||||
//[nll]~| ERROR implementation of
|
||||
|
||||
fn main() { }
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Trait` is not general enough
|
||||
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
|
||||
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5
|
||||
|
|
||||
LL | foo::<()>();
|
||||
| ^^^^^^^^^ implementation of `Trait` is not general enough
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Trait` is not general enough
|
||||
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
|
||||
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5
|
||||
|
|
||||
LL | foo::<()>();
|
||||
| ^^^^^^^^^^^ implementation of `Trait` is not general enough
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// Test a case where variance and higher-ranked types interact in surprising ways.
|
||||
//
|
||||
// In particular, we test this pattern in trait solving, where it is not connected
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Trait` is not general enough
|
||||
--> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
|
||||
--> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5
|
||||
|
|
||||
LL | foo::<()>();
|
||||
| ^^^^^^^^^ implementation of `Trait` is not general enough
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Trait` is not general enough
|
||||
--> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
|
||||
--> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5
|
||||
|
|
||||
LL | foo::<()>();
|
||||
| ^^^^^^^^^^^ implementation of `Trait` is not general enough
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// Test an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
|
||||
//
|
||||
// In particular, we test this pattern in trait solving, where it is not connected
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-just-for-static.rs:24:5
|
||||
--> $DIR/hrtb-just-for-static.rs:28:5
|
||||
|
|
||||
LL | want_hrtb::<StaticInt>()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
@ -8,7 +8,7 @@ LL | want_hrtb::<StaticInt>()
|
||||
= note: ...but it actually implements `Foo<&'static isize>`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-just-for-static.rs:30:5
|
||||
--> $DIR/hrtb-just-for-static.rs:34:5
|
||||
|
|
||||
LL | want_hrtb::<&'a u32>()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-just-for-static.rs:24:5
|
||||
--> $DIR/hrtb-just-for-static.rs:28:5
|
||||
|
|
||||
LL | want_hrtb::<StaticInt>()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
@ -8,7 +8,7 @@ LL | want_hrtb::<StaticInt>()
|
||||
= note: ...but it actually implements `Foo<&'static isize>`
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/hrtb-just-for-static.rs:30:5
|
||||
--> $DIR/hrtb-just-for-static.rs:34:5
|
||||
|
|
||||
LL | fn give_some<'a>() {
|
||||
| -- lifetime `'a` defined here
|
||||
@ -16,7 +16,7 @@ LL | want_hrtb::<&'a u32>()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-just-for-static.rs:30:5
|
||||
--> $DIR/hrtb-just-for-static.rs:34:5
|
||||
|
|
||||
LL | want_hrtb::<&'a u32>()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// Test a case where you have an impl of `Foo<X>` for all `X` that
|
||||
// is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730.
|
||||
|
||||
@ -27,7 +31,10 @@ fn give_static() {
|
||||
// AnyInt implements Foo<&'a isize> for any 'a, so it is a match.
|
||||
impl<'a> Foo<&'a isize> for &'a u32 { }
|
||||
fn give_some<'a>() {
|
||||
want_hrtb::<&'a u32>() //~ ERROR
|
||||
want_hrtb::<&'a u32>()
|
||||
//[base]~^ ERROR
|
||||
//[nll]~^^ ERROR lifetime may not live long enough
|
||||
//[nll]~| ERROR implementation of `Foo` is not general enough
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Bar` is not general enough
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:43:5
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:47:5
|
||||
|
|
||||
LL | foo_hrtb_bar_not(&mut t);
|
||||
| ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
|
||||
@ -8,7 +8,7 @@ LL | foo_hrtb_bar_not(&mut t);
|
||||
= note: ...but it actually implements `Bar<&'b isize>`
|
||||
|
||||
error: implementation of `Bar` is not general enough
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:43:5
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:47:5
|
||||
|
|
||||
LL | foo_hrtb_bar_not(&mut t);
|
||||
| ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
|
@ -1,5 +1,5 @@
|
||||
warning: function cannot return without recursing
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:16:1
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:20:1
|
||||
|
|
||||
LL | / fn no_hrtb<'b, T>(mut t: T)
|
||||
LL | | where
|
||||
@ -15,7 +15,7 @@ LL | | }
|
||||
= help: a `loop` may express intention better if this is on purpose
|
||||
|
||||
warning: function cannot return without recursing
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:25:1
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:29:1
|
||||
|
|
||||
LL | / fn bar_hrtb<T>(mut t: T)
|
||||
LL | | where
|
||||
@ -30,7 +30,7 @@ LL | | }
|
||||
= help: a `loop` may express intention better if this is on purpose
|
||||
|
||||
warning: function cannot return without recursing
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:35:1
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:39:1
|
||||
|
|
||||
LL | / fn foo_hrtb_bar_not<'b, T>(mut t: T)
|
||||
LL | | where
|
||||
@ -39,7 +39,7 @@ LL | | {
|
||||
... |
|
||||
LL | | foo_hrtb_bar_not(&mut t);
|
||||
| | ------------------------ recursive call site
|
||||
LL | |
|
||||
... |
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^ cannot return without recursing
|
||||
@ -47,7 +47,7 @@ LL | | }
|
||||
= help: a `loop` may express intention better if this is on purpose
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:43:5
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:47:5
|
||||
|
|
||||
LL | fn foo_hrtb_bar_not<'b, T>(mut t: T)
|
||||
| -- lifetime `'b` defined here
|
||||
@ -56,7 +56,7 @@ LL | foo_hrtb_bar_not(&mut t);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
|
||||
|
||||
error: implementation of `Bar` is not general enough
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:43:5
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:47:5
|
||||
|
|
||||
LL | foo_hrtb_bar_not(&mut t);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
|
||||
@ -65,7 +65,7 @@ LL | foo_hrtb_bar_not(&mut t);
|
||||
= note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
|
||||
|
||||
warning: function cannot return without recursing
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:48:1
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:53:1
|
||||
|
|
||||
LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
|
||||
LL | | where
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// Test a case where you have an impl of `Foo<X>` for all `X` that
|
||||
// is being applied to `for<'a> Foo<&'a mut X>`. Issue #19730.
|
||||
|
||||
@ -13,7 +17,7 @@ impl<'a, X, F> Foo<X> for &'a mut F where F: Foo<X> + Bar<X> {}
|
||||
|
||||
impl<'a, X, F> Bar<X> for &'a mut F where F: Bar<X> {}
|
||||
|
||||
fn no_hrtb<'b, T>(mut t: T)
|
||||
fn no_hrtb<'b, T>(mut t: T) //[nll]~ WARN function cannot return
|
||||
where
|
||||
T: Bar<&'b isize>,
|
||||
{
|
||||
@ -22,7 +26,7 @@ fn no_hrtb<'b, T>(mut t: T)
|
||||
no_hrtb(&mut t);
|
||||
}
|
||||
|
||||
fn bar_hrtb<T>(mut t: T)
|
||||
fn bar_hrtb<T>(mut t: T) //[nll]~ WARN function cannot return
|
||||
where
|
||||
T: for<'b> Bar<&'b isize>,
|
||||
{
|
||||
@ -32,7 +36,7 @@ fn bar_hrtb<T>(mut t: T)
|
||||
bar_hrtb(&mut t);
|
||||
}
|
||||
|
||||
fn foo_hrtb_bar_not<'b, T>(mut t: T)
|
||||
fn foo_hrtb_bar_not<'b, T>(mut t: T) //[nll]~ WARN function cannot return
|
||||
where
|
||||
T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
|
||||
{
|
||||
@ -42,10 +46,11 @@ fn foo_hrtb_bar_not<'b, T>(mut t: T)
|
||||
// clause only specifies `T : Bar<&'b isize>`.
|
||||
foo_hrtb_bar_not(&mut t);
|
||||
//~^ ERROR implementation of `Bar` is not general enough
|
||||
//~| ERROR implementation of `Bar` is not general enough
|
||||
//[base]~^^ ERROR implementation of `Bar` is not general enough
|
||||
//[nll]~^^^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn foo_hrtb_bar_hrtb<T>(mut t: T)
|
||||
fn foo_hrtb_bar_hrtb<T>(mut t: T) //[nll]~ WARN function cannot return
|
||||
where
|
||||
T: for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>,
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:127:22
|
||||
error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:122:22
|
||||
|
|
||||
LL | pub struct Map<S, F> {
|
||||
| --------------------
|
||||
@ -8,13 +8,13 @@ LL | pub struct Map<S, F> {
|
||||
| doesn't satisfy `_: StreamExt`
|
||||
...
|
||||
LL | let filter = map.filterx(|x: &_| true);
|
||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>` due to unsatisfied trait bounds
|
||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: the following trait bounds were not satisfied:
|
||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>: Stream`
|
||||
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>: Stream`
|
||||
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>: Stream`
|
||||
--> $DIR/issue-30786.rs:105:50
|
||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
|
||||
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
|
||||
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
|
||||
--> $DIR/issue-30786.rs:100:50
|
||||
|
|
||||
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||
| --------- - ^^^^^^ unsatisfied trait bound introduced here
|
||||
@ -23,8 +23,8 @@ help: one of the expressions' fields has a method of the same name
|
||||
LL | let filter = map.stream.filterx(|x: &_| true);
|
||||
| +++++++
|
||||
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:140:24
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:134:24
|
||||
|
|
||||
LL | pub struct Filter<S, F> {
|
||||
| -----------------------
|
||||
@ -33,13 +33,13 @@ LL | pub struct Filter<S, F> {
|
||||
| doesn't satisfy `_: StreamExt`
|
||||
...
|
||||
LL | let count = filter.countx();
|
||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>` due to unsatisfied trait bounds
|
||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: the following trait bounds were not satisfied:
|
||||
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>: Stream`
|
||||
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>: Stream`
|
||||
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>: Stream`
|
||||
--> $DIR/issue-30786.rs:105:50
|
||||
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
|
||||
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
|
||||
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
|
||||
--> $DIR/issue-30786.rs:100:50
|
||||
|
|
||||
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||
| --------- - ^^^^^^ unsatisfied trait bound introduced here
|
@ -1,5 +1,5 @@
|
||||
error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:127:22
|
||||
error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:122:22
|
||||
|
|
||||
LL | pub struct Map<S, F> {
|
||||
| --------------------
|
||||
@ -8,13 +8,13 @@ LL | pub struct Map<S, F> {
|
||||
| doesn't satisfy `_: StreamExt`
|
||||
...
|
||||
LL | let filter = map.filterx(|x: &_| true);
|
||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>` due to unsatisfied trait bounds
|
||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: the following trait bounds were not satisfied:
|
||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>: Stream`
|
||||
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>: Stream`
|
||||
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:126:27: 126:36]>: Stream`
|
||||
--> $DIR/issue-30786.rs:105:50
|
||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
|
||||
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
|
||||
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:121:27: 121:36]>: Stream`
|
||||
--> $DIR/issue-30786.rs:100:50
|
||||
|
|
||||
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||
| --------- - ^^^^^^ unsatisfied trait bound introduced here
|
||||
@ -23,8 +23,8 @@ help: one of the expressions' fields has a method of the same name
|
||||
LL | let filter = map.stream.filterx(|x: &_| true);
|
||||
| +++++++
|
||||
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:140:24
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:134:24
|
||||
|
|
||||
LL | pub struct Filter<S, F> {
|
||||
| -----------------------
|
||||
@ -33,13 +33,13 @@ LL | pub struct Filter<S, F> {
|
||||
| doesn't satisfy `_: StreamExt`
|
||||
...
|
||||
LL | let count = filter.countx();
|
||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>` due to unsatisfied trait bounds
|
||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: the following trait bounds were not satisfied:
|
||||
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>: Stream`
|
||||
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>: Stream`
|
||||
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:139:30: 139:42]>: Stream`
|
||||
--> $DIR/issue-30786.rs:105:50
|
||||
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
|
||||
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
|
||||
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:133:30: 133:42]>: Stream`
|
||||
--> $DIR/issue-30786.rs:100:50
|
||||
|
|
||||
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||
| --------- - ^^^^^^ unsatisfied trait bound introduced here
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream<Item=T`
|
||||
// should act as assertion that item does not borrow from its stream;
|
||||
// but an earlier buggy rustc allowed `.map(|x: &_| x)` which does
|
||||
@ -6,15 +10,6 @@
|
||||
// This tests double-checks that we do not allow such behavior to leak
|
||||
// through again.
|
||||
|
||||
// revisions: migrate nll
|
||||
//[nll]compile-flags: -Z borrowck=mir
|
||||
|
||||
// Since we are testing nll (and migration) explicitly as a separate
|
||||
// revisions, don't worry about the --compare-mode=nll on this test.
|
||||
|
||||
// ignore-compare-mode-nll
|
||||
// ignore-compare-mode-polonius
|
||||
|
||||
pub trait Stream {
|
||||
type Item;
|
||||
fn next(self) -> Option<Self::Item>;
|
||||
@ -125,8 +120,7 @@ fn variant1() {
|
||||
// guess.
|
||||
let map = source.mapx(|x: &_| x);
|
||||
let filter = map.filterx(|x: &_| true);
|
||||
//[migrate]~^ ERROR the method
|
||||
//[nll]~^^ ERROR the method
|
||||
//~^ ERROR the method
|
||||
}
|
||||
|
||||
fn variant2() {
|
||||
@ -138,8 +132,7 @@ fn variant2() {
|
||||
let map = source.mapx(identity);
|
||||
let filter = map.filterx(|x: &_| true);
|
||||
let count = filter.countx();
|
||||
//[migrate]~^ ERROR the method
|
||||
//[nll]~^^ ERROR the method
|
||||
//~^ ERROR the method
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/issue-46989.rs:38:5
|
||||
--> $DIR/issue-46989.rs:42:5
|
||||
|
|
||||
LL | assert_foo::<fn(&i32)>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
@ -1,5 +1,5 @@
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/issue-46989.rs:38:5
|
||||
--> $DIR/issue-46989.rs:42:5
|
||||
|
|
||||
LL | assert_foo::<fn(&i32)>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
|
@ -1,3 +1,7 @@
|
||||
// revisions: base nll
|
||||
// ignore-compare-mode-nll
|
||||
//[nll] compile-flags: -Z borrowck=mir
|
||||
|
||||
// Regression test for #46989:
|
||||
//
|
||||
// In the move to universes, this test started passing.
|
||||
|
Loading…
Reference in New Issue
Block a user