You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gccrs: Fix RangePattern negative literal bounds being treated as positive.
This commit removes the need for a tracking `has_minus` boolean in `RangePattern`
for both AST and HIR, and just parses the negatable literals as negative values.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h:
* parse_literal_or_range_pattern: Parse literal range bounds as negative values,
instead of positive values with `has_minus` bool.
* parse_range_pattern_bound: Ditto.
* ast/rust-pattern.h (RangePatternBoundLiteral): Remove `has_minus` boolean.
* hir/tree/rust-hir-pattern.h (RangePatternBoundLiteral): Ditto.
* ast/rust-ast-collector.cc (visit(RestPattern)): Ditto.
* ast/rust-pattern.cc (RangePatternBoundLiteral::as_string): Ditto.
* hir/rust-ast-lower-base.cc (lower_range_pattern_bound): Ditto.
* hir/rust-hir-dump.cc(visit(RangePatternBoundLiteral)): Ditto.
* hir/tree/rust-hir.cc(RangePatternBoundLiteral::as_string): Ditto.
Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
0 commit comments