diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2025-03-24 07:09:18 +0000 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2025-08-08 14:10:41 +0000 |
| commit | f4094ea25236bc4ba3d9b7b03d2674ba7ab92907 (patch) | |
| tree | 0ea6b79a71777f39425d31c7843083297d21c0a5 /tests/ui/wf | |
| parent | 43327b5da6bc4ccbddebb935b1bcf362ccb8f993 (diff) | |
| download | rust-f4094ea25236bc4ba3d9b7b03d2674ba7ab92907.tar.gz rust-f4094ea25236bc4ba3d9b7b03d2674ba7ab92907.zip | |
update test expectations for boring locals + dropckoutlives interactions
The suboptimal error only appears with NLLs due to liveness differences where polonius cannot have as many boring locals. Sometimes this causes NLLs to emit a duplicate error as well.
Diffstat (limited to 'tests/ui/wf')
| -rw-r--r-- | tests/ui/wf/hir-wf-check-erase-regions.nll.stderr (renamed from tests/ui/wf/hir-wf-check-erase-regions.stderr) | 8 | ||||
| -rw-r--r-- | tests/ui/wf/hir-wf-check-erase-regions.polonius.stderr | 39 | ||||
| -rw-r--r-- | tests/ui/wf/hir-wf-check-erase-regions.rs | 6 |
3 files changed, 48 insertions, 5 deletions
diff --git a/tests/ui/wf/hir-wf-check-erase-regions.stderr b/tests/ui/wf/hir-wf-check-erase-regions.nll.stderr index 07304cd448e..dcade3aa367 100644 --- a/tests/ui/wf/hir-wf-check-erase-regions.stderr +++ b/tests/ui/wf/hir-wf-check-erase-regions.nll.stderr @@ -1,5 +1,5 @@ error[E0277]: `&'a T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:7:21 + --> $DIR/hir-wf-check-erase-regions.rs:11:21 | LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'a T` is not an iterator @@ -11,7 +11,7 @@ note: required by a bound in `std::iter::IntoIterator::IntoIter` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL error[E0277]: `&'a T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:7:5 + --> $DIR/hir-wf-check-erase-regions.rs:11:5 | LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; | ^^^^^^^^^^^^^ `&'a T` is not an iterator @@ -23,7 +23,7 @@ note: required by a bound in `Flatten` --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL error[E0277]: `&'a T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:11:27 + --> $DIR/hir-wf-check-erase-regions.rs:15:27 | LL | fn into_iter(self) -> Self::IntoIter { | ^^^^^^^^^^^^^^ `&'a T` is not an iterator @@ -35,7 +35,7 @@ note: required by a bound in `Flatten` --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL error[E0277]: `&T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:11:27 + --> $DIR/hir-wf-check-erase-regions.rs:15:27 | LL | fn into_iter(self) -> Self::IntoIter { | ^^^^^^^^^^^^^^ `&T` is not an iterator diff --git a/tests/ui/wf/hir-wf-check-erase-regions.polonius.stderr b/tests/ui/wf/hir-wf-check-erase-regions.polonius.stderr new file mode 100644 index 00000000000..55728aa642b --- /dev/null +++ b/tests/ui/wf/hir-wf-check-erase-regions.polonius.stderr @@ -0,0 +1,39 @@ +error[E0277]: `&'a T` is not an iterator + --> $DIR/hir-wf-check-erase-regions.rs:11:21 + | +LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'a T` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&'a T` + = help: the trait `Iterator` is implemented for `&mut I` + = note: required for `Flatten<std::slice::Iter<'a, T>>` to implement `Iterator` +note: required by a bound in `std::iter::IntoIterator::IntoIter` + --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL + +error[E0277]: `&'a T` is not an iterator + --> $DIR/hir-wf-check-erase-regions.rs:11:5 + | +LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; + | ^^^^^^^^^^^^^ `&'a T` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&'a T` + = help: the trait `Iterator` is implemented for `&mut I` + = note: required for `&'a T` to implement `IntoIterator` +note: required by a bound in `Flatten` + --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL + +error[E0277]: `&'a T` is not an iterator + --> $DIR/hir-wf-check-erase-regions.rs:15:27 + | +LL | fn into_iter(self) -> Self::IntoIter { + | ^^^^^^^^^^^^^^ `&'a T` is not an iterator + | + = help: the trait `Iterator` is not implemented for `&'a T` + = help: the trait `Iterator` is implemented for `&mut I` + = note: required for `&'a T` to implement `IntoIterator` +note: required by a bound in `Flatten` + --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/wf/hir-wf-check-erase-regions.rs b/tests/ui/wf/hir-wf-check-erase-regions.rs index 20cc1cfe730..ef9132697ef 100644 --- a/tests/ui/wf/hir-wf-check-erase-regions.rs +++ b/tests/ui/wf/hir-wf-check-erase-regions.rs @@ -1,6 +1,10 @@ // Regression test for #87549. //@ incremental +//@ ignore-compare-mode-polonius (explicit revisions) +//@ revisions: nll polonius +//@ [polonius] compile-flags: -Zpolonius=next + pub struct Table<T, const N: usize>([Option<T>; N]); impl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> { @@ -10,7 +14,7 @@ impl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> { fn into_iter(self) -> Self::IntoIter { //~^ ERROR `&'a T` is not an iterator - //~| ERROR `&T` is not an iterator + //[nll]~| ERROR `&T` is not an iterator unimplemented!() } } |
