Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject const item with no value in impl context #2713

Merged
merged 11 commits into from
Nov 6, 2023
2 changes: 2 additions & 0 deletions gcc/rust/Make-lang.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ GRS_OBJS = \
rust/rust-ast-fragment.o \
rust/rust-ast-dump.o \
rust/rust-ast-collector.o \
rust/rust-ast-visitor.o \
rust/rust-hir-dump.o \
rust/rust-session-manager.o \
rust/rust-compile.o \
Expand Down Expand Up @@ -188,6 +189,7 @@ GRS_OBJS = \
rust/rust-builtins.o \
rust/rust-feature.o \
rust/rust-feature-gate.o \
rust/rust-ast-validation.o \
rust/rust-dir-owner.o \
rust/rust-unicode.o \
rust/rust-punycode.o \
Expand Down
5 changes: 3 additions & 2 deletions gcc/rust/ast/rust-ast-collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,12 @@ TokenCollector::visit (ConstGenericParam &param)
auto id = param.get_name ().as_string ();
push (Rust::Token::make_identifier (UNDEF_LOCATION, std::move (id)));
push (Rust::Token::make (COLON, UNDEF_LOCATION));
visit (param.get_type ());
if (param.has_type ())
visit (param.get_type ());
if (param.has_default_value ())
{
push (Rust::Token::make (EQUAL, UNDEF_LOCATION));
visit (param.get_type ());
visit (param.get_default_value ());
}
}

Expand Down
Loading