Skip to content

Conversation

m4rch3n1ng
Copy link
Contributor

@m4rch3n1ng m4rch3n1ng commented Feb 27, 2025

fixes #228.

parse const parameter default assignments. specified in the reference it takes blocks, identifiers and literals (with optional minus).

also fixes some more of the mismatches from #229:

diff
--- .tmp/list.txt	2025-02-27 14:52:48.714795961 +0100
+++ .tmp/list.txt.default-const-params	2025-02-27 20:22:50.306213116 +0100
@@ -67,21 +67,12 @@
 tests/ui/coherence/coherence-overlap-negative-impls.rs
 tests/ui/const-generics/arg-in-pat-3.rs
 tests/ui/const-generics/const_trait_fn-issue-88433.rs
-tests/ui/const-generics/defaults/const-default.rs
 tests/ui/const-generics/defaults/const-param-as-default-value.rs
-tests/ui/const-generics/defaults/default-annotation.rs
-tests/ui/const-generics/defaults/repr-c-issue-82792.rs
 tests/ui/const-generics/defaults/rp_impl_trait.rs
 tests/ui/const-generics/defaults/trait_objects.rs
-tests/ui/const-generics/defaults/type-default-const-param-name.rs
-tests/ui/const-generics/generic_arg_infer/dont-use-defaults.rs
 tests/ui/const-generics/generic_const_exprs/drop_impl.rs
-tests/ui/const-generics/generic_const_exprs/inline-const-in-const-generic-defaults.rs
 tests/ui/const-generics/generic_const_exprs/issue-90847.rs
-tests/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs
 tests/ui/const-generics/issues/issue-88119.rs
-tests/ui/const-generics/min_const_generics/default_trait_param.rs
-tests/ui/const-generics/min_const_generics/type_and_const_defaults.rs
 tests/ui/consts/const-eval/issue-55541.rs
 tests/ui/consts/const-labeled-break.rs
 tests/ui/consts/trait_specialization.rs
@@ -136,8 +127,6 @@
 tests/ui/delegation/self-coercion.rs
 tests/ui/delegation/target-expr-pass.rs
 tests/ui/derives/derive-hygiene.rs
-tests/ui/derives/derive-macro-const-default.rs
-tests/ui/deriving/coerce-pointee-bounds-issue-127647.rs
 tests/ui/destructuring-assignment/struct_destructure.rs
 tests/ui/drop/dynamic-drop.rs
 tests/ui/dyn-compatibility/assoc_const_bounds.rs

@maxbrunsfeld
Copy link
Contributor

Thanks so much for tracking the progress on the rustc files.

@m4rch3n1ng
Copy link
Contributor Author

added the second part with type_parameter, updated tests, rebased on master and did tree-sitter generate. should be good to go now.

Copy link
Contributor

@maxbrunsfeld maxbrunsfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more naming change. Thanks for addressing all of this feedback!

instead of having two seperate type_parameter rules:
`constrained_type_parameter` and `optional_type_parameter`, combine them
into one rule with two `optional`s.
@maxbrunsfeld maxbrunsfeld merged commit 4130d3b into tree-sitter:master Feb 28, 2025
4 checks passed
@maxbrunsfeld
Copy link
Contributor

Thank you!

@m4rch3n1ng m4rch3n1ng deleted the const-param-defaults branch February 28, 2025 02:00
@clason
Copy link

clason commented Feb 28, 2025

This is a breaking change and should have been marked as such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: error on const generics

3 participants