Skip to content

Commit c9b2784

Browse files
committed
mark two polonius tests as known-bug
As tracked in the soundness issue 153215.
1 parent 1eb36c6 commit c9b2784

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.edition2015.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
2-
--> $DIR/rpit-hide-lifetime-for-swap.rs:20:5
2+
--> $DIR/rpit-hide-lifetime-for-swap.rs:26:5
33
|
44
LL | fn hide<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
55
| -- -------------- opaque type defined here

tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.edition2024.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: `x` does not live long enough
2-
--> $DIR/rpit-hide-lifetime-for-swap.rs:27:38
2+
--> $DIR/rpit-hide-lifetime-for-swap.rs:33:38
33
|
44
LL | let x = [1, 2, 3];
55
| - binding `x` declared here

tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
//@revisions: edition2015 edition2024
2-
//@[edition2015] edition:2015
3-
//@[edition2024] edition:2024
1+
//@ revisions: edition2015 edition2024 polonius_alpha
2+
//@ ignore-compare-mode-polonius (explicit revisions)
3+
//@ [edition2015] edition: 2015
4+
//@ [edition2024] edition: 2024
5+
//@ [polonius_alpha] known-bug: #153215
6+
//@ [polonius_alpha] check-pass
7+
//@ [polonius_alpha] edition: 2024
8+
//@ [polonius_alpha] compile-flags: -Zpolonius=next
9+
410
// This test should never pass!
511

612
use std::cell::RefCell;

tests/ui/impl-trait/hidden-lifetimes.edition2015.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
2-
--> $DIR/hidden-lifetimes.rs:33:5
2+
--> $DIR/hidden-lifetimes.rs:38:5
33
|
44
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
55
| -- -------------- opaque type defined here
@@ -14,7 +14,7 @@ LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + use<'
1414
| ++++++++++++++++
1515

1616
error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
17-
--> $DIR/hidden-lifetimes.rs:50:5
17+
--> $DIR/hidden-lifetimes.rs:55:5
1818
|
1919
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
2020
| -- -------------- opaque type defined here

tests/ui/impl-trait/hidden-lifetimes.edition2024.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0515]: cannot return value referencing local variable `x`
2-
--> $DIR/hidden-lifetimes.rs:41:5
2+
--> $DIR/hidden-lifetimes.rs:46:5
33
|
44
LL | hide_ref(&mut res).swap(hide_ref(&mut &x));
55
| -- `x` is borrowed here
66
LL | res
77
| ^^^ returns a value referencing data owned by the current function
88

99
error[E0597]: `x` does not live long enough
10-
--> $DIR/hidden-lifetimes.rs:57:38
10+
--> $DIR/hidden-lifetimes.rs:62:38
1111
|
1212
LL | let x = [1, 2, 3];
1313
| - binding `x` declared here

tests/ui/impl-trait/hidden-lifetimes.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
//@revisions: edition2015 edition2024
2-
//@[edition2015] edition:2015
3-
//@[edition2024] edition:2024
1+
//@ revisions: edition2015 edition2024 polonius_alpha
2+
//@ ignore-compare-mode-polonius (explicit revisions)
3+
//@ [edition2015] edition: 2015
4+
//@ [edition2024] edition: 2024
5+
//@ [polonius_alpha] known-bug: #153215
6+
//@ [polonius_alpha] check-pass
7+
//@ [polonius_alpha] edition: 2024
8+
//@ [polonius_alpha] compile-flags: -Zpolonius=next
49

510
// Test to show what happens if we were not careful and allowed invariant
611
// lifetimes to escape though an impl trait.

0 commit comments

Comments
 (0)