10

Github In which we start to parse const generics defaults by lqd · Pull Request...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/80547
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.
neoserver,ios ssh client

Member

lqd commented 16 days ago

edited

As discussed in this zulip topic, this PR extracts the parsing parts from @JulianKnodt's PR #75384 for a better user-experience using the newly stabilized min_const_generics (albeit temporary) as shown in #80507: trying to use default values on const generics currently results in parse errors, as if the user didn't use the correct syntax (which is somewhat true but also misleading).

This PR extracts (and slightly modifies in a couple places) @JulianKnodt's parsing code (with attribution if I've done everything correctly), AST and HIR changes, and feature gate setup.

This feature is now marked as "incomplete" and thus will also print out the expected "const generics default values are unstable" error instead of a syntax error. Note that, as I've only extracted the parsing part, the actual feature will not work at all if enabled. There will be ICEs, and inference errors on the const generics default values themselves.

Fixes #80507.

Once this merges, I'll:

  • modify the const generics tracking issue to refer to the const_generics_defaults gate rather than the older temporary name it uses there.
  • create the GH F-const_generics_defaults label

r? @varkor


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK