-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.
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
oli-obk
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.