-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
Functions in std which could be evaluated in compile time should be qualified by const
.
Such as:
fn size_of<T>() -> usize;
fn size_of_val<T: ?sized>(_: &T) -> usize;
fn type_name<T: ?sized>() -> &'static str;
fn type_id<T: ?Sized + 'static> () -> u64;
fn needs_drop<T>() -> bool;
......
I suppose they should be const fn
. And there are more. Is it correct?
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.