Skip to content

the test(s) from issue 25579 should be ported to NLL run-pass tests #55797

@pnkfelix

Description

@pnkfelix

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.fixed-by-NLLBugs fixed, but only when NLL is enabled.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions