Closed
Description
After #6990 lands the following fails with an error message. (It currently ICEs.)
static x: &'static uint = &'static 1;
static y: uint = *x;
fn main(){
match 1 {
y => {}
_ => {}
}
}
const.rs:2:17: 2:19 error: Unsupported constant expr
const.rs:2 static y: uint = *x;
^~
I'm not sure whether this is correctly not-constant, or whether it should compile fine. In the former case, is this something that should be handled in check_const.rs
rather than const_eval.rs
(where it is handled currently (0d0c004))?
That testcase requires the match
with the y
.
(This is filed because I wasn't sure about whether this is a valid testcase for #6990 or whether it shouldn't be triggering this code path at all.)