Add an is_effect flag to GenericArgKind#118785
Add an is_effect flag to GenericArgKind#118785fee1-dead wants to merge 3 commits intorust-lang:masterfrom
is_effect flag to GenericArgKind#118785Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in need_type_info.rs cc @lcnr |
This comment has been minimized.
This comment has been minimized.
compiler-errors
left a comment
There was a problem hiding this comment.
I think this approach is pretty invasive, and would rather we don't change every usage site of GenericArg::Const just to handle a printing bug.
I would much rather see the call to path_generic_args take an additional &[ty::GenericParamDef] so it can detect host-ness via that param instead. I think this is possible -- if you don't want to attempt this, please let me know, since I may be able to try it myself.
Sounds like a good approach. I probably won't have more time to work on this this weekend, so feel free to pick it up if you want. |
|
Could we add a lang item |
hmmm, so we can just see if the defid of the type of the const matches? sounds like a good idea too. |
| if let ty::GenericParamDefKind::Const { is_host_effect: true, .. } = params[index].kind | ||
| { | ||
| return None; | ||
| } | ||
|
|
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
kind of, yea. we already have the adtflags that we can check for |
…-dead Don't print host effect param in pretty `path_generic_args` Make `own_args_no_defaults` pass back the `GenericParamDef`, so that we can pass both the args *and* param definitions into `path_generic_args`. That allows us to use the `GenericParamDef` to filter out effect params. This allows us to filter out the host param regardless of whether it's `sym::host` or `true`/`false`. This also renames a couple of `const_effect_param` -> `host_effect_param`, and restores `~const` pretty printing to `TraitPredPrintModifiersAndPath`. cc rust-lang#118785 r? `@fee1-dead` cc `@oli-obk`
|
☔ The latest upstream changes (presumably #118788) made this pull request unmergeable. Please resolve the merge conflicts. |
Which should help us prevent printing
<false>(effects desugaring) in diagnostics.r? @compiler-errors
cc @oli-obk