mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 12:36:35 +03:00
fix cycle error when a static and a promoted are mutually recursive
This also now allows promoteds everywhere to point to 'extern static', because why not? We still check that constants cannot transitively reach 'extern static' through references. (We allow it through raw pointers.)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// check-pass
|
||||
|
||||
struct Value {
|
||||
values: &'static [&'static Value],
|
||||
}
|
||||
|
||||
// This `static` recursively points to itself through a promoted (the slice).
|
||||
static VALUE: Value = Value {
|
||||
values: &[&VALUE],
|
||||
};
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user