Github Use AnonConst for asm! constants by Amanieu · Pull Request #83916 · rust-...
source link: https://github.com/rust-lang/rust/pull/83916
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.
Considering these limitations, is this still something that we want to move forward with?
Well, what are the alternatives? With array repeat expressions not being promotion points any more, and stdarch switching away from rustc_args_required_const
, we are close to cutting down promotion to be just about lifetime extension (making &expr
have 'static
lifetime), as it was originally intended. I still think that is a worthwhile goal, so we should make sure that anything we do here is forward-compatible with such a future.
We lose the ability to use expressions derived from generics.
Note that this affects other situations as well, such as array repeat expressions. We certainly want to fix this in the future. If this is for now "good enough" elsewhere, then why not for asm!
?
IMO we should just do the same kind of post-monomorphization evaluation that we do for associated consts and promoteds (AFAIK that would be rather easy to implement, we already have those codepaths for associated consts and promoteds), but @lcnr has plans to ensure that there are no post-monomorphization failures which (to my knowledge) needs a lot of design still.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK