-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for Mutex::new() as const fn #66806
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hi,
I think being able to do
static mut GLOBAL_LOCK: Mutex<Type> = Mutex::new(Type::new())Is a very important feature, right now you have to do weird jumps with
Option/MaybeUninitandOnceto then return a&'static Mutex<T>.In practice, the missing pieces here are: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/mutex.rs#L24 and #57349
alexcrichton Pointed out here #66823 (comment) that this also requires
Box. so that's another missing piece in cost fn for these to be usable in const fn'sI opened this Issue as part of: #57563