rust/tests/ui/nll/issue-46589.rs
Rémy Rakic b99fe2b720 mark polonius=next's NLL imprecisions as known-bugs
- linked-list cursor-like patterns
- issue-46589

These are known-bugs for the polonius alpha, where they show the same
imprecision as NLLs, but are supported by the old datalog
implementation.
2025-08-08 15:15:09 +00:00

33 lines
669 B
Rust

//@ ignore-compare-mode-polonius (explicit revisions)
//@ revisions: nll polonius legacy
//@ [nll] known-bug: #46589
//@ [polonius] known-bug: #46589
//@ [polonius] compile-flags: -Zpolonius=next
//@ [legacy] check-pass
//@ [legacy] compile-flags: -Zpolonius=legacy
struct Foo;
impl Foo {
fn get_self(&mut self) -> Option<&mut Self> {
Some(self)
}
fn new_self(&mut self) -> &mut Self {
self
}
fn trigger_bug(&mut self) {
let other = &mut (&mut *self);
*other = match (*other).get_self() {
Some(s) => s,
None => (*other).new_self()
};
let c = other;
}
}
fn main() {}