The work on reviewing the diagnostic differences between AST-borrowck and NLL leads me to conclude that NLL is (probably) correctly accepting the regression test we added for #25579
Namely this:
|
enum Sexpression { |
|
Num(()), |
|
Cons(&'static mut Sexpression) |
|
} |
|
|
|
fn causes_error_in_ast(mut l: &mut Sexpression) { |
|
loop { match l { |
|
&mut Sexpression::Num(ref mut n) => {}, |
|
&mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] |
|
l = &mut **expr; //[ast]~ ERROR [E0506] |
|
} |
|
}} |
|
} |
We should make the original test be AST-borrowck only (via -Z borrowck=ast) and make a new version of the test (and perhaps the original code from the description on #25579) that is NLL-only and goes in run-pass.
The work on reviewing the diagnostic differences between AST-borrowck and NLL leads me to conclude that NLL is (probably) correctly accepting the regression test we added for #25579
Namely this:
rust/src/test/ui/issues/issue-25579.rs
Lines 16 to 28 in 653da4f
We should make the original test be AST-borrowck only (via
-Z borrowck=ast) and make a new version of the test (and perhaps the original code from the description on #25579) that is NLL-only and goes in run-pass.