Github implement `feature(const_generics_defaults)` by JulianKnodt · Pull Reques...
source link: https://github.com/rust-lang/rust/pull/75384
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Implements const generics defaults struct Example<const N: usize=3>
, as well as a query for getting the default of a given const-parameter's def id. There are some remaining FIXME's but they were specified as not blocking for merging this PR. This also puts the defaults behind the unstable feature gate #![feature(const_generics_defaults)]
.
This currently creates a field which is always false on GenericParamDefKind
for future use when
consts are permitted to have defaults. I'm not sure if this is exactly what is best for adding default parameters, but I mimicked the style of type defaults, so hopefully this is ok.
r? @lcnr
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK