Add a separate error for `dyn Trait` in `const fn` by WaffleLapkin · Pull Reques...
source link: https://github.com/rust-lang/rust/pull/89021
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.
For the cases of fields like this one it would be nice to have a span_note
pointing at the type and field's type to show how it is a trait object.
It would be really nice! Can we implement this though? It seems like we only check locals and not expressions:
I'm not sure if we can't get that info from local.local_info
or local.source_info
(I'm not that familiar with const eval and have to relearn it every time I look at it).
Hm, after reading docs I can't see how we can get the expression, but maybe I'm missing something
Can you check what the contents of local.local_info
are? I assume it is going to be a VarBindingForm
. If it is, what are the contents of opt_match_place
?
Alternatively, if the data isn't there, it could potentially be added.
So in the case of our interest (field access) local.local_info
is simply None
:(
In that case, we'll have to make more dramatic changes so that we can track that data :-/
It's probably not high priority, but if you desire to take that on, I'd be more than happy to see it through!
I don't think I'm interested enough in that. Thanks for offering help though!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK