Open
Description
For example, function f
is rejected with an error that a
needs dropping, while g
succeeds even though it should use more conservative qualification because it uses an opaque function id
:
pub const fn id<T>(t: T) -> T { t }
pub const fn f() -> String {
let s = String::new();
let mut a: (Option<String>, Option<&String>) = (None, None);
a.1 = Some(&s);
s
}
pub const fn g() -> String {
let s = String::new();
let mut a: (Option<String>, Option<&String>) = (None, None);
a.1 = Some(id(&s));
s
}
@rustbot label +A-const-eval +A-const-fn