-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Permit multi-segment paths as const generic arguments without {}
#77773
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
{}
{}
The treatment should be somewhat similar to imports, for every path in a generic argument context resolve should produce a Then that path is effectively lowered into two |
On one hand, this is an annoying papercut, and essentially a special case that users would have to learn. On the other hand, it's quite a lot of complexity for a small issue. (Though if we end up fixing this issue in the future, after |
Generally special cases in both a compiler and a language should be avoided. Writing S::<{m::N}> isn't too much bad, but the syntax here is already a special case compared to the second part of the [T; N] array syntax... |
If it is only the syntax concern that stops this, then why is |
|
I bumped into this again today after using a constant from another crate via a fully qualified name as an argument to a generic struct, and would suggest that the compiler error message be improved in the interim. |
…compiler-errors Don't call `walk_` functions directly if there is an equivalent `visit_` method I was working on rust-lang#77773 and realized in one of my experiments that the `visit_path` method was not always called whereas it should have. This fixes it. r? `@davidtwco`
…compiler-errors Don't call `walk_` functions directly if there is an equivalent `visit_` method I was working on rust-lang#77773 and realized in one of my experiments that the `visit_path` method was not always called whereas it should have. This fixes it. r? ``@davidtwco``
Rollup merge of rust-lang#120316 - GuillaumeGomez:fix-ast-visitor, r=compiler-errors Don't call `walk_` functions directly if there is an equivalent `visit_` method I was working on rust-lang#77773 and realized in one of my experiments that the `visit_path` method was not always called whereas it should have. This fixes it. r? ``@davidtwco``
Uh oh!
There was an error while loading. Please reload this page.
(Playground link)
There's no reason this couldn't be supported, but it's nontrivial to implement: we need to wait until type-checking to disambiguate between types and constants due to associated types (see this Zulip conversation).
This is essentially the same issue as #66615, but it's more visible (and affects
min_const_generics
).The text was updated successfully, but these errors were encountered: