1 2024-01-30 Owen Avery <powerboat9.gamer@gmail.com>
3 * ast/rust-ast-full-decls.h
4 (class TraitImplItem): Remove forward declaration.
5 (class AssociatedItem): Add forward declaration.
7 (class TraitImplItem): Remove.
8 (class TraitItem): Inherit from AssociatedItem.
9 (SingleASTNode::take_trait_impl_item):
10 Return std::unique_ptr<AssociatedItem> instead of
11 std::unique_ptr<TraitImplItem>.
13 (class Function): Inherit from AssociatedItem instead of
15 (class TypeAlias): Likewise.
16 (class ConstantItem): Likewise.
17 (class TraitImpl): Store items as AssociatedItem.
18 * expand/rust-derive-clone.cc
19 (DeriveClone::clone_fn): Return std::unique_ptr<AssociatedItem>.
20 (DeriveClone::clone_impl): Take std::unique_ptr<AssociatedItem>.
21 * expand/rust-derive-clone.h
22 (DeriveClone::clone_fn): Return std::unique_ptr<AssociatedItem>.
23 (DeriveClone::clone_impl): Take std::unique_ptr<AssociatedItem>.
24 * expand/rust-expand-visitor.cc
25 (ExpandVisitor::visit): Handle changes to
26 SingleASTNode::take_trait_impl_item.
27 * parse/rust-parse-impl.h
28 (Parser::parse_impl): Parse TraitImpl as containing AssociatedItem.
29 (Parser::parse_trait_impl_item): Return
30 std::unique_ptr<AssociatedItem>.
31 (Parser::parse_trait_impl_function_or_method): Likewise.
33 (Parser::parse_trait_impl_item): Return
34 std::unique_ptr<AssociatedItem>.
35 (Parser::parse_trait_impl_function_or_method): Likewise.
37 2024-01-30 Robert Goss <goss.robert@gmail.com>
39 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit) Add additional check
40 * typecheck/rust-hir-type-check-struct-field.h: A helper method to make error added
41 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve) Update message
43 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
45 * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): fix for lifetimes
46 (ASTLowerWhereClauseItem::visit): fix for lifetimes
48 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
50 * parse/rust-parse-impl.h (Parser::parse_where_clause): fix parsing
51 (Parser::parse_where_clause_item): fix parsing
52 (Parser::parse_type_bound_where_clause_item): fix parsing
53 (Parser::parse_trait_bound): fix parsing
54 * parse/rust-parse.h: fix parsing
56 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
58 * lex/rust-lex.cc (Lexer::dump_and_skip):
61 2024-01-30 Owen Avery <powerboat9.gamer@gmail.com>
63 * ast/rust-ast-fragment.cc
64 (Fragment::assert_single_fragment): Update.
66 (class TraitImplItem): Move definition before that of TraitItem.
68 Inherit from TraitImplItem instead of AssociatedItem.
69 (class SingleASTNode): Unify handling of associated items.
70 (SingleASTNode::take_assoc_item): Move from...
71 (SingleASTNode::take_impl_item): ...here, but leave stub calling
72 take_assoc_item behind.
73 (SingleASTNode::take_trait_item):
74 Cast associated item to TraitItem.
75 (SingleASTNode::take_trait_impl_item):
76 Cast associated item to TraitImplItem.
78 (SingleASTNode::SingleASTNode):
79 Unify handling of associated items.
80 (SingleASTNode::operator=): Likewise.
81 (SingleASTNode::accept_vis): Likewise.
82 (SingleASTNode::is_error): Likewise.
83 (SingleASTNode::as_string): Likewise.
85 (class Function): Remove direct inheritence from AssociatedItem.
86 (class ConstantItem): Likewise.
88 (class MacroInvocation):
89 Remove direct inheritence from AssociatedItem and TraitImplItem.
91 2024-01-30 Robert Goss <goss.robert@gmail.com>
93 * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool
94 * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields
96 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
98 * parse/rust-parse-impl.h (Parser::parse_inherent_impl_item):
99 Added switch-case for ASYNC token.
101 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
103 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
104 Enclose const in single quotes.
106 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
108 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
109 Added check for `async` functions inside trait.
110 * parse/rust-parse-impl.h (Parser::parse_trait_item):
111 Added switch-case for ASYNC token.
113 2024-01-30 Nirmal Patel <nirmal@nirmal.dev>
115 * lex/rust-lex.cc (Lexer::parse_byte_string): Handle newline
116 while parsing byte strings
117 (Lexer::parse_string): Handle newline while parsing strings
119 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
121 * backend/rust-compile-expr.cc (CompileExpr::visit): Use new API.
122 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Use new API.
123 * typecheck/rust-tyty-cmp.h: Remove old API.
124 * typecheck/rust-tyty.cc (FnPtr::is_equal): Use new API.
125 * typecheck/rust-tyty.h: Remove old API.
126 * typecheck/rust-unify.cc (UnifyRules::expect_fnptr): Use new API.
128 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
130 * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): For lifetimes.
132 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
134 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime): Propagate static
136 * hir/rust-ast-lower-base.h: Propagate static requirement.
137 * hir/rust-ast-lower-implitem.h: Propagate static requirement.
138 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Propagate static requirement.
139 * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): Propagate static requirement.
140 (ASTLoweringType::visit): Propagate static requirement.
141 * hir/rust-ast-lower-type.h: Propagate static requirement.
143 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
145 * parse/rust-parse-impl.h (Parser::parse_generic_param): Lifetime elision control.
146 (Parser::parse_lifetime_where_clause_item): Lifetime elision control.
147 (Parser::parse_type_param_bound): Lifetime elision control.
148 (Parser::parse_lifetime_bounds): Lifetime elision control.
149 (Parser::parse_lifetime): Lifetime elision control.
150 (Parser::parse_path_generic_args): Lifetime elision control.
151 (Parser::parse_self_param): Lifetime elision control.
152 (Parser::parse_break_expr): Lifetime elision control.
153 (Parser::parse_continue_expr): Lifetime elision control.
154 (Parser::parse_reference_type_inner): Lifetime elision control.
155 * parse/rust-parse.h: Lifetime elision control.
157 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
159 * ast/rust-ast.h: Elided lifetime static constructor
160 * ast/rust-type.h: Default lifetime to elided.
161 * parse/rust-parse-impl.h (Parser::parse_lifetime_param): Use elided lifetime.
162 (Parser::parse_lifetime): Use elided lifetime/
163 (Parser::lifetime_from_token): Use elided lifetime.
164 (Parser::parse_self_param): Use elided lifetime.
165 (Parser::parse_reference_type_inner): Use elided lifetime.
167 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
169 * parse/rust-parse-impl.h (Parser::lifetime_from_token): Fix matched pattern.
171 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
173 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
174 Added check for `async` function inside trait.
176 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
178 * parse/rust-parse-impl.h (Parser::parse_trait_impl_item):
179 Handled `async` items
181 2024-01-30 Raiki Tamura <tamaron1203@gmail.com>
183 * Make-lang.in: Add .o files
184 * backend/rust-mangle.cc (struct V0Path): moved to splitted files
186 (legacy_mangle_name): Likewise.
187 (legacy_mangle_canonical_path): Likewise.
188 (legacy_hash): Likewise.
189 (v0_tuple_prefix): Likewise.
190 (v0_numeric_prefix): Likewise.
191 (v0_simple_type_prefix): Likewise.
192 (v0_complex_type_prefix): Likewise.
193 (v0_integer_62): Likewise.
194 (v0_opt_integer_62): Likewise.
195 (v0_disambiguator): Likewise.
196 (v0_type_prefix): Likewise.
197 (v0_generic_args): Likewise.
198 (v0_identifier): Likewise.
199 (v0_type_path): Likewise.
200 (v0_function_path): Likewise.
201 (v0_scope_path): Likewise.
202 (v0_crate_path): Likewise.
203 (v0_inherent_or_trait_impl_path): Likewise.
204 (v0_closure): Likewise.
205 (legacy_mangle_item): Likewise.
206 (v0_mangle_item): Likewise.
207 * backend/rust-mangle.h (legacy_mangle_item): Likewise.
208 (v0_mangle_item): Likewise.
209 * backend/rust-mangle-legacy.cc: New file.
210 * backend/rust-mangle-v0.cc: New file.
212 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
214 * checks/errors/borrowck/rust-bir-place.h: Cleanup.
215 * checks/errors/borrowck/rust-borrow-checker.h: Cleanup.
217 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
219 * typecheck/rust-tyty.h (BaseType::is): Cast API.
220 (SubstitutionRef>): Cast API.
221 (BaseType::as): Cast API.
222 (BaseType::try_as): Cast API.
224 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
226 * typecheck/rust-tyty.h (class ClosureType): Inherit interface.
227 (class FnPtr): Inherit interface.
228 (class FnType): Inherit interface.
229 (class CallableTypeInterface): New interface.
230 (BaseType::is): Detect interface members API.
232 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
234 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Refactor.
236 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
238 * checks/errors/borrowck/rust-bir-builder-internal.h: Replace nodiscard.
239 * checks/errors/borrowck/rust-bir-place.h: Replace nodiscard.
241 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
243 * typecheck/rust-tyty.h: Fix nodiscard to warn unused.
245 2024-01-30 Jakub Dupak <dev@jakubdupak.com>
247 * hir/tree/rust-hir-item.h: Ad lifetime getter.
248 * hir/tree/rust-hir-path.h: Make getter const ref.
249 * hir/tree/rust-hir.h: Const ref and new getter.
251 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
253 * Make-lang.in (GRS_OBJS): Add rust-attribs.o.
254 * backend/rust-builtins.cc (builtin_const, builtin_noreturn)
255 (builtin_novops): Remove.
256 (BuiltinsContext::lookup_simple_builtin): Adjust.
257 (BuiltinsContext::setup_overflow_fns): Remove.
258 (BuiltinsContext::define_function_type): Set builtin type to
259 errormark so the builtin is considered unavailable.
260 (BuiltinsContext::setup_math_fns): Remove.
261 (BuiltinsContext::setup_atomic_fns): Remove.
262 (build_c_type_nodes): Refactor based on D frontend.
263 (BuiltinsContext::define_builtin_types): Likewise.
264 (DEF_PRIMITIVE_TYPE): New.
265 (DEF_FUNCTION_TYPE_0): New.
266 (DEF_FUNCTION_TYPE_1): New.
267 (DEF_FUNCTION_TYPE_2): New.
268 (DEF_FUNCTION_TYPE_3): New.
269 (DEF_FUNCTION_TYPE_4): New.
270 (DEF_FUNCTION_TYPE_5): New.
271 (DEF_FUNCTION_TYPE_6): New.
272 (DEF_FUNCTION_TYPE_7): New.
273 (DEF_FUNCTION_TYPE_8): New.
274 (DEF_FUNCTION_TYPE_9): New.
275 (DEF_FUNCTION_TYPE_10): New.
276 (DEF_FUNCTION_TYPE_11): New.
277 (DEF_FUNCTION_TYPE_VAR_0): New.
278 (DEF_FUNCTION_TYPE_VAR_1): New.
279 (DEF_FUNCTION_TYPE_VAR_2): New.
280 (DEF_FUNCTION_TYPE_VAR_3): New.
281 (DEF_FUNCTION_TYPE_VAR_4): New.
282 (DEF_FUNCTION_TYPE_VAR_5): New.
283 (DEF_FUNCTION_TYPE_VAR_6): New.
284 (DEF_FUNCTION_TYPE_VAR_7): New.
285 (DEF_FUNCTION_TYPE_VAR_11): New.
286 (DEF_POINTER_TYPE): New.
287 (BuiltinsContext::setup): Adjust.
288 (BuiltinsContext::define_builtin_attributes): New.
289 (DEF_ATTR_NULL_TREE): New.
291 (DEF_ATTR_STRING): New.
292 (DEF_ATTR_IDENT): New.
293 (DEF_ATTR_TREE_LIST): New.
294 (handle_flags): Remove.
295 (BuiltinsContext::define_builtins): New.
297 (BuiltinsContext::define_builtin): Remove.
298 (BuiltinsContext::register_rust_mappings): New. Add all missing
300 (BuiltinsContext::lookup_gcc_builtin): Adjust.
301 * backend/rust-builtins.h (DEF_PRIMITIVE_TYPE): New.
302 (DEF_FUNCTION_TYPE_0): New.
303 (DEF_FUNCTION_TYPE_1): New.
304 (DEF_FUNCTION_TYPE_2): New.
305 (DEF_FUNCTION_TYPE_3): New.
306 (DEF_FUNCTION_TYPE_4): New.
307 (DEF_FUNCTION_TYPE_5): New.
308 (DEF_FUNCTION_TYPE_6): New.
309 (DEF_FUNCTION_TYPE_7): New.
310 (DEF_FUNCTION_TYPE_8): New.
311 (DEF_FUNCTION_TYPE_9): New.
312 (DEF_FUNCTION_TYPE_10): New.
313 (DEF_FUNCTION_TYPE_11): New.
314 (DEF_FUNCTION_TYPE_VAR_0): New.
315 (DEF_FUNCTION_TYPE_VAR_1): New.
316 (DEF_FUNCTION_TYPE_VAR_2): New.
317 (DEF_FUNCTION_TYPE_VAR_3): New.
318 (DEF_FUNCTION_TYPE_VAR_4): New.
319 (DEF_FUNCTION_TYPE_VAR_5): New.
320 (DEF_FUNCTION_TYPE_VAR_6): New.
321 (DEF_FUNCTION_TYPE_VAR_7): New.
322 (DEF_FUNCTION_TYPE_VAR_11): New.
323 (DEF_POINTER_TYPE): New.
324 (DEF_ATTR_NULL_TREE): New.
326 (DEF_ATTR_STRING): New.
327 (DEF_ATTR_IDENT): New.
328 (DEF_ATTR_TREE_LIST): New.
329 * backend/rust-compile-intrinsic.cc (Intrinsics::compile): Add
331 (op_with_overflow_inner): Adjust.
332 (copy_handler_inner): Adjust.
333 (prefetch_data_handler): Adjust.
334 (build_atomic_builtin_name): Adjust.
335 (atomic_load_handler_inner): Adjust.
336 (uninit_handler): Adjust.
337 (move_val_init_handler): Adjust.
338 (expect_handler_inner): Adjust.
339 * rust-gcc.cc (fetch_overflow_builtins): Adjust.
340 * rust-lang.cc (rust_localize_identifier): Adjust.
341 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): New.
342 * rust-attribs.cc: New file.
344 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
346 * expand/rust-cfg-strip.cc (CfgStrip::visit): Change calls from visitor
348 (CfgStrip::go): Add call to visit crate.
349 * expand/rust-cfg-strip.h (class CfgStrip): Update prototypes and
351 * ast/rust-ast-visitor.cc: add WhereClause condition check.
353 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
355 * expand/rust-expand-visitor.cc (ExpandVisitor::go): Add call to visit
357 (ExpandVisitor::visit): Remove some visit functions in favor of their
358 default visitor counterpart.
359 * expand/rust-expand-visitor.h (class ExpandVisitor): Inherit from
360 default visitor and remove now useless function prototypes.
362 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
364 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
365 duplicated functions.
366 * resolve/rust-default-resolver.h (class DefaultResolver): Make the
367 default resolver inherit from the default visitor.
369 2024-01-30 Owen Avery <powerboat9.gamer@gmail.com>
371 * checks/errors/rust-feature.cc
372 (Feature::name_hash_map):
373 Add entries for Name::LANG_ITEMS and Name::NO_CORE.
374 * checks/errors/rust-feature.h
375 (Feature::Name::LANG_ITEMS): New.
376 (Feature::Name::NO_CORE): New.
378 2024-01-30 Kushal Pal <kushalpal109@gmail.com>
380 * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
381 Renamed `WIN64` to `WIN_64`
382 * util/rust-abi.cc (get_abi_from_string): Likewise
383 (get_string_from_abi): Likewise
384 * util/rust-abi.h (enum ABI): Likewise
386 2024-01-30 Nobel Singh <nobel2073@gmail.com>
388 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
389 check for const funtion.
391 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
393 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
394 a validation check and emit an error depending on the context.
396 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
398 * ast/rust-ast-collector.cc (TokenCollector::visit): Adapt defintion
400 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
401 * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
402 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
403 * hir/rust-ast-lower-implitem.h: Likewise.
404 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
405 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
406 * resolve/rust-ast-resolve-stmt.h: Likewise.
407 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
408 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
409 * parse/rust-parse-impl.h: Allow empty function body during parsing.
410 * ast/rust-ast.cc (Function::Function): Constructor now take an
411 optional for the body.
412 (Function::operator=): Adapt to new optional member.
413 (Function::as_string): Likewise.
414 * ast/rust-item.h (class Function): Make body optional and do not
415 rely on nullptr anymore.
417 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
419 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_generic_args):
421 (EarlyNameResolver::resolve_qualified_path_type): Likewise.
422 (EarlyNameResolver::visit): Add a top level visit function for crate
423 and remove duplicated code.
424 * resolve/rust-early-name-resolver.h (class EarlyNameResolver): Update
425 overriden function list.
427 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
429 * util/rust-attributes.cc (AttributeChecker::visit): Add visit function
431 * util/rust-attributes.h (class AttributeChecker): Update function
434 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
436 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Add a visit
437 function for the crate level.
438 (FeatureGate::check): Add call to crate visit.
439 * checks/errors/rust-feature-gate.h (class FeatureGate): Remove now
440 useless visit functions (traversal only).
442 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
444 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
446 * checks/errors/rust-ast-validation.h: Add visit function prototype.
448 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
450 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
453 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
455 * parse/rust-parse-impl.h (Parser::parse_vis_item): Allow parsing async
457 (Parser::parse_async_item): Account for const offset during async
460 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
462 * ast/rust-ast-builder.cc (AstBuilder::fn_qualifiers): Change
463 constructor to match the new arguments.
464 * ast/rust-ast-collector.cc (TokenCollector::visit): Change behavior
465 to handle both const and async specifiers at the same time.
466 * ast/rust-ast.cc (FunctionQualifiers::as_string): Likewise.
467 * ast/rust-item.h (class FunctionQualifiers): Remove AsyncConstStatus
468 and replace it with both Async and Const status. Also change the safety
469 arguments to use an enum instead of a boolean.
470 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
471 Update constructor call.
472 * hir/tree/rust-hir-item.h: Add Const and Async status, remove
473 AsyncConstStatus, update the constructor.
474 * hir/tree/rust-hir.cc (FunctionQualifiers::as_string): Update with
476 * parse/rust-parse-impl.h (Parser::parse_function_qualifiers): Update
478 * util/rust-common.h (enum Mutability): Make an enum class.
479 (enum class): Add Async and Const enum class to avoid booleans.
480 (enum Unsafety): Change to an enum class.
482 2024-01-30 Owen Avery <powerboat9.gamer@gmail.com>
484 * ast/rust-ast-full-decls.h
485 (class InherentImplItem): Remove.
487 (class InherentImplItem): Remove.
488 (class SingleASTNode):
489 Store pointer to AssociatedItem instead of InherentImplItem.
491 (SingleASTNode::SingleASTNode):
492 Use clone_associated_item instead of clone_inherent_impl_item.
493 (SingleASTNode::operator=): Likewise.
495 (class InherentImpl):
496 Use AssociatedItem rather than InherentImplItem.
497 (class Function): Likewise.
498 (class ConstantItem): Likewise.
500 (class MacroInvocation): Likewise.
501 * expand/rust-expand-visitor.cc
502 (ExpandVisitor::visit): Likewise.
503 * parse/rust-parse-impl.h
504 (Parser::parse_impl): Likewise.
505 (Parser::parse_inherent_impl_item): Likewise.
506 (Parser::parse_inherent_impl_function_or_method): Likewise.
508 (Parser::parse_inherent_impl_item): Likewise.
509 (Parser::parse_inherent_impl_function_or_method): Likewise.
511 2024-01-30 Philip Herron <herron.philip@googlemail.com>
513 * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block): removed
514 * backend/rust-compile-base.h: update header
515 * backend/rust-compile-block.cc (CompileBlock::visit): remove old logic
516 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function): likewise
517 * backend/rust-compile-stmt.cc (CompileStmt::visit): likewise
518 * backend/rust-compile-var-decl.h: ensure we setup tuple bindings correctly
520 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
522 * ast/rust-item.h: Add safety getter to modules.
523 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Check
524 a module's safety and emit an error when meeting an unsafe module.
525 * checks/errors/rust-ast-validation.h: Add function prototype.
526 * parse/rust-parse-impl.h (Parser::parse_module): Move the module locus
527 to the first token instead of the mod keyword.
529 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
531 * parse/rust-parse-impl.h (Parser::parse_vis_item): Dispatch to parse
532 module when meeting an unsafe module.
533 (Parser::parse_module): Set unsafe status when the parser encounter an
536 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
538 * ast/rust-item.h: Add safety status to Modules in the AST.
539 * parse/rust-parse-impl.h (Parser::parse_module): Adapt constructors.
541 2024-01-30 Owen Avery <powerboat9.gamer@gmail.com>
543 * hir/tree/rust-hir-pattern.h
544 (class TupleItems): New.
545 (class TupleStructItems): Inherit from TupleItems.
546 (class TuplePatternItems): Likewise.
548 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
550 * resolve/rust-toplevel-name-resolver-2.0.cc
551 (TopLevel::insert_or_error_out): New functions.
552 (TopLevel::handle_use_dec): New function.
553 (flatten_rebind): Likewise.
554 (flatten_list): Likewise.
555 (flatten_glob): Likewise.
557 (TopLevel::visit): Visit various `use` declaration nodes.
558 * resolve/rust-toplevel-name-resolver-2.0.h: Declare functions and
561 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
563 * resolve/rust-early-name-resolver-2.0.cc
564 (Early::visit): Remove visitors.
565 * resolve/rust-early-name-resolver-2.0.h: Likewise.
567 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
569 * ast/rust-item.h (class UseTree): Add `node_id` member.
571 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
573 * resolve/rust-toplevel-name-resolver-2.0.cc
574 (TopLevel::insert_or_error_out): Add documentation comment.
575 (TopLevel::go): Likewise.
577 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
579 * resolve/rust-early-name-resolver-2.0.cc
580 (Early::insert_once): New function.
581 (Early::visit): Likewise.
582 * resolve/rust-early-name-resolver-2.0.h: Likewise.
584 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
586 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Store mappings
587 after having resolved them.
588 * resolve/rust-late-name-resolver-2.0.h: Add `TypePath` visitor.
590 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
592 * resolve/rust-late-name-resolver-2.0.cc
593 (Late::setup_builtin_types): New function.
594 (Late::go): Setup builtin types.
595 * resolve/rust-late-name-resolver-2.0.h:
596 * resolve/rust-name-resolution-context.cc
597 (NameResolutionContext::map_usage): New function.
598 * resolve/rust-name-resolution-context.h: Likewise.
600 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
602 * resolve/rust-name-resolution-context.h: Store a reference to the
604 * resolve/rust-name-resolution-context.cc
605 (NameResolutionContext::NameResolutionContext): Likewise.
607 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
609 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use
610 the DefaultResolver in the toplevel visitor.
612 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
614 * Make-lang.in: Compile late name resolver.
615 * resolve/rust-late-name-resolver-2.0.cc: New file.
616 * resolve/rust-late-name-resolver-2.0.h: New file.
618 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
620 * resolve/rust-name-resolution-context.h: Add a Labels stack.
622 2024-01-30 M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
624 * parse/rust-parse-impl.h (Parser::parse_item): Likewise.
625 (Parser::parse_vis_item): Likewise.
626 (Parser::parse_async_item): Likewise.
627 * parse/rust-parse.h: Made declaration for parse_async_item.
629 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
631 * lex/rust-lex.cc (Lexer::classify_keyword): Update keyword map name.
632 * lex/rust-token.h (enum PrimitiveCoreType): Remove some deprecated
634 * util/rust-keyword-values.cc (get_keywords): Update the keyword map
636 (RS_TOKEN): Define as empty
637 (RS_TOKEN_KEYWORD_2015): Add the emission value.
638 (RS_TOKEN_KEYWORD_2018): Likewise.
639 * util/rust-keyword-values.h (RS_KEYWORD_LIST): Introduce the keyword
641 (RS_TOKEN_KEYWORD_2018): Define multiple new keywords.
643 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
645 * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value.
646 * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Likewise.
647 (Parser::parse_item): Likewise.
648 (Parser::parse_vis_item): Likewise.
649 (Parser::parse_macro_rules_def): Likewise.
650 (Parser::parse_union): Likewise.
651 (Parser::parse_trait_impl_item): Likewise.
652 (Parser::parse_stmt): Likewise.
653 (Parser::parse_stmt_or_expr): Likewise.
655 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
657 * util/rust-keyword-values.h (class WeakKeywords): Add new class with
658 weak keyword constexpr.
660 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
662 * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value
664 * ast/rust-ast.h: Likewise.
665 * parse/rust-parse-impl.h (Parser::parse_path_ident_segment): Likewise.
666 (Parser::parse_macro_match_fragment): Likewise.
667 (Parser::parse_extern_crate): Likewise.
668 (Parser::parse_use_tree): Likewise.
669 (Parser::parse_const_item): Likewise.
670 (Parser::parse_literal_expr): Likewise.
671 (Parser::parse_maybe_named_param): Likewise.
672 (Parser::parse_pattern_no_alt): Likewise.
673 (Parser::left_denotation): Likewise.
674 (Parser::parse_path_in_expression_pratt): Likewise.
676 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
678 * lex/rust-token.h (enum PrimitiveCoreType): Add await keyword
681 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
683 * lex/rust-token.h (enum PrimitiveCoreType): Change macro for
684 underscore in token list.
686 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
688 * lex/rust-token.h (enum PrimitiveCoreType): Change enum macro calls.
689 (RS_TOKEN_KEYWORD): Remove generic token keyword macro.
690 (RS_TOKEN_KEYWORD_2015): Introduce keywords for edition 2015.
691 (RS_TOKEN_KEYWORD_2018): Likewise with edition 2018.
692 * lex/rust-token.cc (RS_TOKEN_KEYWORD): Remove old macro definition.
693 (RS_TOKEN_KEYWORD_2015): Replace with 2015 definition...
694 (RS_TOKEN_KEYWORD_2018): ... and 2018 definition.
695 * util/rust-keyword-values.cc (RS_TOKEN_KEYWORD): Likewise.
696 (RS_TOKEN_KEYWORD_2015): Likewise.
697 (RS_TOKEN_KEYWORD_2018): Likewise.
698 * util/rust-keyword-values.h (RS_TOKEN_KEYWORD): Likewise.
699 (RS_TOKEN_KEYWORD_2015): Likewise.
700 (RS_TOKEN_KEYWORD_2018): Likewise.
702 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
704 * lex/rust-token.h (enum PrimitiveCoreType): Change keyword suffix from
706 * ast/rust-ast-collector.cc (TokenCollector::visit): Update suffix to
707 match the new declaration.
708 * lex/rust-lex.cc (Lexer::parse_raw_identifier): Likewise.
709 * parse/rust-parse-impl.h (can_tok_start_type): Likewise.
710 (Parser::parse_item): Likewise.
711 (Parser::parse_vis_item): Likewise.
712 (Parser::parse_extern_crate): Likewise.
713 (Parser::parse_function): Likewise.
714 (Parser::parse_function_qualifiers): Likewise.
715 (Parser::parse_struct): Likewise.
716 (Parser::parse_enum): Likewise.
717 (Parser::parse_static_item): Likewise.
718 (Parser::parse_trait_item): Likewise.
719 (Parser::parse_inherent_impl_item): Likewise.
720 (Parser::parse_trait_impl_item): Likewise.
721 (Parser::parse_extern_block): Likewise.
722 (Parser::parse_external_item): Likewise.
723 (Parser::parse_stmt): Likewise.
724 (Parser::parse_return_expr): Likewise.
725 (Parser::parse_match_expr): Likewise.
726 (Parser::parse_type): Likewise.
727 (Parser::parse_for_prefixed_type): Likewise.
728 (Parser::parse_type_no_bounds): Likewise.
729 (Parser::parse_stmt_or_expr): Likewise.
730 * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewie.
731 * util/rust-token-converter.cc (convert): Likewise.
733 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
735 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
736 zero field check during ast validation pass.
737 * checks/errors/rust-ast-validation.h: Add union visit function
740 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
742 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
743 ast validation pass to reject variadic arguments on regular functions.
745 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
747 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add auto
748 trait associated item check in AST validation pass.
749 * parse/rust-parse-impl.h: Remove old error emission done during
752 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
754 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Reject
755 auto traits with super traits.
757 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
759 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
760 check for generics on auto traits.
761 * checks/errors/rust-ast-validation.h: Add visit function prototype.
763 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
765 * resolve/rust-forever-stack.hxx: Remove debug log.
767 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
769 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Format.
771 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
773 * resolve/rust-forever-stack.h: New method.
774 * resolve/rust-forever-stack.hxx: Likewise.
776 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
778 * resolve/rust-forever-stack.h: New method.
779 * resolve/rust-forever-stack.hxx: Likewise.
781 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
783 * resolve/rust-forever-stack.hxx: Do not copy segment when
784 dereferencing iterator in `find_starting_point`.
786 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
788 * resolve/rust-forever-stack.h: Fix `ForeverStack::resolve_path`
790 * resolve/rust-forever-stack.hxx: Likewise.
791 * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Use new API.
792 (Early::visit_attributes): Likewise.
794 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
796 * resolve/rust-forever-stack.hxx: Add specific behavior for
797 `ForeverStack::get` when dealing with labels.
799 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
801 * resolve/rust-forever-stack.h: Improve resolve_path API.
802 * resolve/rust-forever-stack.hxx: Likewise and fix implementation.
804 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
806 * resolve/rust-rib.h: Add Namespace enum.
808 2024-01-30 Arthur Cohen <arthur.cohen@embecosm.com>
810 * ast/rust-ast.h: Change Path API to be more consistent.
811 * ast/rust-path.h: Likewise.
812 * ast/rust-ast-collector.cc (TokenCollector::visit): Use new API.
813 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
814 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
815 * resolve/rust-forever-stack.hxx: Likewise.
817 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
819 * parse/rust-parse-impl.h (Parser::parse_function): Early return on
820 unrecoverable errors.
821 (Parser::parse_trait_item): Likewise.
822 (Parser::parse_self_param): Update return type.
823 * parse/rust-parse.h (enum ParseSelfError): Add enumeration to describe
824 different self parameter parsing errors.
826 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
828 * parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop
831 2024-01-30 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
833 * ast/rust-item.h (struct Visibility): Move Visibility from here...
834 * ast/rust-ast.h (struct Visibility): ...to here.
835 * parse/rust-parse-impl.h (Parser::parse_trait_item): Parse visibility
836 before giving it back to the item parsing function.
837 (Parser::parse_trait_type): Add visibility modifier.
838 * parse/rust-parse.h (RUST_PARSE_H): Change function prototype.
840 2024-01-18 Arthur Cohen <arthur.cohen@embecosm.com>
842 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
843 Cast size_t value to unsigned long.
844 * expand/rust-proc-macro.cc (load_macros): Likewise.
845 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
847 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
849 * hir/tree/rust-hir-pattern.h
850 (TupleStructItems::ItemType::RANGE): Rename to...
851 (TupleStructItems::ItemType::RANGED): ...here.
852 (TupleStructItems::ItemType::NO_RANGE): Rename to...
853 (TupleStructItems::ItemType::MULTIPLE): ...here.
854 (TuplePatternItems::TuplePatternItemType): Rename to...
855 (TuplePatternItems::ItemType): ...here.
857 * backend/rust-compile-pattern.cc: Likewise.
858 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
859 * checks/errors/borrowck/rust-bir-builder-pattern.h: Likewise.
861 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
863 * lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Remove
864 additional zero after empty floating point.
865 * parse/rust-parse-impl.h (Parser::left_denotation): Handle float with
866 empty floating point.
868 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
870 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
871 Fix reference to node.
872 * backend/rust-mangle.cc (struct V0Path): Modified to accept closures.
873 (v0_crate_path): Modified to accept closures.
874 (v0_closure): New function to mangle closures.
875 (v0_path): Modified to accept closures
876 * util/rust-mapping-common.h (UNKNOWN_NODEID): Change to UINT32_MAX.
877 (UNKNOWN_HIRID): Change to UINT32_MAX.
879 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
881 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Move from here...
882 * ast/rust-ast-visitor.h: ... to here.
884 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
886 * ast/rust-ast-collector.cc (TokenCollector::visit): Move to header
888 (TokenCollector::visit_items_joined_by_separator): Likewise.
889 (TokenCollector::visit_as_line): Likewise.
890 (TokenCollector::visit_items_as_lines): Likewise.
891 (TokenCollector::visit_items_as_block): Likewise.
892 * ast/rust-ast-collector.h: Add implementation.
894 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
896 * ast/rust-ast-collector.cc (TokenCollector::visit): Add visitor for
897 VariadicParam and remove Self parameter visitor from Function visit.
898 * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_self_param): Remove
900 (CfgStrip::maybe_strip_trait_method_decl): Remove self parameter visit.
901 (CfgStrip::maybe_strip_function_params): Handle new function
903 (CfgStrip::visit): Handle VariadicParam, SelfParam and FunctionParam.
904 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_self_param):
906 (ExpandVisitor::expand_trait_method_decl): Do not visit self parameter.
907 (ExpandVisitor::visit): Add visit for VariadicParam, FunctionParam and
909 (ExpandVisitor::expand_function_params): Visit parameters instead.
910 * expand/rust-expand-visitor.h: Update function prototypes.
911 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Update visit
913 (ResolveTraitItems::visit): Likewise.
914 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
915 Update visit functions with the new visitor functions for VariadicParam
916 SelfParam and FunctionParam.
917 * resolve/rust-early-name-resolver.h: Update function prototypes.
918 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Update visitor
919 according to the new function parameter structures.
920 * ast/rust-ast-visitor.h: Update prototypes and add visitor virtual
921 functions for SelfParam, FunctionParam and VariadicParam.
922 * ast/rust-ast.cc (Function::Function): Move constructor in
923 implementation instead of header.
924 (Function::operator=): Likewise.
925 (Function::as_string): Update function with pointer dereference.
926 (VariadicParam::as_string): Likewise.
927 (TraitFunctionDecl::as_string): Likewise.
928 (TraitMethodDecl::as_string): Likewise.
929 (FunctionParam::accept_vis): Add function for visitor.
930 (SelfParam::accept_vis): Likewise.
931 (VariadicParam::accept_vis): Likewise.
932 (TraitItemFunc::TraitItemFunc): Move constructor to implementation
934 (TraitItemFunc::operator=): Likewise.
935 (TraitItemMethod::TraitItemMethod): Likewise.
936 (TraitItemMethod::operator=): Likewise.
937 * ast/rust-item.h (class Function): Remove self optional member.
938 (class TraitMethodDecl): Likewise.
939 (class TraitFunctionDecl): Likewise.
940 (class Param): Add abstract parameter class.
941 (class SelfParam): Inherit from Param and remove parameter common
943 (class FunctionParam): Likewise.
944 (class VariadicParam): Likewise.
945 (struct Visibility): Move structure declaration.
946 (class VisItem): Likewise.
947 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
948 a self parameter check during AST validation.
949 * checks/errors/rust-ast-validation.h: Add function prototype.
950 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Update function
952 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Rework
953 function for the new parameters.
954 (ASTLoweringBase::visit): Add visit functions for VariadicParam,
955 FunctionParam and SelfParam.
956 * hir/rust-ast-lower-base.h: Update function prototypes.
957 * parse/rust-parse-impl.h (Parser::parse_function): Update function
958 according to new function representation.
959 (Parser::parse_function_param): Return vector of abstract param instead
961 (Parser::parse_method): Update according to new representation.
962 (Parser::parse_trait_item): Likewise.
963 (Parser::parse_self_param): Error out with
964 self pointers and prevent the lexer from eating regular function
965 parameters. Update return type.
966 * parse/rust-parse.h: Update function return types.
967 * ast/rust-ast-collector.h: Add VariadicParam visit prototype.
968 * ast/rust-ast.h (struct Visibility): Move struct declaration.
969 (class VisItem): Likewise.
970 * ast/rust-expr.h: Update included files.
971 * checks/errors/rust-feature-gate.h: Add visitor functions for
972 SelfParam, FunctionParam and VariadicParam.
973 * expand/rust-cfg-strip.h: Update function prototypes.
974 * expand/rust-derive.h: Likewise.
975 * hir/rust-ast-lower-implitem.h: Handle special arguments.
976 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
977 * metadata/rust-export-metadata.cc (ExportContext::emit_function):
979 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add visitor
981 * resolve/rust-ast-resolve-base.h: Update prototypes.
982 * resolve/rust-ast-resolve-stmt.h: Handle new parameter kind.
983 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
984 * resolve/rust-default-resolver.h: Update prototype.
985 * util/rust-attributes.cc (AttributeChecker::visit): Add visitor
986 functions for SelfParam and VariadicParam.
987 * util/rust-attributes.h: Add visit prototypes.
989 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
991 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
992 check for additional named argument as well as variadic argument's
994 * checks/errors/rust-ast-validation.h: Add visit function prototype for
997 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
999 * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Push the new
1000 trait context when visiting a trait.
1001 * ast/rust-ast-visitor.h: Add visit function prototype and TRAIT
1004 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1006 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Change
1007 reported error location to the lifetime location.
1009 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1011 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check if there is
1012 a label before visit.
1013 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Emit an
1014 error when a label has a forbidden name.
1015 * checks/errors/rust-ast-validation.h: Add function prototype.
1017 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1019 * ast/rust-expr.h (class BreakExpr): Change Lifetime to LoopLabel.
1020 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Lower lifetime
1021 inside the label instead.
1022 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve the
1025 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1027 * lex/rust-lex.cc (Lexer::parse_raw_identifier): Use const value.
1028 * parse/rust-parse-impl.h (Parser::parse_simple_path_segment):
1031 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1033 * lex/rust-lex.cc (RS_TOKEN): Remove local map.
1034 (RS_TOKEN_KEYWORD): Likewise.
1035 (Lexer::classify_keyword): Change call to utils.
1036 * util/rust-keyword-values.cc (get_keywords): Add init function.
1037 (RS_TOKEN_KEYWORD): Call to X macro.
1038 * util/rust-keyword-values.h: Change from set to a map.
1040 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1042 * checks/errors/rust-ast-validation.cc (RS_TOKEN): Remove locale set.
1043 (RS_TOKEN_KEYWORD): Likewise.
1044 (ASTValidation::visit): Change keyword set call to the one from utils.
1046 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1048 * Make-lang.in: Add rust-keyword-values.cc to the list.
1049 * util/rust-keyword-values.cc: New file.
1050 * util/rust-keyword-values.h: New file.
1052 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1054 * util/rust-attribute-values.h (RUST_ATTRIBUTES_VALUE_H): Remove old
1056 (RUST_ATTRIBUTE_VALUES_H): Add new one.
1058 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1060 * checks/errors/rust-ast-validation.cc (RS_TOKEN): Add keyword set.
1061 (RS_TOKEN_KEYWORD): Likewise.
1062 (ASTValidation::visit): Add validation on lifetime visit.
1063 * checks/errors/rust-ast-validation.h: Add function prototype.
1065 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1068 (class Method): Remove.
1069 (Function::self_param): New.
1070 (Function::has_self_param): New.
1071 (Function::Function): Initialize self_param.
1072 (Function::operator=): Likewise.
1073 (Function::get_self_param): New.
1075 (Method::as_string): Remove.
1076 (Method::accept_vis): Remove.
1077 * ast/rust-ast-collector.cc
1078 (TokenCollector::visit):
1079 Remove AST::Method visitor, handle self_param in AST::Function visitor.
1080 * ast/rust-ast-collector.h
1081 (TokenCollector::visit): Remove AST::Method visitor.
1082 * ast/rust-ast-full-decls.h (class Method): Remove.
1083 * ast/rust-ast-visitor.h
1084 (ASTVisitor::visit): Remove AST::Method visitor.
1085 (DefaultASTVisitor::visit): Likewise.
1086 * ast/rust-ast-visitor.cc
1087 (DefaultASTVisitor::visit):
1088 Remove AST::Method visitor, handle self_param in AST::Function visitor.
1089 * checks/errors/rust-feature-gate.cc
1090 (FeatureGate::visit): Remove AST::Method visitor.
1091 * checks/errors/rust-feature-gate.h
1092 (FeatureGate::visit): Likewise..
1093 * expand/rust-cfg-strip.cc
1095 Remove AST::Method visitor, handle self_param in AST::Function visitor.
1096 * expand/rust-cfg-strip.h
1097 (CfgStrip::visit): Remove AST::Method visitor.
1098 * expand/rust-derive-clone.cc
1099 (DeriveClone::clone_fn): Return AST::Function instead of AST::Method.
1100 * expand/rust-derive.h (DeriveVisitor::visit): Remove AST::Method visitor.
1101 * expand/rust-expand-visitor.cc
1102 (ExpandVisitor::visit):
1103 Remove AST::Method visitor, handle self_param in AST::Function visitor.
1104 * expand/rust-expand-visitor.h:
1105 (ExpandVisitor::visit): Remove AST::Method visitor.
1106 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
1107 * hir/rust-ast-lower-base.h (ASTLoweringBase::visit): Likewise.
1108 * hir/rust-ast-lower-implitem.h
1109 (ASTLowerImplItem::visit):
1110 Remove AST::Method visitor, handle self_param in AST::Function visitor.
1111 * parse/rust-parse-impl.h: Include optional.h.
1112 (Parser::parse_function): Adjust AST::Function construction.
1113 (Parser::parse_inherent_impl_function_or_method):
1114 Construct AST::Function instead of AST::Method,
1115 adjust AST::Function construction.
1116 (Parser::parse_trait_impl_function_or_method): Likewise.
1117 (Parser::parse_method):
1118 Return std::unique_ptr<AST::Function> instead of AST::Method.
1119 * parse/rust-parse.h
1120 (Parser::parse_method): Likewise.
1121 * resolve/rust-ast-resolve-base.cc
1122 (ResolverBase::visit): Remove AST::Method visitor.
1123 * resolve/rust-ast-resolve-base.h
1124 (ResolverBase::visit): Likewise.
1125 * resolve/rust-ast-resolve-implitem.h
1126 (ResolveToplevelImplItem::visit): Likewise.
1127 * resolve/rust-ast-resolve-item.cc
1128 (ResolveItem::visit): Remove AST::Method visitor,
1129 handle self_param in AST::Function visitor.
1130 * resolve/rust-ast-resolve-item.h
1131 (ResolveItem::visit): Remove AST::Method visitor.
1132 * resolve/rust-default-resolver.cc
1133 (DefaultResolver::visit): Remove AST::Method visitor.
1134 * resolve/rust-default-resolver.h
1135 (DefaultResolver::visit): Likewise.
1136 * resolve/rust-early-name-resolver.cc
1137 (EarlyNameResolver::visit): Remove AST::Method visitor,
1138 handle self_param in AST::Function visitor.
1139 * resolve/rust-early-name-resolver.h
1140 (EarlyNameResolver::visit): Remove AST::Method visitor.
1141 * resolve/rust-toplevel-name-resolver-2.0.cc
1142 (TopLevel::visit): Likewise.
1143 * resolve/rust-toplevel-name-resolver-2.0.h
1144 (TopLevel::visit): Likewise.
1145 * util/rust-attributes.cc
1146 (AttributeChecker::visit): Likewise.
1147 * util/rust-attributes.h
1148 (AttributeChecker::visit): Likewise.
1150 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1152 * parse/rust-parse-impl.h (Parser::parse_named_function_param): Add
1153 new parsing ability.
1155 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1157 * ast/rust-ast.cc (ExternalFunctionItem::as_string): Adapt as_string
1158 function to the new ast representation.
1159 (NamedFunctionParam::as_string): Likewise.
1160 * ast/rust-item.h: Add a function to test whether a FunctionParam has
1162 * expand/rust-cfg-strip.cc (CfgStrip::visit): Adapt cfg strip visitor
1163 for the new variadic arguments.
1164 * hir/rust-ast-lower-extern.h: Adapt lowering to the new variadic
1165 function representation.
1166 * metadata/rust-export-metadata.cc (ExportContext::emit_function):
1167 Change call to constructor.
1168 * parse/rust-parse-impl.h (Parser::parse_named_function_param): Change
1169 NamedFunctionParam parsing to accomodate new variadic representation.
1170 (Parser::parse_external_item): Change external item parsing to use the
1171 new NamedFunctionParam variadics.
1172 * parse/rust-parse.h: Add new parsing function prototypes.
1173 * ast/rust-ast-collector.cc (TokenCollector::visit): Rework token
1174 collection to take into account variadic parameters.
1175 * ast/rust-ast-visitor.cc: Likewise.
1176 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change function
1177 bound to avoid getting the type of a variadic parameter.
1178 * resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
1180 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
1183 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1185 * ast/rust-item.h (class NamedFunctionParam): Add variadic boolean and
1186 another constructor.
1187 * hir/rust-ast-lower-extern.h: Avoid last parameter when variadic.
1189 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1191 * ast/rust-item.h: Add a getter to check if a given function is
1194 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1196 * parse/rust-parse-impl.h (Parser::parse_function_param): Parse
1199 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1201 * ast/rust-item.h (class FunctionParam): Add some informations to
1202 function parameters in order to be able to store variadic argument as
1203 a function parameter.
1205 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1207 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Adapt
1208 the call to the new visit functions.
1209 (ASTValidation::check): Launch the parent class visitor root function.
1210 * checks/errors/rust-ast-validation.h (class ASTValidation): Inherit
1211 from the contextual visitor.
1213 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1215 * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Add multiple
1216 context saving calls.
1217 * ast/rust-ast-visitor.h (class DefaultASTVisitor): Make visit
1219 (class ContextualASTVisitor): Add a stack like container for the
1220 current context chain.
1222 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1224 * Make-lang.in: Add the new visitor object file.
1225 * ast/rust-ast-visitor.h (class DefaultASTVisitor): Create the default
1227 * ast/rust-ast.h: Add a new reference getter for visitor pattern.
1228 * ast/rust-ast-visitor.cc: New file.
1230 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1232 * ast/rust-ast.h: Add some missing mutable reference getters.
1233 * ast/rust-expr.h: Likewise.
1234 * ast/rust-item.h: Likewise.
1235 * ast/rust-path.h: Likewise.
1237 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1239 * ast/rust-ast-collector.cc (TokenCollector::visit): Check for presence
1240 of a type and use the default value instead of the type.
1242 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1244 * checks/errors/rust-ast-validation.cc (ASTValidation::check): Launch
1245 check over the whole given crate.
1246 (ASTValidation::visit): Implement visitor for some members of the ast.
1247 * checks/errors/rust-ast-validation.h: Update some prototype according
1248 to implemented visitor functions. Also add a context tracker.
1250 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1252 * rust-session-manager.cc (Session::compile_crate): Add call to ast
1255 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1257 * lang.opt: Add the new compile options and update the enum values.
1258 * rust-session-manager.h (struct CompileOptions): Add the new steps to
1261 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1263 * Make-lang.in: Add the new object file the list.
1264 * checks/errors/rust-ast-validation.cc: New file.
1265 * checks/errors/rust-ast-validation.h: New file.
1267 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1269 * expand/rust-cfg-strip.cc (CfgStrip::visit): Add expr value check.
1270 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
1271 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
1274 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1276 * ast/rust-ast.h: Move implementation from here...
1277 * ast/rust-ast.cc (SingleASTNode::SingleASTNode): ...to here.
1278 (SingleASTNode::operator=): ...and here...
1279 (SingleASTNode::accept_vis): ...and here...
1280 (SingleASTNode::is_error): ...and here...
1281 (SingleASTNode::as_string): ...also here.
1283 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1285 * ast/rust-ast.h: Add override specifier.
1286 * ast/rust-item.h: Likewise.
1288 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1290 * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::split_current_token):
1291 Add implementation for multiple token split.
1292 * expand/rust-macro-invoc-lexer.h: Add function prototype.
1293 * expand/rust-proc-macro-invoc-lexer.cc (ProcMacroInvocLexer::split_current_token):
1294 Add implementation for 2+ token split for procedural macros.
1295 * expand/rust-proc-macro-invoc-lexer.h: Add function prototype.
1296 * lex/rust-lex.cc (Lexer::split_current_token): Add function to split a
1297 token in multiple other tokens.
1298 * lex/rust-lex.h: Add function prototype for split_current_token.
1299 * parse/rust-parse-impl.h (Parser::left_denotation): Handle float tuple
1300 index identified as a float literal.
1302 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1304 * hir/rust-hir-dump.cc (Dump::visit): Remove obsolete member.
1305 * hir/tree/rust-hir-expr.h (class BorrowExpr): Remove obsolete member.
1306 * hir/tree/rust-hir.cc (BorrowExpr::as_string): Remove obsolete member.
1308 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1310 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Fix typo.
1312 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1314 * backend/rust-compile-expr.cc
1315 (patterns_mergeable): Remove.
1316 (struct PatternMerge): Remove.
1317 (sort_tuple_patterns): Remove.
1318 (simplify_tuple_match): Remove.
1319 (CompileExpr::visit): Modify compilation of MatchExpr.
1320 * backend/rust-compile-pattern.cc
1321 (CompilePatternCaseLabelExpr::visit): Replace with...
1322 (CompilePatternCheckExpr::visit): ...this.
1323 * backend/rust-compile-pattern.h
1324 (class CompilePatternCaseLabelExpr): Replace with...
1325 (class CompilePatternCheckExpr): ...this.
1326 * backend/rust-compile-type.cc
1327 (TyTyResolveCompile::get_implicit_enumeral_node_type):
1328 Make enumeral type equivalent to isize.
1330 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1332 * backend/rust-compile-base.cc (get_attributes): Add documentation for
1334 (get_trait_name): Add documentation for index 1.
1336 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1338 * Make-lang.in: Add gcc/rust/backend/rust-compile-proc-macro.cc to the
1339 list of file to compile.
1340 * backend/rust-compile.cc (attribute_array): Move to
1341 rust-compile-proc-macro.cc
1342 (derive_proc_macro): Likewise.
1343 (bang_proc_macro): Likewise.
1344 (attribute_proc_macro): Likewise.
1345 (proc_macro_payload): Likewise.
1346 (proc_macro): Likewise.
1347 (proc_macro_buffer): Likewise.
1348 (entrypoint): Likewise.
1349 (proc_macro_array): Likewise.
1350 (CompileCrate::add_proc_macro_symbols): Likewise.
1351 * backend/rust-compile-proc-macro.cc: New file.
1353 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1355 * backend/rust-compile.cc (proc_macro_buffer): Update type builder with
1356 array length information.
1357 (proc_macro_array): Update type initializer with array length
1360 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1362 * backend/rust-compile.cc (build_attribute_array): Renamed from...
1363 (attribute_array): ...to attribute array.
1364 (build_derive_proc_macro): Likewise from...
1365 (derive_proc_macro): ... to derive_proc_macro.
1366 (build_bang_proc_macro): Likewise from...
1367 (bang_proc_macro): ...to bang_proc_macro.
1368 (build_attribute_proc_macro): Likewise from...
1369 (attribute_proc_macro): ... to attribute_proc_macro.
1370 (build_proc_macro_payload): Likewise from...
1371 (proc_macro_payload): to proc_macro_payload.
1372 (build_proc_macro): Likewise from...
1373 (proc_macro): ...to proc_macro.
1374 (build_proc_macro_buffer): Likewise from...
1375 (proc_macro_buffer): ... to proc_macro_buffer.
1376 (build_entrypoint): Likewise from...
1377 (entrypoint): ...to entrypoint.
1378 (init_derive_proc_macro): Renamed to it's shorter counterpart.
1379 (init_attribute_proc_macro): Likewise.
1380 (init_bang_proc_macro): Likewise.
1381 (init_proc_macro): Likewise.
1382 (initialize_proc_macro_array): Likewise.
1383 (proc_macro_array): Likewise.
1384 (CompileCrate::add_proc_macro_symbols): Update function calls.
1386 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1388 * backend/rust-compile-base.h: Make static function address_expression
1390 * backend/rust-compile.cc (CompileCrate::add_proc_macro_symbols): Add
1391 new global variable in export function.
1392 (build_bang_proc_macro): Add a function to build the bang proc macro
1394 (build_proc_macro): Add a function to build the proc macro structure
1396 (build_proc_macro_payload): Add a function to build the proc macro
1397 union used in proc macro structures.
1398 (init_derive_proc_macro): Add a function to initialize custom derive
1400 (init_attribute_proc_macro): Add a function to initialize attribute
1402 (init_bang_proc_macro): Add a function to initialize bang proc macros.
1403 (init_proc_macro): Add a function to initialize proc macro structures.
1404 (initialize_proc_macro_array): Add a function to initialize the proc
1406 (CompileCrate::add_proc_macro_symbols): Add call to the new functions
1407 to correctly initialize proc macros as well as their entrypoint.
1409 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1411 * expand/rust-proc-macro.cc (CustomDeriveProcMacro::CustomDeriveProcMacro):
1412 Remove constant string declaration.
1413 (load_macros_array): Add call to the new generation function.
1414 (generate_proc_macro_decls_symbol): Add a new function to generate the
1415 entrypoint symbol name from the stable crate id.
1416 (PROC_MACRO_DECLS_FMT_ARGS):
1417 New macro to keep formats arguments in sync between each call.
1418 * expand/rust-proc-macro.h (generate_proc_macro_decls_symbol): Add
1420 * rust-system.h: Include <iomanip>.
1422 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1424 * backend/rust-compile.cc (build_attribute_array): Add a function to
1425 build the attribute array type.
1426 (build_derive_proc_macro): Add a function to build the derive proc
1428 (build_bang_proc_macro): Add a function to build the bang proc macro
1430 (build_attribute_proc_macro): Add a function to build the attribute
1432 (build_proc_macro): Add a function to build the proc macro tagged union
1434 (build_proc_macro_buffer): Add a function to build the proc macro
1436 (build_entrypoint): Add a function to build the proc macro entrypoint
1438 * backend/rust-compile.h: Add function prototype.
1440 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1442 * backend/rust-compile-context.h: Add getters.
1444 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1446 * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
1447 Make the function non static in order to be able to access the
1448 compile context. Also add the whole proc macro infomrmation
1450 (get_attributes): Add a function to retrieve the different
1451 attributes from a derive procedural macro definition attribute.
1452 (get_trait_name): Add a function to retrieve the trait name from
1453 a derive procedural macro definition attribute.
1454 * backend/rust-compile-base.h: Add function prototypes.
1456 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1458 * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
1459 Reformat uncorrectly formatted comments.
1461 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1463 * backend/rust-compile-context.h (struct CustomDeriveInfo): Add
1464 new derive procedural macro metadata information holder for
1467 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1469 * ast/rust-ast.h: Add const getter.
1471 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1473 * backend/rust-compile-base.cc (handle_proc_macro_common): Add
1474 new attribute "gccrs_proc_macro" to all procedural macro
1476 (get_abi): Add a function to retrieve the correct ABI depending
1477 on wether the function is a proc macro or not.
1479 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1481 * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
1482 Add proc macro handlers dispatch.
1483 (handle_proc_macro_common): Add a function for common behavior
1484 between all kinds of proc macros.
1485 * backend/rust-compile-base.h: Add function prototypes.
1487 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1489 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop): Move.
1490 (ExprStmtBuilder::get_label_ctx): Move.
1491 (ExprStmtBuilder::get_unnamed_loop_ctx): Moved.
1492 (ExprStmtBuilder::visit): BIR improvements.
1493 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Refactor.
1494 * checks/errors/borrowck/rust-bir-builder-internal.h (class LifetimeResolver):
1496 (struct BuilderContext): Move.Refactor.
1497 (optional_from_ptr): Map on null ptr.
1498 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h (class LazyBooleanExprBuilder):
1500 * checks/errors/borrowck/rust-bir-builder-pattern.h: Refactor.
1501 * checks/errors/borrowck/rust-bir-builder-struct.h (class StructBuilder): Refactor.
1502 * checks/errors/borrowck/rust-bir-builder.h: Refactor.
1503 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Refactor.
1504 (Dump::visit): Refactor.
1505 (Dump::visit_place): Refactor.
1506 (Dump::visit_move_place): Refactor.
1507 (Dump::visit_lifetime): Refactor.
1508 * checks/errors/borrowck/rust-bir-dump.h: Refactor.
1509 * checks/errors/borrowck/rust-bir-place.h: Refactor.
1511 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1513 * checks/errors/borrowck/dev-notes.md: New file.
1515 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1517 * checks/errors/borrowck/bir-design-notes.md: New file.
1519 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1521 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Use goto.
1522 * checks/errors/borrowck/rust-bir-builder-internal.h: Explicit goto.
1523 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Explicit goto.
1525 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1527 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Continue.
1528 (ExprStmtBuilder::setup_loop): Continue.
1530 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1532 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Detech infinite loops.
1534 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1536 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Push ctx.
1537 (ExprStmtBuilder::setup_loop): Common loop infractructure setup.
1538 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Loop ctx.
1539 * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext): Loop ctx.
1541 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1543 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Improve jumps dump.
1544 (Dump::visit): Improve jumps dump.
1545 * checks/errors/borrowck/rust-bir-dump.h (class Dump): Improve jumps dump.
1547 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1549 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Simplify cfg logic.
1550 (Dump::go): Run simplify cfg.
1551 * checks/errors/borrowck/rust-bir-dump.h: Option to simplify cfg.
1553 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1555 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Use new print.
1556 (print_comma_separated): Comma separation print.
1557 (Dump::visit): Use new print.
1559 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1561 * Make-lang.in: Build BIR dump.
1562 * checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Cross-platform mkdir.
1563 (dump_function_bir): Save dump to file.
1564 (BorrowChecker::go): Run dump during borrowck.
1565 * checks/errors/borrowck/rust-bir-dump.cc: New file.
1566 * checks/errors/borrowck/rust-bir-dump.h: New file.
1568 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1570 * Make-lang.in: Compile BIR expr visitor.
1571 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Use BIR builder.
1572 * rust-session-manager.cc (Session::compile_crate): Run borrow checker.
1573 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc: New file.
1574 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: New file.
1575 * checks/errors/borrowck/rust-bir-builder-internal.h: New file.
1576 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: New file.
1577 * checks/errors/borrowck/rust-bir-builder-pattern.h: New file.
1578 * checks/errors/borrowck/rust-bir-builder-struct.h: New file.
1579 * checks/errors/borrowck/rust-bir-builder.h: New file.
1581 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1583 * checks/errors/borrowck/rust-borrow-checker.cc: Include to compile new code.
1584 * checks/errors/borrowck/rust-bir-place.h: New file.
1585 * checks/errors/borrowck/rust-bir-visitor.h: New file.
1586 * checks/errors/borrowck/rust-bir.h: New file.
1588 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1590 * lang.opt: CLI flag.
1591 * rust-session-manager.cc (Session::compile_crate): Guard execution.
1593 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1595 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::BorrowChecker): Opt dump.
1596 (BorrowChecker::go): Opt dump.
1597 * checks/errors/borrowck/rust-borrow-checker.h (class BorrowChecker): Opt dump.
1598 * lang.opt: Add compile until borrowcheck.
1599 * rust-session-manager.cc (Session::enable_dump): Add BIR.
1600 (Session::compile_crate): Handle new options.
1601 * rust-session-manager.h (struct CompileOptions): Add BIR.
1603 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1605 * Make-lang.in: Build borrowck.
1606 * checks/errors/borrowck/rust-borrow-checker.cc: New file.
1607 * checks/errors/borrowck/rust-borrow-checker.h: New file.
1608 * checks/errors/borrowck/rust-function-collector.h: New file.
1610 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1612 * ast/rust-pattern.h: Add override modifier to overriding methods.
1614 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1616 * ast/rust-item.h: Add a new constructor for const with no value
1618 * parse/rust-parse-impl.h (Parser::parse_const_item): Allow const with
1619 no expression value.
1621 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1623 * hir/tree/rust-hir-path.h: Avoid copy in getter.
1625 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1627 * backend/rust-compile-expr.cc (CompileExpr::visit): Rename method.
1628 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Rename method.
1629 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Rename method.
1630 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Rename method.
1631 * hir/rust-hir-dump.cc (Dump::visit): Rename method.
1632 * hir/tree/rust-hir-expr.h: Rename method.
1633 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Rename method.
1634 * typecheck/rust-tyty.h: Rename method.
1636 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1638 * backend/rust-compile-base.cc: Rename method.
1639 * backend/rust-compile-expr.cc (sort_tuple_patterns): Rename method.
1640 * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Rename method.
1641 (CompilePatternBindings::visit): Rename method.
1642 (CompilePatternLet::visit): Rename method.
1643 * backend/rust-compile-stmt.cc (CompileStmt::visit): Rename method.
1644 * backend/rust-compile-var-decl.h: Rename method.
1645 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate): Rename method.
1646 * hir/rust-hir-dump.cc (Dump::visit): Rename method.
1647 * hir/tree/rust-hir-path.h: Rename method.
1648 * hir/tree/rust-hir-pattern.h: Rename method.
1649 * hir/tree/rust-hir.h: Rename method.
1650 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::Resolve): Rename method.
1651 (TypeCheckPattern::visit): Rename method.
1652 (ClosureParamInfer::visit): Rename method.
1653 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Rename method.
1654 * util/rust-hir-map.cc (Mappings::insert_hir_pattern): Rename method.
1656 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1658 * hir/tree/rust-hir-expr.h: Add getter for name.
1660 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1662 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Implement for tuple pat.
1663 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Implement for tupple pat.
1665 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1667 * hir/tree/rust-hir-path.h: Avoid copy in getter.
1668 * hir/tree/rust-hir-pattern.h: Avoid copy in getter.
1669 * hir/tree/rust-hir.h: Avoid copy in getter.
1671 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1673 * resolve/rust-ast-resolve-implitem.h
1674 (ResolveToplevelImplItem::go): Take AssociatedItem as parameter.
1675 (ResolveTopLevelTraitItems::go): Likewise.
1676 * resolve/rust-ast-resolve-item.cc
1677 (ResolveTraitItems::go): Likewise.
1678 (ResolveItem::resolve_impl_item): Likewise.
1679 (ResolveImplItems::go): Likewise.
1680 * resolve/rust-ast-resolve-item.h
1681 (ResolveTraitItems::go): Likewise.
1682 (ResolveItem::resolve_impl_item): Likewise.
1683 (ResolveImplItems::go): Likewise.
1685 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1687 * hir/rust-ast-lower-implitem.h
1688 (ASTLoweringImplItem::translate): Take AssociatedItem as parameter.
1689 (ASTLoweringTraitItem::translate): Likewise.
1691 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1693 * backend/rust-compile-expr.cc (CompileExpr::visit): Bail on labelled block.
1695 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1697 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add loop ctx.
1699 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1701 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve using loop logic.
1703 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1705 * hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Call loop lowering and add it to constr.
1706 * hir/tree/rust-hir-expr.h (class LoopLabel): Move before BlockExpr and add to BlockExpr.
1708 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1710 * ast/rust-ast-builder.cc (AstBuilder::block): Add label arg to constructor call.
1711 * ast/rust-expr.h (class LoopLabel): Move before BlockExpr.
1712 (class BlockExpr): Add LoopLabel member.
1713 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Add label arg to constructor call.
1714 * parse/rust-parse-impl.h (Parser::parse_block_expr): Add label parameter.
1715 (Parser::parse_labelled_loop_expr): Add label arg to constructor call.
1716 * parse/rust-parse.h: Add label arg to constructor call.
1718 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1721 (class AssociatedItem):
1722 New, based on TraitItem, InherentImplItem, and TraitImplItem classes.
1723 (class TraitItem): Inherit from AssociatedItem.
1724 (class InherentImplItem): Likewise.
1725 (class TraitImplItem): Likewise.
1727 (class Method): Update cloning functions.
1728 (class Function): Likewise.
1729 (class TypeAlias): Likewise.
1730 (class ConstantItem): Likewise.
1731 (class TraitItemFunc): Likewise.
1732 (class TraitItemMethod): Likewise.
1733 (class TraitItemConst): Likewise.
1734 (class TraitItemType): Likewise.
1736 (class MacroInvocation): Likewise.
1738 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
1740 * backend/rust-mangle.cc (v0_identifier): Fix broken encoding.
1741 (v0_scope_path): Modify paramter.
1742 (v0_path): Fix namespace for modules.
1744 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1746 * parse/rust-parse-impl.h (Parser::parse_closure_expr_pratt): Fix
1747 closure parsing function to handle consecutive parameter lists.
1749 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1751 * ast/rust-macro.h: Add PATH fragment to follow set restrictions.
1753 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1755 * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Add a function
1756 that checks tokens given by the lexer represents an accurate macro
1757 definition. This will reduce code duplication.
1758 (Parser::parse_item): Replace condition with call to new checking
1760 (Parser::parse_stmt): Likewise.
1761 * parse/rust-parse.h: Add function prototype for is_macro_rules_def.
1763 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1765 * parse/rust-parse-impl.h (Parser::parse_expr): Fix range from expr.
1767 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1769 * parse/rust-parse-impl.h (Parser::parse_item): Relax constraints
1770 around default identifier at item scope to accept "default" macros.
1772 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1774 * parse/rust-parse-impl.h (Parser::parse_path_expr_segment): Accept
1775 left shift tokens in order to let generic parsing function split the
1778 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1781 (Pattern::get_pattern_node_id): Rename to...
1782 (Pattern::get_node_id): ...here.
1784 (MacroInvocation::get_pattern_node_id): Rename to...
1785 (MacroInvocation::get_node_id): ...here.
1787 (PathInExpression::get_pattern_node_id): Remove.
1788 (QualifiedPathInExpression::get_pattern_node_id): Remove.
1789 * ast/rust-pattern.h
1790 (LiteralPattern::get_pattern_node_id): Remove.
1791 (IdentifierPattern::get_pattern_node_id): Remove.
1792 (WildcardPattern::get_pattern_node_id): Remove.
1793 (RestPattern::get_pattern_node_id): Rename to...
1794 (RestPattern::get_node_id): ...here.
1795 (RangePattern::get_pattern_node_id): Remove.
1796 (ReferencePattern::get_pattern_node_id): Remove.
1797 (StructPattern::get_pattern_node_id): Remove.
1798 (TupleStructPattern::get_pattern_node_id): Remove.
1799 (TuplePattern::get_pattern_node_id): Remove.
1800 (GroupedPattern::get_pattern_node_id): Remove.
1801 (SlicePattern::get_pattern_node_id): Remove.
1802 (AltPattern::get_pattern_node_id): Remove.
1803 * resolve/rust-early-name-resolver.cc
1804 (EarlyNameResolver::visit):
1805 Use get_node_id instead of get_pattern_node_id.
1807 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1809 * parse/rust-parse-impl.h (Parser::parse_expr): Add comma delimiter.
1811 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1813 * parse/rust-parse-impl.h (Parser::parse_visibility): Relax constraints
1814 over public visibility return condition in order to accept pub unit
1817 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1819 * typecheck/rust-tyty.cc (BaseType::is_unit): Refactor.
1820 (BaseType::satisfies_bound): Refactor.
1821 (BaseType::get_root): Refactor.
1822 (BaseType::destructure): Refactor.
1823 (BaseType::monomorphized_clone): Refactor.
1824 (BaseType::is_concrete): Refactor.
1825 (InferType::InferType): Refactor.
1826 (InferType::clone): Refactor.
1827 (InferType::apply_primitive_type_hint): Refactor.
1828 (StructFieldType::is_equal): Refactor.
1829 (ADTType::is_equal): Refactor.
1830 (handle_substitions): Refactor.
1831 (ADTType::handle_substitions): Refactor.
1832 (TupleType::TupleType): Refactor.
1833 (TupleType::is_equal): Refactor.
1834 (TupleType::handle_substitions): Refactor.
1836 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1838 * typecheck/rust-tyty.cc (InferType::InferType): Use static constant for kind information.
1839 (ErrorType::ErrorType): Use static constant for kind information.
1840 (TupleType::TupleType): Use static constant for kind information.
1841 (BoolType::BoolType): Use static constant for kind information.
1842 (IntType::IntType): Use static constant for kind information.
1843 (UintType::UintType): Use static constant for kind information.
1844 (FloatType::FloatType): Use static constant for kind information.
1845 (USizeType::USizeType): Use static constant for kind information.
1846 (ISizeType::ISizeType): Use static constant for kind information.
1847 (CharType::CharType): Use static constant for kind information.
1848 (ReferenceType::ReferenceType): Use static constant for kind information.
1849 (PointerType::PointerType): Use static constant for kind information.
1850 (ParamType::ParamType): Use static constant for kind information.
1851 (StrType::StrType): Use static constant for kind information.
1852 (NeverType::NeverType): Use static constant for kind information.
1853 (PlaceholderType::PlaceholderType): Use static constant for kind information.
1854 * typecheck/rust-tyty.h: Add static kind information to all TyTy classes.
1855 Create safe cast and check methods.
1857 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1859 * parse/rust-parse-impl.h (Parser::parse_type_param_bound): Add missing
1860 case for lifetime switch.
1862 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1864 * lex/rust-token.cc (Token::as_string): Update function to output scope
1865 resolution tokens correctly.
1866 * parse/rust-parse-impl.h (Parser::parse_generic_param): Change call to
1869 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
1871 * backend/rust-compile-context.h: Modify declaration.
1872 * backend/rust-mangle.cc (struct V0Path): New struct.
1873 (v0_path): New function.
1874 (legacy_mangle_name): Take Context as argument.
1875 (v0_numeric_prefix): Fix type strings.
1876 (v0_complex_type_prefix): New function.
1877 (v0_add_integer_62): Deleted
1878 (v0_integer_62): New function.
1879 (v0_add_opt_integer_62): Deleted.
1880 (v0_opt_integer_62): New function.
1881 (v0_add_disambiguator): Deleted.
1882 (v0_disambiguator): New function.
1883 (v0_type_prefix): Support more types.
1884 (v0_generic_args): New function.
1885 (v0_add_identifier): Deleted.
1886 (v0_identifier): New function.
1887 (v0_type_path): New function.
1888 (v0_function_path): New function.
1889 (v0_scope_path): New function.
1890 (v0_crate_path): New function.
1891 (v0_inherent_or_trait_impl_path): New function.
1892 (v0_mangle_item): Use v0_path.
1893 (Mangler::mangle_item): Take Context as argument.
1894 * backend/rust-mangle.h (class Context): Add forward declaration.
1895 * hir/tree/rust-hir-item.h: Fix include.
1897 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1899 * hir/tree/rust-hir-pattern.h
1900 (TupleStructItems::clone_tuple_struct_items_impl): Rename to...
1901 (TupleStructItems::clone_tuple_items_impl): ...here.
1902 (TupleStructItemsNoRange::clone_tuple_struct_items_impl): Rename to...
1903 (TupleStructItemsNoRange::clone_tuple_items_impl): ...here.
1904 (TupleStructItemsRange::clone_tuple_struct_items_impl): Rename to...
1905 (TupleStructItemsRange::clone_tuple_items_impl): ...here.
1906 (TuplePatternItems::clone_tuple_pattern_items_impl): Rename to...
1907 (TuplePatternItems::clone_tuple_items_impl): ...here.
1908 (TuplePatternItemsMultiple::clone_tuple_pattern_items_impl): Rename to...
1909 (TuplePatternItemsMultiple::clone_tuple_items_impl): ...here.
1910 (TuplePatternItemsRanged::clone_tuple_pattern_items_impl): Rename to...
1911 (TuplePatternItemsRanged::clone_tuple_items_impl): ...here.
1913 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1915 * hir/tree/rust-hir-pattern.h
1916 (TuplePatternItems::get_pattern_type): Rename to...
1917 (TuplePatternItems::get_item_type): ...here.
1918 (TuplePatternItemsMultiple::get_pattern_type): Rename to...
1919 (TuplePatternItemsMultiple::get_item_type): ...here.
1920 (TuplePatternItemsRanged::get_pattern_type): Rename to...
1921 (TuplePatternItemsRanged::get_item_type): ...here.
1922 * backend/rust-compile-expr.cc: Adjust calls to renamed methods.
1923 * backend/rust-compile-pattern.cc: Likewise.
1924 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
1926 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
1928 * backend/rust-compile-expr.cc (CompileExpr::visit): Merge 2 if clauses.
1929 * backend/rust-compile-extern.h: Fix typo in comment.
1931 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1933 * parse/rust-parse-impl.h: Add missing token consumption
1935 2024-01-16 Mohammed Rizan Farooqui <rizanfarooqui@gmail.com>
1937 * expand/rust-macro-builtins.cc (MacroBuiltin::include_str_handler): Comment removed
1938 (MacroBuiltin::env_handler): Comment removed
1939 (MacroBuiltin::cfg_handler): Comment removed
1940 (MacroBuiltin::line_handler): Comment removed
1942 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
1944 * backend/rust-compile.cc (HIRCompileBase::coercion_site1): Fix wrong cast
1946 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
1948 * rust-session-manager.cc (Session::expansion): Add early break on
1951 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
1953 * util/rust-canonical-path.h: Add new segment kind for inherent impl.
1954 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Use it.
1955 * resolve/rust-ast-resolve-toplevel.h: Use it.
1957 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
1959 * ast/rust-expr.h: Fix spelling of "doesn't".
1960 * backend/rust-compile-expr.cc: Fix spelling of "accessors".
1961 * backend/rust-compile-implitem.h: Fix spelling of "normal".
1962 * backend/rust-constexpr.cc: Fix spelling of "actual".
1964 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
1966 * hir/rust-hir-dump.cc (Dump::debug): New.
1968 * hir/rust-hir-dump.h (debug): New.
1970 2024-01-16 Philip Herron <herron.philip@googlemail.com>
1972 * Make-lang.in: fixup formatting
1973 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): remove old check
1974 * rust-session-manager.cc (Session::compile_crate): call new lint
1975 * resolve/rust-ast-verify-assignee.h: Removed.
1976 * checks/errors/rust-readonly-check.cc: New file.
1977 * checks/errors/rust-readonly-check.h: New file.
1979 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
1981 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
1982 Added ErrorCode & more fixit hints.
1984 2024-01-16 Philip Herron <herron.philip@googlemail.com>
1986 * backend/rust-compile-block.h: remove HIR::ForLoopExpr
1987 * backend/rust-compile-expr.h: likewise
1988 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): likewise
1989 * checks/errors/privacy/rust-privacy-reporter.h: likewise
1990 * checks/errors/rust-const-checker.cc (ConstChecker::visit): likewise
1991 * checks/errors/rust-const-checker.h: likewise
1992 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): likewise
1993 * checks/errors/rust-unsafe-checker.h: likewise
1994 * checks/lints/rust-lint-marklive.h: likewise
1995 * hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): likewise
1996 * hir/rust-hir-dump.cc (Dump::visit): likewise
1997 * hir/rust-hir-dump.h: likewise
1998 * hir/tree/rust-hir-expr.h (class ForLoopExpr): likewise
1999 * hir/tree/rust-hir-full-decls.h (class ForLoopExpr): likewise
2000 * hir/tree/rust-hir-visitor.h: likewise
2001 * hir/tree/rust-hir.cc (ForLoopExpr::as_string): likewise
2002 (ForLoopExpr::accept_vis): likewise
2003 * typecheck/rust-hir-type-check-expr.h: likewise
2005 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
2007 * backend/rust-compile-expr.cc (CompileExpr::visit): Fix typo in varIadic.
2008 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
2009 * rust-backend.h (function_type_varadic): Rename into ...
2010 (function_type_variadic): ... this.
2011 * rust-gcc.cc (function_type_varadic): Rename into ...
2012 (function_type_variadic): ... this.
2013 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
2014 * typecheck/rust-tyty.h (is_varadic): Renamed into ...
2015 (is_variadic): ... this.
2017 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
2019 * backend/rust-compile-base.cc (HIRCompileBase::compile_function):
2020 Fix typo in substitutions.
2021 (HIRCompileBase::resolve_method_address): Likewise.
2022 * backend/rust-compile-extern.h (CompileExternItem::visit):
2024 * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
2026 * backend/rust-compile-intrinsic.cc (maybe_override_ctx):
2028 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
2029 * backend/rust-compile-resolve-path.cc
2030 (HIRCompileBase::query_compile): Likewise.
2031 * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion):
2033 * typecheck/rust-hir-type-check-item.cc
2034 (TypeCheckItem::ResolveImplBlockSelfWithInference): Likewise.
2035 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit):
2037 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
2039 * typecheck/rust-tyty.cc (BaseType::has_subsititions_defined):
2041 (BaseType::has_substitutions_defined): ... this.
2042 (ADTType::is_equal): Fix typo in substitutions.
2043 (handle_substitions): Likewise.
2044 (FnType::is_equal): Likewise.
2045 (FnType::handle_substitions): Likewise.
2046 * typecheck/rust-tyty.h (has_subsititions_defined): Renamed into
2048 (has_substitutions_defined): ... this.
2050 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2052 * backend/rust-compile-intrinsic.cc
2053 (get_identifier): Add declaration.
2054 (assume_handler): New.
2055 (generic_intrinsics): Add assume_handler entry.
2057 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2060 (Backend::wchar_type): Store static wchar tree.
2062 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2065 (complex_type): Remove.
2066 (complex_constant_expression): Remove.
2067 (real_part_expression): Remove.
2068 (imag_part_expression): Remove.
2069 (complex_expression): Remove.
2071 (complex_type): Remove.
2072 (complex_constant_expression): Remove.
2073 (real_part_expression): Remove.
2074 (imag_part_expression): Remove.
2075 (complex_expression): Remove.
2077 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2080 (namespace Backend):
2081 Use namespace definition instead of qualified names.
2083 2024-01-16 liushuyu <liushuyu011@gmail.com>
2085 * backend/rust-compile-intrinsic.cc: add `copy`
2086 intrinsics and make `copy_nonoverlapping` handler more generic
2088 2024-01-16 liushuyu <liushuyu011@gmail.com>
2090 * backend/rust-builtins.cc: add `expect` builtin definition.
2091 * backend/rust-compile-intrinsic.cc: add `likely` and `unlikely`
2094 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2096 * rust_error_codes.def: Moved to...
2097 * rust-error-codes.def: ...here...
2098 * rust-diagnostics.h: ...and update references.
2100 2024-01-16 Guillaume Gomez <guillaume1.gomez@gmail.com>
2102 * backend/rust-compile-intrinsic.cc: Simplify `make_unsigned_long_tree`
2103 * rust-backend.h: Remove `integer_constant_expression`
2104 * rust-gcc.cc: Remove `integer_constant_expression`
2106 2024-01-16 Dave Evans <dave@dmetwo.org>
2108 * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit):
2109 Add AltPattern visitor function
2110 * backend/rust-compile-pattern.h:
2111 Update CompilePatternCaseLabelExpr::visit(AltPattern&).
2112 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
2113 Update AltPattern visitor
2115 2024-01-16 Guillaume Gomez <guillaume1.gomez@gmail.com>
2117 * backend/rust-compile-intrinsic.cc: Remove unused argument
2119 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2121 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
2122 Added new error message, rich location and error code.
2124 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2127 (class Backend): Convert to ...
2128 (namespace Backend): ... namespace.
2130 (Backend::Backend): Rename to ...
2131 (Backend::init): ... here.
2132 (rust_get_backend): Remove.
2133 * rust-session-manager.cc
2134 (rust_get_backend): Remove.
2135 (Session::init): Use Backend::init instead of rust_get_backend.
2136 (Session::compile_crate):
2137 Initialize Context without pointer to Backend.
2138 * rust-session-manager.h
2139 (Session::backend): Remove.
2140 * backend/rust-compile-context.cc
2141 (Context::Context): Remove pointer to Backend.
2142 * backend/rust-compile-context.h
2143 (class Context): Remove pointer to Backend, update function calls.
2144 * backend/rust-compile-base.cc: Update function calls.
2145 * backend/rust-compile-block.cc: Likewise.
2146 * backend/rust-compile-expr.cc: Likewise.
2147 * backend/rust-compile-extern.h: Likewise.
2148 * backend/rust-compile-fnparam.cc: Likewise.
2149 * backend/rust-compile-intrinsic.cc: Likewise.
2150 * backend/rust-compile-item.cc: Likewise.
2151 * backend/rust-compile-pattern.cc: Likewise.
2152 * backend/rust-compile-resolve-path.cc: Likewise.
2153 * backend/rust-compile-type.cc: Likewise.
2154 * backend/rust-compile-var-decl.h: Likewise.
2155 * backend/rust-compile.cc: Likewise.
2157 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2159 * ast/rust-ast.cc (Attribute::check_cfg_predicate): Change raw
2160 string to constexpr call.
2161 (Attribute::separate_cfg_attrs): Likewise.
2162 * backend/rust-compile-base.cc (should_mangle_item): Likewise.
2163 (HIRCompileBase::setup_fndecl): Likewise.
2164 (HIRCompileBase::handle_cold_attribute_on_fndecl): Likewise.
2165 * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
2167 * checks/errors/rust-unsafe-checker.cc (check_target_attr):
2169 * expand/rust-cfg-strip.cc (fails_cfg): Likewise.
2170 (fails_cfg_with_expand): Likewise.
2171 (expand_cfg_attrs): Likewise.
2172 * expand/rust-macro-builtins.cc: Likewise.
2173 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Likewise.
2174 (ASTLoweringBase::lower_macro_definition): Likewise.
2175 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
2176 * parse/rust-parse-impl.h (Parser::parse_doc_comment): Likewise.
2177 * parse/rust-parse.cc (extract_module_path): Likewise.
2178 * resolve/rust-early-name-resolver.cc (is_macro_use_module):
2180 (EarlyNameResolver::visit): Likewise.
2181 * resolve/rust-toplevel-name-resolver-2.0.cc (is_macro_export):
2183 * rust-session-manager.cc (Session::injection): Likewise.
2184 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): Likewise.
2185 * util/rust-attributes.cc (is_proc_macro_type): Likewise.
2186 (AttributeChecker::check_attribute): Likewise.
2187 (AttributeChecker::visit): Likewise.
2188 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
2189 * util/rust-attribute-values.h: New file.
2191 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2194 (Backend::Backend): New.
2195 (Backend::~Backend): Remove.
2196 (class Gcc_backend): Remove.
2198 (Gcc_backend::Gcc_backend): Rename to ...
2199 (Backend::Backend): ... here.
2200 (rust_get_backend): Construct Backend instead of Gcc_backend.
2202 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2204 * expand/rust-proc-macro.cc (tokenstream_from_string): Change
2205 linemap null pointer to the current linemap.
2207 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2209 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
2210 Add proc macro definition insertion.
2212 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2214 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_def):
2215 Change the function body to fetch the node id from the macro
2217 (Mappings::insert_bang_proc_macro_def): Likewise.
2218 (Mappings::insert_attribute_proc_macro_def): Likewise.
2219 * util/rust-hir-map.h: Update the function's prototype by
2220 removing the node id from the list of arguments.
2222 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2224 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
2225 Add proc macro handle retrieval for attribute and derive proc macros.
2227 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2229 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macro_def):
2230 Update function to accomodate new signature.
2231 (Mappings::lookup_bang_proc_macro_def): Likewise.
2232 (Mappings::lookup_attribute_proc_macro_def): Likewise.
2233 * util/rust-hir-map.h: Update function signatures.
2235 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2237 * expand/rust-macro-expand.h (struct MacroExpander): Update
2238 lookup function prototypes.
2239 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macro_invocation):
2240 Update lookup function according to new signature.
2241 (Mappings::lookup_bang_proc_macro_invocation): Likewise.
2242 (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
2243 * util/rust-hir-map.h: Update function prototypes.
2245 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2248 (Backend::write_export_data): Remove.
2250 (Backend::write_export_data): Remove.
2252 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2255 (Backend::real_part_expression): Make non-virtual.
2256 (Backend::imag_part_expression): Likewise.
2257 (Backend::complex_expression): Likewise.
2258 (Backend::convert_expression): Likewise.
2259 (Backend::struct_field_expression): Likewise.
2260 (Backend::compound_expression): Likewise.
2261 (Backend::conditional_expression): Likewise.
2262 (Backend::negation_expression): Likewise.
2263 (Backend::arithmetic_or_logical_expression): Likewise.
2264 (Backend::arithmetic_or_logical_expression_checked): Likewise.
2265 (Backend::comparison_expression): Likewise.
2266 (Backend::lazy_boolean_expression): Likewise.
2267 (Backend::constructor_expression): Likewise.
2268 (Backend::array_constructor_expression): Likewise.
2269 (Backend::array_initializer): Likewise.
2270 (Backend::array_index_expression): Likewise.
2271 (Backend::call_expression): Likewise.
2272 (Gcc_backend::real_part_expression): Remove.
2273 (Gcc_backend::imag_part_expression): Remove.
2274 (Gcc_backend::complex_expression): Remove.
2275 (Gcc_backend::convert_expression): Remove.
2276 (Gcc_backend::struct_field_expression): Remove.
2277 (Gcc_backend::compound_expression): Remove.
2278 (Gcc_backend::conditional_expression): Remove.
2279 (Gcc_backend::negation_expression): Remove.
2280 (Gcc_backend::arithmetic_or_logical_expression): Remove.
2281 (Gcc_backend::arithmetic_or_logical_expression_checked): Remove.
2282 (Gcc_backend::comparison_expression): Remove.
2283 (Gcc_backend::lazy_boolean_expression): Remove.
2284 (Gcc_backend::constructor_expression): Remove.
2285 (Gcc_backend::array_constructor_expression): Remove.
2286 (Gcc_backend::array_initializer): Remove.
2287 (Gcc_backend::array_index_expression): Remove.
2288 (Gcc_backend::call_expression): Remove.
2290 (Gcc_backend::real_part_expression): Rename to ...
2291 (Backend::real_part_expression): ... here.
2292 (Gcc_backend::imag_part_expression): Rename to ...
2293 (Backend::imag_part_expression): ... here.
2294 (Gcc_backend::complex_expression): Rename to ...
2295 (Backend::complex_expression): ... here.
2296 (Gcc_backend::convert_expression): Rename to ...
2297 (Backend::convert_expression): ... here.
2298 (Gcc_backend::struct_field_expression): Rename to ...
2299 (Backend::struct_field_expression): ... here.
2300 (Gcc_backend::compound_expression): Rename to ...
2301 (Backend::compound_expression): ... here.
2302 (Gcc_backend::conditional_expression): Rename to ...
2303 (Backend::conditional_expression): ... here.
2304 (Gcc_backend::negation_expression): Rename to ...
2305 (Backend::negation_expression): ... here.
2306 (Gcc_backend::arithmetic_or_logical_expression): Rename to ...
2307 (Backend::arithmetic_or_logical_expression): ... here.
2308 (Gcc_backend::arithmetic_or_logical_expression_checked): Rename to ...
2309 (Backend::arithmetic_or_logical_expression_checked): ... here.
2310 (Gcc_backend::comparison_expression): Rename to ...
2311 (Backend::comparison_expression): ... here.
2312 (Gcc_backend::lazy_boolean_expression): Rename to ...
2313 (Backend::lazy_boolean_expression): ... here.
2314 (Gcc_backend::constructor_expression): Rename to ...
2315 (Backend::constructor_expression): ... here.
2316 (Gcc_backend::array_constructor_expression): Rename to ...
2317 (Backend::array_constructor_expression): ... here.
2318 (Gcc_backend::array_initializer): Rename to ...
2319 (Backend::array_initializer): ... here.
2320 (Gcc_backend::array_index_expression): Rename to ...
2321 (Backend::array_index_expression): ... here.
2322 (Gcc_backend::call_expression): Rename to ...
2323 (Backend::call_expression): ... here.
2325 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2327 * rust-session-manager.cc (Session::load_extern_crate): Change
2328 variable name, add temporaries and comments.
2330 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2332 * expand/rust-proc-macro.h: Change get_trait_name to get_name in
2333 order to be coherent with the others proc macro type name
2335 * resolve/rust-toplevel-name-resolver-2.0.cc (insert_macros):
2336 Add a templated funtion that inserts a proc macro into the
2337 context and emit an error on failure.
2338 (TopLevel::visit): Change from manual insertion to a function
2341 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2343 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
2344 Change to assertion.
2345 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macros):
2347 (Mappings::lookup_bang_proc_macros): Likewise.
2348 (Mappings::lookup_attribute_proc_macros): Likewise.
2350 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2352 * metadata/rust-extern-crate.cc (ExternCrate::ExternCrate):
2353 Update definition to allow Extern crate with no content (pure
2355 (ExternCrate::ok): Panic on no content.
2356 (ExternCrate::load): Likewise.
2357 * metadata/rust-extern-crate.h: Update prototypes.
2358 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
2359 Remove macro resolution.
2360 (TopLevel::visit): Likewise.
2361 * resolve/rust-toplevel-name-resolver-2.0.h: Add visit prototype
2363 * rust-session-manager.cc (Session::load_extern_crate): Adapt
2364 content depending on the loaded crate's content.
2365 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macros):
2366 Change return type to optional because it is way more
2368 (Mappings::lookup_bang_proc_macros): Likewise.
2369 (Mappings::lookup_attribute_proc_macros): Likewise.
2370 * util/rust-hir-map.h: Update function prototypes.
2372 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2374 * metadata/rust-imports.cc (Import::try_package_in_directory):
2375 Remove error when some macro are found even if no import data is
2378 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2380 * ast/rust-ast.h (class BangProcMacro): Move class from here to
2381 rust-proc-macro.h. Also remove related functions.
2382 (class AttributeProcMacro): Likewise.
2383 (class CustomDeriveProcMacro): Likewise.
2384 (struct Crate): Remove proc macro vector members.
2385 * expand/rust-macro-expand.h (struct MacroExpander): Change the
2386 type to the newly created classes.
2387 * expand/rust-proc-macro.cc (BangProcMacro::BangProcMacro): Add
2388 constructor implementation.
2389 (AttributeProcMacro::AttributeProcMacro): Likewise.
2390 (CustomDeriveProcMacro::CustomDeriveProcMacro): Likewise.
2391 * expand/rust-proc-macro.h (class BangProcMacro): Move class to
2393 (class AttributeProcMacro): Likewise.
2394 (class CustomDeriveProcMacro): Likewise.
2395 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
2396 Change top level visitor to check mappings instead
2397 * rust-session-manager.cc (Session::load_extern_crate):
2398 Add back macro collection to mappings.
2399 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macros):
2400 Update getter signature with new types.
2401 (Mappings::insert_bang_proc_macros): Likewise.
2402 (Mappings::insert_attribute_proc_macros): Likewise.
2403 (Mappings::lookup_derive_proc_macros): Likewise.
2404 (Mappings::lookup_bang_proc_macros): Likewise.
2405 (Mappings::lookup_attribute_proc_macros): Likewise.
2406 (Mappings::insert_derive_proc_macro_def): Likewise.
2407 (Mappings::insert_bang_proc_macro_def): Likewise.
2408 (Mappings::insert_attribute_proc_macro_def): Likewise.
2409 (Mappings::lookup_derive_proc_macro_def): Likewise.
2410 (Mappings::lookup_bang_proc_macro_def): Likewise.
2411 (Mappings::lookup_attribute_proc_macro_def): Likewise.
2412 (Mappings::insert_derive_proc_macro_invocation): Likewise.
2413 (Mappings::lookup_derive_proc_macro_invocation): Likewise.
2414 (Mappings::insert_bang_proc_macro_invocation): Likewise.
2415 (Mappings::lookup_bang_proc_macro_invocation): Likewise.
2416 (Mappings::insert_attribute_proc_macro_invocation): Likewise.
2417 (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
2418 * util/rust-hir-map.h: Update function prototypes as well as map
2421 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2423 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
2424 Visit crate's newly stored proc macros.
2425 * rust-session-manager.cc (Session::load_extern_crate):
2426 Store proc macros in the parsed crate instead of a local
2427 variable to achieve mappings.
2429 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2431 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
2432 Change argument to reference.
2433 * resolve/rust-early-name-resolver-2.0.h: Update function
2436 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2438 * ast/rust-ast.h: Add getters.
2440 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2442 * ast/rust-ast.h (struct Crate): Add proc macro members.
2444 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2446 * ast/rust-ast.h (class BangProcMacro): Add new proc macro
2448 (class AttributeProcMacro): Likewise.
2449 (class CustomDeriveProcMacro): Likewise.
2451 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2453 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
2454 Add function to handle attributes.
2455 (Early::visit): Override visitor functions.
2456 * resolve/rust-early-name-resolver-2.0.h: Add prototype.
2458 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2460 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Convert
2461 tokenstream to path list.
2463 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2465 * ast/rust-ast.cc (Attribute::is_derive): Remove tokenstream
2468 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2470 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Change
2471 return type to a vector of references.
2472 * ast/rust-ast.h: Update constructor.
2473 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
2474 Update function call.
2476 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2478 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Add
2479 function as member function.
2480 * ast/rust-ast.h: Add prototype.
2481 * expand/rust-expand-visitor.cc (get_traits_to_derive): Remove
2483 (ExpandVisitor::expand_inner_stmts): Update function call.
2485 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2487 * ast/rust-ast.cc (Attribute::is_derive): Add member function.
2488 * ast/rust-ast.h: Likewise.
2489 * expand/rust-expand-visitor.cc (is_derive): Remove old
2491 (ExpandVisitor::expand_inner_stmts): Update function call.
2492 (ExpandVisitor::visit_inner_using_attrs): Likewise.
2494 2024-01-16 Philip Herron <herron.philip@googlemail.com>
2496 * backend/rust-compile-expr.cc (CompileExpr::visit): use a temp for the value
2498 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2501 (Backend::block): Make non-virtual.
2502 (Backend::block_add_statements): Likewise.
2503 (Gcc_backend::block): Remove.
2504 (Gcc_backend::block_add_statements): Remove.
2506 (Gcc_backend::block): Rename to ...
2507 (Backend::block): ... here.
2508 (Gcc_backend::block_add_statements): Rename to ...
2509 (Backend::block_add_statements): ... here.
2511 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2513 * expand/rust-macro-expand.h: Change include directive with the
2515 * expand/rust-proc-macro.h (RUST_PROC_MACRO_H): Likewise.
2516 * util/rust-hir-map.h: Likewise.
2517 * util/rust-token-converter.h: Likewise.
2518 * util/rust-token-converter.cc: Remove useless include
2520 * Make-lang.in: Rename library.
2522 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2525 (Backend::init_statement): Make non-virtual.
2526 (Backend::assignment_statement): Likewise.
2527 (Backend::return_statement): Likewise.
2528 (Backend::if_statement): Likewise.
2529 (Backend::loop_expression): Likewise.
2530 (Backend::exit_expression): Likewise.
2531 (Backend::compound_statement): Likewise.
2532 (Backend::statement_list): Likewise.
2533 (Backend::exception_handler_statement): Likewise.
2534 (Gcc_backend::init_statement): Remove.
2535 (Gcc_backend::assignment_statement): Remove.
2536 (Gcc_backend::return_statement): Remove.
2537 (Gcc_backend::if_statement): Remove.
2538 (Gcc_backend::compound_statement): Remove.
2539 (Gcc_backend::statement_list): Remove.
2540 (Gcc_backend::exception_handler_statement): Remove.
2541 (Gcc_backend::loop_expression): Remove.
2542 (Gcc_backend::exit_expression): Remove.
2544 (Gcc_backend::init_statement): Rename to ...
2545 (Backend::init_statement): ... here.
2546 (Gcc_backend::assignment_statement): Rename to ...
2547 (Backend::assignment_statement): ... here.
2548 (Gcc_backend::return_statement): Rename to ...
2549 (Backend::return_statement): ... here.
2550 (Gcc_backend::exception_handler_statement): Rename to ...
2551 (Backend::exception_handler_statement): ... here.
2552 (Gcc_backend::if_statement): Rename to ...
2553 (Backend::if_statement): ... here.
2554 (Gcc_backend::loop_expression): Rename to ...
2555 (Backend::loop_expression): ... here.
2556 (Gcc_backend::exit_expression): Rename to ...
2557 (Backend::exit_expression): ... here.
2558 (Gcc_backend::compound_statement): Rename to ...
2559 (Backend::compound_statement): ... here.
2560 (Gcc_backend::statement_list): Rename to ...
2561 (Backend::statement_list): ... here.
2563 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2566 (Backend::function): Make non-virtual.
2567 (Backend::function_defer_statement): Likewise.
2568 (Backend::function_set_parameters): Likewise.
2569 (Backend::write_global_definitions): Likewise.
2570 (Backend::write_export_data): Likewise.
2571 (Gcc_backend::function): Remove.
2572 (Gcc_backend::function_defer_statement): Remove.
2573 (Gcc_backend::function_set_parameters): Remove.
2574 (Gcc_backend::write_global_definitions): Remove.
2575 (Gcc_backend::write_export_data): Remove.
2577 (Gcc_backend::function): Rename to ...
2578 (Backend::function): ... here.
2579 (Gcc_backend::function_defer_statement):
2580 Fix a qualified lookup of Backend::label and rename to ...
2581 (Backend::function_defer_statement): ... here.
2582 (Gcc_backend::function_set_parameters) Rename to ...
2583 (Backend::function_set_parameters): ... here.
2584 (Gcc_backend::write_global_definitions): Rename to ...
2585 (Backend::write_global_definitions): ... here.
2586 (Gcc_backend::write_export_data): Rename to ...
2587 (Backend::write_export_data): ... here.
2589 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2591 * typecheck/rust-hir-inherent-impl-overlap.h:
2592 Added rich location and errorcode.
2593 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
2596 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2598 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
2601 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2604 (Backend::zero_expression): Make non-virtual.
2605 (Backend::var_expression): Likewise.
2606 (Backend::integer_constant_expression): Likewise.
2607 (Backend::float_constant_expression): Likewise.
2608 (Backend::complex_constant_expression): Likewise.
2609 (Backend::string_constant_expression): Likewise.
2610 (Backend::char_constant_literal): Likewise.
2611 (Backend::wchar_constant_literal): Likewise.
2612 (Backend::boolean_constant_expression): Likewise.
2613 (Gcc_backend::zero_expression): Remove.
2614 (Gcc_backend::var_expression): Remove.
2615 (Gcc_backend::integer_constant_expression): Remove.
2616 (Gcc_backend::float_constant_expression): Remove.
2617 (Gcc_backend::complex_constant_expression): Remove.
2618 (Gcc_backend::string_constant_expression): Remove.
2619 (Gcc_backend::wchar_constant_expression): Remove.
2620 (Gcc_backend::char_constant_expression): Remove.
2621 (Gcc_backend::boolean_constant_expression): Remove.
2623 (Gcc_backend::zero_expression): Rename to ...
2624 (Backend::zero_expression): ... here.
2625 (Gcc_backend::var_expression): Rename to ...
2626 (Backend::var_expression): ... here.
2627 (Gcc_backend::integer_constant_expression): Rename to ...
2628 (Backend::integer_constant_expression): ... here.
2629 (Gcc_backend::float_constant_expression): Rename to ...
2630 (Backend::float_constant_expression): ... here.
2631 (Gcc_backend::complex_constant_expression): Rename to ...
2632 (Backend::complex_constant_expression): ... here.
2633 (Gcc_backend::string_constant_expression): Rename to ...
2634 (Backend::string_constant_expression): ... here.
2635 (Gcc_backend::wchar_constant_expression): Rename to ...
2636 (Backend::wchar_constant_expression): ... here.
2637 (Gcc_backend::char_constant_expression): Rename to ...
2638 (Backend::char_constant_expression): ... here.
2639 (Gcc_backend::boolean_constant_expression): Rename to ...
2640 (Backend::boolean_constant_expression): ... here.
2642 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2645 (Backend::global_variable): Make non-virtual.
2646 (Backend::global_variable_set_init): Likewise.
2647 (Backend::local_variable): Likewise.
2648 (Backend::parameter_variable): Likewise.
2649 (Backend::static_chain_variable): Likewise.
2650 (Backend::temporary_variable): Likewise.
2651 (Gcc_backend::global_variable): Remove.
2652 (Gcc_backend::global_variable_set_init): Remove.
2653 (Gcc_backend::local_variable): Remove.
2654 (Gcc_backend::parameter_variable): Remove.
2655 (Gcc_backend::static_chain_variable): Remove.
2656 (Gcc_backend::temporary_variable): Remove.
2657 (Gcc_backend::non_zero_size_type): Move to ...
2658 (Backend::non_zero_size_type): ... here.
2659 (Gcc_backend::convert_tree): Move to ...
2660 (Backend::convert_tree): ... here.
2662 (Gcc_backend::non_zero_size_type): Rename to ...
2663 (Backend::non_zero_size_type): ... here.
2664 (Gcc_backend::convert_tree): Rename to ...
2665 (Backend::convert_tree): ... here.
2666 (Gcc_backend::global_variable): Rename to ...
2667 (Backend::global_variable): ... here.
2668 (Gcc_backend::global_variable_set_init): Rename to ...
2669 (Backend::global_variable_set_init): ... here.
2670 (Gcc_backend::local_variable): Rename to ...
2671 (Backend::local_variable): ... here.
2672 (Gcc_backend::parameter_variable): Rename to ...
2673 (Backend::parameter_variable): ... here.
2674 (Gcc_backend::static_chain_variable): Rename to ...
2675 (Backend::static_chain_variable): ... here.
2676 (Gcc_backend::temporary_variable): Rename to ...
2677 (Backend::temporary_variable): ... here.
2679 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2681 * checks/errors/privacy/rust-privacy-reporter.cc
2682 (PrivacyReporter::check_for_privacy_violation):
2683 Added errorcode & richlocation.
2685 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2688 (Backend::debug): Make non-virtual.
2689 (Backend::get_identifier_node): Likewise.
2690 (Gcc_backend::debug): Remove.
2691 (Gcc_backend::get_identifier_node): Remove.
2693 (Gcc_backend::debug): Rename to ...
2694 (Backend::debug): ... here.
2695 (Gcc_backend::get_identifier_node): Rename to ...
2696 (Backend::get_identifier_node): ... here.
2698 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2700 * typecheck/rust-hir-type-check-expr.cc
2701 (TypeCheckExpr::visit): Expect if conditions to have type bool.
2703 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2706 (Backend::label): Make non-virtual.
2707 (Backend::label_definition_statement): Likewise.
2708 (Backend::goto_statement): Likewise.
2709 (Backend::label_address): Likewise.
2710 (Gcc_backend::label): Remove.
2711 (Gcc_backend::label_definition_statement): Remove.
2712 (Gcc_backend::goto_statement): Remove.
2713 (Gcc_backend::label_address): Remove.
2715 (Gcc_backend::label): Rename to ...
2716 (Backend::label): ... here.
2717 (Gcc_backend::label_definition_statement): Rename to ...
2718 (Backend::label_definition_statement): ... here.
2719 (Gcc_backend::goto_statement): Rename to ...
2720 (Backend::goto_statement): ... here.
2721 (Gcc_backend::label_address): Rename to ...
2722 (Backend::label_address): ... here.
2724 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2726 * backend/rust-constexpr.cc
2727 (struct constexpr_fundef): Rename to ...
2728 (struct rust_constexpr_fundef): ... here.
2729 (struct constexpr_call): Rename to ...
2730 (struct rust_constexpr_call): ... here.
2732 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
2734 * lex/rust-input-source.h: Move constants from here...
2735 * util/rust-codepoint.h (struct Codepoint): ... to here
2736 * util/rust-attributes.cc (check_no_mangle_function): New function.
2737 (AttributeChecker::visit): Use it.
2738 * util/rust-unicode.cc (is_ascii_only): New function.
2739 * util/rust-unicode.h (is_ascii_only): Likewise.
2740 * backend/rust-mangle.cc (legacy_mangle_name): Use it.
2741 * util/rust-punycode.cc (extract_basic_string): Likewise.
2742 * lex/rust-lex.cc (Lexer::parse_byte_char): Likewise.
2744 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2746 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit):
2747 Added richlocation & error code.
2749 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2751 * typecheck/rust-hir-type-check-expr.cc
2752 (TypeCheckExpr::resolve_fn_trait_call): Add TODO comment.
2753 * typecheck/rust-tyty-bounds.cc
2754 (TypeBoundPredicate::TypeBoundPredicate):
2755 Add assertions, new error constructor.
2756 (TypeBoundPredicate::error): Use new error constructor.
2757 * typecheck/rust-tyty.h
2758 (struct TypeBoundPredicate::mark_is_error): New.
2759 (TypeBoundPredicate::TypeBoundPredicate):
2760 Add new error constructor.
2762 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2765 (Backend::wchar_type): Make non-virtual.
2766 (Backend::get_pointer_size): Likewise.
2767 (Backend::raw_str_type): Likewise.
2768 (Backend::integer_type): Likewise.
2769 (Backend::float_type): Likewise.
2770 (Backend::complex_type): Likewise.
2771 (Backend::pointer_type): Likewise.
2772 (Backend::reference_type): Likewise.
2773 (Backend::immutable_type): Likewise.
2774 (Backend::function_type): Likewise.
2775 (Backend::function_type_varadic): Likewise.
2776 (Backend::function_ptr_type): Likewise.
2777 (Backend::struct_type): Likewise.
2778 (Backend::union_type): Likewise.
2779 (Backend::array_type): Likewise.
2780 (Backend::named_type): Likewise.
2781 (Backend::type_size): Likewise.
2782 (Backend::type_alignment): Likewise.
2783 (Backend::type_field_alignment): Likewise.
2784 (Backend::type_field_offset): Likewise.
2785 (Gcc_backend::wchar_type): Remove.
2786 (Gcc_backend::get_pointer_size): Remove.
2787 (Gcc_backend::raw_str_type): Remove.
2788 (Gcc_backend::integer_type): Remove.
2789 (Gcc_backend::float_type): Remove.
2790 (Gcc_backend::complex_type): Remove.
2791 (Gcc_backend::pointer_type): Remove.
2792 (Gcc_backend::reference_type): Remove.
2793 (Gcc_backend::immutable_type): Remove.
2794 (Gcc_backend::function_type): Remove.
2795 (Gcc_backend::function_type_varadic): Remove.
2796 (Gcc_backend::function_ptr_type): Remove.
2797 (Gcc_backend::struct_type): Remove.
2798 (Gcc_backend::union_type): Remove.
2799 (Gcc_backend::array_type): Remove.
2800 (Gcc_backend::named_type): Remove.
2801 (Gcc_backend::type_size): Remove.
2802 (Gcc_backend::type_alignment): Remove.
2803 (Gcc_backend::type_field_alignment): Remove.
2804 (Gcc_backend::type_field_offset): Remove.
2805 (Gcc_backend::fill_in_fields): Move to ...
2806 (Backend::fill_in_fields): ... here.
2807 (Gcc_backend::fill_in_array): Move to ...
2808 (Backend::fill_in_array): ... here.
2810 (Gcc_backend::wchar_type): Rename to ...
2811 (Backend::wchar_type): ... here.
2812 (Gcc_backend::get_pointer_size): Rename to ...
2813 (Backend::get_pointer_size): ... here.
2814 (Gcc_backend::raw_str_type): Rename to ...
2815 (Backend::raw_str_type): ... here.
2816 (Gcc_backend::integer_type): Rename to ...
2817 (Backend::integer_type): ... here.
2818 (Gcc_backend::float_type): Rename to ...
2819 (Backend::float_type): ... here.
2820 (Gcc_backend::complex_type): Rename to ...
2821 (Backend::complex_type): ... here.
2822 (Gcc_backend::pointer_type): Rename to ...
2823 (Backend::pointer_type): ... here.
2824 (Gcc_backend::reference_type): Rename to ...
2825 (Backend::reference_type): ... here.
2826 (Gcc_backend::immutable_type): Rename to ...
2827 (Backend::immutable_type): ... here.
2828 (Gcc_backend::function_type): Rename to ...
2829 (Backend::function_type): ... here.
2830 (Gcc_backend::function_type_varadic): Rename to ...
2831 (Backend::function_type_varadic): ... here.
2832 (Gcc_backend::function_ptr_type): Rename to ...
2833 (Backend::function_ptr_type): ... here.
2834 (Gcc_backend::struct_type): Rename to ...
2835 (Backend::struct_type): ... here.
2836 (Gcc_backend::union_type): Rename to ...
2837 (Backend::union_type): ... here.
2838 (Gcc_backend::fill_in_fields): Rename to ...
2839 (Backend::fill_in_fields): ... here.
2840 (Gcc_backend::array_type): Rename to ...
2841 (Backend::array_type): ... here.
2842 (Gcc_backend::fill_in_array): Rename to ...
2843 (Backend::fill_in_array): ... here.
2844 (Gcc_backend::named_type): Rename to ...
2845 (Backend::named_type): ... here.
2846 (Gcc_backend::type_size): Rename to ...
2847 (Backend::type_size): ... here.
2848 (Gcc_backend::type_alignment): Rename to ...
2849 (Backend::type_alignment): ... here.
2850 (Gcc_backend::type_field_alignment): Rename to ...
2851 (Backend::type_field_alignment): ... here.
2852 (Gcc_backend::type_field_offset): Rename to ...
2853 (Backend::type_field_offset): ... here.
2855 2024-01-16 Philip Herron <herron.philip@googlemail.com>
2857 * backend/rust-compile-intrinsic.cc (move_val_init_handler): mark as side-effects
2859 2024-01-16 Philip Herron <herron.philip@googlemail.com>
2861 * backend/rust-compile-intrinsic.cc (uninit_handler): Update fndecl attributes
2863 2024-01-16 Philip Herron <herron.philip@googlemail.com>
2865 * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): fix use before init
2867 2024-01-16 Philip Herron <herron.philip@googlemail.com>
2869 * backend/rust-compile-intrinsic.cc (enter_intrinsic_block): take the locals vector
2870 (uninit_handler): make a temp variable and use the address of it
2872 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2874 * resolve/rust-early-name-resolver-2.0.cc (Early::visit):
2875 Collect error instead of lambda.
2876 * resolve/rust-early-name-resolver-2.0.h (std::function<void):
2878 * rust-diagnostics.h: Change collection type.
2879 * rust-session-manager.cc (Session::expansion): Change
2880 collection container.
2882 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2884 * resolve/rust-early-name-resolver-2.0.cc (Early::visit):
2885 Collect error instead of emitting it. Also add invocation
2887 * resolve/rust-early-name-resolver-2.0.h (std::function<void):
2888 Add type definition for collection.
2889 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
2890 Register macro rule definition in mappings.
2891 * rust-session-manager.cc (Session::expansion): Add macro
2892 resolve error collection.
2894 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2897 Add "backend/rust-tree.h" and "backend/rust-tree.h" to gtfiles.
2898 * backend/rust-tree.cc: Include new header generated by gengtype.
2899 * backend/rust-tree.h
2900 (struct language_function): Add TODO.
2902 Include "rust-tree.h".
2903 (struct lang_type): Remove duplicate definition.
2904 (struct lang_decl): Likewise.
2905 (struct lang_identifier): Likewise.
2906 (struct language_function): Likewise.
2908 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2910 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
2911 Added error code and rich location.
2913 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2915 * backend/rust-tree.h
2916 (struct rust_cp_class_binding): Fork from gcc/cp/name_lookup.h.
2917 (struct rust_cp_binding_level): Likewise.
2918 (struct named_label_entry): Remove declaration...
2919 (struct rust_named_label_entry): ... and fork definition from gcc/cp/decl.cc.
2921 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2923 * rust-diagnostics.cc (rust_be_error_at): Added overload function.
2924 (rust_error_at): non-const `rich_location *` function.
2925 * rust-diagnostics.h (rust_error_at): Implementation of overloaded
2927 (rust_be_error_at): likewise.
2928 * rust_error_codes.def: Added GNU license.
2930 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2932 * typecheck/rust-tyty.cc (BaseType::satisfies_bound):
2933 Added errorcode and user-friendly error message.
2935 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2937 * backend/rust-tree.cc
2938 (resort_data): Fork from c++ frontend.
2939 (resort_member_name_cmp): Likewise.
2940 (resort_type_member_vec): Likewise.
2941 * backend/rust-tree.h
2942 (resort_type_member_vec): Likewise.
2944 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2946 * backend/rust-tree.cc
2947 (struct conv_type_hasher): Rename to ...
2948 (struct rust_conv_type_hasher): ... here.
2949 (struct cplus_array_hasher): Rename to ...
2950 (struct rust_cplus_array_hasher): ... here.
2951 (struct source_location_table_entry_hash): Rename to ...
2952 (struct rust_source_location_table_entry_hash): ... here.
2953 * backend/rust-tree.h
2954 (struct named_decl_hash): Rename to ...
2955 (struct rust_named_decl_hash): ... here.
2956 (struct cxx_saved_binding): Rename to ...
2957 (struct rust_cxx_saved_binding): ... here.
2958 (struct named_label_hash): Rename to ...
2959 (struct rust_named_label_hash): ... here.
2960 (struct tree_pair_s): Rename to ...
2961 (struct rust_tree_pair_s): ... here.
2962 (struct tree_pair_p): Rename to ...
2963 (struct rust_tree_pair_p): ... here.
2965 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2967 * backend/rust-tree.cc
2968 (Rust::gt_pch_nx): Move external function declaration ...
2969 (gt_pch_nx): ... out of Rust namespace.
2970 * backend/rust-tree.h
2971 (OVL_FIRST): Qualify function name.
2973 2024-01-16 Philip Herron <herron.philip@googlemail.com>
2975 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): do a final lookup
2977 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2979 * parse/rust-parse-impl.h (Parser::parse_generic_params):
2980 Added more user friendly message.
2982 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2984 * expand/rust-macro-builtins.cc
2985 (MacroBuiltin::include_str_handler): Use vector::data.
2987 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
2989 * typecheck/rust-hir-type-check-type.cc:
2990 Added last variant name, errorcode & rich location. for enum candidates.
2992 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
2994 * backend/rust-tree.h
2995 (struct stmt_tree_s): Remove.
2996 (typedef stmt_tree): Remove.
2997 (c_language_function::x_stmt_tree): Remove.
2998 (saved_scope::x_stmt_tree): Remove.
2999 (lang_decl_fn::pending_inline_p): Remove.
3000 (lang_decl_fn::spare): Adjust size.
3001 (lang_decl_fn::pending_inline_info): Remove.
3003 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3005 * backend/rust-constexpr.cc:
3006 Include gt-rust-rust-constexpr.h.
3007 (struct constexpr_call_hasher): Rename to ...
3008 (struct rust_constexpr_call_hasher): ... here.
3009 (struct constexpr_fundef_hasher): Rename to ...
3010 (struct rust_constexpr_fundef_hasher): ... here.
3011 * config-lang.in: Add rust-constexpr.cc to gtfiles.
3013 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3015 * backend/rust-mangle.cc (v0_add_identifier): Added punycode encoding
3016 (v0_mangle_item): Likewise.
3017 * lex/rust-lex.cc (assert_source_content): Change type
3018 (test_buffer_input_source): Change type
3019 (test_file_input_source): Change type
3020 * resolve/rust-ast-resolve-toplevel.h: fix typo
3021 * rust-session-manager.cc (Session::load_extern_crate): fix typo
3022 * util/rust-canonical-path.h: fix typo
3023 * util/rust-hir-map.cc (NodeMapping::get_error): fix typo
3024 (Mappings::Mappings): fix typo
3025 * util/rust-mapping-common.h (UNKNOWN_CREATENUM): fix typo
3026 (UNKNOWN_CRATENUM): Change 0 to UINT32_MAX
3028 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3030 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
3031 Updated errorcode & more userfriendly message.
3033 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3035 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit):
3036 Added more helpful error message.
3038 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3040 * typecheck/rust-hir-path-probe.h:
3041 Fixes issue & added rich location message.
3042 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3043 Added rich location and error code.
3045 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3047 * lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Only
3048 accept digits after a dot instead of accepting any float
3051 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3053 * ast/rust-pattern.h: No need of assertion, we are handling it.
3054 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
3055 Added check which emits error instead of using assertion.
3056 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
3057 Added rich location and error code.
3059 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3061 * backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
3062 Added rich_location & error code.
3064 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3066 * parse/rust-parse-impl.h (Parser::parse_trait):
3067 added errorcode & updated error message.
3069 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3071 * parse/rust-parse-impl.h (Parser::parse_outer_attribute):
3072 Added errorcode & updated error function.
3074 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3076 * rust-diagnostics.cc (va_constructor):
3077 Added constructor for all possible cases.
3078 (Error::Error): Updated error struct
3079 for all possible cases.
3080 * rust-diagnostics.h (struct Error):
3081 Updated error struct to support error
3082 code & rich location support.
3084 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3086 * backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
3087 Added rich_location & error code.
3089 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3091 * rust-diagnostics.cc: Switch from new[] to xcalloc
3093 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3095 * util/make-rust-unicode.py: Add type annotation
3097 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3099 * backend/rust-compile-intrinsic.cc (check_for_cached_intrinsic):
3100 simplify this cached intrinsic check
3101 * backend/rust-mangle.cc (legacy_mangle_item): use new interface
3102 * typecheck/rust-tyty.h: new managle helper
3104 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3106 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
3107 use the single candidate
3109 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
3111 * hir/rust-hir-dump.cc (Dump::visit): Remove useless if/else
3112 already handled by visit_field.
3114 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3116 * util/rust-punycode.cc: Add CHECKING_P guard.
3118 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3120 * backend/rust-mangle.cc (legacy_mangle_name): Use Unicode escape
3122 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3124 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): remove hack
3126 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3128 * expand/rust-proc-macro-invoc-lexer.cc
3129 (ProcMacroInvocLexer::skip_token): Remove.
3130 * expand/rust-proc-macro-invoc-lexer.h:
3131 Include "rust-macro-invoc-lexer.h".
3132 (class ProcMacroInvocLexer):
3133 Extend MacroInvocLexerBase.
3135 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3137 * lex/rust-codepoint.h: Moved to...
3138 * util/rust-codepoint.h: ...here.
3139 * lex/rust-input-source.h: Add missing license
3140 * util/rust-unicode.cc: Add missing license
3141 * util/rust-punycode.cc (extract_basic_string): Remove constant
3143 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3145 * expand/rust-macro-expand.h: Keep optional references for last_def
3147 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Store
3148 optional references.
3149 * rust-session-manager.cc (Session::expansion): Use tl::optional's APIs
3150 for better checking.
3152 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
3154 * hir/rust-hir-dump.h (do_ifexpr): New.
3155 * hir/rust-hir-dump.cc (Dump::do_ifexpr): New.
3156 (Dump::visit): Use do_ifexpr and visit_field
3158 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3160 * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
3161 Refactored ErrorCodes & error messages.
3163 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3165 * backend/rust-compile-base.cc:
3168 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3170 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
3171 called error function.
3172 (ASTLoweringBase::lower_extern_block): likewise.
3174 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3176 * ast/rust-ast-collector.cc: Adjust formatting.
3177 * checks/errors/rust-feature-gate.cc: Add trailing newline.
3178 * rust-diagnostics.h: Remove old comment.
3180 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3183 (Gcc_backend::struct_type): Remove references to "this".
3184 (Gcc_backend::union_type): Likewise.
3185 (Gcc_backend::array_type): Likewise.
3186 (Gcc_backend::wchar_constant_expression): Likewise.
3187 (Gcc_backend::convert_expression): Likewise.
3188 (Gcc_backend::constructor_expression): Likewise.
3189 (Gcc_backend::array_initializer): Likewise.
3190 (Gcc_backend::assignment_statement): Likewise.
3191 (Gcc_backend::global_variable): Likewise.
3192 (Gcc_backend::temporary_variable): Likewise.
3193 (Gcc_backend::function_defer_statement): Likewise.
3195 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3197 * Make-lang.in: Add rust-punycode.o.
3198 * rust-lang.cc (run_rust_tests): Add selftest.
3199 * util/rust-punycode.cc: New file.
3200 * util/rust-punycode.h: New file.
3202 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3204 * backend/rust-compile.cc (HIRCompileBase::verify_array_capacities):
3207 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3209 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve):
3212 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3215 (Backend::error_variable): Remove.
3216 (Gcc_backend::error_variable): Move to ...
3218 (Bvariable::error_variable): ... here ...
3220 (Bvariable::error_variable): ... and declare here.
3221 (Gcc_backend::global_variable): Update error_variable call.
3222 (Gcc_backend::local_variable): Likewise.
3223 (Gcc_backend::parameter_variable): Likewise.
3224 (Gcc_backend::static_chain_variable): Likewise.
3225 (Gcc_backend::temporary_variable): Likewise.
3226 * backend/rust-compile-extern.h
3227 (CompileExternItem::visit): Likewise.
3228 * backend/rust-compile-fnparam.cc
3229 (CompileFnParam::CompileFnParam): Likewise.
3231 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3233 * backend/rust-compile-type.cc
3234 (TyTyResolveCompile::visit): Inline Backend::bool_type call.
3236 (Backend::bool_type): Remove.
3237 (Backend::char_type): Remove.
3238 (Gcc_backend::bool_type): Remove.
3239 (Gcc_backend::char_type): Remove.
3241 (Gcc_backend::char_constant_expression): Inline Backend::char_type call.
3243 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3245 * lex/rust-lex.cc (assert_source_content): Fix namespace specifier
3246 (test_buffer_input_source): Likewise.
3247 (test_file_input_source): Likewise.
3248 * lex/rust-lex.h: Move InputSource ...
3249 * lex/rust-input-source.h: ... to here. (New file)
3250 * lex/rust-token.cc (nfc_normalize_token_string): New function
3251 * lex/rust-token.h (nfc_normalize_token_string): New function
3252 * rust-lang.cc (run_rust_tests): Modify order of selftests.
3253 * rust-session-manager.cc (validate_crate_name): Modify interface of Utf8String.
3254 * util/rust-unicode.cc (lookup_cc): Modify codepoint_t typedef.
3255 (lookup_recomp): Likewise.
3256 (recursive_decomp_cano): Likewise.
3257 (decomp_cano): Likewise.
3258 (sort_cano): Likewise.
3259 (compose_hangul): Likewise.
3260 (assert_normalize): Likewise.
3261 (Utf8String::nfc_normalize): New function.
3262 * util/rust-unicode.h: Modify interface of Utf8String.
3264 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3266 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
3269 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3271 * util/rust-common.h (enum_to_str): Remove extra semicolon after
3274 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3276 * checks/errors/rust-const-checker.cc (ConstChecker::visit):
3277 Use of mutable reference in constant functions.
3278 * checks/errors/rust-feature-gate.cc (FeatureGate::gate):
3279 ErrorCode for intrinsics are subject to change.
3281 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3283 * checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
3286 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3288 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
3291 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3293 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Declare
3294 macros in the current rib if they are macros 2.0.
3296 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3298 * ast/rust-macro.h: Add new method to `MacroRulesDefinition` to allow
3299 getting the `MacroKind` contained.
3301 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3303 * rust-session-manager.cc
3304 (Session::expansion): Use new `Early` name resolution 2.0 pass
3306 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3308 * Make-lang.in: Add new object file.
3309 * resolve/rust-early-name-resolver-2.0.cc: New file.
3310 * resolve/rust-early-name-resolver-2.0.h: New file.
3312 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3314 * resolve/rust-default-resolver.cc
3315 (DefaultResolver::visit): Visit CallExpr and MethodCallExpr properly.
3316 * resolve/rust-default-resolver.h: Switch "node" to plural in documentation.
3318 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3320 * resolve/rust-toplevel-name-resolver-2.0.cc
3321 (TopLevel::insert_or_error_out): Fix format string.
3322 (is_macro_export): New method.
3323 (TopLevel::visit): Handle macro definitions.
3325 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3327 * resolve/rust-name-resolution-context.cc
3328 (Resolver::insert): Do not call into `rust_unreachable` when resolving
3331 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3333 * resolve/rust-forever-stack.h
3334 (insert_at_root): New method.
3335 (resolve_path): New method.
3336 (reverse_iter): Iterate on `Node`s instead of `Rib`s
3337 * resolve/rust-forever-stack.hxx: Add path resolution.
3339 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3341 * resolve/rust-rib.h: Add shadowing parameter. Make kind field public.
3342 * resolve/rust-rib.cc (Rib::insert): Likewise.
3344 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3346 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
3347 refactored message and called error function.
3349 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3351 * checks/errors/rust-feature-gate.cc (FeatureGate::check):
3352 errorcode support for unknown feature.
3354 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3356 * typecheck/rust-unify.cc (UnifyRules::emit_type_mismatch):
3357 refactored & called error function.
3359 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
3361 * expand/rust-macro-builtins.cc
3362 (load_file_bytes): Return a tl::optional.
3363 (MacroBuiltin::include_byte_handler): Adjust and check file was
3365 (MacroBuiltin::include_str_handler): Likewise.
3367 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3369 * resolve/rust-toplevel-name-resolver-2.0.h
3370 (class TopLevel): Inherit from DefaultResolver
3371 * resolve/rust-toplevel-name-resolver-2.0.cc
3372 (TopLevel::TopLevel): Remove unecessary methods
3374 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3376 * Make-lang.in: Add new object file.
3377 * resolve/rust-default-resolver.cc: New file.
3378 * resolve/rust-default-resolver.h: New file.
3380 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3382 * util/rust-unicode.cc (decomp_cano): Decompose Hangul.
3383 (sort_cano): Fix bounds check.
3384 (recomp): use `compose_hangul`.
3385 (compose_hangul): Compose Hangul.
3386 (rust_utf8_normalize_test): Add tests.
3388 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3390 * resolve/rust-forever-stack.hxx: assert() -> rust_assert()
3392 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3394 * Make-lang.in: Add new object file.
3395 * resolve/rust-toplevel-name-resolver-2.0.cc: New file.
3396 * resolve/rust-toplevel-name-resolver-2.0.h: New file.
3398 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3400 * Make-lang.in: Add new object file.
3401 * resolve/rust-name-resolution-context.cc: New file.
3402 * resolve/rust-name-resolution-context.h: New file.
3404 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3406 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3407 called error function.
3409 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3411 * expand/rust-macro-invoc-lexer.cc
3412 (MacroInvocLexer::skip_token): Remove.
3413 * expand/rust-macro-invoc-lexer.h
3414 (class MacroInvocLexer): Extend MacroInvocLexerBase.
3416 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
3418 * ast/rust-ast-fragment.cc (Fragment::create_empty): New.
3419 * ast/rust-ast-fragment.h (MacroTranscriberFunc): New.
3420 * ast/rust-macro.h (MacroRulesDefinition): Use MacroTranscriberFunc.
3421 * expand/rust-macro-builtins.cc
3422 (MacroBuiltin::builtin_transcribers): likewise.
3423 (MacroBuiltin::assert_handler): Return optional.
3424 (MacroBuiltin::file_handler): Likewise.
3425 (MacroBuiltin::column_handler): Likewise.
3426 (MacroBuiltin::include_bytes_handler): Likewise.
3427 (MacroBuiltin::include_str_handler): Likewise.
3428 (MacroBuiltin::compile_error_handler): Likewise.
3429 (MacroBuiltin::concat_handler): Likewise.
3430 (MacroBuiltin::env_handler): Likewise.
3431 (MacroBuiltin::cfg_handler): Likewise.
3432 (MacroBuiltin::include_handler): Likewise.
3433 (MacroBuiltin::line_handler): Likewise.
3434 (MacroBuiltin::stringify_handler): Likewise.
3435 (MacroBuiltin::sorry): Likewise.
3436 * expand/rust-macro-builtins.h (builtin_transcribers): Use
3437 MacroTranscriberFunc.
3438 (assert_handler): Return optional.
3439 (file_handler): Likewise.
3440 (column_handler): Likewise.
3441 (include_bytes_handler): Likewise.
3442 (include_str_handler): Likewise.
3443 (compile_error_handler): Likewise.
3444 (concat_handler): Likewise.
3445 (env_handler): Likewise.
3446 (cfg_handler): Likewise.
3447 (include_handler): Likewise.
3448 (line_handler): Likewise.
3449 (stringify_handler): Likewise.
3451 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc):
3452 Adjust to transcribers returning optional.
3454 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3456 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
3457 always resolve the type even when its an a mandatory trait item
3458 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
3459 Add check for enum candidates otherwise you get undefined behaviour
3461 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3463 * lex/rust-codepoint.h: Add comment
3464 * lex/rust-lex.h: New method to get decoded characters
3465 * rust-session-manager.cc (validate_crate_name): Modify unicode check
3466 (rust_crate_name_validation_test): Add testcases
3467 * util/rust-unicode.h (RUST_UNICODE_H): New class Utf8String.
3468 (class Utf8String): New class.
3469 * util/rust-unicode.cc (binary_search_sorted_array): Add comment.
3470 (recursive_decomp_cano): Add comment.
3471 (recomp): Remove dead code.
3472 (dump_string): Removed.
3474 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3476 * util/rust-unicode.cc: Add CHECKING_P guard.
3478 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3480 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3481 We need to check if a function context exists
3483 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3485 * expand/rust-proc-macro.cc (literal_from_string): update Lexer constructor
3486 (tokenstream_from_string): likewise
3487 * lex/rust-lex.cc (Lexer::Lexer): likewise
3488 * lex/rust-lex.h: pass through Linemap
3489 * parse/rust-cfg-parser.cc (parse_cfg_option): likewise
3490 * rust-session-manager.cc (Session::load_extern_crate): likewise
3491 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
3492 dont apply Sized on self
3493 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate): new
3494 * typecheck/rust-hir-type-check-base.h: add prototype
3495 * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::Resolve): apply Sized
3496 (TypeResolveGenericParam::visit): likewise
3497 * typecheck/rust-hir-type-check-type.h: update prototypes
3498 * typecheck/rust-typecheck-context.cc: remove bad assertions
3499 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): cleanup
3500 (TypeCheckBase::get_predicate_from_bound): apply sized rules properly
3501 * util/rust-hir-map.cc (Mappings::lookup_trait_item_lang_item): helpers
3502 (Mappings::get_lang_item): likewise
3503 * util/rust-hir-map.h: likewise
3504 * util/rust-token-converter.cc (from_ident): update lexer ctor
3505 (from_punct): likewise
3507 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3509 * typecheck/rust-hir-path-probe.cc: track regular polarity
3510 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): likewise
3511 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
3512 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): likewise
3513 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
3514 (TypeBoundPredicate::TypeBoundPredicate): update ctor
3515 (TypeBoundPredicate::operator=): update copy assignment ctor
3516 (TypeBoundPredicate::error): update error node
3517 * typecheck/rust-tyty.h: add polarity field to predicate
3519 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3521 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): use new BoundPolarity enum
3522 * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): likewise
3523 * hir/rust-hir-dump.cc (BoundPolarityString): new helper
3524 (Dump::visit): update hir dump
3525 * hir/tree/rust-hir-item.h (class ImplBlock): likewise
3526 * hir/tree/rust-hir-type.h (class TraitBound): likewise
3527 * hir/tree/rust-hir.cc (TraitBound::as_string): fix as string
3528 * util/rust-common.h (enum Polarity): add new anti bound
3529 (enum BoundPolarity): likewise
3530 * util/rust-hir-map.cc (Mappings::Mappings): update naming
3532 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3534 * rust-backend.h: Include "rust-gcc.h".
3535 (class Gcc_backend): Move to ...
3536 * rust-gcc.cc (class Gcc_backend): ... here.
3538 2024-01-16 Philip Herron <herron.philip@googlemail.com>
3540 * typecheck/rust-hir-type-check-item.cc: add is_error check
3542 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
3544 * Make-lang.in: Add rust-unicode.o
3545 * rust-lang.cc (run_rust_tests): Add test.
3546 * rust-system.h: Include <array>
3547 * util/make-rust-unicode.py: Generater of rust-unicode-data.h.
3548 * util/rust-unicode-data.h: Auto-generated file.
3549 * util/rust-unicode.cc: New file.
3550 * util/rust-unicode.h: New file.
3552 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
3554 * rust-diagnostics.cc: Rework `make_description` and `make_url` functions.
3555 * rust-diagnostics.h: Specify ErrorCode's underlying type,
3556 remove error_codes_strings table.
3557 * rust_error_codes.def: New file.
3559 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3561 * rust-location.h (typedef Location): Remove.
3562 * expand/rust-proc-macro.cc
3563 (register_callback): Replace Location constructor with UNDEF_LOCATION.
3564 * ast/rust-ast-collector.h: Replace Location with location_t.
3565 * checks/errors/privacy/rust-privacy-reporter.cc: Likewise.
3566 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
3567 * checks/errors/privacy/rust-pub-restricted-visitor.cc: Likewise.
3568 * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
3569 * checks/errors/rust-feature-gate.cc: Likewise.
3570 * checks/errors/rust-feature-gate.h: Likewise.
3571 * metadata/rust-imports.h: Likewise.
3572 * resolve/rust-ast-resolve-path.h: Likewise.
3573 * resolve/rust-name-resolver.h: Likewise.
3574 * rust-backend.h: Likewise.
3575 * rust-diagnostics.h: Likewise.
3576 * rust-gcc.cc: Likewise.
3577 * rust-linemap.h: Likewise.
3578 * util/rust-attributes.cc: Likewise.
3579 * util/rust-hir-map.cc: Likewise.
3580 * util/rust-hir-map.h: Likewise.
3581 * util/rust-token-converter.cc: Likewise.
3583 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3585 * typecheck/rust-autoderef.cc: Replace Location with location_t.
3586 * typecheck/rust-coercion.cc: Likewise.
3587 * typecheck/rust-coercion.h: Likewise.
3588 * typecheck/rust-hir-path-probe.h: Likewise.
3589 * typecheck/rust-hir-trait-reference.cc: Likewise.
3590 * typecheck/rust-hir-trait-resolve.cc: Likewise.
3591 * typecheck/rust-hir-type-check-base.cc: Likewise.
3592 * typecheck/rust-hir-type-check-expr.cc: Likewise.
3593 * typecheck/rust-hir-type-check-expr.h: Likewise.
3594 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
3595 * typecheck/rust-hir-type-check-item.cc: Likewise.
3596 * typecheck/rust-hir-type-check-path.cc: Likewise.
3597 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
3598 * typecheck/rust-hir-type-check-stmt.cc: Likewise.
3599 * typecheck/rust-hir-type-check-struct.cc: Likewise.
3600 * typecheck/rust-hir-type-check-type.cc: Likewise.
3601 * typecheck/rust-hir-type-check-type.h: Likewise.
3602 * typecheck/rust-type-util.cc: Likewise.
3603 * typecheck/rust-type-util.h: Likewise.
3604 * typecheck/rust-tyty-bounds.cc: Likewise.
3605 * typecheck/rust-tyty-call.cc: Likewise.
3606 * typecheck/rust-tyty-call.h: Likewise.
3607 * typecheck/rust-tyty-cmp.h: Likewise.
3608 * typecheck/rust-tyty-subst.cc: Likewise.
3609 * typecheck/rust-tyty-subst.h: Likewise.
3610 * typecheck/rust-tyty.cc: Likewise.
3612 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3614 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3615 refactored error message & called error function.
3617 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3619 * expand/rust-proc-macro.cc (literal_from_string): Add callback
3621 (load_macros_array): Likewise.
3623 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3625 * util/rust-token-converter.cc (handle_suffix): Rework function
3626 to make it work with the new literal conversion function.
3627 (convert_literal): Add a new function to convert to a proc macro
3628 literal from a literal tokenptr. The function will abort if the
3629 pointer does not point to a literal.
3630 (convert): Add call to convert literal for every literal case.
3631 * util/rust-token-converter.h (convert_literal): Add public
3634 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3636 * expand/rust-proc-macro.cc: Remove static modifier and move to
3637 an anonymous namespace.
3639 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3641 * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
3642 Formatted according to enum class.
3643 * checks/errors/rust-feature-gate.cc (FeatureGate::gate): likewise.
3644 * checks/errors/rust-unsafe-checker.cc (check_unsafe_call): likewise.
3645 * hir/rust-ast-lower-base.cc (struct_field_name_exists): likewise.
3646 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): likewise.
3647 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
3649 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): likewise.
3650 (PatternDeclaration::add_new_binding): likewise.
3651 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): likewise.
3652 * resolve/rust-ast-verify-assignee.h: likewise.
3653 * rust-diagnostics.cc: updated make_desc & url function for enum class.
3654 * rust-diagnostics.h (struct ErrorCode): removed struct to switch to enum.
3655 (enum class): Switched from errorcode struct to enum class.
3656 (XSTR): Macro for converting enum to string.
3657 (STR): macro Used by XSTR for converting to string.
3658 (ERROR_CODE): macro used by map for check.
3659 (TABLE_TO_MAP): macro used by map for check
3660 * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
3661 Formatted according to enum class.
3662 * typecheck/rust-hir-path-probe.h: likewise.
3663 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise.
3664 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
3666 (TypeCheckImplItemWithTrait::visit): likewise.
3667 * typecheck/rust-hir-type-check-item.cc: likewise.
3668 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): likewise.
3669 (emit_invalid_field_error): likewise.
3670 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): likewise.
3671 * typecheck/rust-tyty-call.cc (emit_unexpected_argument_error): likewise.
3672 (TypeCheckCallExpr::visit): likewise.
3673 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
3675 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): likewise.
3677 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3679 * util/rust-attributes.cc (check_proc_macro_non_root): Add
3680 function to emit this specific error.
3681 (AttributeChecker::visit): Modify visitor to propagate to some
3682 containers that were not handled correctly.
3684 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3686 * backend/rust-compile-base.h: Replace Location with location_t.
3687 * metadata/rust-imports.h: Likewise.
3688 * resolve/rust-name-resolver.cc: Likewise.
3689 * resolve/rust-name-resolver.h: Likewise.
3690 * rust-backend.h: Likewise.
3691 * rust-gcc.cc: Likewise.
3692 * rust-gcc.h: Likewise.
3694 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3696 * expand/rust-proc-macro.cc (available): Remove function.
3697 (load_macros_array): There was no need for an indirection here.
3699 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3701 * expand/rust-proc-macro.cc (available): Add symbol
3703 (load_macros_array): Likewise.
3705 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3707 * expand/rust-proc-macro.cc (load_macros_array): Symbol rename.
3709 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3711 * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
3712 Refactor the function to be safer and more efficient.
3714 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3716 * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
3717 Add a new function to find a potential proc macro type
3718 attribute on a given item.
3719 (proc_macro_privacy_check): Move all proc macro privacy check in
3720 their own function to avoid cluttering the usual privacy check.
3721 (PrivacyReporter::go): Add call to newly created proc macro
3722 privacy check function.
3724 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3726 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::go):
3727 Add visibility verification.
3729 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3731 * util/rust-attributes.cc (is_proc_macro_type): Add function to
3732 identify matching proc macro attribute type.
3733 (check_proc_macro_non_function): Add function to check and emit
3735 (AttributeChecker::visit): Add cal to new check function.
3737 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3739 * ast/rust-ast.h: Remove NodeId from identifiers.
3741 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3743 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
3744 Added check for error code support.
3746 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3748 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
3749 called error function.
3751 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3753 * backend/rust-compile-base.cc: Replace Location with location_t.
3754 * backend/rust-compile-base.h: Likewise.
3755 * backend/rust-compile-expr.cc: Likewise.
3756 * lex/rust-token.h: Likewise.
3757 * metadata/rust-import-archive.cc: Likewise.
3758 * metadata/rust-imports.cc: Likewise.
3759 * metadata/rust-imports.h: Likewise.
3760 * rust-backend.h: Likewise.
3761 * rust-diagnostics.cc: Likewise.
3762 * rust-diagnostics.h: Likewise.
3763 * rust-gcc.cc: Likewise.
3764 * rust-linemap.cc: Likewise.
3765 * util/rust-token-converter.cc: Likewise.
3767 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3769 * ast/rust-ast-builder.h: Replace Location with location_t.
3770 * ast/rust-ast.h: Likewise.
3771 * ast/rust-expr.h: Likewise.
3772 * ast/rust-item.h: Likewise.
3773 * ast/rust-macro.h: Likewise.
3774 * ast/rust-path.h: Likewise.
3775 * hir/tree/rust-hir-expr.h: Likewise.
3776 * hir/tree/rust-hir-item.h: Likewise.
3777 * hir/tree/rust-hir-path.h: Likewise.
3778 * hir/tree/rust-hir.h: Likewise.
3779 * lex/rust-lex.cc: Likewise.
3780 * lex/rust-lex.h: Likewise.
3782 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3784 * expand/rust-derive-clone.cc: Replace Location with location_t.
3785 * expand/rust-derive-clone.h: Likewise.
3786 * expand/rust-derive-copy.cc: Likewise.
3787 * expand/rust-derive-copy.h: Likewise.
3788 * expand/rust-derive.cc: Likewise.
3789 * expand/rust-derive.h: Likewise.
3790 * expand/rust-macro-builtins.cc: Likewise.
3791 * expand/rust-macro-builtins.h: Likewise.
3792 * expand/rust-macro-expand.cc: Likewise.
3793 * parse/rust-parse-impl.h: Likewise.
3794 * parse/rust-parse.cc: Likewise.
3795 * parse/rust-parse.h: Likewise.
3797 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3799 * parse/rust-parse-impl.h
3800 (Parser::parse_macro_match): Use token_id_is_keyword.
3802 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3804 * ast/rust-ast.h (class Identifier): Remove interface
3806 (class SimplePath): Likewise.
3807 * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
3809 (derive_item): Update according to get_traits_to_derive return
3811 (expand_item_attribute): Likewise.
3812 (ExpandVisitor::expand_inner_stmts): Likewise.
3813 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
3814 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_invocation):
3815 Change input type to SimplePath.
3816 (Mappings::lookup_derive_proc_macro_invocation): Likewise.
3817 (Mappings::insert_attribute_proc_macro_invocation): Likewise.
3818 (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
3819 * util/rust-hir-map.h: Likewise with function prototypes.
3820 * util/rust-proc-macro-invocation.h: Removed.
3822 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3824 * ast/rust-ast.h: Add new constructor for SimplePath from an
3826 * expand/rust-expand-visitor.cc (get_traits_to_derive): Add
3829 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3831 * expand/rust-macro-expand.cc (MacroExpander::import_proc_macros):
3833 * expand/rust-macro-expand.h (struct MacroExpander): Remove
3834 import_proc_macro function.
3835 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_def):
3836 Add a function to insert a derive proc macro definition.
3837 (Mappings::insert_bang_proc_macro): Remove function.
3838 (Mappings::insert_bang_proc_macro_def): Add function to insert a
3839 bang proc macro definition.
3840 (Mappings::insert_attribute_proc_macro_def): Likewise with
3841 attribute proc macros.
3842 (Mappings::lookup_derive_proc_macro_def): Add a function to
3843 lookup a defined derive proc macro definition.
3844 (Mappings::lookup_bang_proc_macro): Remove function.
3845 (Mappings::lookup_bang_proc_macro_def): Add a function to lookup
3846 a bang proc macro definition.
3847 (Mappings::lookup_attribute_proc_macro_def): Add a function to
3848 lookup an attribute prod macro definition.
3849 (Mappings::insert_derive_proc_macro_invocation): Add a function
3850 to insert a derive proc macro invocation.
3851 (Mappings::lookup_derive_proc_macro_invocation): Add a function
3852 to lookup a derive proc macro invocation.
3853 (Mappings::insert_bang_proc_macro_invocation): Add a function to
3854 insert a bang proc macro invocation.
3855 (Mappings::lookup_bang_proc_macro_invocation): Add a function to
3856 lookup a bang proc macro invocation.
3857 (Mappings::insert_attribute_proc_macro_invocation): Add a
3858 function to insert an attribute proc macro invocation.
3859 (Mappings::lookup_attribute_proc_macro_invocation): Add a
3860 function to lookup an attribute proc macro invocation.
3861 * util/rust-hir-map.h: Add different proc macro mappings
3862 and change function prototypes.
3863 * expand/rust-expand-visitor.cc (get_traits_to_derive): Return a
3864 vector of SimplePath instead.
3865 (derive_item): Accept SimplePath instead of a string.
3866 * ast/rust-ast.h: Add common ProcMacroInvocable interface to
3867 Identifiers and SimplePath nodes.
3868 * ast/rust-ast.cc: Add const modifier.
3869 * ast/rust-macro.h: Change path and identifier getters.
3870 * ast/rust-path.h: Change return type to reference.
3871 * util/rust-proc-macro-invocation.h: New file.
3873 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3875 * util/rust-attributes.h (RUST_ATTRIBUTES_H): Add missing header
3878 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3880 * ast/rust-ast.h (class MetaItem): Add MetaItem dispatch values.
3881 * ast/rust-expr.h: Add LitExpr and PathLit dispatch.
3882 * ast/rust-macro.h: Add remaining dispatch getters.
3884 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3886 * metadata/rust-extern-crate.h: Add proc macro getter.
3887 * rust-session-manager.cc (Session::load_extern_crate): Collect
3888 mappings and create mappings.
3889 * util/rust-hir-map.cc: Add insertion and lookup functions for
3891 * util/rust-hir-map.h: Add function prototypes.
3893 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3895 * metadata/rust-imports.cc (Import::try_package_in_directory):
3896 Add call to load macros before loading metadatas.
3897 * expand/rust-proc-macro.cc: Return empty vector instead of
3900 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3902 * metadata/rust-import-archive.cc (Stream_concatenate::do_peek):
3904 (Stream_concatenate::do_advance): Likewise.
3905 (Import::find_archive_export_data): Replace with a smart
3907 * metadata/rust-imports.cc (add_search_path): Change return type
3909 (Import::open_package): Likewise.
3910 (Import::try_package_in_directory): Likewise.
3911 (Import::find_export_data): Likewise.
3912 (Import::find_object_export_data): Likewise.
3913 (Import::Import): Change constructor to accept unique_ptr.
3914 * metadata/rust-imports.h: Change constructor prototype.
3915 * rust-session-manager.cc (Session::load_extern_crate): Change
3916 pointer to smart pointer.
3918 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3920 * metadata/rust-extern-crate.cc (ExternCrate::ExternCrate):
3921 Change constructor to accept procedural macro vector.
3922 * metadata/rust-extern-crate.h: Add vector of procecural macro
3924 * rust-session-manager.cc (Session::load_extern_crate): Add
3925 argument to new constructor call.
3927 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3929 * metadata/rust-imports.cc (add_search_path): Change prototype,
3930 now return a pair of Stream and procedural macro vector.
3931 (Import::open_package): Likewise.
3932 (Import::try_package_in_directory): Likewise.
3933 * metadata/rust-imports.h: Likewise.
3934 * rust-session-manager.cc (Session::load_extern_crate):
3937 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3939 * metadata/rust-imports.h: Make the function to load a given
3941 * rust-session-manager.cc (Session::load_extern_crate): Change
3942 path resolution depending on extern crate declaration in cli
3945 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3947 * ast/rust-ast-collector.h
3948 (TokenCollector::visit):
3949 Replace default argument with UNDEF_LOCATION.
3951 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
3953 * backend/rust-compile-base.cc: Replace Location with location_t.
3954 * backend/rust-compile-base.h: Likewise.
3955 * backend/rust-compile-block.cc: Likewise.
3956 * backend/rust-compile-expr.cc: Likewise.
3957 * backend/rust-compile-expr.h: Likewise.
3958 * backend/rust-compile-extern.h: Likewise.
3959 * backend/rust-compile-implitem.h: Likewise.
3960 * backend/rust-compile-intrinsic.cc: Likewise.
3961 * backend/rust-compile-item.h: Likewise.
3962 * backend/rust-compile-pattern.h: Likewise.
3963 * backend/rust-compile-resolve-path.cc: Likewise.
3964 * backend/rust-compile-stmt.cc: Likewise.
3965 * backend/rust-compile-type.cc: Likewise.
3966 * backend/rust-compile.cc: Likewise.
3967 * backend/rust-constexpr.cc: Likewise.
3969 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
3971 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3972 refactored and call error function.
3974 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3976 * util/rust-attributes.cc (AttributeChecker::visit): Add help
3979 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3981 * util/rust-attributes.cc (AttributeChecker::visit): Add
3982 attribute input check.
3984 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3986 * util/rust-attributes.cc (AttributeChecker::visit): Add
3987 attribute check on functions.
3989 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3991 * util/rust-token-converter.cc (from_ident): Adapt code to new
3994 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
3996 * expand/rust-proc-macro.cc (tokenstream_from_string): Add a
3997 function that creates a tokenstream from a given string.
3998 (load_macros_array): Add call to registration function.
4000 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4002 * lang.opt: Add option
4003 * rust-session-manager.cc: Add option registration in session
4005 * rust-session-manager.h (struct CompileOptions): Add new getter
4006 for proc macros instead of a boolean.
4008 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4010 * resolve/rust-forever-stack.h: New file.
4011 * resolve/rust-forever-stack.hxx: New file.
4013 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
4015 * hir/rust-hir-dump.cc (convert_param_kind_to_str): New.
4016 (convert_new_bind_type_to_str): New.
4017 (convert_mut_to_str): New.
4022 (Dump::begin_field): New.
4023 (Dump::end_field): New.
4024 (Dump::put_field): New.
4025 (Dump::visit_field): New.
4026 (Dump::visit): Refactor.
4027 (Dump::visit_collection): New.
4028 (Dump::do_traititem): New.
4029 (Dump::do_vis_item): New.
4030 (Dump::do_functionparam): New.
4031 (Dump::do_pathpattern): New.
4032 (Dump::do_structexprstruct): New.
4033 (Dump::do_expr): New.
4034 (Dump::do_pathexpr): New.
4035 (Dump::do_typepathsegment): New.
4036 (Dump::do_typepathfunction): New.
4037 (Dump::do_qualifiedpathtype): New.
4038 (Dump::do_operatorexpr): New.
4039 (Dump::do_mappings): New.
4040 (Dump::do_inner_attrs): New.
4041 (Dump::do_outer_attrs): New.
4042 (Dump::do_baseloopexpr): New.
4043 (Dump::do_ifletexpr): New.
4044 (Dump::do_struct): New.
4045 (Dump::do_enumitem): New.
4046 (Dump::do_traitfunctiondecl): New.
4047 (Dump::do_externalitem): New.
4048 (Dump::do_namefunctionparam): New.
4049 (Dump::do_stmt): New.
4050 (Dump::do_type): New.
4051 (Dump::do_item): New.
4052 (Dump::do_tuplefield): New.
4053 (Dump::do_structfield): New.
4054 (Dump::do_genericargs): New.
4055 (Dump::do_maybenamedparam): New.
4056 * hir/rust-hir-dump.h: Refactor.
4057 * hir/tree/rust-hir-item.h (enum_to_str): New.
4058 * hir/tree/rust-hir-type.h (enum_to_str): New.
4059 * hir/tree/rust-hir.cc (enum_to_str): New.
4060 * util/rust-common.h (enum_to_str): New.
4062 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4063 Matthew Jasper <mjjasper1@gmail.com>
4065 * Make-lang.in: Add `rust-rib.cc` object.
4066 * resolve/rust-rib.cc: New file.
4067 * resolve/rust-rib.h: New file.
4069 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4071 * ast/rust-ast.h: Replace Location with location_t.
4072 * ast/rust-expr.h: Likewise.
4073 * ast/rust-item.h: Likewise.
4074 * ast/rust-macro.h: Likewise.
4075 * ast/rust-path.h: Likewise.
4076 * ast/rust-pattern.h: Likewise.
4077 * ast/rust-stmt.h: Likewise.
4078 * ast/rust-type.h: Likewise.
4079 * hir/rust-ast-lower-base.h: Likewise.
4080 * hir/tree/rust-hir-expr.h: Likewise.
4081 * hir/tree/rust-hir-item.h: Likewise.
4082 * hir/tree/rust-hir-path.h: Likewise.
4083 * hir/tree/rust-hir-pattern.h: Likewise.
4084 * hir/tree/rust-hir-stmt.h: Likewise.
4085 * hir/tree/rust-hir-type.h: Likewise.
4086 * hir/tree/rust-hir.h: Likewise.
4087 * lex/rust-token.h: Likewise.
4088 * resolve/rust-ast-resolve-pattern.h: Likewise.
4089 * typecheck/rust-hir-trait-reference.h: Likewise.
4090 * typecheck/rust-tyty-bounds.h: Likewise.
4091 * typecheck/rust-tyty-call.h: Likewise.
4092 * typecheck/rust-tyty-subst.h: Likewise.
4093 * typecheck/rust-tyty-util.h: Likewise.
4094 * typecheck/rust-tyty.h: Likewise.
4096 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4098 * ast/rust-ast-collector.cc: Replace Location with location_t.
4099 * ast/rust-ast.cc: Likewise.
4100 * ast/rust-ast.h: Likewise.
4101 * ast/rust-expr.h: Likewise.
4102 * ast/rust-item.h: Likewise.
4103 * ast/rust-macro.h: Likewise.
4104 * ast/rust-path.cc: Likewise.
4105 * ast/rust-path.h: Likewise.
4106 * ast/rust-pattern.h: Likewise.
4107 * ast/rust-stmt.h: Likewise.
4108 * ast/rust-type.h: Likewise.
4109 * backend/rust-compile-base.cc: Likewise.
4110 * backend/rust-compile-base.h: Likewise.
4111 * backend/rust-compile-block.cc: Likewise.
4112 * backend/rust-compile-expr.cc: Likewise.
4113 * backend/rust-compile-expr.h: Likewise.
4114 * backend/rust-compile-fnparam.cc: Likewise.
4115 * backend/rust-compile-fnparam.h: Likewise.
4116 * backend/rust-compile-intrinsic.cc: Likewise.
4117 * backend/rust-compile-pattern.cc: Likewise.
4118 * backend/rust-compile-resolve-path.h: Likewise.
4119 * backend/rust-compile.cc: Likewise.
4120 * checks/errors/rust-const-checker.cc: Likewise.
4121 * checks/errors/rust-const-checker.h: Likewise.
4122 * checks/errors/rust-unsafe-checker.cc: Likewise.
4123 * checks/errors/rust-unsafe-checker.h: Likewise.
4124 * expand/rust-macro-builtins.cc: Likewise.
4125 * expand/rust-macro-expand.h: Likewise.
4126 * hir/rust-ast-lower-base.h: Likewise.
4127 * hir/rust-ast-lower-implitem.h: Likewise.
4128 * hir/rust-ast-lower-item.cc: Likewise.
4129 * hir/tree/rust-hir-expr.h: Likewise.
4130 * hir/tree/rust-hir-item.h: Likewise.
4131 * hir/tree/rust-hir-path.h: Likewise.
4132 * hir/tree/rust-hir-pattern.h: Likewise.
4133 * hir/tree/rust-hir-stmt.h: Likewise.
4134 * hir/tree/rust-hir-type.h: Likewise.
4135 * hir/tree/rust-hir.cc: Likewise.
4136 * hir/tree/rust-hir.h: Likewise.
4137 * lex/rust-token.h: Likewise.
4138 * metadata/rust-extern-crate.cc: Likewise.
4139 * metadata/rust-extern-crate.h: Likewise.
4140 * parse/rust-parse-impl.h: Likewise.
4141 * parse/rust-parse.h: Likewise.
4142 * resolve/rust-ast-resolve-expr.cc: Likewise.
4143 * resolve/rust-ast-resolve-implitem.h: Likewise.
4144 * resolve/rust-ast-resolve-pattern.h: Likewise.
4145 * resolve/rust-ast-resolve-stmt.h: Likewise.
4146 * resolve/rust-ast-resolve-toplevel.h: Likewise.
4147 * resolve/rust-ast-resolve-type.h: Likewise.
4148 * resolve/rust-name-resolver.cc: Likewise.
4149 * resolve/rust-name-resolver.h: Likewise.
4150 * rust-diagnostics.cc: Likewise.
4151 * rust-diagnostics.h: Likewise.
4152 * rust-gcc.cc: Likewise.
4153 * rust-session-manager.cc: Likewise.
4154 * rust-session-manager.h: Likewise.
4155 * typecheck/rust-casts.cc: Likewise.
4156 * typecheck/rust-casts.h: Likewise.
4157 * typecheck/rust-coercion.cc: Likewise.
4158 * typecheck/rust-coercion.h: Likewise.
4159 * typecheck/rust-hir-path-probe.cc: Likewise.
4160 * typecheck/rust-hir-path-probe.h: Likewise.
4161 * typecheck/rust-hir-trait-reference.cc: Likewise.
4162 * typecheck/rust-hir-trait-reference.h: Likewise.
4163 * typecheck/rust-hir-trait-resolve.cc: Likewise.
4164 * typecheck/rust-hir-type-check-base.cc: Likewise.
4165 * typecheck/rust-hir-type-check-base.h: Likewise.
4166 * typecheck/rust-hir-type-check-item.cc: Likewise.
4167 * typecheck/rust-hir-type-check-item.h: Likewise.
4168 * typecheck/rust-hir-type-check-path.cc: Likewise.
4169 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
4170 * typecheck/rust-hir-type-check-pattern.h: Likewise.
4171 * typecheck/rust-hir-type-check-type.cc: Likewise.
4172 * typecheck/rust-hir-type-check-type.h: Likewise.
4173 * typecheck/rust-hir-type-check.cc: Likewise.
4174 * typecheck/rust-hir-type-check.h: Likewise.
4175 * typecheck/rust-substitution-mapper.cc: Likewise.
4176 * typecheck/rust-substitution-mapper.h: Likewise.
4177 * typecheck/rust-type-util.cc: Likewise.
4178 * typecheck/rust-typecheck-context.cc: Likewise.
4179 * typecheck/rust-tyty-bounds.cc: Likewise.
4180 * typecheck/rust-tyty-call.h: Likewise.
4181 * typecheck/rust-tyty-subst.cc: Likewise.
4182 * typecheck/rust-tyty-subst.h: Likewise.
4183 * typecheck/rust-tyty-util.cc: Likewise.
4184 * typecheck/rust-tyty-util.h: Likewise.
4185 * typecheck/rust-tyty.cc: Likewise.
4186 * typecheck/rust-tyty.h: Likewise.
4187 * typecheck/rust-unify.cc: Likewise.
4188 * typecheck/rust-unify.h: Likewise.
4189 * util/rust-hir-map.cc: Likewise.
4190 * util/rust-hir-map.h: Likewise.
4191 * util/rust-identifier.h: Likewise.
4193 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4196 (Gcc_backend::debug): Move out of class declaration.
4197 (Gcc_backend::get_identifier_node): Likewise.
4198 (Gcc_backend::wchar_type): Likewise.
4200 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4202 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
4203 called error function.
4205 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4207 * rust-linemap.h (Linemap::predeclared_location): Remove.
4208 * backend/rust-compile-type.cc:
4209 Replace Linemap::predeclared_location with BUILTINS_LOCATION.
4210 * resolve/rust-name-resolver.cc: Likewise.
4211 * typecheck/rust-hir-type-check-type.cc: Likewise.
4212 * typecheck/rust-tyty.cc: Likewise.
4214 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4216 * rust-gcc.h: Add include guard.
4218 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4220 * rust-system.h (rust_unreachable): Change definition to fancy_abort
4221 * ast/rust-ast-collector.cc (TokenCollector::visit): Use rust_unreachable
4222 instead of gcc_unreachable.
4223 (get_delimiters): Likewise.
4224 * ast/rust-ast-dump.h: Likewise.
4225 * ast/rust-ast-formatting.cc (get_string_in_delims): Likewise.
4226 (get_mode_dump_desc): Likewise.
4227 * ast/rust-ast.cc (Visibility::as_string): Likewise.
4228 (UseTreeGlob::as_string): Likewise.
4229 * ast/rust-ast.h: Likewise.
4230 * ast/rust-macro.h: Likewise.
4231 * ast/rust-path.h: Likewise.
4232 * backend/rust-compile-expr.cc (sort_tuple_patterns): Likewise.
4233 (CompileExpr::visit): Likewise.
4234 (CompileExpr::generate_closure_fntype): Likewise.
4235 * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): Likewise.
4236 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): Likewise.
4237 (CompilePatternLet::visit): Likewise.
4238 * backend/rust-constexpr.cc (base_field_constructor_elt): Likewise.
4239 (eval_array_reference): Likewise.
4240 (label_matches): Likewise.
4241 (eval_store_expression): Likewise.
4242 (eval_call_expression): Likewise.
4243 (build_data_member_initialization): Likewise.
4244 (array_index_cmp): Likewise.
4245 (get_array_or_vector_nelts): Likewise.
4246 (eval_bit_field_ref): Likewise.
4247 (eval_loop_expr): Likewise.
4248 (potential_constant_expression_1): Likewise.
4249 * backend/rust-mangle.cc (v0_simple_type_prefix): Likewise.
4250 (v0_type_prefix): Likewise.
4251 (v0_mangle_item): Likewise.
4252 (Mangler::mangle_item): Likewise.
4253 * backend/rust-tree.cc (convert_to_void): Likewise.
4254 (type_memfn_quals): Likewise.
4255 (rs_tree_equal): Likewise.
4256 (fold_offsetof): Likewise.
4257 (fold_builtin_source_location): Likewise.
4258 (lvalue_error): Likewise.
4259 * backend/rust-tree.h (struct named_decl_hash): Likewise.
4260 (struct named_label_hash): Likewise.
4261 * checks/errors/privacy/rust-visibility-resolver.cc
4262 (VisibilityResolver::resolve_visibility): Likewise.
4263 (VisibilityResolver::visit): Likewise.
4264 * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Likewise.
4265 * checks/errors/rust-feature.cc (Feature::create): Likewise.
4266 * expand/rust-expand-visitor.cc (get_traits_to_derive): Likewise.
4267 (derive_item): Likewise.
4268 (expand_item_attribute): Likewise.
4269 (expand_stmt_attribute): Likewise.
4270 * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Likewise.
4271 (MacroExpander::match_repetition): Likewise.
4272 (transcribe_context): Likewise.
4273 (MacroExpander::import_proc_macros): Likewise.
4274 (MacroExpander::parse_proc_macro_output): Likewise.
4275 * expand/rust-macro-expand.h: Likewise.
4276 * expand/rust-macro-invoc-lexer.h: Likewise.
4277 * expand/rust-macro-substitute-ctx.cc (SubstituteCtx::substitute_token): Likewise.
4278 * expand/rust-proc-macro-invoc-lexer.h: Likewise.
4279 * expand/rust-proc-macro.cc (load_macros): Likewise.
4280 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_generic_args): Likewise.
4281 (ASTLoweringBase::lower_literal): Likewise.
4282 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
4283 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Likewise.
4284 * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Likewise.
4285 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
4286 * hir/tree/rust-hir.cc (get_string_in_delims): Likewise.
4287 (Visibility::as_string): Likewise.
4288 (UseTreeGlob::as_string): Likewise.
4289 (CompoundAssignmentExpr::as_string): Likewise.
4290 (ArithmeticOrLogicalExpr::as_string): Likewise.
4291 * lex/rust-lex.cc (Lexer::parse_byte_string): Likewise.
4292 (Lexer::parse_string): Likewise.
4293 * lex/rust-token.cc (RS_TOKEN): Likewise.
4294 * parse/rust-parse-impl.h (Parser::parse_simple_path_segment): Likewise.
4295 (Parser::parse_path_ident_segment): Likewise.
4296 (Parser::parse_attr_input): Likewise.
4297 (Parser::parse_inherent_impl_item): Likewise.
4298 (Parser::parse_trait_impl_item): Likewise.
4299 (Parser::parse_type_path_segment): Likewise.
4300 (Parser::parse_reference_type): Likewise.
4301 (get_lbp_for_comparison_expr): Likewise.
4302 * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewise.
4303 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
4304 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
4305 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
4306 (ResolveTypeToCanonicalPath::visit): Likewise.
4307 (ResolveGenericArgs::resolve_disambiguated_generic): Likewise.
4308 * rust-gcc.cc (operator_to_tree_code): Likewise.
4309 (fetch_overflow_builtins): Likewise.
4310 (Gcc_backend::non_zero_size_type): Likewise.
4311 (Gcc_backend::convert_tree): Likewise.
4312 * rust-lang.cc (grs_langhook_type_for_mode): Likewise.
4313 (grs_langhook_global_bindings_p): Likewise.
4314 (grs_langhook_pushdecl): Likewise.
4315 (grs_langhook_getdecls): Likewise.
4316 (convert): Likewise.
4317 * typecheck/rust-autoderef.h: Likewise.
4318 * typecheck/rust-hir-path-probe.cc: Likewise.
4319 * typecheck/rust-hir-trait-reference.cc (TraitItemReference::get_tyty): Likewise.
4320 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): Likewise.
4321 * typecheck/rust-hir-type-check-expr.cc: Likewise.
4322 * typecheck/rust-hir-type-check-expr.h: Likewise.
4323 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): Likewise.
4324 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
4325 * typecheck/rust-hir-type-check-stmt.h: Likewise.
4326 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
4327 * typecheck/rust-substitution-mapper.h: Likewise.
4328 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::get_context_type): Likewise.
4329 * typecheck/rust-tyty-call.h: Likewise.
4330 * typecheck/rust-tyty.cc (TypeKindFormat::to_string): Likewise.
4331 (BaseType::monomorphized_clone): Likewise.
4332 (VariantDef::variant_type_string): Likewise.
4333 (ClosureType::handle_substitions): Likewise.
4334 (IntType::as_string): Likewise.
4335 (UintType::as_string): Likewise.
4336 (FloatType::as_string): Likewise.
4337 * typecheck/rust-unify.cc (UnifyRules::expect_projection): Likewise.
4338 * util/rust-token-converter.cc (convert): Likewise.
4339 (from_literal): Likewise.
4340 (from_group): Likewise.
4341 (from_tokentree): Likewise.
4343 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4345 * checks/errors/rust-feature-gate.cc (FeatureGate::gate):
4346 called error function.
4348 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4350 * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
4351 called error function.
4353 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4355 * checks/errors/rust-unsafe-checker.cc (check_unsafe_call):
4356 called error function.
4358 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4361 (typedef RichLocation): Remove.
4362 * expand/rust-macro-expand.cc: Replace RichLocation with rich_location.
4363 * hir/rust-ast-lower-base.cc: Likewise.
4364 * resolve/rust-ast-resolve-implitem.h: Likewise.
4365 * resolve/rust-ast-resolve-stmt.h: Likewise.
4366 * resolve/rust-ast-resolve-toplevel.h: Likewise.
4367 * rust-diagnostics.cc: Likewise.
4368 * rust-diagnostics.h: Likewise.
4369 * rust-session-manager.cc: Likewise.
4370 * typecheck/rust-casts.cc: Likewise.
4371 * typecheck/rust-coercion.cc: Likewise.
4372 * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
4373 * typecheck/rust-hir-path-probe.h: Likewise.
4374 * typecheck/rust-hir-trait-reference.cc: Likewise.
4375 * typecheck/rust-hir-type-check-expr.cc: Likewise.
4376 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
4377 * typecheck/rust-hir-type-check-item.cc: Likewise.
4378 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
4379 * typecheck/rust-tyty-cmp.h: Likewise.
4380 * typecheck/rust-tyty-subst.cc: Likewise.
4381 * typecheck/rust-tyty.cc: Likewise.
4382 * typecheck/rust-unify.cc: Likewise.
4384 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4387 (Lexer::start_line): Use linemap_line_start.
4389 (Linemap::start_line): Remove.
4391 (Linemap::start_line): Remove.
4393 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4396 (RichLocation::RichLocation): Remove.
4397 (RichLocation::~RichLocation): Remove.
4398 (RichLocation::add_range): Remove.
4399 (RichLocation::add_fixit_insert_before): Remove.
4400 (RichLocation::add_fixit_insert_after): Remove.
4402 (class RichLocation): Remove.
4403 * rust-diagnostics.cc
4404 (rust_be_error_at): Remove RichLocation::get invocation.
4405 * expand/rust-macro-expand.cc: Fix RichLocation constructor.
4406 * hir/rust-ast-lower-base.cc: Likewise.
4407 * resolve/rust-ast-resolve-implitem.h: Likewise.
4408 * resolve/rust-ast-resolve-stmt.h: Likewise.
4409 * resolve/rust-ast-resolve-toplevel.h: Likewise.
4410 * rust-session-manager.cc: Likewise.
4411 * typecheck/rust-casts.cc: Likewise.
4412 * typecheck/rust-coercion.cc: Likewise.
4413 * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
4414 * typecheck/rust-hir-path-probe.h: Likewise.
4415 * typecheck/rust-hir-trait-reference.cc: Likewise.
4416 * typecheck/rust-hir-type-check-expr.cc: Likewise.
4417 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
4418 * typecheck/rust-hir-type-check-item.cc: Likewise.
4419 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
4420 * typecheck/rust-tyty-cmp.h: Likewise.
4421 * typecheck/rust-tyty-subst.cc: Likewise.
4422 * typecheck/rust-tyty.cc: Likewise.
4423 * typecheck/rust-unify.cc: Likewise.
4425 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4428 (Lexer::get_current_location): Use linemap_position_for_column.
4429 * rust-session-manager.cc
4430 (Session::handle_crate_name): Likewise.
4432 (Linemap::get_location): Remove.
4434 (Linemap::get_location): Likewise.
4436 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4438 * lex/rust-token.cc (escape_special_chars): Add a function that
4439 escape a given string.
4440 (Token::as_string): Add call to escape function for string/char
4443 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
4445 * hir/tree/rust-hir-type.h (MaybeNamedParam::get_type): Remove
4447 (BareFunctionType::get_return_type): Likewise.
4449 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4451 * backend/rust-compile-intrinsic.cc (offset_handler): Remove
4453 (sizeof_handler): Likewise.
4454 (transmute_handler): Likewise.
4455 (rotate_handler): Likewise.
4456 (wrapping_op_handler_inner): Likewise.
4457 (op_with_overflow_inner): Likewise.
4458 (atomic_load_handler_inner): Likewise.
4459 (unchecked_op_inner): Likewise.
4460 (uninit_handler): Likewise.
4462 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4464 * ast/rust-ast.h: Add virtual destructor.
4465 * expand/rust-macro-expand.h: Likewise.
4467 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4469 * hir/tree/rust-hir-full-decls.h (struct Crate): Change to
4471 (class Crate): Likewise.
4472 (struct StructField): Likewise.
4473 (class StructField): Likewise.
4474 (struct TupleField): Likewise.
4475 (class TupleField): Likewise.
4476 (struct TraitFunctionDecl): Likewise.
4477 (class TraitFunctionDecl): Likewise.
4478 * rust-session-manager.h (struct Crate): Likewise.
4479 (class Crate): Likewise.
4481 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4484 (MetaItemPathLit::get_locus): Remove copy construction.
4485 * backend/rust-constexpr.cc
4486 (eval_constant_expression): Likewise.
4487 (is_valid_constexpr_fn): Likewise.
4488 * util/rust-token-converter.cc
4489 (convert): Likewise.
4491 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4494 (Lexer::dump_and_skip): Use location_to_string.
4496 (Linemap::to_string): Move to...
4497 (Linemap::location_to_string): ... here.
4499 (Linemap::to_string): Remove.
4500 (Linemap::location_to_string): Remove definition.
4502 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
4504 * hir/tree/rust-hir-expr.h (TypeCastExpr::get_casted_expr): Remove
4506 (TypeCastExpr::get_type_to_convert_to): Likewise.
4507 (CompoundAssignmentExpr::get_left_expr): Likewise.
4508 (CompoundAssignmentExpr::get_right_expr): Likewise.
4509 (GroupedExpr::get_expr_in_parens): Likewise.
4510 (TupleIndexExpr::get_tuple_expr): Likewise.
4511 (FieldAccessExpr::get_receiver_expr): Likewise.
4512 (ClosureParam::get_pattern): Likewise.
4513 (ClosureParam::get_type): Likewise.
4514 (ExprType::get_return_type): Likewise.
4515 (IfLetExpr::get_scrutinee_expr): Likewise.
4516 (MatchArm::get_guard_expr): Likewise.
4517 (MatchExpr::get_scrutinee_expr): Likewise.
4518 * hir/tree/rust-hir-item.h (TypeParam::get_type): Likewise.
4519 (SelfParam::get_type): Likewise.
4520 (Function::get_return_type): Likewise.
4521 (TypeAlias::get_type_aliased): Likewise.
4522 (StructField::get_field_type): Likewise.
4523 (TraitFunctionDecl::get_block_expr): Likewise.
4524 (ImplBlock::get_trait_ref): Likewise.
4525 * hir/tree/rust-hir-path.h (ConstGenericArg::get_expression): New.
4526 (TypePathFunction::get_return_type): Remove assert in accessor.
4527 (QualifiedPathType::get_trait): Likewise.
4528 * hir/tree/rust-hir-pattern.h (PatternType::get_lower_bound): Likewise.
4529 (PatternType::get_upper_bound): Likewise.
4530 (ReferencePattern::get_referenced_pattern): Likewise.
4531 * hir/tree/rust-hir.h (ConstGenericParam::get_default_expression): Likewise.
4533 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4535 * hir/rust-ast-lower-base.cc (struct_field_name_exists):
4536 called error function.
4538 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4540 * rust-diagnostics.cc
4541 (rust_be_error_at): Add function accepting location_t and ErrorCode.
4542 (rust_error_at): Likewise.
4543 * rust-diagnostics.h
4544 (rust_error_at): Likewise.
4545 (rust_be_error_at): Likewise.
4547 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4550 (class Gcc_linemap): Remove.
4551 (Gcc_linemap::start_file): Move to...
4552 (Linemap::start_file): ... here.
4553 (Gcc_linemap::to_string): Move to...
4554 (Linemap::to_string): ... here.
4555 (Gcc_linemap::stop): Move to...
4556 (Linemap::stop): ... here.
4557 (Gcc_linemap::start_line): Move to...
4558 (Linemap::start_line): ... here.
4559 (Gcc_linemap::get_location): Move to...
4560 (Linemap::get_location): ... here.
4561 (rust_get_linemap): Use Linemap.
4563 (Linemap::in_file_): New field from Gcc_linemap.
4564 (Linemap::Linemap): Initialize in_file_.
4565 (Linemap::~Linemap): Make non-virtual.
4566 (Linemap::start_file): Likewise.
4567 (Linemap::start_line): Likewise.
4568 (Linemap::get_location): Likewise.
4569 (Linemap::stop): Likewise.
4570 (Linemap::to_string): Likewise.
4572 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4574 * Make-lang.in: Remove rust-optional-test.cc's object file
4575 * ast/rust-macro.h: Remove use of Rust::Optional
4576 * backend/rust-compile-base.cc
4577 (HIRCompileBase::resolve_method_address): Likewise.
4578 * checks/errors/privacy/rust-privacy-reporter.cc
4579 (PrivacyReporter::check_for_privacy_violation): Likewise.
4580 (PrivacyReporter::visit): Likewise.
4581 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
4582 * checks/errors/rust-feature-gate.cc (FeatureGate::check): Likewise.
4583 * checks/errors/rust-feature.cc (Feature::create): Likewise.
4584 (Feature::as_name): Likewise.
4585 * checks/errors/rust-feature.h: Likewise.
4586 * expand/rust-macro-builtins.cc: Likewise.
4587 * lex/rust-lex.cc (Lexer::Lexer): Likewise.
4588 (Lexer::skip_token): Likewise.
4589 (Lexer::dump_and_skip): Likewise.
4590 * lex/rust-lex.h: Likewise.
4591 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
4592 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
4593 * rust-lang.cc (run_rust_tests): Likewise.
4594 * rust-session-manager.cc (Session::compile_crate): Likewise.
4595 (TargetOptions::dump_target_options): Likewise.
4596 * rust-session-manager.h (struct TargetOptions): Likewise.
4597 * util/rust-hir-map.cc (Mappings::lookup_module_children): Likewise.
4598 (Mappings::lookup_module_chidren_items): Likewise.
4599 (Mappings::lookup_module_child): Likewise.
4600 (Mappings::lookup_parent_module): Likewise.
4601 * util/rust-hir-map.h (RUST_HIR_MAP_H): Likewise.
4602 * util/rust-optional-test.cc: Removed.
4603 * util/rust-optional.h: Removed.
4605 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4607 * rust-linemap.h (Linemap::unknown_location): Remove.
4609 Replace Linemap::unknown_location with UNKNOWN_LOCATION.
4610 * ast/rust-path.cc: Likewise.
4611 * hir/tree/rust-hir.cc: Likewise.
4612 * metadata/rust-imports.cc: Likewise.
4613 * parse/rust-parse-impl.h: Likewise.
4614 * parse/rust-parse.h: Likewise.
4615 * rust-backend.h: Likewise.
4616 * rust-diagnostics.cc: Likewise.
4617 * rust-session-manager.cc: Likewise.
4618 * typecheck/rust-tyty.cc: Likewise.
4620 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4622 * resolve/rust-ast-verify-assignee.h: called error function.
4624 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4626 * typecheck/rust-tyty-call.cc (emit_unexpected_argument_error):
4627 Refactored invalid number of argument into one function.
4628 (TypeCheckCallExpr::visit): called refactored function.
4629 (TypeCheckMethodCallExpr::check): likewise.
4631 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4633 * util/expected.h: Adapt class to GCC requirements.
4635 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4637 * util/expected.h: New file.
4639 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4641 * util/optional.h: Adapt for GCC.
4643 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
4645 * util/optional.h: New file.
4647 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4649 * rust-location.h (UNDEF_LOCATION): New.
4650 * ast/rust-ast-collector.cc: Replace Location () with UNDEF_LOCATION.
4651 * ast/rust-ast-fragment.cc: Likewise.
4652 * ast/rust-ast.h: Likewise.
4653 * ast/rust-expr.h: Likewise.
4654 * ast/rust-item.h: Likewise.
4655 * ast/rust-macro.h: Likewise.
4656 * ast/rust-path.h: Likewise.
4657 * ast/rust-type.h: Likewise.
4658 * backend/rust-compile-expr.cc: Likewise.
4659 * backend/rust-compile-extern.h: Likewise.
4660 * backend/rust-compile-implitem.h: Likewise.
4661 * backend/rust-compile-intrinsic.cc: Likewise.
4662 * backend/rust-compile-item.h: Likewise.
4663 * backend/rust-compile.cc: Likewise.
4664 * backend/rust-constexpr.cc: Likewise.
4665 * expand/rust-expand-visitor.cc: Likewise.
4666 * expand/rust-macro-expand.cc: Likewise.
4667 * expand/rust-macro-expand.h: Likewise.
4668 * expand/rust-macro-invoc-lexer.cc: Likewise.
4669 * expand/rust-proc-macro-invoc-lexer.cc: Likewise.
4670 * expand/rust-proc-macro.cc: Likewise.
4671 * hir/tree/rust-hir-expr.h: Likewise.
4672 * hir/tree/rust-hir-item.h: Likewise.
4673 * hir/tree/rust-hir-path.h: Likewise.
4674 * hir/tree/rust-hir-type.h: Likewise.
4675 * hir/tree/rust-hir.h: Likewise.
4676 * lex/rust-lex.cc: Likewise.
4677 * metadata/rust-export-metadata.cc: Likewise.
4678 * parse/rust-parse-impl.h: Likewise.
4679 * resolve/rust-ast-resolve-item.cc: Likewise.
4680 * resolve/rust-ast-resolve.cc: Likewise.
4681 * rust-diagnostics.h: Likewise.
4682 * rust-session-manager.cc: Likewise.
4683 * typecheck/rust-autoderef.cc: Likewise.
4684 * typecheck/rust-coercion.cc: Likewise.
4685 * typecheck/rust-hir-dot-operator.cc: Likewise.
4686 * typecheck/rust-hir-path-probe.cc: Likewise.
4687 * typecheck/rust-hir-trait-reference.cc: Likewise.
4688 * typecheck/rust-hir-trait-reference.h: Likewise.
4689 * typecheck/rust-hir-type-check-expr.cc: Likewise.
4690 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
4691 * typecheck/rust-hir-type-check-type.cc: Likewise.
4692 * typecheck/rust-hir-type-check.cc: Likewise.
4693 * typecheck/rust-tyty-bounds.cc: Likewise.
4694 * typecheck/rust-tyty-subst.cc: Likewise.
4695 * typecheck/rust-tyty.cc: Likewise.
4696 * util/rust-hir-map.cc: Likewise.
4698 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4700 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix abit
4703 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4705 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix
4706 external item trailing semicolon and outer attributes.
4708 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4710 * ast/rust-ast-collector.cc (TokenCollector::visit): Output
4711 outer attributes on external functions.
4713 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4715 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix method
4718 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4720 * ast/rust-ast-collector.cc (TokenCollector::visit): Add where
4723 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4725 * ast/rust-ast-collector.cc (TokenCollector::visit): Add outer
4726 attributes to collector output.
4728 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4730 * ast/rust-ast-collector.cc (TokenCollector::visit): Add
4731 variadics in collector output.
4733 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4735 * ast/rust-ast-collector.cc (TokenCollector::visit): Add
4738 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4740 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix generic
4743 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4745 * ast/rust-ast-collector.cc (TokenCollector::visit): Reformat
4748 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4750 * ast/rust-ast-collector.cc (TokenCollector::visit): Output
4751 generic in inherent impl.
4753 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4755 * ast/rust-ast-dump.cc (Dump::require_spacing): Change dollar
4758 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4760 * ast/rust-ast-collector.cc (TokenCollector::visit): Change
4763 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4765 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix trait
4768 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4770 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix binding
4773 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4775 * ast/rust-ast-collector.cc (TokenCollector::visit): Output
4776 function qualifiers after visibility.
4778 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4780 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix self
4783 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4785 * ast/rust-ast-dump.cc (Dump::require_spacing): Add a rule to
4786 remove spaces around dots and after references.
4788 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4790 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix several
4791 token collection rules.
4792 * ast/rust-ast-dump.cc (Dump::require_spacing): Add spacing rule
4795 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4797 * expand/rust-macro-invoc-lexer.h
4798 (class MacroInvocLexerBase): New.
4800 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4802 * expand/rust-macro-builtins.cc
4803 (source_relative_path): Use LOCATION_FILE.
4804 (MacroBuiltin::file_handler): Likewise.
4805 (MacroBuiltin::column_handler): Use LOCATION_COLUMN.
4806 (MacroBuiltin::line_handler): Use LOCATION_LINE.
4808 (Gcc_linemap::location_file): Remove.
4809 (Gcc_linemap::location_line): Remove.
4810 (Gcc_linemap::location_column): Remove.
4812 (Linemap::location_file): Remove.
4813 (Linemap::location_line): Remove.
4814 (Linemap::location_column): Remove.
4815 (Linemap::location_to_file): Remove.
4816 (Linemap::location_to_line): Remove.
4817 (Linemap::location_to_column): Remove.
4819 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4821 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
4822 called error function and changed error message
4825 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4828 (Gcc_linemap::get_unknown_location): Remove.
4829 (Gcc_linemap::get_predeclared_location): Remove.
4830 (Gcc_linemap::is_predeclared): Remove.
4831 (Gcc_linemap::is_unknown): Remove.
4833 (Linemap::get_predeclared_location): Remove.
4834 (Linemap::get_unknown_location): Remove.
4835 (Linemap::is_predeclared): Remove.
4836 (Linemap::is_unknown): Remove.
4837 (Linemap::predeclared_location): Use BUILTINS_LOCATION.
4838 (Linemap::unknown_location): Use UNKNOWN_LOCATION.
4839 (Linemap::is_predeclared_location): Remove.
4840 (Linemap::is_unknown_location): Remove.
4842 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4844 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
4845 called error function
4847 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4849 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve):
4850 called error function.
4852 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
4854 * lex/rust-lex.cc (Lexer::input_source_is_valid_utf8): New method of `Lexer`.
4855 * lex/rust-lex.h: Likewise.
4856 * rust-session-manager.cc (Session::compile_crate): Add error.
4858 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4860 * expand/rust-macro-expand.cc
4861 (transcribe_expression): Skip trailing semicolon.
4863 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
4865 * typecheck/rust-hir-type-check-item.cc: called error function.
4867 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
4869 * ast/rust-ast.h: Modify constructors of `Rust::Identifier`
4870 * ast/rust-pattern.h: Likewise.
4871 * hir/tree/rust-hir-item.h: Likewise.
4872 * parse/rust-parse-impl.h (Parser::parse_macro_rules_def): Likewise.
4873 (Parser::parse_decl_macro_def): Likewise.
4874 (Parser::parse_macro_match_fragment): Likewise.
4875 (Parser::parse_module): Likewise.
4876 (Parser::parse_use_tree): Likewise.
4877 (Parser::parse_function): Likewise.
4878 (Parser::parse_type_param): Likewise.
4879 (Parser::parse_type_alias): Likewise.
4880 (Parser::parse_struct): Likewise.
4881 (Parser::parse_struct_field): Likewise.
4882 (Parser::parse_enum): Likewise.
4883 (Parser::parse_enum_item): Likewise.
4884 (Parser::parse_union): Likewise.
4885 (Parser::parse_static_item): Likewise.
4886 (Parser::parse_trait): Likewise.
4887 (Parser::parse_trait_item): Likewise.
4888 (Parser::parse_trait_type): Likewise.
4889 (Parser::parse_trait_const): Likewise.
4890 (Parser::parse_external_item): Likewise.
4891 (Parser::parse_generic_args_binding): Likewise.
4892 (Parser::parse_method): Likewise.
4893 (Parser::parse_maybe_named_param): Likewise.
4894 (Parser::parse_identifier_pattern): Likewise.
4895 (Parser::parse_struct_expr_field): Likewise.
4896 (ResolveItem::visit): Likewise.
4897 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit):Add comments
4898 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
4899 * checks/lints/rust-lint-scan-deadcode.h: Fix error location
4901 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
4903 * backend/rust-compile-base.cc
4904 (HIRCompileBase::address_expression): Remove gcc_location method call.
4905 (HIRCompileBase::indirect_expression): Likewise.
4906 (HIRCompileBase::compile_constant_item): Likewise.
4907 (HIRCompileBase::named_constant_expression): Likewise.
4908 * backend/rust-compile-expr.cc
4909 (CompileExpr::visit): Remove gcc_location method call, use UNKNOWN_LOCATION to initialize.
4910 (CompileExpr::get_fn_addr_from_dyn): Remove gcc_location method call.
4911 (CompileExpr::type_cast_expression): Likewise.
4912 * backend/rust-compile-intrinsic.cc
4913 (transmute_handler): Replace "Location ().gcc_location ()" with UNKNOWN_LOCATION.
4914 (copy_nonoverlapping_handler): Likewise.
4915 (prefetch_data_handler): Likewise.
4916 (atomic_store_handler_inner): Likewise.
4917 (atomic_load_handler_inner): Likewise.
4918 * resolve/rust-ast-resolve-expr.cc
4919 (ResolveExpr::visit): Remove gcc_location method call.
4920 * rust-diagnostics.cc
4921 (rust_be_error_at): Likewise.
4922 (rust_be_warning_at): Likewise.
4923 (rust_be_fatal_error): Likewise.
4924 (rust_be_inform): Likewise.
4925 * rust-diagnostics.h
4926 (rust_sorry_at): Likewise.
4928 (Bvariable::get_tree): Likewise.
4929 (Gcc_backend::fill_in_fields): Likewise.
4930 (Gcc_backend::named_type): Likewise.
4931 (Gcc_backend::real_part_expression): Likewise.
4932 (Gcc_backend::imag_part_expression): Likewise.
4933 (Gcc_backend::complex_expression): Likewise.
4934 (Gcc_backend::convert_expression): Likewise.
4935 (Gcc_backend::struct_field_expression): Likewise.
4936 (Gcc_backend::compound_expression): Likewise.
4937 (Gcc_backend::conditional_expression): Likewise.
4938 (Gcc_backend::negation_expression): Likewise.
4939 (Gcc_backend::arithmetic_or_logical_expression): Likewise.
4940 (Gcc_backend::arithmetic_or_logical_expression_checked): Likewise.
4941 (Gcc_backend::comparison_expression): Likewise.
4942 (Gcc_backend::lazy_boolean_expression): Likewise.
4943 (Gcc_backend::constructor_expression): Likewise.
4944 (Gcc_backend::array_constructor_expression): Likewise.
4945 (Gcc_backend::array_initializer): Likewise.
4946 (Gcc_backend::array_index_expression): Likewise.
4947 (Gcc_backend::call_expression): Likewise.
4948 (Gcc_backend::assignment_statement): Likewise.
4949 (Gcc_backend::return_statement): Likewise.
4950 (Gcc_backend::exception_handler_statement): Likewise.
4951 (Gcc_backend::if_statement): Likewise.
4952 (Gcc_backend::loop_expression): Likewise.
4953 (Gcc_backend::exit_expression): Likewise.
4954 (Gcc_backend::block): Likewise.
4955 (Gcc_backend::convert_tree): Likewise.
4956 (Gcc_backend::global_variable): Likewise.
4957 (Gcc_backend::local_variable): Likewise.
4958 (Gcc_backend::parameter_variable): Likewise.
4959 (Gcc_backend::static_chain_variable): Likewise.
4960 (Gcc_backend::temporary_variable): Likewise.
4961 (Gcc_backend::label): Likewise.
4962 (Gcc_backend::goto_statement): Likewise.
4963 (Gcc_backend::label_address): Likewise.
4964 (Gcc_backend::function): Likewise.
4966 (Gcc_linemap::to_string): Likewise.
4967 (Gcc_linemap::location_file): Likewise.
4968 (Gcc_linemap::location_line): Likewise.
4969 (Gcc_linemap::location_column): Likewise.
4970 (Gcc_linemap::is_predeclared): Likewise.
4971 (Gcc_linemap::is_unknown): Likewise.
4972 (RichLocation::RichLocation): Likewise.
4973 (RichLocation::add_range): Likewise.
4974 (RichLocation::add_fixit_insert_before): Likewise.
4975 (RichLocation::add_fixit_insert_after): Likewise.
4977 (class Location): Replace with typedef.
4978 (operator<): Remove.
4979 (operator==): Remove.
4980 (operator+): Remove.
4981 (operator-): Remove.
4982 * typecheck/rust-hir-trait-resolve.cc
4983 (AssociatedImplTrait::setup_associated_types): Initialize Location with UNKNOWN_LOCATION.
4984 * typecheck/rust-hir-type-check-stmt.cc
4985 (TypeCheckStmt::visit): Likewise.
4986 * util/rust-token-converter.cc
4987 (convert): Remove gcc_location method call.
4989 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
4991 * hir/tree/rust-hir-expr.h (BorrowExpr::is_double_borrow): New.
4992 (ArrayElemsCopied::get_elem_to_copy)
4993 (ArrayElemsCopied::get_num_copies_expr): Return unique_ptr.
4994 (CallExpr::get_fnexpr): Likewise.
4995 (ReturnExpr::get_expr): Likewise.
4996 (StructExprStructFields::get_struct_base): New.
4997 (MethodCallExpr::has_params): New.
4998 (ClosureExpr::has_params): New.
4999 (BlockExpr::get_inner_attrs): New.
5000 (WhileLoopExpr::get_patterns): New.
5001 (ForLoopExpr::get_pattern): New.
5002 (IfLetExpr::get_if_block): Return ref to unique_ptr.
5003 (IfLetExprConseqElse::get_else_block): Likewise.
5004 (MatchExpr::get_inner_attrs): New.
5005 * hir/tree/rust-hir-item.h (Module::get_module_name): New.
5006 (ExternCrate::get_referenced_crate)
5007 (ExternCrate::get_as_clause_name): New.
5008 (UseTreeGlob::get_glob_type, UseTreeGlob::get_path): New.
5009 (UseTreeList::get_path_type, UseTreeList::get_path)
5010 (UseTreeList::get_trees): New.
5011 (TraitItemKind::get_expr): Remove assert. unique_ptr can
5012 be "empty". Must be checked in caller.
5013 * hir/tree/rust-hir-pattern.h (IdentifierPattern::get_is_ref)
5014 (IdentifierPattern::get_to_bind): New.
5015 (RangePatternBoundType::get_has_minus): New.
5016 (RangePattern::get_has_ellipsis_syntax): New.
5017 (StructPatternField::get_outer_attrs): New.
5018 (StructPatternFieldTuplePat::get_index)
5019 (StructPatternFieldTuplePat::get_tuple_pattern): New.
5020 (StructPatternFieldIdent::get_has_ref): New.
5021 * hir/tree/rust-hir-stmt.h (LetStmt::get_outer_attrs): New.
5023 (LetStmt::get_init_expr, LetStmt::get_pattern): Return unique_ptr.
5024 (ExprStmt::get_expr): Likewise.
5025 * hir/tree/rust-hir-type.h (TraitBound::get_for_lifetimes): New.
5026 (TraitBound::get_in_params): New.
5027 (TraitBound::get_opening_question_mark): New.
5028 (ImplTraitType::get_type_param_bounds): New.
5029 (TraitObjectType::get_has_dyn): New.
5030 (TraitBound::get_type_in_parens): New.
5031 (ImplTraitTypeOneBound::get_trait_bound): New.
5032 (BareFunctionType::get_for_lifetimes)
5033 (BareFunctionType::get_is_variadic)
5034 (BareFunctionType::get_function_qualifiers): New.
5035 * hir/tree/rust-hir.h (class Expr): Virtual inherit from FullVisitable.
5036 (class Pattern): Likewise.
5037 (ConstGenericParam::get_name): New.
5038 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adjust call.
5039 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
5040 * backend/rust-compile-expr.cc (CompileExpr::visit): Adjust call.
5041 (CompileExpr::array_copied_expr): Likewise.
5042 (CompileExpr::generate_possible_fn_trait_call): Likewise.
5043 * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
5044 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
5045 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
5046 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
5047 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
5048 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
5050 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5052 * typecheck/rust-hir-path-probe.h: called error function
5054 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5056 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
5057 called error function
5059 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
5061 * hir/tree/rust-hir-expr.h (class ArrayElems): Inherit from FullVisitable.
5062 (class StructExprField): Likewise.
5063 * hir/tree/rust-hir-item.h (class WhereClauseItem): Likewise.
5064 (class UseTree): Likewise.
5065 (UseTreeRebind::get_path, UseTreeRebind::get_identifier)
5066 (UseTreeRebind::get_bind_type): New.
5067 (UseDeclaration::get_use_tree): New.
5068 (struct TraitFunctionDecl): Change struct to ...
5069 (class TraitFunctionDecl): ... class.
5070 (TraitFunctionDecl::get_where_clause): New.
5071 (StructField::get_outer_attrs): New.
5072 (struct TupleField): Change struct to ...
5073 (class TupleField): ... class.
5074 (TupleField::get_visibility, TupleField::get_outer_attrs): New.
5075 * hir/tree/rust-hir-pattern.h (class TupleStructItems): Inherit
5078 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
5080 * lex/rust-lex.cc (Lexer::build_token): Replace function call.
5081 (Lexer::parse_string): Likewise.
5082 (Lexer::parse_identifier_or_keyword): Likewise.
5083 (Lexer::parse_raw_string): Likewise.
5084 (Lexer::parse_char_or_lifetime): Likewise.
5085 (Lexer::get_input_codepoint_length): Deleted.
5086 (Lexer::peek_codepoint_input): Deleted.
5087 (Lexer::skip_codepoint_input): Deleted.
5088 * lex/rust-lex.h: Remove some methods and fields
5090 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5092 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): track output
5093 * util/rust-hir-map.cc (Mappings::lookup_trait_item_lang_item): new helper
5094 * util/rust-hir-map.h: add prototype for helper
5096 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5098 * backend/rust-compile-expr.cc (CompileExpr::generate_possible_fn_trait_call): use fnexpr
5099 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_fn_trait_call): likewise
5101 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5103 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
5105 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
5107 * hir/tree/rust-hir.h (struct Crate): Rename struct into ...
5108 (class Crate): ... class, and add get_items.
5109 * backend/rust-compile.cc (CompileCrate::go): Adapt to visibility change of items.
5110 * checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve): Likewise.
5111 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::go): Likewise.
5112 * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::go): Likewise.
5113 * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::go): Likewise.
5114 * checks/errors/rust-const-checker.cc (ConstChecker::go): Likewise.
5115 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::go): Likewise.
5116 * checks/lints/rust-lint-marklive.cc (FindEntryPoint::find): Likewise.
5117 * checks/lints/rust-lint-scan-deadcode.h (ScanDeadCode::Scan): Likewise.
5118 * metadata/rust-export-metadata.cc (PublicInterface::gather_export_data): Likewise.
5119 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
5120 * hir/rust-hir-dump.cc (CompileCrate::go): Likewise.
5122 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
5124 * hir/tree/rust-hir-expr.h (AwaitExpr::get_awaited_expr): New.
5125 (AsyncBlockExpr::get_has_move, AsyncBlockExpr::get_block_expr): New.
5126 * hir/tree/rust-hir-item.h (Enum::get_where_clause): New.
5127 (Trait::get_where_clause, Trait::is_unsafe): New.
5128 (ExternalItem::get_visibility): New.
5130 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
5132 * hir/tree/rust-hir.h (class FullVisitable): New.
5133 (class Stmt): Adjust with new class.
5134 (class Expr): Likewise.
5135 (class Pattern): Likewise.
5136 (class Type): Likewise.
5137 (class TypeParamBound): Likewise.
5138 (class GenericParam): Likewise.
5139 (class TraitItem): Likewise.
5140 (class ImplItem): Likewise.
5142 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
5144 * hir/tree/rust-hir.h (class WithInnerAttrs): New.
5145 (class Item): Adjust to new WithInnerAttrs class.
5146 (struct Crate): Likewise.
5147 * hir/rust-hir-dump.cc (Dump::go): Likewise.
5148 (Dump::visit): Likewise.
5149 * hir/tree/rust-hir-expr.h (class GroupedExpr): Likewise.
5150 (class ArrayExpr): Likewise.
5151 (class TupleExpr): Likewise.
5152 (class StructExprStruct): Likewise.
5153 (class BlockExpr): Likewise.
5154 (class MatchExpr): Likewise.
5155 * hir/tree/rust-hir-item.h (TypeParam::get_outer_attribute): New.
5156 (class Module): Adjust to new WithInnerAttrs class.
5157 (struct StructField): change struct to...
5158 (class StructField): ... a class.
5159 (class ImplBlock): Adjust to new WithInnerAttrs class.
5160 (class ExternBlock): Likewise.
5162 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
5164 * hir/tree/rust-hir-type.h (ArrayType::get_element_type): Returns
5166 * hir/tree/rust-hir-expr.h (ArithmeticOrLogicalExpr::get_lhs)
5167 (ArithmeticOrLogicalExpr::get_rhs): Likewise.
5168 (ComparisonExpr::get_lhs, ComparisonExpr::get_rhs): Likewise.
5169 (LazyBooleanExpr::get_lhs, LazyBooleanExpr::get_rhs): Likewise.
5170 (AssignmentExpr::get_lhs, AssignmentExpr::get_rhs): Likewise.
5171 (ArrayExpr::get_internal_elements): Likewise.
5172 (ArrayIndexExpr::get_index_expr, ArrayIndexExpr::get_array_expr):
5174 (StructExprFieldWithVal::get_value): Likewise.
5175 (IfExpr::get_if_condition, IfExpr::get_if_block): Likewise.
5176 (ExprWithBlock::get_else_block): Likewise.
5177 * hir/tree/rust-hir-item.h (FunctionParam::get_param_name)
5178 (FunctionParam::get_type): Likewise.
5179 (ConstantItem::get_type, ConstantItem::get_expr): Likewise.
5180 (StaticItem::get_expr, StaticItem::get_type): Likewise.
5181 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
5182 Adjust for previous change.
5183 * backend/rust-compile-block.cc (CompileConditionalBlocks::visit):
5185 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
5186 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
5187 * backend/rust-compile-struct-field-expr.cc
5188 (CompileStructExprField::visit): Likewise.
5189 * checks/errors/privacy/rust-privacy-reporter.cc
5190 (PrivacyReporter::visit): Likewise.
5191 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5193 * typecheck/rust-hir-type-check-implitem.cc
5194 (TypeCheckImplItem::visit): Likewise.
5195 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
5197 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit):
5199 * typecheck/rust-hir-type-check-struct.cc
5200 (TypeCheckStructExpr::visit): Likewise.
5201 * typecheck/rust-hir-type-check.cc
5202 (TraitItemReference::get_type_from_fn): Likewise.
5204 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5206 * ast/rust-pattern.h: Change constructor to accept new parameter
5207 instead of defaulting on string type.
5208 * parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern):
5209 Propagate type hint.
5210 (Parser::parse_pattern_no_alt): Likewise.
5212 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
5214 * lex/rust-lex.cc (Lexer::parse_byte_char):add check for range of codepoint
5216 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5218 * typecheck/rust-hir-type-check-pattern.cc (emit_invalid_field_error): Refactored Field
5220 (TypeCheckPattern::visit): called emit_invalid_field_error function
5222 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
5224 * expand/rust-macro-expand.cc
5225 (MacroExpander::match_matcher): Remove append_fragment inside repetitions.
5226 (MacroExpander::match_n_matches): Use sub_stack push/pop to handle repetitions.
5227 (MatchedFragmentContainer::add_fragment): Add MatchedFragmentContainer accepting version.
5228 * expand/rust-macro-expand.h
5229 (MatchedFragmentContainer::add_fragment): Likewise.
5230 (MatchedFragmentContainerRepetition::add_fragment): Likewise.
5231 (SubstititionScope::append_fragment): Likewise.
5233 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5235 * typecheck/rust-casts.cc (TypeCastRules::check): apply new argument
5236 * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): track if this is a cast site
5237 (TypeCoercionRules::TryCoerce): update ctor
5238 (TypeCoercionRules::TypeCoercionRules): cleanup error handling
5239 (TypeCoercionRules::do_coercion): likewise
5240 (TypeCoercionRules::coerce_unsafe_ptr): only infer in try mode
5241 (TypeCoercionRules::coerce_borrowed_pointer): cleanup
5242 * typecheck/rust-coercion.h: update header
5244 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5246 * typecheck/rust-hir-trait-reference.h: update prototype
5247 * typecheck/rust-hir-trait-resolve.cc: add generic args as an out param
5248 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): use the generics
5250 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5252 * ast/rust-ast-collector.cc (TokenCollector::visit): Add comment
5253 after tail expressions.
5254 * ast/rust-ast-dump.cc (Dump::require_spacing): Check for
5255 missing previous token.
5256 * ast/rust-ast-dump.h: Output formatting characters.
5258 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5260 * ast/rust-ast-collector.cc (TokenCollector::collect): Collect
5261 CollectItems once done.
5262 (TokenCollector::newline): Add newline formatting
5264 (TokenCollector::indentation): Add indentation implementation.
5265 (TokenCollector::increment_indentation): Add indentation
5267 (TokenCollector::comment): Add new comment formatting option.
5268 * ast/rust-ast-collector.h: Update prototypes.
5270 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5272 * ast/rust-ast-collector.cc (TokenCollector::collect_tokens):
5274 (TokenCollector::visit_items_joined_by_separator): Change store
5276 (TokenCollector::visit_as_line): Likewise.
5277 (TokenCollector::visit_items_as_block): Likewise.
5278 (TokenCollector::trailing_comma): Likewise.
5279 (TokenCollector::visit): Likewise.
5280 (TokenCollector::visit_closure_common): Likewise.
5281 (TokenCollector::visit_function_common): Likewise.
5282 * ast/rust-ast-collector.h (class CollectItem): Add class to
5283 differentiate between formatting and raw data (tokens).
5285 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5287 * ast/rust-ast-collector.cc (TokenCollector::TokenCollector):
5288 Remove constructor, changing it to an implicit default
5290 * ast/rust-ast-collector.h: Change from container reference to
5292 * ast/rust-ast-dump.h: Change call to constructor.
5293 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
5295 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5297 * ast/rust-ast-dump.cc (Dump::require_spacing): Add a function
5298 to determine wether a space shall output.
5299 * ast/rust-ast-dump.h: Add function prototype as well as
5302 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5304 * ast/rust-ast-collector.cc (TokenCollector::visit): Add a visit
5305 function for visitable abstract class so we can call a dump on
5307 * ast/rust-ast-collector.h: Add new visit function prototype.
5308 * ast/rust-ast-dump.cc (Dump::go): Add call to process function.
5309 (Dump::visit): Remove functions.
5310 (Dump::visit_items_joined_by_separator): Likewise.
5311 (Dump::visit_as_line): Likewise.
5312 (Dump::visit_items_as_lines): Likewise.
5313 (Dump::visit_items_as_block): Likewise.
5314 (Dump::visit_function_common): Likewise.
5315 (get_delimiters): Likewise.
5316 (Dump::debug): Update with call to tokencollector.
5317 * ast/rust-ast-dump.h (RUST_AST_DUMP_H): Move include
5319 (class Dump): Remove multiple prototypes and add generic process
5322 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5324 * ast/rust-ast-collector.cc (TokenCollector::visit): Add
5325 semicolon in extern blocks.
5327 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5329 * rust-session-manager.cc (Session::enable_dump): Remove
5331 (Session::compile_crate): Likewise.
5332 (Session::dump_tokenstream): Likewise.
5333 * rust-session-manager.h (struct CompileOptions): Likewise.
5335 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
5337 * lex/rust-lex.cc (Lexer::build_token):add check for all kinds of whitespaces
5339 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5341 * ast/rust-ast.h: Add default constructors.
5343 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5345 * ast/rust-ast-collector.cc (TokenCollector::visit): Change with
5347 * ast/rust-ast.cc (Module::as_string): Likewise.
5348 (StaticItem::as_string): Likewise.
5349 (TupleStruct::as_string): Likewise.
5350 (Method::as_string): Likewise.
5351 (StructStruct::as_string): Likewise.
5352 (UseTreeRebind::as_string): Likewise.
5353 (Enum::as_string): Likewise.
5354 (Trait::as_string): Likewise.
5355 (Union::as_string): Likewise.
5356 (Function::as_string): Likewise.
5357 (TypeAlias::as_string): Likewise.
5358 (MacroRulesDefinition::as_string): Likewise.
5359 (FieldAccessExpr::as_string): Likewise.
5360 (MacroMatchFragment::as_string): Likewise.
5361 (TypeParam::as_string): Likewise.
5362 (StructExprFieldIdentifierValue::as_string): Likewise.
5363 (EnumItem::as_string): Likewise.
5364 (StructField::as_string): Likewise.
5365 (ExternalTypeItem::as_string): Likewise.
5366 (ExternalStaticItem::as_string): Likewise.
5367 (ExternalFunctionItem::as_string): Likewise.
5368 (TraitFunctionDecl::as_string): Likewise.
5369 (TraitMethodDecl::as_string): Likewise.
5370 (TraitItemConst::as_string): Likewise.
5371 (TraitItemType::as_string): Likewise.
5372 (MaybeNamedParam::as_string): Likewise.
5373 (MetaListPaths::as_string): Likewise.
5374 (MetaListNameValueStr::as_string): Likewise.
5375 (Module::process_file_path): Likewise.
5376 (MetaListNameValueStr::check_cfg_predicate): Likewise.
5377 (MetaListPaths::check_cfg_predicate): Likewise.
5378 (MetaWord::check_cfg_predicate): Likewise.
5379 (MetaNameValueStr::check_cfg_predicate): Likewise.
5380 (MetaNameValueStr::to_attribute): Likewise.
5381 (MetaWord::to_attribute): Likewise.
5382 (MetaListPaths::to_attribute): Likewise.
5383 (MetaListNameValueStr::to_attribute): Likewise.
5384 (operator<<): Change Identifier class <<
5385 operator overload for standard output stream.
5386 * ast/rust-ast.h (class Identifier): Change typedef to proper
5388 (operator<<): Add prototype for operator overload.
5389 (class Token): Change getter identifier.
5390 (class MetaListNameValueStr): Likewise.
5391 (class PathExpr): Likewise.
5392 * ast/rust-expr.h: Likewise.
5393 * ast/rust-item.h: Likewise.
5394 * ast/rust-macro.h: Likewise.
5395 * ast/rust-path.cc (GenericArg::disambiguate_to_type): Likewise.
5396 (GenericArgsBinding::as_string): Likewise.
5397 (ConstGenericParam::as_string): Likewise.
5398 * ast/rust-path.h: Likewise.
5399 * ast/rust-pattern.cc (IdentifierPattern::as_string): Likewise.
5400 (StructPatternFieldIdentPat::as_string): Likewise.
5401 (StructPatternFieldIdent::as_string): Likewise.
5402 * ast/rust-type.h: Likewise.
5403 * backend/rust-compile-base.cc: Likewise.
5404 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
5405 * backend/rust-compile-extern.h: Likewise.
5406 * backend/rust-compile-fnparam.cc (CompileFnParam::visit):
5408 * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
5410 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
5411 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): Likewise.
5412 * backend/rust-compile-struct-field-expr.cc (CompileStructExprField::visit):
5414 * backend/rust-compile-var-decl.h: Likewise.
5415 * backend/rust-compile.cc: Likewise.
5416 * checks/errors/rust-unsafe-checker.cc (check_extern_call):
5418 * checks/lints/rust-lint-marklive.cc (MarkLive::visit):
5420 * checks/lints/rust-lint-scan-deadcode.h: Likewise.
5421 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Likewise.
5422 (DeriveClone::visit_tuple): Likewise.
5423 (DeriveClone::visit_struct): Likewise.
5424 (DeriveClone::visit_union): Likewise.
5425 * expand/rust-derive-copy.cc (DeriveCopy::visit_struct):
5427 (DeriveCopy::visit_tuple): Likewise.
5428 (DeriveCopy::visit_enum): Likewise.
5429 (DeriveCopy::visit_union): Likewise.
5430 * expand/rust-macro-expand.cc (MacroExpander::match_matcher):
5432 (MacroExpander::match_n_matches): Likewise.
5433 (MacroExpander::match_repetition): Likewise.
5434 (MacroExpander::match_repetition_skipped_metavars): Likewise.
5435 * hir/rust-ast-lower-base.cc (struct_field_name_exists):
5437 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
5438 * hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit):
5440 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
5441 * hir/tree/rust-hir-expr.h: Likewise.
5442 * hir/tree/rust-hir-item.h: Likewise.
5443 * hir/tree/rust-hir-path.h: Likewise.
5444 * hir/tree/rust-hir-type.h: Likewise.
5445 * hir/tree/rust-hir.cc (Module::as_string): Likewise.
5446 (StaticItem::as_string): Likewise.
5447 (TupleStruct::as_string): Likewise.
5448 (ConstantItem::as_string): Likewise.
5449 (StructStruct::as_string): Likewise.
5450 (UseTreeRebind::as_string): Likewise.
5451 (Enum::as_string): Likewise.
5452 (Trait::as_string): Likewise.
5453 (Union::as_string): Likewise.
5454 (Function::as_string): Likewise.
5455 (TypeAlias::as_string): Likewise.
5456 (FieldAccessExpr::as_string): Likewise.
5457 (TypeParam::as_string): Likewise.
5458 (GenericArgsBinding::as_string): Likewise.
5459 (StructPatternFieldIdent::as_string): Likewise.
5460 (StructPatternFieldIdentPat::as_string): Likewise.
5461 (IdentifierPattern::as_string): Likewise.
5462 (StructExprFieldIdentifierValue::as_string): Likewise.
5463 (EnumItem::as_string): Likewise.
5464 (StructField::as_string): Likewise.
5465 (ExternalStaticItem::as_string): Likewise.
5466 (ExternalFunctionItem::as_string): Likewise.
5467 (NamedFunctionParam::as_string): Likewise.
5468 (TraitFunctionDecl::as_string): Likewise.
5469 (TraitItemConst::as_string): Likewise.
5470 (TraitItemType::as_string): Likewise.
5471 (MaybeNamedParam::as_string): Likewise.
5472 * hir/tree/rust-hir.h: Likewise.
5473 * parse/rust-parse-impl.h (Parser::parse_macro_match_fragment):
5475 (Parser::parse_module): Likewise.
5476 (Parser::parse_use_tree): Likewise.
5477 (Parser::parse_maybe_named_param): Likewise.
5478 * resolve/rust-ast-resolve-implitem.h: Likewise.
5479 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
5481 (ResolveItem::visit): Likewise.
5482 (flatten_rebind): Likewise.
5483 (ResolveExternItem::visit): Likewise.
5484 (rust_flatten_rebind): Likewise.
5485 (rust_flatten_rebind_nested): Likewise.
5486 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
5488 (PatternDeclaration::visit): Likewise.
5489 (PatternDeclaration::add_new_binding): Likewise.
5490 * resolve/rust-ast-resolve-stmt.h: Likewise.
5491 * resolve/rust-ast-resolve-toplevel.h: Likewise.
5492 * resolve/rust-ast-resolve-type.h: Likewise.
5493 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
5494 * typecheck/rust-autoderef.cc: Likewise.
5495 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
5497 * typecheck/rust-hir-path-probe.cc (PathProbeType::visit):
5499 * typecheck/rust-hir-trait-reference.cc (TraitReference::get_name): Likewise.
5500 * typecheck/rust-hir-trait-resolve.cc (ResolveTraitItemToRef::visit): Likewise.
5501 (TraitResolver::resolve_trait): Likewise.
5502 (TraitItemReference::resolve_item): Likewise.
5503 (AssociatedImplTrait::setup_raw_associated_types): Likewise.
5504 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
5505 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5507 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise.
5508 (TypeCheckImplItem::visit): Likewise.
5509 (TypeCheckImplItemWithTrait::visit): Likewise.
5510 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
5512 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
5513 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
5514 * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise.
5515 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
5516 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): Likewise.
5517 * util/rust-attributes.cc (check_doc_attribute): Likewise.
5518 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
5520 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
5522 * lex/rust-lex.cc (is_float_digit):Change types of param to `uint32_t`
5523 (is_x_digit):Likewise
5524 (is_octal_digit):Likewise
5525 (is_bin_digit):Likewise
5526 (check_valid_float_dot_end):Likewise
5527 (is_whitespace):Likewise
5528 (is_non_decimal_int_literal_separator):Likewise
5529 (is_identifier_start):Likewise
5530 (is_identifier_continue):Likewise
5531 (Lexer::skip_broken_string_input):Likewise
5532 (Lexer::build_token):Remove handling BOM
5533 (Lexer::parse_in_type_suffix):Modify use of `current_char`
5534 (Lexer::parse_in_decimal):Likewise
5535 (Lexer::parse_escape):Likewise
5536 (Lexer::parse_utf8_escape):Likewise
5537 (Lexer::parse_partial_string_continue):Likewise
5538 (Lexer::parse_partial_hex_escape):Likewise
5539 (Lexer::parse_partial_unicode_escape):Likewise
5540 (Lexer::parse_byte_char):Likewise
5541 (Lexer::parse_byte_string):Likewise
5542 (Lexer::parse_raw_byte_string):Likewise
5543 (Lexer::parse_raw_identifier):Likewise
5544 (Lexer::parse_non_decimal_int_literal):Likewise
5545 (Lexer::parse_decimal_int_or_float):Likewise
5546 (Lexer::peek_input):Change return type to `Codepoint`
5547 (Lexer::get_input_codepoint_length):Change to return 1
5548 (Lexer::peek_codepoint_input):Change to be wrapper of `peek_input`
5549 (Lexer::skip_codepoint_input):Change to be wrapper of `skip_input`
5550 (Lexer::test_get_input_codepoint_n_length):Deleted
5551 (Lexer::split_current_token):Deleted
5552 (Lexer::test_peek_codepoint_input):Deleted
5553 (Lexer::start_line):Move backwards
5554 (assert_source_content):New helper function for selftest
5555 (test_buffer_input_source):New helper function for selftest
5556 (test_file_input_source):Likewise
5557 (rust_input_source_test):New test
5558 * lex/rust-lex.h (rust_input_source_test):New test
5559 * rust-lang.cc (run_rust_tests):Add selftest
5561 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
5563 * expand/rust-macro-expand.cc
5564 (MacroExpander::match_repetition_skipped_metavars): New.
5565 (MacroExpander::match_repetition): Use new method.
5566 * expand/rust-macro-expand.h
5567 (MacroExpander::match_repetition_skipped_metavars): New.
5569 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5571 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
5573 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5575 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
5577 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
5579 * expand/rust-macro-expand.cc
5580 (MacroExpander::match_token): Match token instead of token id.
5581 * parse/rust-parse-impl.h
5582 (Parser::skip_token): Add token-skipping variant.
5583 (Parser::expect_token): Likewise.
5584 * parse/rust-parse.h
5585 (Parser::skip_token): Likewise.
5586 (Parser::expect_token): Likewise.
5588 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
5590 * lang.opt: Add -frust-name-resolution-2.0 option
5592 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5594 * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): add check for pointers
5596 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5598 * typecheck/rust-autoderef.cc: use new selection filter
5599 * typecheck/rust-hir-dot-operator.cc (MethodResolver::Select): new slection Filter
5600 * typecheck/rust-hir-dot-operator.h: New select prototype
5601 * typecheck/rust-hir-type-check-expr.cc: call select
5602 * typecheck/rust-type-util.cc (try_coercion): new helper
5603 * typecheck/rust-type-util.h (try_coercion): helper prototype
5605 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5607 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): passed "E0277"
5608 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): passed "E0277"
5610 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
5612 * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
5613 Expand expressions in more contexts.
5614 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
5615 Visit enum variants.
5617 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5619 * ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Refactor
5620 code and warn about dangling reference.
5621 * expand/rust-expand-visitor.cc (expand_stmt_attribute):
5622 Document function and change argument names to make those
5625 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5627 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
5628 Remove second argument.
5629 (ExpandVisitor::visit): Remove argument from function call.
5630 * expand/rust-expand-visitor.h: Update function prototype.
5632 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5634 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change
5635 call to expand_inner_stmts.
5636 (expand_tail_expr): Change argument name and try to expand the
5637 last statement as a tail expression once all statements have
5639 * expand/rust-expand-visitor.h: Change prototype to accept
5641 * ast/rust-expr.h: Add try_convert_last_stmt function prototype.
5643 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5645 * ast/rust-expr.h: Add a function to take tail expr as well
5646 as a function to set a tail expression.
5647 * expand/rust-expand-visitor.cc (expand_tail_expr): Add tail
5648 expression expansion function.
5649 (ExpandVisitor::visit): Add call to tail expr expansion in for
5652 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
5653 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5655 * expand/rust-expand-visitor.cc : Change type from pointer to
5656 reference and expand statements from statements.
5657 * ast/rust-macro.h: Return macro kind.
5658 * ast/rust-ast.h: Add Statement kind.
5659 * ast/rust-item.h: Change module.
5660 * ast/rust-stmt.h: Return kind.
5662 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
5664 * expand/rust-macro-expand.cc
5665 (MacroExpander::expand_decl_macro):
5666 Use pointers/smart pointers to refer to MatchedFragmentContainer instances.
5667 (MacroExpander::transcribe_rule): Likewise.
5668 (MatchedFragmentContainer::get_single_fragment): New implementation.
5669 (MatchedFragmentContainer::get_fragments): Likewise.
5670 (MatchedFragmentContainer::add_fragment): Likewise.
5671 (MatchedFragmentContainer::zero): Likewise.
5672 (MatchedFragmentContainer::metavar): Likewise.
5673 * expand/rust-macro-expand.h
5674 (class MatchedFragmentContainer): Make abstract.
5675 (class MatchedFragmentContainerMetaVar): New.
5676 (class MatchedFragmentContainerRepetition): New.
5677 (class SubstitutionScope):
5678 Use pointers/smart pointers to refer to MatchedFragmentContainer instances.
5679 (MacroExpander::transcribe_rule): Likewise.
5680 * expand/rust-macro-substitute-ctx.cc
5681 (SubstituteCtx::substitute_metavar): Likewise.
5682 (SubstituteCtx::check_repetition_amount): Likewise.
5683 (SubstituteCtx::substitute_repetition): Likewise.
5684 * expand/rust-macro-substitute-ctx.h
5685 (class SubstituteCtx): Likewise.
5687 2024-01-16 Muhammad Mahad <mahadtxt@gmail.com>
5689 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): called rust_error_at
5690 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): called rust_error_at
5692 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5694 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
5695 arguments mappings as an out parameter and apply them to the bounds
5696 * typecheck/rust-hir-type-check-item.h: update the prototype
5697 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
5698 apply the arguments to the segment type
5700 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5702 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
5703 simplify lookup of the respective predicate
5704 * typecheck/rust-tyty-subst.cc (SubstitutionArg::SubstitutionArg): track original parameter
5705 (SubstitutionArg::operator=): update copy ctor
5706 (SubstitutionArg::get_param_ty): use original param
5707 (SubstitutionArg::as_string): update as_string
5708 * typecheck/rust-tyty-subst.h: add new private field
5710 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5712 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
5713 New helper utility to infer non concrete types and handle the case where its not a
5714 binding generic type (which inherits SubstitutionRef)
5715 * typecheck/rust-hir-type-check-item.h: new helper prototype
5716 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): use this helper
5718 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5720 * typecheck/rust-hir-trait-resolve.cc: use lookup_predicate (DefID)
5721 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): fix formatting
5723 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
5725 * ast/rust-ast.h (MacroInvocation::add_semicolon): New method.
5726 (Expr::to_stmt): Remove method.
5727 * ast/rust-macro.h (MacroInvocation::add_semicolon): Add override.
5728 (MacroInvocation::to_stmt): Remove override.
5729 * ast/rust-stmt.h: Remove use of Expr::to_stmt.
5730 (ExprStmt::add_semicolon): Add override.
5731 * expand/rust-macro-expand.h (struct MacroExpander):
5732 Add EXPR/STMT and remove BLOCK from ContextType.
5733 * expand/rust-expand-visitor.cc (ExpandVisitor::maybe_expand_expr): Use EXPR context.
5734 (ExpandVisitor::expand_inner_stmts): Use STMT context.
5735 (ExpandVisitor::visitor): Remove use of BLOCK context.
5736 * expand/rust-macro-expand.cc (parse_many): Pass enum by value.
5737 (transcribe_on_delimiter): Remove function.
5738 (transcribe_context): Use EXPR/STMT contexts.
5739 (MacroExpander::parse_proc_macro_output): Use EXPR/STMT contexts.
5740 (transcribe_many_stmts): Parse statements with semicolons.
5741 * parse/rust-parse-impl.h (Parser::parse_stmt):
5742 Delegate macro parsing to parse_expr_stmt, check for ! after macro_rules.
5743 (Parser::parse_let_stmt): Work around lack of NT tokens.
5744 (Parser::parse_expr_stmt): Handle statements at end of macro expansions.
5745 (Parser::parse_expr_stmt): Parse macro statements/expression statements
5746 starting with a macro.
5747 (Parser::parse_match_expr): Don't modify flag unnecessarily.
5748 (Parser::parse_stmt_or_expr):
5749 Parse macro statements/expression statements starting with a macro.
5750 (Parser::parse_path_based_stmt_or_expr): Remove method.
5751 (Parser::parse_macro_invocation_maybe_semi): Remove method.
5752 (Parser::parse_expr): Move code into left_denotations.
5753 (Parser::left_denotations): New method.
5754 (Parser::null_denotation): Split out methods for cases with and without paths.
5755 (Parser::null_denotation_path): New method.
5756 (Parser::null_denotation_not_path): New method.
5757 (Parser::parse_macro_invocation_partial): Don't check for semicolon here.
5758 * parse/rust-parse.h: Update declarations.
5759 (struct ParseRestrictions): Additional flag.
5761 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
5763 * ast/rust-ast.cc (BlockExpr::strip_tail_expr):
5764 Don't normalize tail expression in this method.
5765 (BlockExpr::normalize_tail_expr): New method that only does the normalization.
5766 * ast/rust-expr.h: Declare new method.
5767 * hir/rust-ast-lower-block.h: Normalize tail expressions on blocks before lowering.
5769 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
5771 * ast/rust-ast-dump.cc (Dump::visit): Print macro invocations.
5773 2024-01-16 Raiki Tamura <tamaron1203@gmail.com>
5775 * lex/rust-lex.cc (is_whitespace):add all lacked codepoints valid as whitespaces
5776 (is_identifier_start):new function to check XID_Start and underscore
5777 (is_identifier_continue):new function to check XID_Continue
5778 (Lexer::build_token):tokenize Unicode identifiers
5779 (Lexer::parse_partial_string_continue):add comments
5780 (Lexer::parse_partial_unicode_escape):add comments
5781 (Lexer::parse_raw_identifier):change to use `is_identifier_scontinue`
5782 (Lexer::parse_identifier_or_keyword):change to use `is_identifier_continue`
5783 (Lexer::parse_char_or_lifetime):change to use `is_identifier_start/continue`
5784 (Lexer::skip_codepoint_input):do not attempt to skip input when bumping EOF
5785 * lex/rust-lex.h:add `current_char32` field
5787 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
5790 (Lexer::classify_keyword): Check if iterator is valid before dereferencing.
5792 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
5794 * expand/rust-macro-expand.cc
5795 (MacroExpander::match_repetition): Remove redundant rust_error_at call.
5797 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5799 * typecheck/rust-unify.cc (UnifyRules::go): dont check bounds on placeholders
5801 2024-01-16 tieway59 <tieway59@foxmail.com>
5803 * typecheck/rust-tycheck-dump.h: Delete this file
5804 * rust-session-manager.cc: Remove `Session::dump_type_resolution`
5805 and `TYPE_RESOLUTION_DUMP`
5806 * rust-session-manager.h: Likewise
5808 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5810 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
5811 match the fntype to the candidate
5813 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
5815 * expand/rust-derive.h: Store AstBuilder and location.
5816 * expand/rust-derive.cc (DeriveVisitor::DeriveVisitor): Update constructor.
5817 * expand/rust-derive-clone.h: Remove members now stored in `DeriveVisitor`.
5818 * expand/rust-derive-copy.h: Likewise.
5819 * expand/rust-derive-clone.cc (DeriveClone::DeriveClone): Update constructor.
5820 * expand/rust-derive-copy.cc (DeriveCopy::DeriveCopy): Likewise.
5822 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5824 * backend/rust-compile-item.cc (CompileItem::visit): ensure assoicated types are setup
5825 * typecheck/rust-hir-trait-reference.h: new interface for concrete impl block
5826 * typecheck/rust-hir-trait-resolve.cc (AssociatedImplTrait::setup_raw_associated_types):
5827 ensure we setup assoicated types for this impl block
5829 2024-01-16 Dave Evans <dave@dmetwo.org>
5831 * backend/rust-compile-expr.cc (check_match_scrutinee): Add REF type to rust_assert.
5832 (CompileExpr::visit): Add REF type for scrutinee_kind in MatchExpr visitor.
5834 2024-01-16 TieWay59 <tieway59@foxmail.com>
5836 * typecheck/rust-hir-type-check-expr.cc: Remove obsolete error diagnostic
5838 2024-01-16 Philip Herron <herron.philip@googlemail.com>
5840 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
5842 * typecheck/rust-type-util.cc (types_compatable): implementation of new interface
5843 * typecheck/rust-type-util.h (types_compatable): prototype
5844 * typecheck/rust-unify.cc (UnifyRules::expect_placeholder):
5845 It is allow for unification against placeholders
5847 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5849 * expand/rust-expand-visitor.cc (derive_item): Add const
5850 attribute to the trait name argument.
5851 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
5853 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5855 * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
5856 assertion to allow empty derive directives.
5858 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5860 * expand/rust-expand-visitor.cc (expand_attribute): Add function
5861 to expand a given attribute on a given item.
5862 * expand/rust-macro-expand.h (struct MacroExpander): Change
5863 return type to ast fragment.
5865 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5867 * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
5868 the function to get traits in a given attribute instead of an
5870 (ExpandVisitor::expand_struct_fields): Remove call in visitor.
5871 (ExpandVisitor::expand_function_params): Likewise.
5872 (ExpandVisitor::expand_closure_params): Likewise.
5873 (ExpandVisitor::visit): Likewise.
5874 (ExpandVisitor::expand_outer_attribute): Remove function.
5875 (ExpandVisitor::visit_outer_attrs): Remove function.
5876 * expand/rust-expand-visitor.h: Remove function prototypes.
5877 (ExpandVisitor::visit_outer_attrs): Remove function.
5879 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5881 * expand/rust-expand-visitor.h: Remove fragment collection fro
5883 * expand/rust-macro-expand.h (struct MacroExpander): Remove
5884 procedural macro fragment from expander.
5886 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5888 * ast/rust-ast-fragment.cc (Fragment::Fragment): Remove
5889 overwrite member in constructor.
5890 (Fragment::operator=): Removal of overwrite member in copy.
5891 (Fragment::should_overwrite): Remove overwrite getter.
5892 * ast/rust-ast-fragment.h: Remove overwrite boolean member.
5893 * expand/rust-expand-visitor.cc (derive_item): Add a function to
5894 derive items using the expander for now.
5895 (builtin_derive_item): Rename from derive_item to
5896 builtin_derive_item.
5897 (ExpandVisitor::visit): Remove visit to derive attributes.
5898 (ExpandVisitor::expand_derive): Remove derive attribute visitor.
5899 (ExpandVisitor::visit_attrs_with_derive): Likewise.
5900 * expand/rust-expand-visitor.h: Update insertion of other kind
5901 of proc macros. We no longer have an overwrite attribute in the
5903 * expand/rust-macro-expand.cc (MacroExpander::parse_procmacro_output):
5904 Return the fragment instead of inserting it.
5905 * expand/rust-macro-expand.h (struct MacroExpander): Return
5908 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5910 * ast/rust-ast-collector.h: Update enum name to match
5912 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_derive):
5913 Add call to expander.
5914 (ExpandVisitor::expand_outer_attribute):
5915 Change call to macro expander.
5916 (ExpandVisitor::expand_inner_attribute): Likewise.
5917 * expand/rust-expand-visitor.h: Remove const attribute to match
5918 visitor declaration. Attach result to the AST. Add condition for
5920 * expand/rust-proc-macro.h: Add token collector and expansion
5921 call. Add lexers and parsers for each proc macro type and uses
5922 them to parse macro output.
5923 * expand/rust-macro-expand.h (struct MacroExpander): Add
5925 * expand/rust-proc-macro.cc (ProcMacroExpander::import_proc_macros):
5927 * expand/rust-macro-expand.cc (MacroExpander::import_proc_macros):
5928 ... to here. Unify procedural macro parsing under one function.
5929 Add a flag to determine whether it originate from a derive
5931 (MacroExpander::parse_procmacro_output):
5932 Parse macro output to statements. Store an error on parsing
5934 * Make-lang.in: Add const_TokenPtr specific lexer.
5935 * expand/rust-proc-macro-invoc-lexer.cc: New file.
5936 * expand/rust-proc-macro-invoc-lexer.h: New file.
5937 * rust-session-manager.cc (Session::expansion): Remove
5938 ProcMacroExpander declaration.
5939 * ast/rust-ast-fragment.cc (Fragment::Fragment): Add overwrite
5941 (Fragment::should_overwrite): Add a getter to determine whether
5942 the fragment shall overwrite it's parent or be appended after.
5943 * ast/rust-ast-fragment.h: Add flag to declaration.
5945 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5947 * util/rust-hir-map.cc (Mappings::insert_bang_proc_macro):
5948 Add a function to insert a new bang proc macro.
5949 (Mappings::lookup_bang_proc_macro): Add a function to lookup a
5950 bang procedural macro.
5951 (Mappings::insert_derive_proc_macro): Add a function to insert a
5952 derive procedural macro.
5953 (Mappings::lookup_derive_proc_macro): Add a function to lookup a
5954 derive procedural macro.
5955 (Mappings::insert_attribute_proc_macro): Add a function to
5956 insert an attribute procedural macro.
5957 (Mappings::lookup_attribute_proc_macro): Add a function to
5958 lookup an attribute procedural macro.
5959 * util/rust-hir-map.h: Add function prototypes.
5960 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_outer_attribute):
5961 Implement expansion of outer attributes.
5962 (ExpandVisitor::expand_inner_attribute):
5963 Add call for inner attribute expansion.
5964 * expand/rust-expand-visitor.h:
5965 Add new procedural macro expander attribute.
5966 * expand/rust-proc-macro.cc (load_macros_array): Add a function
5967 to load the proc macro array from a given shared object.
5968 (load_macros): Add a function to retrieve procedural macro
5969 vector from a given shared object.
5970 (ProcMacroExpander::import_proc_macros): Add a function to load
5971 procedural macros from a given extern crate name.
5972 * expand/rust-proc-macro.h (RUST_PROC_MACRO_H): Add new
5974 (class ProcMacroExpander): Add new ProcMacroExpander class.
5975 * rust-session-manager.cc (Session::expansion): Create new macro
5976 expander and feed it to the expand visitor.
5977 * util/rust-attributes.cc: Add macro_export builtin attribute.
5979 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5981 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix
5982 attribute collection.
5984 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5986 * ast/rust-ast-collector.h: Make trivial visitors public.
5988 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5990 * Make-lang.in: Add rust-proc-macro object to list.
5991 * expand/rust-proc-macro.cc: New file.
5992 * expand/rust-proc-macro.h: New file.
5994 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5996 * util/rust-attributes.cc: Add attribute to the table.
5998 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6000 * ast/rust-ast-collector.cc (TokenCollector::visit): Move
6001 implementation from here...
6002 * ast/rust-ast-collector.h: ... to here.
6004 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6006 * Make-lang.in: Add "rust-dir-owner.o".
6007 * ast/rust-ast.cc: Include "rust-dir-owner.h".
6008 (Module::process_file_path):
6009 Handle non-mod-rs external file modules properly.
6010 * parse/rust-parse-impl.h: Include "rust-dir-owner.h".
6011 (Parser::parse_module):
6012 Handle non-mod-rs external file modules properly.
6013 * util/rust-dir-owner.cc: New file.
6014 * util/rust-dir-owner.h: New file.
6016 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6018 * expand/rust-macro-builtins.cc: Fix comments.
6019 (MacroBuiltin::proc_macro_builtin): Add error message.
6020 * expand/rust-macro-builtins.h: Fix comments.
6022 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6024 * typecheck/rust-hir-trait-resolve.cc: when the bound is concrete keep the mapping
6025 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): add missing call
6026 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): make this the same as paths
6028 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6030 * util/rust-optional.h
6031 (class Optional): Add volatile field to union.
6033 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6035 * expand/rust-macro-substitute-ctx.cc
6036 (SubstituteCtx::substitute_metavar): Substitute crate metavar.
6038 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6040 * parse/rust-parse-impl.h
6041 (Parser::null_denotation): Allow struct expression referencing.
6043 2024-01-16 Charalampos Mitrodimas <charmitro@gmail.com>
6045 * ast/rust-ast-dump.cc (Dump::visit):
6046 print literals based on their type.
6048 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6050 * expand/rust-macro-builtins.cc (MacroBuiltin::dummy): New function.
6051 * expand/rust-macro-builtins.h: Declare it.
6053 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6055 * ast/rust-ast-builder.cc (AstBuilder::struct_expr_struct): New function.
6056 (AstBuilder::let): Likewise.
6057 (AstBuilder::struct_expr): Likewise.
6058 (AstBuilder::struct_expr_field): Likewise.
6059 (AstBuilder::field_access): Likewise.
6060 (AstBuilder::wildcard): Likewise.
6061 * ast/rust-ast-builder.h: Likewise.
6062 * expand/rust-derive-clone.cc (DeriveClone::visit_union): Implement
6065 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6067 * Make-lang.in: Add new files.
6068 * expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveCopy.
6069 * expand/rust-derive-copy.cc: New file.
6070 * expand/rust-derive-copy.h: New file.
6072 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6074 * expand/rust-derive-clone.cc (DeriveClone::visit_struct): Implement proper
6075 cloning for structs with fields.
6076 * ast/rust-ast-builder.cc (AstBuilder::struct_expr): New function.
6077 (AstBuilder::struct_expr_field): Likewise.
6078 (AstBuilder::field_access): Likewise.
6079 (AstBuilder::let): Likewise.
6080 * ast/rust-ast-builder.h: Declare new functions.
6082 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6084 * util/rust-token-converter.cc (convert): Use a variable instead
6085 of multiple nested calls.
6087 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6089 * lex/rust-lex.h: Make build_token method public.
6090 * lex/rust-token.h: Add a setter for a token location.
6091 * util/rust-token-converter.cc (convert): Add the function to
6092 convert from a Span to a Location.
6093 (from_ident): Convert Ident span to a Location.
6094 (from_literal): Convert Literal span to a Location.
6095 (from_punct): Convert Punct span to a Location.
6096 (from_group): Convert Group span to a Location.
6098 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6100 * util/rust-token-converter.cc (convert): Add implementation.
6102 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6104 * util/rust-token-converter.cc (convert): Update call to
6105 constructors with location information.
6106 (handle_suffix): Convert token locus to a Span and use it in the
6109 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6111 * expand/rust-macro-expand.cc
6112 (MacroExpander::try_match_rule): Don't match delimiters for root matcher.
6113 (MacroExpander::match_matcher): Add option to match delimiters.
6114 * expand/rust-macro-expand.h
6115 (MacroExpander::match_matcher): Likewise.
6116 * parse/rust-parse-impl.h
6117 (Parser::skip_token): Add zero argument method.
6118 * parse/rust-parse.h:
6119 (Parser::skip_token): Likewise.
6121 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6123 * Make-lang.in: remove files
6124 * backend/rust-compile-block.h: fix headers
6125 * backend/rust-compile-expr.h: likewise
6126 * backend/rust-compile-fnparam.h: likewise
6127 * backend/rust-compile-item.h: likewise
6128 * backend/rust-compile-pattern.h: likewise
6129 * backend/rust-compile-resolve-path.h: likewise
6130 * backend/rust-compile-stmt.h: likewise
6131 * typecheck/rust-autoderef.cc: likewise
6132 * typecheck/rust-hir-path-probe.cc: likewise
6133 * typecheck/rust-hir-path-probe.h: likewise
6134 * typecheck/rust-hir-trait-reference.h: likewise
6135 * typecheck/rust-hir-trait-resolve.cc: use a for loop instead
6136 * typecheck/rust-hir-trait-resolve.h: fix headers
6137 * typecheck/rust-hir-type-check-expr.h: likewise
6138 * typecheck/rust-hir-type-check-implitem.h: likewise
6139 * typecheck/rust-hir-type-check-item.h: likewise
6140 * typecheck/rust-hir-type-check-path.cc: likewise
6141 * typecheck/rust-hir-type-check-pattern.h: likewise
6142 * typecheck/rust-hir-type-check-stmt.h: likewise
6143 * typecheck/rust-hir-type-check-type.h: likewise
6144 * typecheck/rust-hir-type-check-util.cc: Removed.
6145 * typecheck/rust-hir-type-check-util.h: Removed.
6147 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6149 * Make-lang.in: Add new object files to Makefile.
6150 * expand/rust-expand-visitor.cc (is_derive): Move function.
6151 (is_builtin): Likewise.
6152 (get_traits_to_derive): New function.
6153 (derive_item): Likewise.
6154 (ExpandVisitor::visit): Visit item/statements containers.
6155 (ExpandVisitor::visit_outer_attrs): Take a reference on the attribute
6157 (ExpandVisitor::is_derive): Deleted function.
6158 (ExpandVisitor::is_builtin): Likewise.
6159 * expand/rust-expand-visitor.h (RUST_EXPAND_VISITOR_H): Add missing #ifdef
6161 (is_derive): Declare function.
6162 (is_builtin): Likewise.
6163 * expand/rust-macro-builtins.cc (builtin_macro_from_string): Use new
6164 MacroBuiltin::builtins map.
6165 (make_macro_path_str): Likewise.
6166 * expand/rust-macro-builtins.h (enum class): Add builtin derive macros.
6167 * expand/rust-derive-clone.cc: New file.
6168 * expand/rust-derive-clone.h: New file.
6169 * expand/rust-derive.cc: New file.
6170 * expand/rust-derive.h: New file.
6171 * util/rust-hir-map.cc (Mappings::insert_macro_def): Fix logic for
6172 setting builtin macro transcribers.
6174 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6176 * ast/rust-ast-builder.cc: New file.
6177 * ast/rust-ast-builder.h: New file.
6179 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6181 * expand/rust-macro-invoc-lexer.cc: Add missing copyright header.
6182 * expand/rust-macro-substitute-ctx.cc: Likewise.
6184 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6186 * rust-session-manager.h:
6187 Include "rust-optional.h".
6188 (struct TargetOptions):
6189 Store values in config key/value pairs as Optional<std::string> rather than std::string.
6190 * rust-session-manager.cc
6191 (TargetOptions::dump_target_options):
6192 Handle Optional<std::string> values.
6194 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6196 * typecheck/rust-casts.cc (TypeCastRules::check): do coercion
6197 (TypeCastRules::emit_cast_error): clang-format
6199 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6201 * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): add name resolution
6202 * resolve/rust-ast-resolve-stmt.h: likewise
6203 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): insert resolved node
6205 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6207 * resolve/rust-ast-resolve-pattern.cc: remove unused
6209 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6211 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): fix missing pop
6213 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6215 * backend/rust-compile-expr.cc (CompileExpr::visit): remove unused
6217 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6219 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::translate): hir lowering
6220 (ASTLoweringStmt::visit): likewise
6221 * hir/rust-ast-lower-stmt.h: likewise
6223 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6225 * expand/rust-macro-substitute-ctx.cc
6226 (SubstituteCtx::substitute_metavar): Allow substitution failure.
6227 (SubstituteCtx::substitute_token):
6228 Handle substitution failure, include dollar sign in count of tokens to substitute.
6229 (SubstituteCtx::substitute_tokens):
6230 Include dollar sign in count of tokens to substitute.
6231 * expand/rust-macro-substitute-ctx.h
6232 (SubstituteCtx::substitute_metavar):
6233 Adjust signature and document new substitution failure handling.
6235 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6237 * expand/rust-macro-substitute-ctx.cc
6238 (SubstituteCtx::check_repetition_amount):
6239 Ignore single fragments while checking repetition amount.
6241 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6243 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): stop if error
6244 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): fix sized options
6245 * typecheck/rust-tyty.cc (BaseType::satisfies_bound): its ok if its an ?T
6246 (BaseType::bounds_compatible): likewise
6247 * typecheck/rust-tyty.h: update prototype
6248 * typecheck/rust-unify.cc (UnifyRules::go): check both sides bounds
6250 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6252 * backend/rust-compile-expr.cc (HIRCompileBase::resolve_deref_adjustment):
6253 reuse op overload code
6254 * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): update
6255 (Adjuster::try_raw_deref_type): likewise
6256 * typecheck/rust-autoderef.h: likewise
6257 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
6258 improve debug loging
6260 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6262 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): refactor
6263 * backend/rust-compile-base.h: likewise
6264 * backend/rust-compile-expr.cc (CompileExpr::visit): likewise
6265 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): likewise
6267 2024-01-16 David Malcolm <dmalcolm@redhat.com>
6269 * typecheck/rust-hir-trait-reference.cc (TraitItemReference::is_optional): Remove
6272 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6274 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::go): Cleanup
6275 order of calls when accumulating #[macro_use] macros.
6276 (EarlyNameResolver::visit): Likewise.
6278 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
6280 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::accumulate_escaped_macros):
6281 Remove unnecessary visit.
6283 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
6285 * ast/rust-ast.cc (Attribute::check_cfg_predicate):
6286 Only check first item as a predicate.
6288 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6290 * util/rust-optional.h
6291 (operator==): New for Optional<T> == Optional<U>.
6293 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6295 * parse/rust-parse-impl.h
6296 (Parser::parse_attr_input): Parse AttrInputMacro.
6298 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6300 * ast/rust-ast-collector.cc (TokenCollector::visit): Propagate
6303 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6305 * util/rust-optional.h
6306 (class Optional<T>): Improve inner state.
6308 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6310 * expand/rust-macro-substitute-ctx.cc
6311 (SubstituteCtx::check_repetition_amount): Handle keywords.
6312 (SubstituteCtx::substitute_token): Likewise.
6314 (Token::get_str): Likewise.
6315 * parse/rust-parse-impl.h
6316 (Parser::parse_macro_match_fragment): Likewise.
6318 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6320 * ast/rust-ast.h: Add `outer_attrs` to Item.
6321 * ast/rust-expr.h: Make use of new inheritance methods.
6322 * ast/rust-item.h: Likewise.
6323 * ast/rust-macro.h: Likewise.
6325 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6327 * util/rust-token-converter.cc (dispatch_float_literals): Remove
6329 (handle_suffix): Rename old dispatch and add one LitKind
6331 (dispatch_integer_literals): Remove function.
6332 (convert): Change call from dispatch to suffix handler.
6334 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6336 * lex/rust-token.h: Implement hash for token id enumeration.
6337 * util/rust-token-converter.cc (dispatch_float_literals): Update
6339 (dispatch_integer_literals): Likewise.
6340 (convert): Likewise.
6341 (string_literal): Remove function.
6342 (byte_string_literal): Likewise.
6343 (unsigned_literal): Likewise.
6344 (signed_literal): Likewise.
6345 (from_literal): Update with new internals.
6347 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6349 * ast/rust-ast-dump.cc
6350 (Dump::visit): Add AttrInputMacro visitor.
6351 * ast/rust-ast-dump.h:
6352 (Dump::visit): Likewise.
6353 * ast/rust-ast-full-decls.h
6354 (class AttrInputMacro): New.
6355 * ast/rust-ast-collector.cc
6356 (TokenCollector::visit):
6357 Add and call out to AttrInputMacro visitor.
6358 * ast/rust-ast-collector.h:
6359 (TokenCollector::visit): Add AttrInputMacro visitor.
6360 * ast/rust-ast-visitor.h:
6361 (ASTVisitor::visit): Likewise.
6363 (AttrInputMacro::accept_vis): New.
6364 (AttrInputMacro::as_string): New.
6365 (AttrInputMacro::AttrInputMacro): New.
6366 (AttrInputMacro::operator=): New.
6368 (AttrInput::AttrInputType::MACRO): New.
6370 (class AttrInputMacro): New.
6371 * checks/errors/rust-feature-gate.h:
6372 (FeatureGate::visit): Add AttrInputMacro visitor.
6373 * expand/rust-cfg-strip.cc
6374 (CfgStrip::visit): Likewise.
6375 * expand/rust-cfg-strip.h:
6376 (CfgStrip::visit): Likewise.
6377 * expand/rust-expand-visitor.cc
6378 (ExpandVisitor::visit): Likewise.
6379 * expand/rust-expand-visitor.h:
6380 (ExpandVisitor::visit): Likewise.
6381 * hir/rust-ast-lower-base.cc
6382 (ASTLoweringBase::visit): Likewise.
6383 * hir/rust-ast-lower-base.h:
6384 (ASTLoweringBase::visit): Likewise.
6385 * resolve/rust-ast-resolve-base.cc
6386 (ResolverBase::visit): Likewise.
6387 * resolve/rust-ast-resolve-base.h:
6388 (ResolverBase::visit): Likewise.
6389 * resolve/rust-early-name-resolver.cc
6390 (EarlyNameResolver::visit): Likewise.
6391 * resolve/rust-early-name-resolver.h:
6392 (EarlyNameResolver::visit): Likewise.
6393 * util/rust-attributes.cc
6394 (AttributeChecker::visit): Likewise.
6395 (check_doc_attribute): Handle AttrInputType::MACRO.
6396 * util/rust-attributes.h:
6397 (AttributeChecker::visit): Add AttrInputMacro visitor.
6399 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6402 (MacroInvocation::clone_macro_invocation_impl): Make public.
6404 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6406 * util/rust-optional.h
6407 (struct std::hash<Optional<T>>): New.
6409 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6411 * util/rust-optional.h
6412 (class Optional<T&>): Use pointers internally.
6414 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6416 * ast/rust-ast-dump.cc (Dump::visit): Implement dump for
6419 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6422 (token_id_keyword_string): Return std::string reference.
6424 (token_id_keyword_string): Return std::string reference.
6426 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
6428 * ast/rust-ast.h (Expr::as_expr_without_block): Remove.
6429 (Expr::set_outer_attrs): Make public in base class.
6430 * expand/rust-macro-expand.cc:
6431 Add fixme comment for pre-existing bug.
6432 * hir/tree/rust-hir.h: Remove Expr::as_expr_without_block.
6433 * parse/rust-parse-impl.h (Parser::parse_lifetime): Use lifetime_from_token.
6434 (Parser::lifetime_from_token): New method.
6435 (Parser::null_denotation): Handle labelled loop expressions and for loop expressions.
6436 (Parser::parse_loop_label): Make initial token a parameter.
6437 (Parser::parse_labelled_loop_expr): Likewise.
6438 (Parser::parse_for_loop_expr): Allow FOR token to already be skipped.
6439 (Parser::parse_expr): Handle expr_can_be_stmt.
6440 (Parser::parse_expr_with_block): Remove.
6441 (Parser::parse_expr_stmt_with_block): Remove.
6442 (Parser::parse_expr_stmt_without_block): Remove.
6443 (Parser::parse_expr_without_block): Remove.
6444 (Parser::parse_stmt_or_expr_with_block): Remove.
6445 (Parser::parse_expr_stmt): Use parse_expr directly.
6446 (Parser::parse_match_expr): Likewise.
6447 (Parser::parse_stmt): Use parse_expr_stmt in more cases.
6448 (Parser::parse_stmt_or_expr):
6449 Rename from parse_stmt_or_expr_without_block, use parse_expr directly.
6450 (Parser::parse_block_expr): Update error message.
6451 * parse/rust-parse.h: Update declarations.
6453 2024-01-16 Matthew Jasper <mjjasper1@gmail.com>
6455 * ast/rust-ast-full-decls.h (class ExprStmtWithoutBlock): Remove.
6456 (class ExprStmtWithBlock): Remove.
6457 * ast/rust-stmt.h (class ExprStmtWithoutBlock): Remove.
6458 (class ExprStmtWithBlock): Remove.
6460 Make non-abstract, add common functionality from removed base classes.
6461 * ast/rust-ast.h: Move to_stmt to base class.
6462 * ast/rust-ast.cc (ExprStmtWithBlock::as_string): Remove.
6463 * ast/rust-macro.h: Use new signature for to_stmt.
6464 (ExprStmt::as_string): New method.
6465 (ExprStmtWithoutBlock::as_string): Remove.
6466 (BlockExpr::strip_tail_expr): Update for removed classes.
6467 (ExprStmtWithoutBlock::accept_vis): Remove.
6468 (ExprStmtWithBlock::accept_vis): Remove.
6469 (ExprStmt::accept_vis): New method.
6470 * ast/rust-ast-dump.cc (Dump::visit): Update for removed classes.
6471 * ast/rust-ast-dump.h: Likewise.
6472 * ast/rust-ast-collector.h: Likewise.
6473 * ast/rust-ast-collector.cc (TokenStream::visit): Likewise.
6474 * ast/rust-ast-visitor.h: Likewise.
6475 * checks/errors/rust-feature-gate.h: Likewise.
6476 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
6477 * expand/rust-expand-visitor.h: Likewise.
6478 * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
6479 * expand/rust-cfg-strip.h: Likewise.
6480 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
6481 * hir/rust-ast-lower-base.h: Likewise.
6482 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
6483 * hir/rust-ast-lower-stmt.h: Likewise.
6484 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
6485 * util/rust-attributes.h: Likewise.
6486 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
6487 * resolve/rust-ast-resolve-base.h: Likewise.
6488 * resolve/rust-ast-resolve-stmt.h: Likewise.
6489 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
6491 * resolve/rust-early-name-resolver.h: Likewise.
6492 * parse/rust-parse-impl.h (Parser::parse_match_expr): Likewise.
6493 (Parser::parse_stmt_or_expr_without_block): Likewise.
6494 * parse/rust-parse.h: Likewise.
6496 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6499 (token_id_is_keyword): New.
6500 (token_id_keyword_string): New.
6502 (token_id_is_keyword): New.
6503 (token_id_keyword_string): New.
6504 * expand/rust-macro-expand.cc
6505 (MacroExpander::match_fragment): Match keywords for ident fragment.
6506 * parse/rust-parse-impl.h
6507 (Parser::parse_identifier_or_keyword_token): Add.
6508 * parse/rust-parse.h
6509 (Parser::parse_identifier_or_keyword_token): Add.
6511 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6513 * util/rust-token-converter.cc (dispatch_float_literals): Invert
6515 (dispatch_integer_literals): Likewise.
6517 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6519 * util/rust-token-converter.cc (convert): Fix style.
6520 (from_ident): Likewise.
6522 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6524 * util/rust-token-converter.cc (dispatch_float_literals): Make
6526 (dispatch_integer_literals): Likewise.
6527 (convert): Likewise.
6528 * util/rust-token-converter.h (convert): Likewise.
6530 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6532 * util/rust-token-converter.cc (from_tokenstream): Add
6533 conversion of Ident structures.
6534 (from_ident): Likewise.
6536 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6538 * util/rust-token-converter.cc (from_literal): Add function
6540 (string_literal): String literal specific handler.
6541 (byte_string_literal): Byte string specific handler.
6542 (unsigned_literal): Unsigned literal specific handler.
6543 (signed_literal): Signed literal specific handler.
6545 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6547 * util/rust-token-converter.cc (from_punct): Add conversion
6550 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6552 * util/rust-token-converter.cc (dispatch_float_literals): Accept
6553 const_TokenPtr instead of TokenPtr.
6554 (dispatch_integer_literals): Likewise.
6555 (convert): Accept vector of const_TokenPtr instead of a vector
6557 * util/rust-token-converter.h (convert): Likewise.
6559 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6561 * util/rust-token-converter.cc (from_tokenstream): Add vector
6562 for joined punct accumulation.
6563 (from_ident): Accept const pointer vector.
6564 (from_literal): Likewise.
6565 (from_punct): Likewise.
6566 (from_group): Likewise.
6567 (from_tokentree): Likewise.
6568 (convert): Likewise.
6569 * util/rust-token-converter.h (convert): Likewise.
6571 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6573 * util/rust-token-converter.cc (from_tokenstream): Add call to
6575 (from_tokentree): Add implementation, from the from_tokenstream
6578 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6580 * util/rust-token-converter.cc (from_punct): Add group
6582 (from_group): Likewise.
6584 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6586 * util/rust-token-converter.cc (to_tokenstream): Change function
6587 name from to_tokenstream to convert.
6588 (convert): Likewise.
6589 (from_tokenstream): Add tokenstream handler.
6590 (from_ident): Add empty function.
6591 (from_literal): Likewise.
6592 (from_punct): Likewise.
6593 (from_group): Likewise.
6594 * util/rust-token-converter.h (to_tokenstream): Change function
6595 name from to_tokenstream to convert.
6596 (convert): Likewise.
6598 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6600 * util/rust-token-converter.cc (dispatch_float_literals): Remove
6601 suffixed temporary variable.
6602 (dispatch_integer_literals): Likewise.
6604 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6606 * Make-lang.in: Add new rust-token-converter file.
6607 * ast/rust-ast-collector.cc (pop_group): Function moved from
6609 (dispatch_float_literals): Likewise.
6610 (dispatch_integer_literals): Likewise.
6611 (TokenCollector::collect): Removed function.
6612 * ast/rust-ast-collector.h: Removed function prototype.
6613 * util/rust-token-converter.cc: New file.
6614 * util/rust-token-converter.h: New file.
6616 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6618 * ast/rust-ast-collector.h (RUST_AST_TOKENSTREAM_H): Rename
6619 headerguard from RUST_AST_TOKENSTREAM_H ...
6620 (RUST_AST_COLLECTOR_H): ... to RUST_AST_COLLECTOR_H.
6622 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6624 * Make-lang.in: Change file name.
6625 * ast/rust-ast-tokenstream.cc: Moved to...
6626 * ast/rust-ast-collector.cc: ...here.
6627 * ast/rust-ast-tokenstream.h: Moved to...
6628 * ast/rust-ast-collector.h: ...here.
6629 * rust-session-manager.cc: Change header name.
6631 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6633 * ast/rust-ast-tokenstream.cc (TokenStream::TokenStream): Rename
6634 TokenStream to TokenCollector.
6635 (TokenCollector::TokenCollector): Likewise.
6636 (TokenStream::collect_tokens): Likewise.
6637 (TokenCollector::collect_tokens): Likewise.
6638 (TokenStream::collect): Likewise.
6639 (TokenCollector::collect): Likewise.
6640 (TokenStream::visit): Likewise.
6641 (TokenCollector::visit): Likewise.
6642 (TokenStream::visit_items_joined_by_separator): Likewise.
6643 (TokenCollector::visit_items_joined_by_separator): Likewise.
6644 (TokenStream::visit_as_line): Likewise.
6645 (TokenCollector::visit_as_line): Likewise.
6646 (TokenStream::visit_items_as_lines): Likewise.
6647 (TokenCollector::visit_items_as_lines): Likewise.
6648 (TokenStream::visit_items_as_block): Likewise.
6649 (TokenCollector::visit_items_as_block): Likewise.
6650 (TokenStream::trailing_comma): Likewise.
6651 (TokenCollector::trailing_comma): Likewise.
6652 (TokenStream::newline): Likewise.
6653 (TokenCollector::newline): Likewise.
6654 (TokenStream::indentation): Likewise.
6655 (TokenCollector::indentation): Likewise.
6656 (TokenStream::increment_indentation): Likewise.
6657 (TokenCollector::increment_indentation): Likewise.
6658 (TokenStream::decrement_indentation): Likewise.
6659 (TokenCollector::decrement_indentation): Likewise.
6660 (TokenStream::visit_closure_common): Likewise.
6661 (TokenCollector::visit_closure_common): Likewise.
6662 (TokenStream::visit_loop_common): Likewise.
6663 (TokenCollector::visit_loop_common): Likewise.
6664 (TokenStream::visit_function_common): Likewise.
6665 (TokenCollector::visit_function_common): Likewise.
6666 * ast/rust-ast-tokenstream.h (class TokenStream): Likewise.
6667 (class TokenCollector): Likewise.
6668 * rust-session-manager.cc (Session::dump_tokenstream): Rename
6669 token vector for clearer intent.
6671 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6673 * ast/rust-ast-tokenstream.cc (dispatch_float_literals): Add
6674 dispatch function for floating point literals.
6675 (TokenStream::collect): Add call to dispatcher.
6677 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6679 * ast/rust-ast-tokenstream.cc (dispatch_integer_literals):
6680 Add a static function to dispatch depending on the core type.
6681 (TokenStream::collect): Add call to dispatch function.
6683 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6685 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add
6686 conversion for byte string and string.
6688 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6690 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add Ident
6693 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6695 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add joint
6696 punct token conversion.
6698 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6700 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add
6701 conversion for single punctuation tokens.
6703 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6705 * ast/rust-ast-tokenstream.cc (pop_group): Add a function to
6706 easily collect a group from a given stack at the end of it.
6707 (TokenStream::collect): Collect tokens as a rust compatible
6709 * ast/rust-ast-tokenstream.h (RUST_AST_TOKENSTREAM_H): Move
6710 includes to stay constrained by guards.
6712 2024-01-16 M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
6714 * ast/rust-ast-full-decls.h (enum class): Added declaration.
6715 (struct AnonConst): Added declaration.
6716 (struct InlineAsmRegOrRegClass): Added declaration.
6717 (struct InlineAsmOperand): Added declaration.
6718 (struct InlineAsmPlaceHolder): Added declaration.
6719 (struct InlineAsmTemplatePiece): Added declaration.
6720 (struct TupleClobber): Added declaration.
6721 (struct TupleTemplateStr): Added declaration.
6722 * ast/rust-expr.h (class InlineAsm): Defined all it's data members outside.
6723 (enum class InlineAsmOptions): Converted this to a enum class so we could use it in the HIR.
6724 (struct AnonConst): Defined it independent of the AST::InlineAsm node.
6725 (struct InlineAsmRegOrRegClass): Defined it independent of the AST::InlineAsm node.
6726 (struct InlineAsmOperand): Defined it independent of the AST::InlineAsm node.
6727 (struct InlineAsmPlaceHolder): Defined it independent of the AST::InlineAsm node.
6728 (struct InlineAsmTemplatePiece): Defined it independent of the AST::InlineAsm node.
6729 (struct TupleClobber): Defined it independent of the AST::InlineAsm node.
6730 (struct TupleTemplateStr): Defined it independent of the AST::InlineAsm node.
6731 * hir/tree/rust-hir-expr.h (class InlineAsmReg): Added defination.
6732 (class InlineAsmRegClass): Added defination.
6733 (struct InlineAsmRegOrRegClass): Added defination.
6734 (class InlineAsm): Added defination.
6735 * hir/tree/rust-hir-full-decls.h (class InlineAsmReg): Added declaration.
6736 (class InlineAsmRegClass): Added declaration.
6737 (struct InlineAsmRegOrRegClass): Added declaration.
6738 (class InlineAsm): Added declaration.
6740 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6742 * backend/rust-compile-base.cc: track return type in fncontext
6743 * backend/rust-compile-context.h (struct fncontext): likewise
6744 * backend/rust-compile-expr.cc (CompileExpr::visit): apply coercion site
6745 (CompileExpr::generate_closure_function): update push_context
6746 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
6748 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6750 * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body):
6751 add missing coercion_site codegen
6753 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6755 * backend/rust-compile-expr.cc (CompileExpr::visit): refactr
6756 (CompileExpr::get_fn_addr_from_dyn): likewise
6757 (CompileExpr::get_receiver_from_dyn): likewise
6758 (CompileExpr::type_cast_expression): likewise
6759 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): likewise
6760 (TyTyResolveCompile::create_dyn_obj_record): likewise
6761 (TyTyResolveCompile::create_slice_type_record): likewise
6762 (TyTyResolveCompile::create_str_type_record): likewise
6763 * backend/rust-compile-type.h: likewise
6764 * backend/rust-compile.cc (HIRCompileBase::coercion_site1): likewise
6765 (HIRCompileBase::coerce_to_dyn_object): refactor
6766 * backend/rust-tree.h (SLICE_FLAG): removed
6767 (SLICE_TYPE_P): removed
6768 (RS_DST_FLAG): new flag
6769 (RS_DST_FLAG_P): new predicate
6770 * typecheck/rust-tyty.cc (ReferenceType::is_dyn_object): new helper
6771 (ReferenceType::is_dyn_obj_type): likewise
6772 (PointerType::is_dyn_object): likewise
6773 (PointerType::is_dyn_obj_type): likewise
6774 * typecheck/rust-tyty.h (class DynamicObjectType): moved up
6776 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6778 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): add filter
6780 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6782 * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body): use unit_expression
6783 (HIRCompileBase::unit_expression): new helper
6784 * backend/rust-compile-base.h: update prototype
6785 * backend/rust-compile-block.cc (CompileBlock::visit): use unit_expression
6786 * backend/rust-compile-expr.cc (CompileExpr::visit): likewise
6787 (CompileExpr::generate_closure_function): likewise
6788 * backend/rust-compile-implitem.cc (CompileTraitItem::visit): cleanup
6789 * backend/rust-compile-item.cc (CompileItem::visit): likewise
6790 * backend/rust-compile-pattern.cc (CompilePatternLet::visit): likewise
6791 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): likewise
6792 * backend/rust-compile-type.cc (TyTyResolveCompile::get_unit_type): new helper
6793 (TyTyResolveCompile::visit): use new unit_type helper
6794 * backend/rust-compile-type.h: likewise
6795 * rust-backend.h: simplify the return_expression
6796 * rust-gcc.cc (Gcc_backend::function_type): likewise
6797 (Gcc_backend::return_statement): likewise
6798 * backend/rust-constexpr.cc (eval_constant_expression): remove bad assertion
6800 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6802 * checks/lints/rust-lint-unused-var.cc (UnusedVariables::Lint): use the decl not the expr
6804 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6806 * parse/rust-parse-impl.h
6807 (Parser::parse_trait_impl_function_or_method):
6808 Parse function/method qualifiers after "default".
6810 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6812 * backend/rust-compile-base.cc: add missing compile_locals call
6814 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6816 * ast/rust-ast.h (class AttrInputMetaItemContainer): Run clang-format.
6817 (class DelimTokenTree): Likewise.
6819 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6821 * resolve/rust-early-name-resolver.cc (is_macro_use_module): New function.
6822 (EarlyNameResolver::accumulate_escaped_macros): New function.
6823 (EarlyNameResolver::go): Use `accumulate_escaped_macros`.
6824 (EarlyNameResolver::visit): Likewise.
6825 * resolve/rust-early-name-resolver.h: Declare `accumulate_escaped_macros`.
6827 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6829 * ast/rust-ast.h: Add take_items() and set_items() method to Crate.
6830 * ast/rust-item.h: Add take_items() and set_items() method to Module.
6832 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6834 * ast/rust-ast.h (enum Kind): Add MODULE variant.
6835 * ast/rust-item.h: Return Kind::MODULE in AST::Module::get_kind().
6837 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6839 * ast/rust-macro.cc (builtin_macro_from_string): Move function.
6840 * ast/rust-macro.h (enum class): Move enum.
6841 (builtin_macro_from_string): Move function.
6842 * expand/rust-macro-builtins.cc (builtin_macro_from_string): New function.
6843 (make_macro_path_str): Use new bi-map.
6844 (parse_single_string_literal): Use new `BuiltinMacro` enum.
6845 (MacroBuiltin::include_bytes_handler): Likewise.
6846 (MacroBuiltin::include_str_handler): Likewise.
6847 (MacroBuiltin::compile_error_handler): Likewise.
6848 (MacroBuiltin::concat_handler): Likewise.
6849 (MacroBuiltin::env_handler): Likewise.
6850 (MacroBuiltin::include_handler): Likewise.
6851 (MacroBuiltin::sorry): New function.
6852 * expand/rust-macro-builtins.h (enum class): Move enum here.
6853 (builtin_macro_from_string): New function declaration.
6854 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Use
6856 * util/rust-hir-map.cc (Mappings::insert_macro_def): Remove old
6859 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
6861 * expand/rust-macro-builtins.cc: Include bidirectional map.
6862 * util/bi-map.h: New file.
6864 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6867 (BlockExpr::strip_tail_expr):
6868 Try to take new tail expression from statements list.
6870 (BlockExpr::strip_tail_expr):
6871 Replace definition with only declaration.
6873 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6876 (Stmt::is_expr): New.
6878 (ExprStmt::is_expr): New.
6880 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6882 * expand/rust-macro-substitute-ctx.cc
6883 (SubstituteCtx::substitute_repetition): Fix out-of-bounds.
6885 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6887 * Make-lang.in: Link against the static libproc_macro.
6889 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
6891 * lang.opt: Add frust-extern option.
6892 * rust-session-manager.cc (Session::handle_extern_option): Add
6893 frust-extern option handler.
6894 * rust-session-manager.h (struct Session): Add an unordered map
6895 to store library name and locations.
6897 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6899 * parse/rust-parse-impl.h
6900 (Parser::parse_generic_params):
6901 Handle parameter parsing error.
6903 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6905 * typecheck/rust-hir-type-check-expr.cc: update for op overload
6907 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6909 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): use the predicate
6910 (TypeCheckExpr::resolve_segments): cleanup
6912 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6914 * typecheck/rust-hir-trait-reference.cc (AssociatedImplTrait::AssociatedImplTrait):
6916 (AssociatedImplTrait::get_trait): remove
6917 (AssociatedImplTrait::get_predicate): new getter
6918 * typecheck/rust-hir-trait-reference.h: bind predicate
6919 * typecheck/rust-hir-type-check-item.cc: update ctor
6920 * typecheck/rust-type-util.cc (lookup_associated_impl_block): new function
6921 * typecheck/rust-type-util.h (class BaseType): remove unused forward decl
6922 (lookup_associated_impl_block): new helper
6923 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::is_equal): new
6924 * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl): use new helper
6925 (SubstitutionRef::monomorphize): update usage/error handling
6926 * typecheck/rust-tyty-subst.h: remove old prototype
6927 * typecheck/rust-tyty.h: add is_equal decl
6929 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6931 * typecheck/rust-hir-type-check-pattern.cc
6932 (TypeCheckPattern::visit): Type check StructPatternFieldIdentPat.
6934 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6936 * hir/rust-ast-lower-pattern.cc
6937 (ASTLoweringPattern::visit): Lower StructPatternFieldIdentPat.
6939 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6941 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_fn_trait_call):
6942 return the assoicated predicate
6943 * typecheck/rust-hir-type-check-expr.h: update prototype
6945 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6947 * hir/rust-ast-lower-implitem.h: add missing where clause lowering
6949 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6951 * hir/tree/rust-hir-item.h: add get_locus() const
6953 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6955 * hir/tree/rust-hir-pattern.h
6956 (StructPatternFieldIdentPat::get_identifier): New.
6957 (StructPatternFieldIdentPat::get_pattern): New.
6959 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
6961 * ast/rust-ast-dump.cc (Dump::visit): print parentheses around
6962 unique expression operand.
6964 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
6966 * rust-session-manager.cc
6967 (Session::enable_dump): Fix error messages.
6969 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6971 * typecheck/rust-unify.cc (UnifyRules::emit_abi_mismatch): new error method
6972 (UnifyRules::expect_fndef): add ABI check
6973 * typecheck/rust-unify.h: prototype for new error method
6975 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6977 * util/rust-abi.cc (get_abi_from_string): add ABI mapping
6979 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6981 * hir/tree/rust-hir-pattern.h: add missing get_mutability
6982 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
6983 use new ClosureParamInfer on untyped parameters
6984 * typecheck/rust-hir-type-check-pattern.cc (ClosureParamInfer::Resolve): interface
6985 (ClosureParamInfer::ClosureParamInfer): constructor
6986 (ClosureParamInfer::visit): visitors for each pattern
6987 * typecheck/rust-hir-type-check-pattern.h (class ClosureParamInfer): new visitor
6989 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6991 * typecheck/rust-hir-type-check-pattern.h: cleanup
6993 2024-01-16 Philip Herron <herron.philip@googlemail.com>
6995 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
6996 return so we dont hit undefined behaviour
6998 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7000 * backend/rust-compile-implitem.h: remove includes
7002 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7004 * backend/rust-compile-item.cc (CompileItem::visit): remove bad checks
7006 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7008 * lang.opt: add lang option flag
7009 * rust-lang.cc (grs_langhook_init_options_struct): enable by default
7011 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7013 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::operator=):
7014 we are done if other is in an error state
7016 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7018 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): verify it is a method
7020 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7022 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): use new interface
7023 * typecheck/rust-hir-type-check-base.h: update prototype to include Self
7024 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): lifewise
7025 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
7027 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): likewise
7028 (TypeCheckExpr::resolve_segments): likewise
7029 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
7030 (TypeResolveGenericParam::visit): likewise
7031 (ResolveWhereClauseItem::visit): likewise
7032 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
7033 (TypeBoundPredicate::apply_generic_arguments): likewise
7034 (TypeBoundsMappings::lookup_predicate): likewise
7035 * typecheck/rust-tyty-bounds.h: likewise
7036 * typecheck/rust-tyty.h:likewise
7038 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7040 * typecheck/rust-hir-type-check.h: New error state and missing copy implementations
7041 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::TypeCheckContextItem):
7043 (TypeCheckContextItem::operator=): missing copy implementation
7044 (TypeCheckContextItem::get_error): new static function
7045 (TypeCheckContextItem::is_error): new method
7046 (TypeCheckContextItem::get_context_type): handle error state
7047 (TypeCheckContextItem::get_defid): handle error state
7049 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7051 * typecheck/rust-hir-type-check.h: new helper
7052 * typecheck/rust-typecheck-context.cc (TypeCheckContext::have_function_context):
7055 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7057 * typecheck/rust-hir-type-check.h: Add prototype
7058 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::get_defid): implementation
7060 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7062 * typecheck/rust-hir-type-check-expr.cc: refactor
7064 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7066 * typecheck/rust-autoderef.cc: don't take a reference
7067 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
7068 * typecheck/rust-hir-type-check.h: remove reference
7069 * typecheck/rust-typecheck-context.cc (TypeCheckContext::pop_return_type): likewise
7071 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7073 * resolve/rust-ast-resolve-pattern.cc
7074 (PatternDeclaration::visit): Handle StructPatternFieldIdentPat.
7076 2024-01-16 TieWay59 <tieway59@foxmail.com>
7078 PR translation/108890
7079 * lang.opt: Fix translation mistakes 2023 in
7081 (line 67): change the inconsistent tab to spaces
7082 (line 75): wrap bare placeholder `integer`
7083 (line 79): remove redundant text of `Choose which`
7084 (line 96): remove redundant text of `Choose which`
7085 (line 112): remove redundant `Flag to`
7086 (line 124): correct the exclusive term `When to stop`
7087 (line 124): correct typo of `copimlation`
7089 2024-01-16 M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
7091 * parse/rust-parse-impl.h (Parser::debug_dump_ast_output): Removed this funtion.
7092 * rust-session-manager.cc (Session::enable_dump): Removed else if (arg == "parse").
7093 (Session::compile_crate): Removed calls of dump_ast and dump_ast_expanded.
7094 (Session::dump_ast): Removed this function.
7095 (Session::dump_ast_expanded): Removed this function.
7096 * rust-session-manager.h (struct CompileOptions): Removed the PARSER_AST_DUMP option.
7098 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7100 * parse/rust-parse-impl.h (Parser::parse_reference_pattern): Do not
7101 call into `parse_pattern` anymore.
7103 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7105 * hir/rust-ast-lower-pattern.cc
7106 (ASTLoweringPattern::translate): Add is_let_top_level parameter.
7107 (ASTLoweringPattern::visit): Handle is_let_top_level.
7108 * hir/rust-ast-lower-pattern.h
7109 (class ASTLoweringPattern): Add is_let_top_level.
7110 * hir/rust-ast-lower-stmt.cc
7111 (ASTLoweringStmt::visit): Set is_let_top_level.
7113 2024-01-16 Zheyuan Chen <sephirotheca17@gmail.com>
7115 * ast/rust-ast-dump.cc: fix bad formatting for associated type.
7117 2024-01-16 Sergey Bugaev <bugaevc@gmail.com>
7119 * hir/rust-ast-lower-expr.h, hir/rust-ast-lower-expr.cc:
7120 Lower AST::ErrorPropagationExpr to HIR::ErrorPropagationExpr
7122 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7124 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix scope
7125 resolution token output.
7127 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7129 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Keep
7132 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7134 * ast/rust-ast-tokenstream.cc (TokenStream::visit_function_common):
7135 Fix function body output.
7137 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7139 * parse/rust-parse-impl.h (Parser::parse_outer_attribute): Fix
7142 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7144 * lex/rust-token.cc (Token::as_string): Fix lifetime string
7147 2024-01-16 Sergey Bugaev <bugaevc@gmail.com>
7149 * resolve/rust-ast-resolve-expr.cc: Add "break rust" Easter egg
7151 2024-01-16 Sergey Bugaev <bugaevc@gmail.com>
7153 * resolve/rust-ast-resolve-expr.h,
7154 resolve/rust-ast-resolve-expr.cc: Add ResolveExpr::funny_error
7156 2024-01-16 Sergey Bugaev <bugaevc@gmail.com>
7158 * ast/rust-ast.h: Add AST::Kind::IDENTIFIER
7160 2024-01-16 Sergey Bugaev <bugaevc@gmail.com>
7162 * ast/rust-ast.h (Kind): Convert into a C++ enum class
7163 * expand/rust-macro-builtins.cc: Adapt to the change
7165 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7167 * typecheck/rust-hir-type-check-expr.cc
7168 (TypeCheckExpr::visit): Add implementation for IfLetExprConseqElse.
7169 * typecheck/rust-hir-type-check-expr.h:
7170 (TypeCheckExpr::visit): Remove stub implementation for IfLetExprConseqElse.
7171 * hir/rust-ast-lower-expr.cc
7172 (ASTLoweringExpr::visit): Lower IfLetExpr{,ConseqElse}.
7173 * hir/rust-ast-lower-expr.h:
7174 (ASTLoweringExpr::visit): Likewise.
7175 * hir/rust-ast-lower-block.h
7176 (ASTLoweringIfLetBlock::visit): Lower IfLetExprConseqElse.
7177 (ASTLoweringExprWithBlock::visit): Likewise.
7178 * hir/rust-ast-lower.cc
7179 (ASTLoweringIfLetBlock::visit): Lower IfLetExprConseqElse.
7180 * hir/tree/rust-hir-expr.h
7181 (IfLetExprConseqElse::IfLetExprConseqElse): Make constructor more general.
7182 (IfLetExprConseqElse::vis_else_block): Add.
7183 (IfLetExprConseqElse::get_else_block): Add.
7184 * resolve/rust-ast-resolve-expr.cc
7185 (ResolveExpr::visit): Add IfLetExprConseqElse visitor.
7186 * resolve/rust-ast-resolve-expr.h
7187 (ResolveExpr::visit): Add IfLetExprConseqElse visitor.
7189 2024-01-16 Sebastian Kirmayer <gnu@kirmayer.eu>
7191 * parse/rust-parse-impl.h
7192 (Parser<ManagedTokenSource>::parse_macro_match_repetition):
7193 reject separator in `?` repetition
7195 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7198 (class IfLetExprConseqElse): Make else_block ExprWithBlock.
7199 (class IfLetExprConseqIf): Remove.
7200 (class IfLetExprConseqIfLet): Remove.
7201 * ast/rust-ast-full-decls.h
7202 (class IfLetExprConseqIf): Remove.
7203 (class IfLetExprConseqIfLet): Remove.
7205 (IfLetExprConseqElse::as_string): Adjust output.
7206 (IfLetExprConseqIf::as_string): Remove.
7207 (IfLetExprConseqIfLet::as_string): Remove.
7208 (IfLetExprConseqIf::accept_vis): Remove.
7209 (IfLetExprConseqIfLet::accept_vis): Remove.
7210 * ast/rust-ast-visitor.h
7211 (ASTVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
7212 * ast/rust-ast-dump.cc
7213 (Dump::visit): Likewise.
7214 * ast/rust-ast-dump.h:
7215 (Dump::visit): Likewise.
7216 * ast/rust-ast-tokenstream.cc
7217 (TokenStream::visit): Likewise.
7218 * ast/rust-ast-tokenstream.h
7219 (TokenStream::visit): Likewise.
7220 * util/rust-attributes.cc
7221 (AttributeChecker::visit): Likewise.
7222 * util/rust-attributes.h:
7223 (AttributeChecker::visit): Likewise.
7224 * resolve/rust-early-name-resolver.cc
7225 (EarlyNameResolver::visit): Likewise.
7226 * resolve/rust-early-name-resolver.h
7227 (EarlyNameResolver::visit): Likewise.
7228 * resolve/rust-ast-resolve-base.h
7229 (ResolverBase::visit): Likewise.
7230 * resolve/rust-ast-resolve-base.cc
7231 (ResolverBase::visit): Likewise.
7232 * checks/errors/rust-feature-gate.h
7233 (FeatureGate::visit): Likewise.
7234 * expand/rust-cfg-strip.cc
7235 (CfgStrip::visit): Likewise.
7236 * expand/rust-cfg-strip.h:
7237 (CfgStrip::visit): Likewise.
7238 * expand/rust-expand-visitor.cc
7239 (ExpandVisitor::visit): Likewise.
7240 * expand/rust-expand-visitor.h
7241 (ExpandVisitor::visit): Likewise.
7242 * hir/rust-ast-lower-base.cc
7243 (ASTLoweringBase::visit): Likewise.
7244 * hir/rust-ast-lower-base.h:
7245 (ASTLoweringBase::visit): Likewise.
7246 * parse/rust-parse-impl.h
7247 (Parser::parse_if_let_expr): Replace IfLetExprConseqIf{,Let} with IfLetExprConseqElse.
7249 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7251 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add struct
7252 name and curly braces to output tokenstream.
7254 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7256 * parse/rust-parse-impl.h
7257 (Parser::parse_macro_match): Handle underscore.
7259 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7261 * hir/tree/rust-hir-full-decls.h
7262 (class ExprStmtWithoutBlock): Remove.
7263 (class ExprStmtWithBlock): Remove.
7264 * hir/tree/rust-hir-stmt.h
7266 Add remaining ExprStmtWith{,out}Block functionality.
7267 (class ExprStmtWithoutBlock): Remove.
7268 (class ExprStmtWithBlock): Remove.
7269 * hir/rust-ast-lower-stmt.cc
7270 (ASTLoweringStmt::visit):
7271 Lower to HIR::ExprStmt instead of deriving class.
7273 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7275 * backend/rust-compile-stmt.cc
7276 (CompileStmt::visit): Unify ExprStmtWith{,out}Block visitors.
7277 * backend/rust-compile-stmt.h
7278 (CompileStmt::visit): Likewise.
7279 * backend/rust-compile-item.h
7280 (CompileItem::visit): Likewise.
7281 * hir/rust-hir-dump.cc
7282 (Dump::visit): Likewise.
7283 * hir/rust-hir-dump.h
7284 (Dump::visit): Likewise.
7285 * hir/tree/rust-hir-stmt.h
7286 (ExprStmt::accept_vis): Add.
7287 (ExprStmtWithoutBlock::accept_vis): Remove.
7288 (ExprStmtWithBlock::accept_vis): Remove.
7289 * hir/tree/rust-hir.cc
7290 (ExprStmt::accept_vis): Add.
7291 (ExprStmtWithoutBlock::accept_vis): Remove.
7292 (ExprStmtWithBlock::accept_vis): Remove.
7293 * hir/tree/rust-hir-visitor.h
7294 (HIRFullVisitor::visit): Likewise.
7295 (HIRFullVisitorBase::visit): Likewise.
7296 (HIRStmtVisitor::visit): Likewise.
7297 * checks/errors/rust-const-checker.cc
7298 (ConstChecker::visit): Likewise.
7299 * checks/errors/rust-const-checker.h
7300 (ConstChecker::visit): Likewise.
7301 * checks/errors/rust-unsafe-checker.cc
7302 (UnsafeChecker::visit): Likewise.
7303 * checks/errors/rust-unsafe-checker.h
7304 (UnsafeChecker::visit): Likewise.
7305 * checks/errors/privacy/rust-privacy-reporter.cc
7306 (PrivacyReporter::visit): Likewise.
7307 * checks/errors/privacy/rust-privacy-reporter.h
7308 (PrivacyReporter::visit): Likewise.
7309 * checks/lints/rust-lint-marklive.h
7310 (MarkLive::visit): Likewise.
7311 * typecheck/rust-hir-type-check-stmt.cc
7312 (TypeCheckStmt::visit): Likewise.
7313 * typecheck/rust-hir-type-check-stmt.h
7314 (TypeCheckStmt::visit): Likewise.
7315 * typecheck/rust-tycheck-dump.h
7316 (TypeResolverDump::visit): Likewise.
7318 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7320 * hir/tree/rust-hir-stmt.h
7321 (ExprStmt::expr): Add field.
7322 (ExprStmt::get_expr): Add method.
7323 (ExprStmt::ExprStmt): Add copy/move constructors, modify existing constructor.
7324 (ExprStmt::operator=): Add assignment operator.
7325 (ExprStmtWithoutBlock::expr): Remove field.
7326 (ExprStmtWithoutBlock::get_expr): Remove method.
7327 (ExprStmtWithoutBlock::ExprStmt):
7328 Remove copy/move constructors, modify existing constructor.
7329 (ExprStmtWithoutBlock::operator=): Remove assignment operator.
7330 (ExprStmtWithBlock::expr): Remove field.
7331 (ExprStmtWithBlock::get_expr): Remove method.
7332 (ExprStmtWithBlock::ExprStmt): Remove copy/move constructors, modify existing constructor.
7333 (ExprStmtWithBlock::operator=): Remove assignment operator.
7334 (ExprStmt::as_string): Add method.
7335 (ExprStmtWithBlock::as_string): Remove method.
7336 (ExprStmtWithoutBlock::as_string): Remove method.
7337 * hir/tree/rust-hir.cc
7338 (ExprStmt::as_string): Add method.
7339 (ExprStmtWithBlock::as_string): Remove method.
7340 (ExprStmtWithoutBlock::as_string): Remove method.
7342 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7345 (class IfExprConseqElse): Make else_block ExprWithBlock.
7346 (class IfExprConseqIf): Remove.
7347 (class IfExprConseqIfLet): Remove.
7348 * ast/rust-ast-full-decls.h
7349 (class IfExprConseqIf): Remove.
7350 (class IfExprConseqIfLet): Remove.
7352 (IfExprConseqElse::as_string): Adjust output.
7353 (IfExprConseqIf::as_string): Remove.
7354 (IfExprConseqIfLet::as_string): Remove.
7355 (IfExprConseqIf::accept_vis): Remove.
7356 (IfExprConseqIfLet::accept_vis): Remove.
7357 * ast/rust-ast-visitor.h
7358 (ASTVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
7359 * ast/rust-ast-tokenstream.cc
7360 (TokenStream::visit): Likewise.
7361 * ast/rust-ast-tokenstream.h
7362 (TokenStream::visit): Likewise.
7363 * ast/rust-ast-dump.cc
7364 (Dump::visit): Likewise.
7365 * ast/rust-ast-dump.h
7366 (Dump::visit): Likewise.
7367 * checks/errors/rust-feature-gate.h
7368 (FeatureGate::visit): Likewise.
7369 * util/rust-attributes.cc
7370 (AttributeChecker::visit): Likewise.
7371 * util/rust-attributes.h
7372 (AttributeChecker::visit): Likewise.
7373 * resolve/rust-early-name-resolver.cc
7374 (EarlyNameResolver::visit): Likewise.
7375 * resolve/rust-early-name-resolver.h
7376 (EarlyNameResolver::visit): Likewise.
7377 * resolve/rust-ast-resolve-base.h
7378 (ResolverBase::visit): Likewise.
7379 * resolve/rust-ast-resolve-base.cc
7380 (ResolverBase::visit): Likewise.
7381 * resolve/rust-ast-resolve-expr.h
7382 (ResolveExpr::visit): Remove IfExprConseqIf visitor.
7383 * resolve/rust-ast-resolve-expr.cc
7384 (ResolveExpr::visit): Likewise.
7385 * expand/rust-cfg-strip.cc
7386 (CfgStrip::visit): Remove IfExprConseqIf{,Let} visitors.
7387 * expand/rust-cfg-strip.h
7388 (CfgStrip::visit): Likewise.
7389 * expand/rust-expand-visitor.cc
7390 (ExpandVisitor::visit): Likewise.
7391 * expand/rust-expand-visitor.h
7392 (ExpandVisitor::visit): Likewise.
7393 * hir/rust-ast-lower-base.cc
7394 (ASTLoweringBase::visit): Likewise.
7395 * hir/rust-ast-lower-base.h
7396 (ASTLoweringBase::visit): Likewise.
7397 * hir/rust-ast-lower-block.h
7398 (ASTLoweringIfBlock::visit): Remove IfExprConseqIf visitor.
7399 (ASTLoweringExprWithBlock::visit): Likewise.
7400 * hir/rust-ast-lower.cc
7401 (ASTLoweringIfBlock::visit):
7402 Remove IfExprConseqIf visitor, adjust IfExprConseqElse lowering.
7403 * hir/rust-ast-lower-expr.h
7404 (ASTLoweringExpr::visit): Remove IfExprConseqIf visitor.
7405 * hir/rust-ast-lower-expr.cc
7406 (ASTLoweringExpr::visit): Likewise.
7407 * parse/rust-parse-impl.h
7408 (Parser::parse_if_expr): Replace IfExprConseqIf{,Let} with IfExprConseqElse.
7410 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7412 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix inner
7413 attribute tokenstream output.
7415 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
7417 * ast/rust-ast-dump.cc (Dump::debug): New.
7418 * ast/rust-ast-dump.h (Dump::debug): Untemplate it.
7420 * ast/rust-ast.h (class Visitable): New.
7421 (class TokenTree): Inherit from Visitable.
7422 (class MacroMatch): Likewise.
7423 (class AttrInput): Likewise.
7424 (class MetaItemInner): Likewise.
7425 (class Pattern): Likewise.
7426 (classTypeParamBound): Likewise.
7427 (class GenericParam): Likewise.
7428 (class TraitItem): Likewise.
7429 (classInherentImplItem): Likewise.
7430 (class TraitImplItem): Likewise.
7431 (class ExternalItem): Likewise.
7432 (class SingleASTNode): Likewise.
7434 2024-01-16 Thomas Schwinge <thomas@codesourcery.com>
7436 * rust-lang.cc (grs_langhook_type_for_mode): Placate clang-format.
7438 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7440 * ast/rust-ast.h: Add boolean for differenciation.
7441 * parse/rust-parse-impl.h (Parser::parse_doc_comment): Change
7442 function interface to make code cleaner. It should return a body
7443 instead of the whole attribute.
7444 (Parser::parse_inner_attribute): Specify the inner status of the
7446 (Parser::parse_attribute_body): Change function interface to
7447 make the code cleaner much like parse_doc_comment.
7448 (Parser::parse_outer_attribute): Specify outer status of the
7450 * parse/rust-parse.h: Update functions prototypes.
7452 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7454 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
7455 reuse resolve_method_address to monomorphize the call if required
7456 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
7457 allow matching against unimplemented trait item bounds
7459 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7461 * typecheck/rust-hir-path-probe.cc: dont subst with a dynamic object
7463 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7465 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): moved here
7466 * backend/rust-compile-base.h: refactored prototype
7467 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): refactor
7468 * backend/rust-compile-expr.h: likewise
7470 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7472 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): remove unused
7474 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7476 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): call destructure
7478 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7480 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
7481 call path probe impl trait
7483 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7485 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
7486 to attribute expansion function.
7488 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7490 * expand/rust-expand-visitor.cc (ExpandVisitor::visit_outer_attrs):
7491 Change condition order.
7492 (ExpandVisitor::visit_inner_using_attrs): Likewise.
7493 (ExpandVisitor::visit_attrs_with_derive): Likewise.
7494 (ExpandVisitor::is_builtin): Add builtin identification
7496 * expand/rust-expand-visitor.h: Add function prototype.
7497 * util/rust-attributes.cc: Add missing rustc_builtin_macro
7500 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7502 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_struct_fields):
7503 Add call to expand structu fields.
7504 (ExpandVisitor::expand_function_params): Add call to expand
7505 function parameters.
7506 (ExpandVisitor::expand_closure_params): Add call to expand
7508 (ExpandVisitor::visit): Add calls for item outer attribute
7511 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7513 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_outer_attribute):
7514 Stub for a single attribute expansion.
7515 (ExpandVisitor::visit_outer_attrs): Visit the attributes to
7516 expand on a given item.
7517 * expand/rust-expand-visitor.h: Add function prototypes.
7519 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7521 * ast/rust-ast.h: Add getter to Expr class.
7522 * ast/rust-expr.h: Add override attribute to existing getters.
7523 Also implement it for RangeExpr, attempting to retrieve outer
7524 attributes on those types will crash the compiler.
7525 * ast/rust-macro.h: Add override attribute to existing getters.
7526 * ast/rust-path.h: Likewise.
7528 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7530 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
7531 to inner attribute stub.
7532 (ExpandVisitor::expand_inner_attribute): Expand one single
7534 (ExpandVisitor::visit_inner_using_attrs): Expand a given item
7535 using a vector of attributes.
7536 (ExpandVisitor::visit_inner_attrs): Visit inner attributes of a
7538 * expand/rust-expand-visitor.h: Add function prototypes.
7540 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7542 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
7544 (ExpandVisitor::expand_derive): Expand a single derive.
7545 (ExpandVisitor::visit_attrs_with_derive): Visit an item with
7547 (ExpandVisitor::is_derive): Identify a derive attribute.
7548 * expand/rust-expand-visitor.h: Add function prototypes.
7550 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7552 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix ICE.
7554 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7556 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
7559 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7561 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Visit inner
7564 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7566 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Change token
7569 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7571 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix existing
7572 and implement remaining attribute visitors.
7574 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7576 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor
7577 to the union's outer attributes.
7579 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7581 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add call to
7582 inner attribute visitor.
7584 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7586 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix ICE.
7588 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7590 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Make comma
7593 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7595 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
7596 additional semicolon output.
7597 * ast/rust-ast-tokenstream.h: Change block visitor prototype
7598 with a default value for trailing tokens.
7600 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7602 * Make-lang.in: Add two new files to the list of sources.
7603 * ast/rust-ast-full.h: Add new ast formatting header.
7604 * ast/rust-ast.cc (enum indent_mode): Move formatting function
7606 (indent_spaces): Likewise.
7607 (get_string_in_delims): Likewise.
7608 (enum AttrMode): Likewise.
7609 (get_mode_dump_desc): Likewise.
7610 (append_attributes): Likewise.
7611 (unquote_string): Likewise.
7612 (GroupedExpr::as_string): Move pattern implementation to it's
7614 (RangePattern::as_string): Likewise.
7615 (RangePatternBoundLiteral::as_string): Likewise.
7616 (SlicePattern::as_string): Likewise.
7617 (AltPattern::as_string): Likewise.
7618 (TuplePatternItemsMultiple::as_string): Likewise.
7619 (TuplePatternItemsRanged::as_string): Likewise.
7620 (TuplePattern::as_string): Likewise.
7621 (StructPatternField::as_string): Likewise.
7622 (StructPatternFieldIdent::as_string): Likewise.
7623 (StructPatternFieldTuplePat::as_string): Likewise.
7624 (StructPatternFieldIdentPat::as_string): Likewise.
7625 (StructPatternElements::as_string): Likewise.
7626 (StructPattern::as_string): Likewise.
7627 (LiteralPattern::as_string): Likewise.
7628 (ReferencePattern::as_string): Likewise.
7629 (IdentifierPattern::as_string): Likewise.
7630 (TupleStructItemsNoRange::as_string): Likewise.
7631 (TupleStructItemsRange::as_string): Likewise.
7632 (TupleStructPattern::as_string): Likewise.
7633 (GroupedExpr::accept_vis): Likewise.
7634 (LiteralPattern::accept_vis): Likewise.
7635 (IdentifierPattern::accept_vis): Likewise.
7636 (WildcardPattern::accept_vis): Likewise.
7637 (RestPattern::accept_vis): Likewise.
7638 (RangePatternBoundLiteral::accept_vis): Likewise.
7639 (RangePatternBoundPath::accept_vis): Likewise.
7640 (RangePatternBoundQualPath::accept_vis): Likewise.
7641 (RangePattern::accept_vis): Likewise.
7642 (ReferencePattern::accept_vis): Likewise.
7643 (StructPatternFieldTuplePat::accept_vis): Likewise.
7644 (StructPatternFieldIdentPat::accept_vis): Likewise.
7645 (StructPatternFieldIdent::accept_vis): Likewise.
7646 (StructPattern::accept_vis): Likewise.
7647 (TupleStructItemsNoRange::accept_vis): Likewise.
7648 (TupleStructItemsRange::accept_vis): Likewise.
7649 (TupleStructPattern::accept_vis): Likewise.
7650 (TuplePatternItemsMultiple::accept_vis): Likewise.
7651 (TuplePatternItemsRanged::accept_vis): Likewise.
7652 (TuplePattern::accept_vis): Likewise.
7653 (GroupedPattern::accept_vis): Likewise.
7654 (SlicePattern::accept_vis): Likewise.
7655 (AltPattern::accept_vis): Likewise.
7656 * ast/rust-ast-formatting.cc: New file.
7657 * ast/rust-ast-formatting.h: New file.
7658 * ast/rust-pattern.cc: New file.
7660 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7662 * Make-lang.in: Add new file for rust-path implementation.
7663 * ast/rust-ast.cc (PathInExpression::as_string): Move function
7665 (PathPattern::as_string): Likewise.
7666 (QualifiedPathInExpression::as_string): Likewise.
7667 (ConstGenericParam::as_string): Likewise.
7668 (QualifiedPathInType::as_string): Likewise.
7669 (TypePath::as_string): Likewise.
7670 (PathPattern::convert_to_simple_path): Likewise.
7671 (TypePath::as_simple_path): Likewise.
7672 (PathExprSegment::as_string): Likewise.
7673 (GenericArgs::as_string): Likewise.
7674 (GenericArgsBinding::as_string): Likewise.
7675 (TypePath::to_trait_bound): Likewise.
7676 (TypePathSegmentGeneric::as_string): Likewise.
7677 (TypePathFunction::as_string): Likewise.
7678 (TypePathSegmentFunction::as_string): Likewise.
7679 (ConstGenericParam::accept_vis): Likewise.
7680 (PathInExpression::accept_vis): Likewise.
7681 (TypePathSegment::accept_vis): Likewise.
7682 (TypePathSegmentGeneric::accept_vis): Likewise.
7683 (TypePathSegmentFunction::accept_vis): Likewise.
7684 (TypePath::accept_vis): Likewise.
7685 (QualifiedPathInExpression::accept_vis): Likewise.
7686 (QualifiedPathInType::accept_vis): Likewise.
7687 (GenericArg::disambiguate_to_const): Likewise.
7688 (GenericArg::disambiguate_to_type): Likewise.
7689 * ast/rust-path.cc: New file.
7691 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7693 * backend/rust-compile-item.cc (CompileItem::visit): unwrap the constant expression
7695 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7697 * util/rust-lang-item.h
7698 (RustLangItem::ItemType::FN): Add.
7699 (RustLangItem::ItemType::FN_MUT): Add.
7700 (RustLangItem::Parse): Handle FN and FN_MUT.
7701 (RustLangItem::ToString): Handle FN and FN_MUT.
7703 2024-01-16 Emanuele Micheletti <micheletti.emanuele@hotmail.com>
7705 * typecheck/rust-casts.cc (TypeCastRules::cast_rules):
7706 case INTEGRAL handles TypeKind::CHAR
7708 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7710 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
7711 add check for reference marker and type's in self params
7712 (ResolveItem::visit): likewise
7713 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
7714 remove bad generics check
7715 (TypeCheckExpr::resolve_segments): likewise
7716 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): likewise
7718 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7720 * resolve/rust-ast-resolve-item.cc
7721 (ResolveTraitItems::visit): add name resolution self param
7722 (ResolveItem::visit): likewise
7724 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7726 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate): this is an empty
7727 (TypeBoundPredicate::operator=): likewise
7728 * typecheck/rust-tyty-subst.cc (SubstitutionArgumentMappings::empty): new interface
7729 (SubstitutionArgumentMappings::is_error): this marks it as an error
7730 * typecheck/rust-tyty-subst.h: update prototypes
7732 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7734 * checks/errors/privacy/rust-privacy-reporter.cc
7735 (PrivacyReporter::check_base_type_privacy): allow error types to be permissive
7737 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7739 * ast/rust-ast-tokenstream.cc (TokenStream::visit_items_as_lines):
7740 Handle trailing chars.
7741 (TokenStream::visit_items_as_block): Likewise.
7742 (TokenStream::visit): Fix visitor.
7744 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7746 * lex/rust-token.cc (Token::as_string): Add type hint output.
7748 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7750 * rust-session-manager.cc (Session::enable_dump): Enable new
7752 (Session::compile_crate): CLI argument parsing.
7753 (Session::dump_tokenstream): Dump the tokenstream as a string in
7755 * rust-session-manager.h (struct CompileOptions): Add
7756 tokenstream dump option.
7758 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7760 * lex/rust-token.cc (Token::as_string): Add as_string
7762 * lex/rust-token.h: Add as_string prototype.
7764 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7766 * ast/rust-ast-tokenstream.cc (TokenStream::TokenStream): Add
7769 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7771 * ast/rust-ast-tokenstream.cc (TokenStream::collect_tokens): Add
7773 (TokenStream::go): Rename function.
7774 (TokenStream::visit): Likewise.
7775 * ast/rust-ast-tokenstream.h: Add collect prototype.
7777 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7779 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Change
7781 * ast/rust-ast.cc (SimplePath::as_string): Change attribute
7783 * ast/rust-ast.h (class SimplePath): Refactor attribute name and
7786 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7788 * ast/rust-ast-tokenstream.cc (TokenStream::visit_as_line): Add
7790 (TokenStream::visit_items_as_block): Likewise.
7791 (TokenStream::newline): Add stub.
7792 (TokenStream::indentation): Add stub.
7793 (TokenStream::increment_indentation): Add stub.
7794 (TokenStream::decrement_indentation): Add stub.
7795 (TokenStream::visit): Add formatting calls.
7796 (TokenStream::visit_function_common): Likewise.
7797 * ast/rust-ast-tokenstream.h: Add stub prototypes.
7799 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7801 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
7803 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7805 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor
7807 * ast/rust-ast-tokenstream.h: Add additional function prototype.
7808 * ast/rust-item.h: Add some getters.
7809 * ast/rust-macro.h: Likewise.
7811 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7813 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
7814 * ast/rust-item.h: Add missing getters.
7816 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7818 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
7820 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7822 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add
7824 (TokenStream::visit_closure_common): Merge common code for
7826 * ast/rust-ast-tokenstream.h: Add function prototype.
7827 * ast/rust-expr.h: Add missing move attribute getter.
7829 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7831 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add
7833 (TokenStream::visit_loop_common): Merge common loop code.
7834 * ast/rust-ast-tokenstream.h: Add function prototypes.
7836 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7838 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
7840 * ast/rust-ast-tokenstream.h: Add function prototype for missing
7843 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7845 * ast/rust-ast-tokenstream.cc (TokenStream::trailing_comma):
7846 Output a trailing comma to the token stream according to the
7848 * ast/rust-ast-tokenstream.h: Add function prototype.
7850 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7852 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
7855 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7857 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
7859 * ast/rust-ast-tokenstream.h: Add function prototypes.
7860 * ast/rust-ast.h: Add missing getters.
7861 * ast/rust-expr.h: Likewise.
7863 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
7865 * Make-lang.in: Add rust-as-tokenstream to compile list.
7866 * ast/rust-item.h: Add missing getter for location.
7867 * ast/rust-ast-tokenstream.cc: Add ast visitor implementation.
7868 * ast/rust-ast-tokenstream.h: New file.
7869 * ast/rust-pattern.h: Add getter.
7871 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7873 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
7874 Add implicit unit type as the return type when not specified
7876 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7878 * util/rust-attributes.cc: Add stable to the table of known attributes
7880 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7882 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): return early on bad type
7883 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::TypeCheckPattern):
7884 remove assertion in favor of check
7885 (TypeCheckPattern::visit): likewise
7887 2024-01-16 Philip Herron <herron.philip@googlemail.com>
7889 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
7890 when its not a block we dont have any ribs to generate locals from
7892 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7894 * parse/rust-parse-impl.h
7895 (Parser<ManagedTokenSource>::parse_expr_without_block):
7896 Remove direct array expression handling.
7898 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7900 * ast/rust-item.h: Fix `Visibility::has_path()` implementation.
7901 * checks/errors/privacy/rust-visibility-resolver.cc
7902 (VisibilityResolver::resolve_module_path): Check if we are dealing with pub(crate) properly.
7904 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7906 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Set
7907 resolved_node_id when visiting root segment of SimplePath.
7909 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7911 * ast/rust-ast.h: Call SimplePath constructor differently in
7912 SimplePath::from_str
7914 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7916 * hir/rust-ast-lower-type.h: Move all remaining definitions to source file.
7917 * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): Moved to source file.
7918 (ASTLoweringType::visit): Likewise.
7919 (ASTLowerGenericParam::translate): Likewise.
7920 (ASTLowerGenericParam::visit): Likewise.
7921 (ASTLoweringTypeBounds::translate): Likewise.
7922 (ASTLoweringTypeBounds::visit): Likewise.
7923 (ASTLowerWhereClauseItem::translate): Likewise.
7924 (ASTLowerWhereClauseItem::visit): Likewise.
7926 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
7928 * ast/rust-pattern.h: Remove commented out code.
7930 2024-01-16 emanuele-em <micheletti.emanuele@hotmail.com>
7932 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): BOOL removed from switch cases
7934 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7936 * Make-lang.in: Rename rust-asttribute-visitor.o -> rust-cfg-strip.o
7937 * expand/rust-attribute-visitor.cc: Moved to...
7938 * expand/rust-cfg-strip.cc: ...here.
7939 * expand/rust-attribute-visitor.h: Moved to...
7940 * expand/rust-cfg-strip.h: ...here.
7941 * expand/rust-macro-expand.cc: Fix include of rust-attribute-visitor.h
7942 * expand/rust-macro-builtins.cc: Likewise.
7943 * rust-session-manager.cc (Session::expansion): Call CfgStrip instead of
7946 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7948 * Make-lang.in: Add new object file.
7949 * expand/rust-attribute-visitor.cc (AttrVisitor::go): Visit all items of a
7951 (AttrVisitor::expand_struct_fields): Do not perform macro expansion anymore.
7952 (AttrVisitor::expand_function_params): Likewise.
7953 (AttrVisitor::expand_generic_args): Likewise.
7954 (AttrVisitor::expand_qualified_path_type): Likewise.
7955 (AttrVisitor::expand_self_param): Likewise.
7956 (AttrVisitor::expand_trait_function_decl): Likewise.
7957 (AttrVisitor::expand_trait_method_decl): Likewise.
7958 (AttrVisitor::visit): Likewise.
7959 (AttrVisitor::maybe_expand_expr): Remove function.
7960 (AttrVisitor::maybe_expand_type): Likewise.
7961 * expand/rust-attribute-visitor.h: Do not keep MacroExpander inside AttrVisitor
7963 * expand/rust-macro-expand.h (struct MacroExpander): Turn ContextType into an
7964 enum class for more type safety.
7965 * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Use new ContextType
7967 * rust-session-manager.cc (Session::expansion): Call into ExpandVisitor.
7968 * expand/rust-expand-visitor.cc: New file.
7969 * expand/rust-expand-visitor.h: New file.
7971 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7973 * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Do not cfg-attr
7974 strip in MacroExpander
7975 (MacroExpander::fails_cfg): Function moved...
7976 (MacroExpander::fails_cfg_with_expand): Function moved...
7977 (MacroExpander::expand_cfg_attrs): Function moved...
7978 * expand/rust-attribute-visitor.cc (fails_cfg): ...here.
7979 (fails_cfg_with_expand): ...here.
7980 (expand_cfg_attrs): ...here.
7981 (AttrVisitor::expand_struct_fields): Use new functions.
7982 (AttrVisitor::expand_tuple_fields): Likewise.
7983 (AttrVisitor::expand_function_params): Likewise.
7984 (AttrVisitor::visit): Likewise.
7985 (AttrVisitor::go): New function.
7986 * expand/rust-attribute-visitor.h: Declare AttrVisitor::go.
7987 * expand/rust-macro-expand.h (struct MacroExpander): Remove cfg-attr related
7990 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
7992 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_macro_definition):
7994 * hir/rust-ast-lower-base.h: Declare `lower_macro_definition`.
7995 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Lower public
7997 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
7998 * hir/rust-ast-lower-stmt.h: Add visitor for `AST::MacroRulesDefinition`.
7999 * hir/rust-ast-lower.cc (ASTLowering::go): Formatting.
8000 (ASTLoweringBlock::visit): Visit `AST::MacroRulesDefinition`
8001 (ASTLoweringIfLetBlock::visit): Formatting.
8002 (ASTLoweringExprWithBlock::visit): Formatting.
8004 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8006 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Add new visitor
8007 for AST::MacroRulesDefinition.
8008 * hir/rust-ast-lower-item.h: Declare above mentioned visitor.
8009 * metadata/rust-export-metadata.cc (ExportContext::emit_macro): New function.
8010 * metadata/rust-export-metadata.h: Declare it.
8011 (PublicInterface::gather_export_data): Go through each exported macro.
8012 * util/rust-hir-map.cc (Mappings::insert_exported_macro): New function.
8013 (Mappings::get_exported_macros): New function.
8014 * util/rust-hir-map.h: Add new mappings for exported macros.
8016 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8018 * backend/rust-compile-item.h: Revert 1c946687239b86a92839d57dfbc928ad7ce35eae.
8019 * backend/rust-compile-stmt.h: Likewise.
8020 * checks/errors/privacy/rust-privacy-reporter.cc
8021 (PrivacyReporter::visit): Likewise.
8022 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
8023 * checks/errors/privacy/rust-pub-restricted-visitor.cc
8024 (PubRestrictedVisitor::visit): Likewise.
8025 * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
8026 * checks/errors/privacy/rust-reachability.cc
8027 (ReachabilityVisitor::visit): Likewise.
8028 * checks/errors/privacy/rust-reachability.h: Likewise.
8029 * checks/errors/privacy/rust-visibility-resolver.cc
8030 (VisibilityResolver::visit): Likewise.
8031 * checks/errors/privacy/rust-visibility-resolver.h: Likewise.
8032 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
8033 * checks/errors/rust-const-checker.h: Likewise.
8034 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
8035 * checks/errors/rust-unsafe-checker.h: Likewise.
8036 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
8037 * hir/rust-ast-lower-item.h: Likewise.
8038 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
8039 * hir/rust-hir-dump.h: Likewise.
8040 * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Likewise.
8041 * hir/tree/rust-hir-item.h (class ExportedMacro): Likewise.
8042 * hir/tree/rust-hir-visitor.h: Likewise.
8043 * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): Likewise.
8044 (ExportedMacro::get_locus): Likewise.
8045 (ExportedMacro::get_item_kind): Likewise.
8046 (ExportedMacro::clone_item_impl): Likewise.
8047 * hir/tree/rust-hir.h: Likewise.
8048 * metadata/rust-export-metadata.cc: Likewise.
8049 * typecheck/rust-hir-type-check-item.h: Likewise.
8050 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
8051 * typecheck/rust-hir-type-check-stmt.h: Likewise.
8052 * typecheck/rust-tycheck-dump.h: Likewise.
8053 * util/rust-attributes.cc: Likewise.
8055 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8057 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): return a TraitObject
8059 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8061 * typecheck/rust-hir-trait-resolve.cc: don't inject extra inference variables
8063 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8065 * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous semicolon when
8066 dumping macro rules.
8068 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8070 * metadata/rust-imports.cc (add_search_path): Change `Go` -> `Rust`.
8071 (Import::try_package_in_directory): Likewise.
8072 (Import::find_export_data): Likewise.
8074 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8076 * hir/rust-ast-lower-pattern.cc
8077 (ASTLoweringPattern::visit): Lower AltPattern.
8078 * hir/rust-ast-lower-pattern.h:
8079 (ASTLoweringPattern::visit): Add AltPattern visitor.
8081 2024-01-16 Xiao Ma <turingki@yeah.net>
8082 Thomas Schwinge <thomas@codesourcery.com>
8084 * checks/errors/rust-feature-gate.cc: Adjust 'ld'->'u'.
8085 * checks/errors/rust-feature.h: Adjust
8086 the type of `m_issue`: 'uint64_t' -> 'unsigned'.
8088 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8090 * ast/rust-ast.h: add const get_final_segment helper
8091 * hir/rust-ast-lower-enumitem.h: dont add an item mapping for enumitems
8092 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): add enum to enum-items mappings
8093 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): likewise
8094 * hir/tree/rust-hir-item.h: add non const helper to get variants
8095 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): resolve the use declaration
8096 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): handle self
8097 * resolve/rust-ast-resolve-toplevel.h: add enum item mappings to module mappings
8098 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): ensure variant
8099 (TypeCheckExpr::resolve_segments): likewise
8100 * typecheck/rust-type-util.cc (query_type): lookup enum's
8101 * util/rust-hir-map.cc (Mappings::insert_hir_enumitem): enum item mappings
8102 (Mappings::lookup_hir_enumitem): likewise
8103 * util/rust-hir-map.h: likewise
8105 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8107 * resolve/rust-ast-resolve-path.cc (ResolvePath::ResolvePath): return NodeId
8108 (ResolvePath::go): update signiture
8109 (ResolvePath::resolve_path): return resolved_node_id
8110 * resolve/rust-ast-resolve-path.h: update prototypes
8112 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8114 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit):
8115 Add lowering for SlicePattern.
8116 * hir/rust-ast-lower-pattern.h: Likewise.
8117 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit):
8118 Add name resolution visit for SlicePattern.
8119 * resolve/rust-ast-resolve-pattern.h: Likewise.
8121 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8123 * hir/rust-ast-lower-implitem.h (RUST_AST_LOWER_IMPLITEM_H): cleanup header usage
8124 * hir/rust-ast-lower-item.cc: likewise
8125 * hir/rust-ast-lower-item.h (RUST_AST_LOWER_ITEM): likewise
8126 * hir/rust-ast-lower-stmt.cc: likewise
8127 * hir/rust-ast-lower-stmt.h (RUST_AST_LOWER_STMT): likewise
8128 * hir/rust-ast-lower-type.h: likewise
8129 * hir/rust-ast-lower.cc: likewise
8130 * hir/rust-ast-lower.h: likewise
8131 * resolve/rust-ast-resolve-expr.h: likewise
8132 * resolve/rust-ast-resolve-item.cc: likewise
8133 * resolve/rust-ast-resolve-item.h: likewise
8134 * resolve/rust-ast-resolve-stmt.cc: likewise
8135 * resolve/rust-ast-resolve-stmt.h: likewise
8136 * resolve/rust-ast-resolve-struct-expr-field.h: likewise
8137 * resolve/rust-ast-resolve-toplevel.h: likewise
8138 * resolve/rust-ast-resolve-type.h: likewise
8139 * resolve/rust-ast-resolve.h: likewise
8141 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8143 * resolve/rust-ast-resolve-pattern.h (class ResolvePattern): Removed.
8145 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8147 * backend/rust-compile-intrinsic.cc (move_val_init_handler): new intrinsice
8148 (uninit_handler): use a builtin memcpy
8150 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8152 * typecheck/rust-coercion.cc (TypeCoercionRules::select): use the result
8154 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8156 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): fix ctor
8157 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): likewise
8158 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
8159 * typecheck/rust-typecheck-context.cc (TypeCheckContext::push_new_loop_context): likewise
8160 * typecheck/rust-tyty-util.cc (TyVar::get_implicit_infer_var): likewise
8161 * typecheck/rust-tyty.cc (InferType::InferType): new ctor with type hint
8162 (InferType::clone): fix ctor
8163 (InferType::apply_primitive_type_hint): new function to apply possible hint
8164 * typecheck/rust-tyty.h: update prototypes
8165 * typecheck/rust-unify.cc (UnifyRules::expect_inference_variable): apply type hints
8166 (UnifyRules::expect_bool): likewise
8167 (UnifyRules::expect_char): likewise
8168 (UnifyRules::expect_int): likewise
8169 (UnifyRules::expect_uint): likewise
8170 (UnifyRules::expect_float): likewise
8171 (UnifyRules::expect_isize): likewise
8172 (UnifyRules::expect_usize): likewise
8174 2024-01-16 Jiakun Fan <120090316@link.cuhk.edu.cn>
8176 * hir/rust-hir-dump.cc (Dump::go): fix format
8177 (Dump::visit): impl `visit (AST::Attribute &)`, dump inner attrs and
8178 `visit (Lifetime &)`
8179 * hir/rust-hir-dump.h:add `visit (AST::Attribute &)`
8181 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8183 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
8184 Print out consistency errors.
8185 (PatternDeclaration::visit): Implement visit for AltPattern.
8186 (PatternDeclaration::add_new_binding): New helper function for
8187 adding a binding to identifier.
8188 * resolve/rust-ast-resolve-pattern.h (struct BindingInfo):
8189 New struct to facilitate checking for inconsistencies between bindings.
8191 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8193 * backend/rust-compile-block.h
8194 (CompileConditionalBlocks::visit): Remove IfLetExprConseqIf{,Let} visitors.
8195 (CompileExprWithBlock::visit): Remove IfLetExprConseqIf{,Let} visitors.
8196 * backend/rust-compile-expr.h
8197 (CompileExpr::visit): Remove IfLetExprConseqIf{,Let} visitors.
8198 * checks/errors/rust-unsafe-checker.cc
8199 (UnsafeChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
8200 * checks/errors/rust-unsafe-checker.h
8201 (UnsafeChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
8202 * checks/errors/rust-const-checker.cc
8203 (ConstChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
8204 * checks/errors/rust-const-checker.h
8205 (ConstChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
8206 * checks/errors/privacy/rust-privacy-reporter.cc
8207 (PrivacyReporter::visit): Remove IfLetExprConseqIf{,Let} visitors.
8208 * checks/errors/privacy/rust-privacy-reporter.h
8209 (PrivacyReporter::visit): Remove IfLetExprConseqIf{,Let} visitors.
8210 * hir/tree/rust-hir-expr.h
8211 (class IfLetExprConseqElse): Make else_block ExprWithBlock.
8212 (class IfLetExprConseqIf): Remove.
8213 (class IfLetExprConseqIfLet): Remove.
8214 * hir/tree/rust-hir-full-decls.h
8215 (class IfLetExprConseqIf): Remove.
8216 (class IfLetExprConseqIfLet): Remove.
8217 * hir/tree/rust-hir.cc
8218 (IfLetExprConseqElse::as_string): Adjust output.
8219 (IfLetExprConseqIf::as_string): Remove.
8220 (IfLetExprConseqIfLet::as_string): Remove.
8221 (IfLetExprConseqIf::accept_vis): Remove.
8222 (IfLetExprConseqIfLet::accept_vis): Remove.
8223 * hir/tree/rust-hir-visitor.h
8224 (HIRFullVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
8225 (HIRFullVisitorBase::visit): Remove IfLetExprConseqIf{,Let} visitors.
8226 (HIRExpressionVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
8227 * hir/rust-hir-dump.cc
8228 (Dump::visit): Remove IfLetExprConseqIf{,Let} visitors.
8229 * hir/rust-hir-dump.h
8230 (Dump::visit): Remove IfLetExprConseqIf{,Let} visitors.
8231 * typecheck/rust-hir-type-check-expr.h
8232 (TypeCheckExpr::visit): Remove IfLetExprConseqIf{,Let} visitors.
8234 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8236 * typecheck/rust-hir-type-check-expr.cc
8237 (TypeCheckExpr::visit): Remove IfExprConseqIf visitor.
8238 * typecheck/rust-hir-type-check-expr.h
8239 (TypeCheckExpr::visit): Remove IfExprConseqIf{,Let} visitor.
8240 * backend/rust-compile-block.cc
8241 (CompileConditionalBlocks::visit): Remove IfExprConseqIf visitor.
8242 * backend/rust-compile-block.h
8243 (CompileConditionalBlocks::visit): Remove IfExprConseqIf{,Let} visitors.
8244 (CompileExprWithBlock::visit):
8245 Remove IfExprConseqIf{,Let} visitors, implement BlockExpr visitor.
8246 * backend/rust-compile-expr.cc
8247 (CompileExpr::visit): Remove IfExprConseqIf visitor.
8248 * backend/rust-compile-expr.h
8249 (CompileExpr::visit): Remove IfExprConseqIf{,Let} visitors.
8250 * checks/lints/rust-lint-marklive.h
8251 (MarkLive::visit): Remove IfExprConseqIf visitor.
8252 * checks/errors/rust-const-checker.cc
8253 (ConstChecker::visit): Remove IfExprConseqIf{,Let} visitors.
8254 * checks/errors/rust-const-checker.h
8255 (ConstChecker::visit): Remove IfExprConseqIf{,Let} visitors.
8256 * checks/errors/rust-unsafe-checker.cc
8257 (UnsafeChecker::visit): Remove IfExprConseqIf{,Let} visitors.
8258 * checks/errors/rust-unsafe-checker.h
8259 (UnsafeChecker::visit): Remove IfExprConseqIf{,Let} visitors.
8260 * checks/errors/privacy/rust-privacy-reporter.cc
8261 (PrivacyReporter::visit): Remove IfExprConseqIf{,Let} visitors.
8262 * checks/errors/privacy/rust-privacy-reporter.h
8263 (PrivacyReporter::visit): Remove IfExprConseqIf{,Let} visitors.
8264 * hir/tree/rust-hir-expr.h
8265 (class IfExprConseqElse): Make else_block ExprWithBlock.
8266 (class IfExprConseqIf): Remove.
8267 (class IfExprConseqIfLet): Remove.
8268 * hir/tree/rust-hir-full-decls.h
8269 (class IfExprConseqIf): Remove.
8270 (class IfExprConseqIfLet): Remove.
8271 * hir/tree/rust-hir.cc
8272 (IfExprConseqElse::as_string): Adjust output.
8273 (IfExprConseqIf::as_string): Remove.
8274 (IfExprConseqIfLet::as_string): Remove.
8275 (IfExprConseqIf::accept_vis): Remove.
8276 (IfExprConseqIfLet::accept_vis): Remove.
8277 * hir/tree/rust-hir-visitor.h
8278 (HIRFullVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
8279 (HIRFullVisitorBase::visit): Remove IfExprConseqIf{,Let} visitors.
8280 (HIRExpressionVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
8281 * hir/rust-hir-dump.cc
8282 (Dump::visit): Remove IfExprConseqIf{,Let} visitors.
8283 * hir/rust-hir-dump.h
8284 (Dump::visit): Remove IfExprConseqIf{,Let} visitors.
8285 * hir/rust-ast-lower.cc
8286 (ASTLoweringIfBlock::visit): Replace HIR::IfExprConseqIf with HIR::IfExprConseqElse.
8288 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8290 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
8291 Push a Product context instead of an Or context.
8293 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8295 * typecheck/rust-hir-inherent-impl-overlap.h (class ImplItemToName): remove
8297 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8299 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): remove unused code
8301 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8303 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): remove infer call
8304 (TypeCheckExpr::resolve_root_path): only infer when we need to
8306 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8308 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): add debug
8310 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8312 * backend/rust-compile.cc: use unify_and instead
8313 * typecheck/rust-tyty-subst.cc (SubstitutionRef::solve_missing_mappings_from_this): remove
8314 * typecheck/rust-tyty-subst.h: update header
8316 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8318 * typecheck/rust-coercion.cc (TypeCoercionRules::select): use new unify_and interface
8319 * typecheck/rust-hir-dot-operator.cc (MethodResolver::try_hook): grab bounds behind refs
8321 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8323 * backend/rust-compile-base.cc: fix headers
8324 * backend/rust-compile-base.h: likewise
8325 * backend/rust-compile-expr.cc: likewise
8326 * backend/rust-compile-extern.h: likewise
8327 * backend/rust-compile-pattern.cc: likewise
8328 * backend/rust-compile.cc: likewise
8329 * typecheck/rust-autoderef.cc: likewise
8330 * typecheck/rust-hir-dot-operator.cc: likewise
8331 * typecheck/rust-hir-inherent-impl-overlap.h: likewise
8332 * typecheck/rust-hir-path-probe.cc: likewise
8333 * typecheck/rust-hir-trait-resolve.cc: likewise
8334 * typecheck/rust-hir-type-check-base.cc: likewise
8335 * typecheck/rust-hir-type-check-base.h (RUST_HIR_TYPE_CHECK_BASE): likewise
8336 * typecheck/rust-hir-type-check-enumitem.cc: likewise
8337 * typecheck/rust-hir-type-check-expr.cc: likewise
8338 * typecheck/rust-hir-type-check-implitem.cc: likewise
8339 * typecheck/rust-hir-type-check-item.cc: likewise
8340 * typecheck/rust-hir-type-check-path.cc: likewise
8341 * typecheck/rust-hir-type-check-pattern.cc: likewise
8342 * typecheck/rust-hir-type-check-stmt.cc: likewise
8343 * typecheck/rust-hir-type-check-struct.cc: likewise
8344 * typecheck/rust-hir-type-check-type.cc: likewise
8345 * typecheck/rust-hir-type-check-type.h: likewise
8346 * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): likewise
8347 * typecheck/rust-tyty-bounds.cc: likewise
8348 * typecheck/rust-tyty-call.cc: likewise
8349 * typecheck/rust-tyty-subst.cc: likewise
8350 * typecheck/rust-tyty.cc: likewise
8352 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8354 * typecheck/rust-tyty.cc (BaseType::has_subsititions_defined): new implementation
8355 (BaseType::needs_generic_substitutions): likewise
8356 (ProjectionType::needs_generic_substitutions): remove
8357 (ProjectionType::has_subsititions_defined): remove
8358 * typecheck/rust-tyty.h: update header
8360 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8362 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): update to use new interface
8363 (TypeCheckExpr::resolve_root_path): likewise
8364 (TypeCheckExpr::resolve_segments): likewise
8365 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
8366 (TypeCheckType::resolve_root_path): likewise
8367 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): likewise
8368 * typecheck/rust-tyty.cc (BaseType::supports_substitutions): likewise
8369 (BaseType::can_substitute): remove
8370 (BaseType::contains_type_parameters): remove
8371 (handle_substitions): cleanup
8372 (TupleType::handle_substitions): update
8373 (FnType::handle_substitions): update
8374 (ProjectionType::supports_substitutions): update
8375 * typecheck/rust-tyty.h: update header
8377 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8379 * typecheck/rust-tyty.h: cleanup ordering of header
8381 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8383 * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): new impl
8384 (InferType::monomorphized_clone): remove
8385 (ErrorType::monomorphized_clone): likewise
8386 (ADTType::monomorphized_clone): likewise
8387 (TupleType::monomorphized_clone): likewise
8388 (FnType::monomorphized_clone): likewise
8389 (FnPtr::monomorphized_clone): likewise
8390 (ClosureType::monomorphized_clone): likewise
8391 (ArrayType::clone): likewise
8392 (ArrayType::get_var_element_type): likewise
8393 (ArrayType::monomorphized_clone): likewise
8394 (SliceType::clone): likewise
8395 (SliceType::get_var_element_type): likewise
8396 (SliceType::monomorphized_clone): likewise
8397 (BoolType::monomorphized_clone): likewise
8398 (IntType::monomorphized_clone): likewise
8399 (UintType::monomorphized_clone): likewise
8400 (FloatType::monomorphized_clone): likewise
8401 (USizeType::monomorphized_clone): likewise
8402 (ISizeType::monomorphized_clone): likewise
8403 (CharType::monomorphized_clone): likewise
8404 (ReferenceType::clone): likewise
8405 (ReferenceType::get_var_element_type): likewise
8406 (ReferenceType::monomorphized_clone): likewise
8407 (PointerType::clone): likewise
8408 (PointerType::get_var_element_type): likewise
8409 (PointerType::monomorphized_clone): likewise
8410 (ParamType::monomorphized_clone): likewise
8411 (StrType::monomorphized_clone): likewise
8412 (NeverType::monomorphized_clone): likewise
8413 (PlaceholderType::monomorphized_clone): likewise
8414 (ProjectionType::monomorphized_clone): likewise
8415 (DynamicObjectType::monomorphized_clone): likewise
8416 * typecheck/rust-tyty.h: update header
8418 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8420 * typecheck/rust-tyty.cc (BaseType::is_unit): new implementation
8421 (ErrorType::is_unit): remove
8422 (TupleType::is_unit): likewise
8423 (NeverType::is_unit): likewise
8424 (PlaceholderType::is_unit): likewise
8425 (ProjectionType::is_unit): likewise
8426 * typecheck/rust-tyty.h: update header
8428 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8430 * typecheck/rust-tyty.cc (BaseType::is_concrete): new implementation
8431 (InferType::is_concrete): remove
8432 (ErrorType::is_concrete): likewise
8433 (StructFieldType::is_concrete): likewise
8434 (ADTType::is_concrete): likewise
8435 (TupleType::is_concrete): likewise
8436 (BoolType::is_concrete): likewise
8437 (IntType::is_concrete): likewise
8438 (UintType::is_concrete): likewise
8439 (FloatType::is_concrete): likewise
8440 (USizeType::is_concrete): likewise
8441 (ISizeType::is_concrete): likewise
8442 (CharType::is_concrete): likewise
8443 (ReferenceType::is_concrete): likewise
8444 (PointerType::is_concrete): likewise
8445 (ParamType::is_concrete): likewise
8446 (StrType::is_concrete): likewise
8447 (NeverType::is_concrete): likewise
8448 (PlaceholderType::is_concrete): likewise
8449 (ProjectionType::is_concrete): likewise
8450 (DynamicObjectType::is_concrete): likewise
8451 * typecheck/rust-tyty.h: update header
8453 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8455 * backend/rust-compile-type.cc (TyTyResolveCompile::TyTyResolveCompile): call destructure
8456 (TyTyResolveCompile::compile): use error_mark_node
8457 (TyTyResolveCompile::visit): use error_mark_node
8458 * backend/rust-compile-type.h: remove recursive ops
8460 2024-01-16 Tage Johansson <frans.tage@gmail.com>
8462 * parse/rust-parse.cc: fix follow-sets
8464 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8466 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit) :declare and
8467 pass bindings to PatternDeclaration::go.
8468 (ResolveExpr::resolve_closure_param): Likewise.
8469 * resolve/rust-ast-resolve-expr.h: Likewise.
8470 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
8471 (ResolveItem::visit): Likewise.
8472 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): Likewise.
8473 (PatternDeclaration::visit): check for previous identifier bindings
8474 before inserting the new one.
8475 * resolve/rust-ast-resolve-pattern.h (enum PatternBoundCtx): New enum.
8476 * resolve/rust-ast-resolve-stmt.h: pass bindings to PatterDeclaration::go.
8478 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8480 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
8481 handle closure parameters pattern bindings using CompilePatternBindings visitor
8483 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8485 * README.md (process): Rename `rust1` to `crab1` in examples.
8486 * Make-lang.in: Rename `rust1` to `crab1`.
8487 * config-lang.in: Likewise.
8488 * lang-specs.h: Likewise.
8489 * rustspec.cc (lang_specific_driver): Likewise.
8491 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8493 * hir/tree/rust-hir-pattern.h
8494 (SlicePattern::get_items): Add.
8496 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8498 * hir/tree/rust-hir-full-decls.h
8499 (struct GenericArgsBinding): Convert to class.
8500 (class GenericArgsBinding): Convert from struct.
8501 (struct TypePathFunction): See above.
8502 (class TypePathFunction): See above.
8503 (struct QualifiedPathType): See above.
8504 (class QualifiedPathType): See above.
8505 * ast/rust-ast-full-decls.h
8506 (struct WhereClause): See above.
8507 (class WhereClause): See above.
8508 (struct SelfParam): See above.
8509 (class SelfParam): See above.
8510 (struct FunctionQualifiers): See above.
8511 (class FunctionQualifiers): See above.
8512 (struct FunctionParam): See above.
8513 (class FunctionParam): See above.
8514 (struct StructField): See above.
8515 (class StructField): See above.
8516 (struct TupleField): See above.
8517 (class TupleField): See above.
8518 (struct TraitFunctionDecl): See above.
8519 (class TraitFunctionDecl): See above.
8520 (struct TraitMethodDecl): See above.
8521 (class TraitMethodDecl): See above.
8522 (struct NamedFunctionParam): See above.
8523 (class NamedFunctionParam): See above.
8524 * hir/tree/rust-hir-path.h
8525 (struct GenericArgsBinding): See above.
8526 (class GenericArgsBinding): See above.
8527 (struct TypePathFunction): See above.
8528 (class TypePathFunction): See above.
8529 (struct QualifiedPathType): See above.
8530 (class QualifiedPathType): See above.
8532 (struct WhereClause): See above.
8533 (class WhereClause): See above.
8534 (struct SelfParam): See above.
8535 (class SelfParam): See above.
8536 (struct FunctionQualifiers): See above.
8537 (class FunctionQualifiers): See above.
8538 (struct FunctionParam): See above.
8539 (class FunctionParam): See above.
8540 (struct StructField): See above.
8541 (class StructField): See above.
8542 (struct TupleField): See above.
8543 (class TupleField): See above.
8544 (struct TraitFunctionDecl): See above.
8545 (class TraitFunctionDecl): See above.
8546 (struct TraitMethodDecl): See above.
8547 (class TraitMethodDecl): See above.
8548 (struct NamedFunctionParam): See above.
8549 (class NamedFunctionParam): See above.
8551 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8553 * hir/tree/rust-hir-pattern.h
8554 (class AltPattern): Remove duplicate access specifier.
8555 (AltPattern::get_alts): Add.
8556 * hir/tree/rust-hir.cc
8557 (AltPattern::as_string): Add.
8558 (AltPattern::accept_vis): Add.
8560 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8562 * hir/tree/rust-hir-item.h (class ExportedMacro): Add new ExportedMacro class.
8563 * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): New function.
8564 (ExportedMacro::get_locus): Likewise.
8565 (ExportedMacro::get_item_kind): Likewise.
8566 (ExportedMacro::clone_item_impl): Likewise.
8567 * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Forward declare class.
8568 * backend/rust-compile-item.h: Add visitor for ExportedMacro.
8569 * backend/rust-compile-stmt.h: Likewise.
8570 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
8571 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
8572 * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::visit):
8574 * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
8575 * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
8576 * checks/errors/privacy/rust-reachability.h: Likewise.
8577 * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
8578 * checks/errors/privacy/rust-visibility-resolver.h: Likewise.
8579 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
8580 * checks/errors/rust-const-checker.h: Likewise.
8581 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
8582 * checks/errors/rust-unsafe-checker.h: Likewise.
8583 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
8584 * hir/rust-ast-lower-item.h: Likewise.
8585 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
8586 * hir/rust-hir-dump.h: Likewise.
8587 * hir/tree/rust-hir-visitor.h: Likewise.
8588 * metadata/rust-export-metadata.cc: Likewise.
8589 * typecheck/rust-hir-type-check-item.h: Likewise.
8590 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
8591 * typecheck/rust-hir-type-check-stmt.h: Likewise.
8592 * typecheck/rust-tycheck-dump.h: Likewise.
8593 * hir/tree/rust-hir.h: Add new ItemKind::MacroExport variant.
8594 * util/rust-attributes.cc: Add #[macro_export] attribute.
8596 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8598 * backend/rust-compile-fnparam.cc (CompileFnParam::visit):
8599 Added visit implementation for ReferencePattern.
8600 (CompileFnParam::create_tmp_param_var):
8601 Refactored duplicated code into a helper function.
8602 * backend/rust-compile-fnparam.h: Added visit implementation for
8604 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit):
8605 Added visit implementation for ReferencePattern and
8607 * backend/rust-compile-pattern.h: Added visit implementation for
8608 ReferencePattern and IdentifierPattern.
8610 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8612 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Move
8613 unloaded module item loading to...
8614 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): ...here.
8616 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
8618 * hir/rust-hir-dump.cc (Dump::visit): Simplify indentation dump to single line.
8620 2024-01-16 Jakub Dupak <dev@jakubdupak.com>
8622 * ast/rust-ast-dump.cc (Indent::Indent): Move to separate file.
8623 (operator<<): Move to separate file.
8624 (Indent::increment): Move to separate file.
8625 (Indent::decrement): Move to separate file.
8626 * ast/rust-ast-dump.h (class Indent): Move to separate file.
8627 * hir/rust-hir-dump.cc (Dump::Dump): Use new indentation object.
8628 (Dump::go): Use new indentation object.
8629 (Dump::visit): Use new indention object.
8630 * hir/rust-hir-dump.h: Use new indentation object.
8631 * util/rust-dump.h: New file. Moved Indentation from rust-ast-dump.cc
8633 2024-01-16 Mahmoud Mohamed <mahadelr19@gmail.com>
8635 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
8636 Add the missing infered type assignment
8638 2024-01-16 Marc Poulhiès <dkm@kataplop.net>
8641 * ast/rust-ast-full-decls.h (StructPatternElements): Declare as a
8643 * ast/rust-item.h (EnumItem): Mark several method as being
8645 * ast/rust-pattern.h (StructPattern::get_locus): Add override.
8646 * lex/rust-lex.h (BufferInputSource): Use reference_wrapper
8647 instead of bare reference.
8648 (TokenSource::get): Add method to implement the reference_wrapper
8650 * typecheck/rust-tyty.h (TypeBoundPredicate): Add empty dtor.
8651 * util/rust-buffered-queue.h (peek): Source token stream is now
8652 using a reference_wrapper, use .get()
8654 2024-01-16 vincent <jfan30@u.rochester.edu>
8656 * typecheck/rust-hir-type-check-pattern.cc
8657 (TypeCheckPattern::visit): rewrite part code to helper function
8658 (TypeCheckPattern::typecheck_range_pattern_bound): helper function
8659 * typecheck/rust-hir-type-check-pattern.h
8660 (TypeCheckPattern::typecheck_range_pattern_bound):
8661 change the parameter of the function
8663 2024-01-16 goar5670 <mahadelr19@gmail.com>
8665 * hir/tree/rust-hir-pattern.h (HIR::ReferencePattern):
8666 added get_referenced_pattern function.
8667 * resolve/rust-ast-resolve-pattern.h
8668 (Resolve::PatternDeclaration): add visit function for
8669 AST::ReferencePattern
8670 * typecheck/rust-hir-type-check-pattern.cc
8671 (Resolver::TypeCheckPattern): add visit function for
8672 HIR::ReferencePattern
8674 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8676 * util/rust-lang-item.h
8677 (RustLangItem::ItemType): New enumerators.
8678 (RustLangItem::Parse): Parse new enumerators.
8679 (RustLangItem::ToString): Handle new enumerators.
8681 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8683 * backend/rust-compile-fnparam.h:
8684 (CompileFnParam::visit): Add AltPattern visitor.
8685 * backend/rust-compile-pattern.h:
8686 (CompilePatternCaseLabelExpr::visit): Add AltPattern visitor.
8687 (CompilePatternBindings::visit): Add AltPattern visitor.
8688 (CompilePatternLet::visit): Add AltPattern visitor.
8689 * backend/rust-compile-resolve-path.h:
8690 (ResolvePathRef::visit): Add AltPattern visitor.
8691 * backend/rust-compile-var-decl.h:
8692 (CompileVarDecl::visit): Add AltPattern visitor.
8693 * checks/errors/rust-const-checker.cc
8694 (ConstChecker::visit): Add AltPattern visitor.
8695 * checks/errors/rust-const-checker.h:
8696 (ConstChecker::visit): Add AltPattern visitor.
8697 * checks/errors/rust-unsafe-checker.cc
8698 (UnsafeChecker::visit): Add AltPattern visitor.
8699 * checks/errors/rust-unsafe-checker.h:
8700 (UnsafeChecker::visit): Add AltPattern visitor.
8701 * hir/rust-hir-dump.cc
8702 (Dump::visit): Add AltPattern visitor.
8703 * hir/rust-hir-dump.h:
8704 (Dump::visit): Add AltPattern visitor.
8705 * hir/tree/rust-hir-full-decls.h
8706 (class AltPattern): Add forward declaration.
8707 * hir/tree/rust-hir-pattern.h
8708 (class AltPattern): New class.
8709 * hir/tree/rust-hir-visitor.h:
8710 (HIRFullVisitor::visit): Add AltPattern visitor.
8711 (HIRFullVisitorBase::visit): Add AltPattern visitor.
8712 (HIRPatternVisitor::visit): Add AltPattern visitor.
8713 * hir/tree/rust-hir.h:
8714 (Pattern::PatternType::ALT): New enumerator.
8715 * typecheck/rust-hir-type-check-pattern.cc
8716 (TypeCheckPattern::visit): Add AltPattern visitor.
8717 * typecheck/rust-hir-type-check-pattern.h:
8718 (TypeCheckPattern::visit): Add AltPattern visitor.
8720 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8722 * ast/rust-macro.cc (builtin_macro_from_string): Add identifier
8724 * ast/rust-macro.h (enum class): Add Stringify builtin macro
8726 * expand/rust-macro-builtins.cc (make_macro_path_str): Add path
8727 for builtin stringify macro.
8728 (MacroBuiltin::stringify_handler): Add handler for builtin
8730 * expand/rust-macro-builtins.h: Add stringify handler's
8732 * util/rust-hir-map.cc (Mappings::insert_macro_def): Add
8733 stringify handler to builtin hir map.
8735 2024-01-16 Nikos Alexandris <nikos-alexandris@protonmail.com>
8737 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
8738 Add length checking for tuple patterns.
8739 (TypeCheckPattern::emit_pattern_size_error): New function.
8740 * typecheck/rust-hir-type-check-pattern.h: New function
8741 emit_pattern_size_error.
8743 2024-01-16 goar5670 <mahadelr19@gmail.com>
8745 * parse/rust-parse-impl.h (Parser::parse_expr):
8746 split LEFT_SHIFT before null_denotation.
8748 2024-01-16 Parthib <parthibdutta02@gmail.com>
8750 * rust-object-export.cc: Modified
8751 * hir/rust-ast-lower-type.cc (rust_fatal_error): Removed
8752 (rust_assert): Added
8754 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8756 * resolve/rust-early-name-resolver.cc
8757 (EarlyNameResolver::visit):
8758 Check for closure parameter without given type.
8760 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8762 * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_resolved_predicate): remove
8764 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8766 * resolve/rust-ast-resolve-type.cc (ResolveRelativeQualTypePath::resolve_qual_seg): fix
8768 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8770 * ast/rust-path.h: add missing copy for node_id
8772 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8774 * rust-gcc.h: remove unused headers
8776 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8778 * ast/rust-ast.cc (QualifiedPathInType::as_string): add missing to string
8779 * ast/rust-path.h: add missing copy+move constructors and assignment overloads
8780 * hir/tree/rust-hir-path.h: likewise
8781 * hir/tree/rust-hir.cc (QualifiedPathInType::as_string): add missing to string
8783 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8785 * typecheck/rust-tyty.cc (ParamType::get_name): call destructure
8787 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8789 * typecheck/rust-hir-trait-resolve.cc: use unify_and infer
8791 2024-01-16 goar5670 <mahadelr19@gmail.com>
8793 * parse/rust-parse-impl.h (Parser::parse_closure_param):
8794 Replace parse_pattern with parse_pattern_no_alt.
8796 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8798 * parse/rust-parse-impl.h (Parser::parse_while_let_loop_expr):
8799 Prevent hard error on token skip.
8800 (Parser::null_denotation): Fix parser for while let expressions.
8802 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8804 * backend/rust-builtins.cc (BuiltinsContext::setup): add memset builtin to the map
8805 * backend/rust-compile-intrinsic.cc (uninit_handler): implement uninit intrinsic
8807 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8809 * parse/rust-parse-impl.h (Parser::parse_slice_pattern): Add
8810 closing square bracket check.
8812 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8814 * parse/rust-parse-impl.h (Parser::parse_external_type_item):
8815 Fix compilation error due to unnecessary move.
8817 2024-01-16 Abdul Rafey <abdulrafeyq@gmail.com>
8819 * hir/rust-hir-dump.cc (Dump::go): support inner attrs, crate items and node mappings
8820 (Dump::visit): support functions, arith/logical exprs, let stmts and literals
8822 2024-01-16 Nikos Alexandris <nikos-alexandris@protonmail.com>
8824 * expand/rust-macro-builtins.cc (load_file_bytes): Add location parameter.
8825 (MacroBuiltin::include_bytes_handler): Pass location to load_file_bytes.
8826 (MacroBuiltin::include_str_handler): Pass location to load_file_bytes.
8828 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8830 * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Handle
8831 RestPattern correctly.
8833 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8835 * ast/rust-pattern.h (class RestPattern): Add NodeId as well as
8836 the clone_impl function.
8838 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8840 * parse/rust-parse-impl.h (Parser::null_denotation): Fix if let
8843 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8845 * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): wraps op_with_overflow
8846 (std::function<tree): likewise
8847 (op_with_overflow): generate the intrinsic based on the tree_code op
8849 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
8851 * Make-lang.in: Add rust-ast-lower-stmt.o
8852 * hir/rust-ast-lower-stmt.h: Move definitions to...
8853 * hir/rust-ast-lower-stmt.cc: ...here.
8855 2024-01-16 mxlol233 <mxlol233@outlook.com>
8857 * checks/errors/rust-feature-gate.cc: Add definition
8859 * checks/errors/rust-feature-gate.h: Likewise.
8860 * checks/errors/rust-feature.cc: Likewise.
8861 * checks/errors/rust-feature.h: Likewise.
8863 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8865 * ast/rust-pattern.h
8866 (StructPatternElements::operator=): Clear vector before inserting.
8867 (TupleStructItemsNoRange::operator=): Clear vector before inserting.
8868 (TupleStructItemsRange::operator=): Clear vectors before inserting.
8869 (TuplePatternItemsMultiple::operator=): Clear vector before inserting.
8870 (TuplePatternItemsRanged::operator=): Clear vectors before inserting.
8871 (SlicePattern::operator=): Clear vector before inserting.
8872 (AltPattern::operator=): Clear vector before inserting.
8873 * hir/tree/rust-hir-pattern.h
8874 (StructPatternElements::operator=): Clear vector before inserting.
8875 (TupleStructItemsNoRange::operator=): Clear vector before inserting.
8876 (TupleStructItemsRange::operator=): Clear vectors before inserting.
8877 (TuplePatternItemsMultiple::operator=): Clear vector before inserting.
8878 (TuplePatternItemsRanged::operator=): Clear vectors before inserting.
8879 (SlicePattern::operator=): Clear vector before inserting.
8881 2024-01-16 bl7awy <mahadelr19@gmail.com>
8883 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): Perform destructure on `from` type.
8885 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8887 * ast/rust-pattern.h
8888 (struct StructPatternElements): Change to class.
8889 (class StructPatternElements): Change from struct.
8890 * hir/tree/rust-hir-pattern.h
8891 (struct StructPatternElements): Change to class.
8892 (class StructPatternElements): Change from struct.
8894 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8896 * typecheck/rust-hir-type-check-pattern.cc
8897 (TypeCheckPattern::visit): Improve error messages.
8899 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
8901 * hir/tree/rust-hir-pattern.h
8902 (class TupleStructItemsNoRange): Fix formatting.
8903 (class TupleStructItemsRange): Fix formatting.
8904 (class TuplePatternItemsMultiple): Fix formatting.
8905 (class TuplePatternItemsRanged): Fix formatting.
8906 (class SlicePattern): Fix formatting.
8908 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
8910 * ast/rust-ast-dump.cc (Dump::visit): Add visitor.
8911 * ast/rust-ast-dump.h: Add visitor prototype.
8912 * ast/rust-ast-full-decls.h (class RestPattern): Add forward
8913 declaration for class RestPattern.
8914 * ast/rust-ast-visitor.h: Add visitor prototype.
8915 * ast/rust-ast.cc (RestPattern::accept_vis): Add function to
8916 accept a foreign visitor.
8917 * ast/rust-pattern.h (class RestPattern): Add class RestPattern.
8918 * checks/errors/rust-feature-gate.h: Add visitor prototype.
8919 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Add
8920 visitor implementation.
8921 * expand/rust-attribute-visitor.h: Add visitor prototype.
8922 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add
8923 visitor implementation.
8924 * hir/rust-ast-lower-base.h: Add visitor prototype.
8925 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add
8926 visitor implementation.
8927 * resolve/rust-ast-resolve-base.h: Add visitor prototype.
8928 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
8929 Add visitor implementation.
8930 * resolve/rust-early-name-resolver.h: Add visitor prototype.
8931 * util/rust-attributes.cc (AttributeChecker::visit): Add visitor
8933 * util/rust-attributes.h: Add visitor prototype.
8935 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8937 * typecheck/rust-tyty-cmp.h: remove
8938 * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): likewise
8939 (reset_cmp_autoderef_mode): likewise
8940 * typecheck/rust-tyty.h (set_cmp_autoderef_mode): likewise
8941 (reset_cmp_autoderef_mode): likewise
8943 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8945 * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): Add new try_flag
8946 (TypeCoercionRules::TypeCoercionRules): set new try flag
8947 (TypeCoercionRules::do_coercion): default to a final unify_and in the else case
8948 (TypeCoercionRules::coerce_unsafe_ptr): cannot coerce to a ptr from ref during autoderef
8949 (TypeCoercionRules::coerce_borrowed_pointer): respect coerceable mutability
8950 * typecheck/rust-coercion.h: update header
8951 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): use new TryCoerce interface
8952 (MethodResolver::append_adjustments): ensure we maintain adjustment mappings
8953 * typecheck/rust-hir-dot-operator.h: add new method append_adjustments
8954 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): extra logging
8956 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8958 * typecheck/rust-unify.cc (UnifyRules::go): fix inference check
8960 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8962 * backend/rust-compile-base.h: unconsify
8963 * backend/rust-compile.cc (HIRCompileBase::coercion_site): likewise
8964 (HIRCompileBase::coercion_site1): likewise
8965 * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): likewise
8966 (Adjuster::try_raw_deref_type): likewise
8967 (Adjuster::try_unsize_type): likewise
8968 (AutoderefCycle::cycle): likewise
8969 (AutoderefCycle::try_autoderefed): likewise
8970 * typecheck/rust-autoderef.h: likewise
8971 * typecheck/rust-coercion.cc (TypeCoercionRules::select): likewise
8972 * typecheck/rust-coercion.h: likewise
8973 * typecheck/rust-hir-dot-operator.cc (MethodResolver::Probe): likewise
8974 (MethodResolver::select): likewise
8975 * typecheck/rust-hir-dot-operator.h: likewise
8977 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8979 * typecheck/rust-unify.cc (UnifyRules::go): respect the emit_errors flag
8981 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8983 * typecheck/rust-casts.cc (TypeCastRules::check): update to new interface
8984 * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): likewise
8985 (TypeCoercionRules::TryCoerce): likewise
8986 (TypeCoercionRules::TypeCoercionRules): likewise
8987 * typecheck/rust-coercion.h: likewise
8988 * typecheck/rust-type-util.cc (coercion_site): likewise
8990 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8992 * typecheck/rust-unify.cc (UnifyRules::go): allow lhs infer vars
8994 2024-01-16 Philip Herron <herron.philip@googlemail.com>
8996 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): update to new inteface
8997 * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_unsafe_ptr): likewise
8998 (TypeCoercionRules::coerce_borrowed_pointer): likewise
8999 * typecheck/rust-hir-type-check.h: likewise
9000 * typecheck/rust-type-util.cc (unify_site_and): new interface to allow for infer and commit
9001 * typecheck/rust-type-util.h (unify_site_and): likewise
9002 * typecheck/rust-typecheck-context.cc (TypeCheckContext::clear_type): new interface
9003 * typecheck/rust-unify.cc (UnifyRules::UnifyRules): update
9004 (UnifyRules::Resolve): new optional flags for commit and infer
9005 (UnifyRules::go): likewise
9006 (UnifyRules::expect_adt): refactor to use new interface
9007 (UnifyRules::expect_reference): likewise
9008 (UnifyRules::expect_pointer): likewise
9009 (UnifyRules::expect_array): likewise
9010 (UnifyRules::expect_slice): likewise
9011 (UnifyRules::expect_fndef): likewise
9012 (UnifyRules::expect_fnptr): likewise
9013 (UnifyRules::expect_tuple): likewise
9014 (UnifyRules::expect_closure): likewise
9015 * typecheck/rust-unify.h: refactor interface
9017 2024-01-16 Philip Herron <herron.philip@googlemail.com>
9019 * typecheck/rust-unify.cc (UnifyRules::Resolve): refactor
9020 (UnifyRules::commit): refactor
9021 * typecheck/rust-unify.h: likewise
9023 2024-01-16 Philip Herron <herron.philip@googlemail.com>
9025 * typecheck/rust-tyty.cc (ADTType::is_concrete): need to consider if is a num_variant
9026 * typecheck/rust-tyty.h: refactor to cc file
9028 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9030 * parse/rust-parse-impl.h (Parser::parse_external_type_item):
9031 Add function to parser an external type item.
9032 (Parser::parse_external_item):
9033 Add identification and parsing for external type items.
9034 * parse/rust-parse.h:
9035 Add parser_external_type_item prototype.
9037 2024-01-16 omkar-mohanty <franzohouser@gmail.com>
9039 * expand/rust-macro-builtins.cc
9040 (MacroBuiltin::include_str_handler): eager expansion
9041 (make_macro_path_str): macto to string
9042 (parse_single_string_literal): check for eager invocation
9043 (MacroBuiltin::assert_handler): eager expansion
9044 (MacroBuiltin::include_bytes_handler): eager expansion
9045 (MacroBuiltin::include_str_handler): eager expansion
9046 (MacroBuiltin::compile_error_handler): eager expansion
9047 (MacroBuiltin::include_handler): eager expansion
9049 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9051 * ast/rust-item.h (class Method): Add `is_default` field.
9052 (class Function): Likewise.
9053 * parse/rust-parse-impl.h (Parser::parse_item): Add nice error when
9054 parsing `default` outside of an `impl` block
9055 (Parser::parse_trait_impl_item): Allow parsing functions
9056 or methods when seeing `default`.
9058 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9060 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::cast_site):
9062 * typecheck/rust-hir-type-check-base.h: Remove cast_site
9064 * typecheck/rust-type-util.cc (cast_site): Add cast_site.
9065 * typecheck/rust-type-util.h (cast_site): Add cast_site
9068 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9070 * ast/rust-item.h: Add non-const `get_visibility` to ExternalTypeItem.
9071 * ast/rust-ast-dump.cc (Dump::visit): Add implementation for ExternalTypeItem.
9072 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Likewise.
9074 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9076 * ast/rust-item.h (class ExternalTypeItem): New class.
9077 * ast/rust-ast.cc (ExternalTypeItem::as_string): New function.
9078 (ExternalTypeItem::accept_vis): Likewise.
9079 * ast/rust-ast-full-decls.h (class ExternalTypeItem): Declare class.
9080 * ast/rust-ast-dump.cc (Dump::visit): Add base visitor for ExternalTypeItem.
9081 * ast/rust-ast-dump.h: Likewise.
9082 * ast/rust-ast-visitor.h: Likewise.
9083 * checks/errors/rust-feature-gate.h: Likewise.
9084 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Likewise.
9085 * expand/rust-attribute-visitor.h: Likewise.
9086 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
9087 * hir/rust-ast-lower-base.h: Likewise.
9088 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
9089 * resolve/rust-ast-resolve-base.h: Likewise.
9090 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
9091 * resolve/rust-early-name-resolver.h: Likewise.
9092 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
9093 * util/rust-attributes.h: Likewise.
9095 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9097 * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::split_current_token):
9098 Add proper implementation.
9100 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9102 * ast/rust-item.h (class Trait): Add `has_auto` field.
9103 * checks/errors/rust-feature.cc: Add handling for `feature(optin_builtin_traits)`
9104 * checks/errors/rust-feature.h: Likewise.
9105 * lex/rust-lex.cc: Fix keyword classification using hashmap.
9106 * lex/rust-token.h: Add `auto` keyword token.
9107 * parse/rust-parse-impl.h (Parser::parse_vis_item): Parse auto traits
9110 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9112 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
9113 Remove TypeCheckBase namespace qualifier.
9114 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::coercion_site):
9115 Remove coercion_site function.
9116 * typecheck/rust-hir-type-check-base.h: Remove coercion_site
9118 * typecheck/rust-type-util.cc (coercion_site): Add coercion_site
9120 * typecheck/rust-type-util.h (coercion_site): Add coercion_site
9122 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
9123 Remove TypeCheckBase namespace qualifier.
9124 (TypeCheckMethodCallExpr::check): Remove TypeCheckBase namespace
9127 2024-01-16 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9129 * typecheck/rust-autoderef.cc: Remove TypeCheckBase qualifier.
9130 * typecheck/rust-hir-trait-resolve.cc: Remove TypeCheckBase
9132 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site):
9134 * typecheck/rust-hir-type-check-base.h: Remove unify_site
9136 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve):
9137 Remove TypeCheckBase qualifier.
9138 * typecheck/rust-type-util.cc (unify_site): Add unify_site
9140 * typecheck/rust-type-util.h (unify_site): Add unify_site
9142 * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::check):
9143 Remove TypeCheckBase qualifier.
9145 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9147 * parse/rust-parse-impl.h (Parser::parse_type): Allow LEFT_SHIFT to
9148 start a type and then split it in `parse_qualified_path_type`
9150 2024-01-16 Arthur Cohen <arthur.cohen@embecosm.com>
9152 * parse/rust-parse-impl.h (Parser::parse_path_generic_args): Split leading
9153 `LEFT_SHIFT` token into two `LEFT_ANGLE` tokens when parsing generic arguments.
9154 (Parser::parse_type_path_segment): Allow `LEFT_ANGLE` as starting token for
9155 parsing generic arguments.
9157 2024-01-16 mxlol233 <mxlol233@outlook.com>
9159 * checks/errors/rust-feature-gate.cc: Add implementations
9161 * checks/errors/rust-feature-gate.h: Likewise.
9163 2024-01-16 Owen Avery <powerboat9.gamer@gmail.com>
9165 * parse/rust-parse-impl.h
9166 (Parser::parse_pattern): Add.
9167 (Parser::parse_pattern_no_alt): Rename.
9168 * parse/rust-parse.h:
9169 (Parser::parse_pattern): Add.
9170 (Parser::parse_pattern_no_alt): Rename.
9172 2024-01-04 David Malcolm <dmalcolm@redhat.com>
9174 * lang.opt.urls: New file, autogenerated by
9175 regenerate-opt-urls.py.
9177 2023-12-14 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9178 Thomas Schwinge <thomas@codesourcery.com>
9180 * config-lang.in: Add libgrust as a target module for the rust
9183 2023-11-19 David Malcolm <dmalcolm@redhat.com>
9185 * rust-location.h: Include "rich-location.h".
9187 2023-10-20 Patrick Palka <ppalka@redhat.com>
9190 * backend/rust-constexpr.cc (potential_constant_expression_1):
9191 Remove NON_DEPENDENT_EXPR handling.
9192 * backend/rust-tree.cc (mark_exp_read): Likewise.
9193 (mark_use): Likewise.
9194 (lvalue_kind): Likewise.
9196 2023-09-28 Richard Sandiford <richard.sandiford@arm.com>
9198 * backend/rust-constexpr.cc (rs_fold_indirect_ref): Remove unused
9201 2023-09-21 Iain Buclaw <ibuclaw@gdcproject.org>
9203 * rust-session-manager.cc (Session::init): Call
9204 targetrustm.rust_os_info.
9205 * rust-target.def (rust_os_info): New hook.
9207 2023-09-21 Iain Buclaw <ibuclaw@gdcproject.org>
9209 * rust-lang.cc (rust_add_target_info): Remove sorry.
9210 * rust-session-manager.cc: Replace include of target.h with
9211 include of tm.h and rust-target.h.
9212 (Session::init): Call targetrustm.rust_cpu_info.
9213 * rust-target.def (rust_cpu_info): New hook.
9214 * rust-target.h (rust_add_target_info): Declare.
9216 2023-09-21 Iain Buclaw <ibuclaw@gdcproject.org>
9218 * rust-target-def.h: New file.
9219 * rust-target.def: New file.
9220 * rust-target.h: New file.
9222 2023-09-11 Parthib <94271200+Parthib314@users.noreply.github.com>
9224 * Make-lang.in: Removed rust-gcc-diagnostics object file.
9225 * rust-diagnostics.cc (rust_be_get_quotechars): Added from original file.
9226 (rust_be_internal_error_at): Likewise.
9227 (rust_be_error_at): Likewise.
9228 (class rust_error_code_rule): Likewise.
9229 (rust_be_warning_at): Likewise.
9230 (rust_be_fatal_error): Likewise.
9231 (rust_be_inform): Likewise.
9232 (rust_be_debug_p): Likewise.
9233 * rust-gcc-diagnostics.cc: Removed.
9235 2023-09-07 David Malcolm <dmalcolm@redhat.com>
9237 * rust-diagnostics.cc (rust_error_at): New overload.
9238 * rust-diagnostics.h (struct ErrorCode): New struct.
9239 (rust_error_at): New.
9240 (rust_be_error_at): Likewise.
9241 * rust-gcc-diagnostics.cc (class rust_error_code_rule): New class.
9242 (rust_be_error_at): New function.
9243 * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error): Emit E0054
9244 when reporting invalid cast error.
9246 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
9247 Juzhe-Zhong <juzhe.zhong@rivai.ai>
9249 * backend/rust-tree.cc (c_common_type_for_mode): Ditto.
9251 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com>
9253 * rust-object-export.cc [TARGET_AIX]: Rename and update usage to
9256 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9258 * parse/rust-parse-impl.h
9259 (Parser::parse_stmt): Handle unsafe expression statements.
9261 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9263 * parse/rust-parse-impl.h
9264 (Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling.
9266 2023-04-06 M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
9268 * ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.
9269 * ast/rust-expr.h (class InlineAsm):Added class definition.
9271 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9273 * rust-diagnostics.h (struct Error): Add new Kind enum and various new
9274 static constructors to allow for hints as well.
9275 * rust-diagnostics.cc (Error::Error): Use new `kind` field properly.
9276 * checks/errors/privacy/rust-visibility-resolver.cc
9277 (VisibilityResolver::resolve_module_path): Use new Error API.
9278 * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise.
9279 * expand/rust-macro-expand.cc (parse_many): Likewise.
9280 (transcribe_type): Likewise.
9281 * parse/rust-parse-impl.h (Parser::parse_crate): Likewise.
9282 * rust-session-manager.cc (Session::handle_crate_name): Likewise.
9283 * ast/rust-ast.cc (Module::load_items): Likewise.
9285 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9287 * ast/rust-ast.h: Keep location in TraitItem base class
9288 * ast/rust-item.h (class TraitItemFunc): Use base class location instead.
9289 (class TraitItemMethod): Likewise.
9290 (class TraitItemConst): Likewise.
9291 (class TraitItemType): Likewise.
9292 * ast/rust-macro.h: Likewise.
9294 2023-04-06 SainiAditya1 <Adityasaini10012001@outlook.com>
9296 * hir/tree/rust-hir-full-test.cc: Moved to...
9297 * hir/tree/rust-hir.cc: ...here.
9298 * Make-lang.in: Rename rust-hir-full-test.
9300 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9302 * ast/rust-ast-dump.cc
9303 (Dump::visit): Add AltPattern visitor.
9304 * ast/rust-ast-dump.h:
9305 (Dump::visit): Add AltPattern visitor.
9306 * ast/rust-ast-full-decls.h
9307 (class AltPattern): Add declaration.
9308 * ast/rust-ast-visitor.h:
9309 (ASTVisitor::visit): Add AltPattern visitor.
9311 (AltPattern::as_string): Add definition.
9312 (AltPattern::accept_vis): Add definition.
9313 * ast/rust-pattern.h
9314 (class AltPattern): Add declaration.
9315 * checks/errors/rust-feature-gate.h:
9316 (FeatureGate::visit) Add AltPattern visitor
9317 * expand/rust-attribute-visitor.cc
9318 (AttrVisitor::visit): Add AltPattern visitor.
9319 * expand/rust-attribute-visitor.h:
9320 (AttrVisitor::visit): Add AltPattern visitor.
9321 * hir/rust-ast-lower-base.cc
9322 (ASTLoweringBase::visit): Add AltPattern visitor.
9323 * hir/rust-ast-lower-base.h:
9324 (ASTLoweringBase::visit): Add AltPattern visitor.
9325 * resolve/rust-ast-resolve-base.cc
9326 (ResolverBase::visit): Add AltPattern visitor.
9327 * resolve/rust-ast-resolve-base.h:
9328 (ResolverBase::visit): Add AltPattern visitor.
9329 * resolve/rust-early-name-resolver.cc
9330 (EarlyNameResolver::visit): Add AltPattern visitor.
9331 * resolve/rust-early-name-resolver.h:
9332 (EarlyNameResolver::visit): Add AltPattern visitor.
9333 * util/rust-attributes.cc
9334 (AttributeChecker::visit): Add AltPattern visitor.
9335 * util/rust-attributes.h:
9336 (AttributeChecker::visit): Add AltPattern visitor.
9338 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9340 * ast/rust-pattern.h: Fix formatting.
9342 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9344 * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not
9345 return nullptr token in expansion of `include!()`
9347 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9349 * checks/errors/rust-feature-gate.h: Add trailing newline before EOF.
9351 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9353 * typecheck/rust-hir-trait-reference.cc (TraitReference::clear_associated_types): make const
9354 (TraitReference::clear_associated_type_projections): new interface
9355 * typecheck/rust-hir-trait-reference.h:
9356 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): refactor
9357 (TraitItemReference::associated_type_reset): reset projections
9358 * typecheck/rust-hir-type-bounds.h:
9359 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): fix bounds
9360 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): refactor into cc file
9361 (TypeBoundsProbe::Probe): refactor
9362 (TypeBoundsProbe::is_bound_satisfied_for_type): likewise
9363 (TypeBoundsProbe::assemble_sized_builtin): add builtin for Sized
9364 (TypeCheckBase::get_predicate_from_bound): refactor
9365 (TypeBoundPredicate::lookup_associated_type): refactor
9366 * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl)
9367 (SubstitutionRef::prepare_higher_ranked_bounds): new interface to clear hanging bounds
9368 (SubstitutionRef::monomorphize): refactor
9369 * typecheck/rust-tyty-subst.h:
9370 * typecheck/rust-tyty.cc (BaseType::get_locus): helper
9371 (BaseType::satisfies_bound): ensure bounds are satisfied and assoicated types
9372 (ParamType::ParamType): new field in constructor
9373 (ParamType::clone): update clone
9374 (ParamType::set_implicit_self_trait): new interface
9375 (ParamType::is_implicit_self_trait): likewise
9376 * typecheck/rust-tyty.h: cleanup
9377 * util/rust-hir-map.cc (Mappings::Mappings): builtin marker
9378 (Mappings::~Mappings): delete marker
9379 (Mappings::lookup_builtin_marker): lookup
9380 * util/rust-hir-map.h: update header
9382 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9384 * hir/tree/rust-hir-item.h: implement virtual function
9385 * hir/tree/rust-hir.h: add virtual function
9387 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9389 * Make-lang.in: add new dependancy
9390 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor
9391 * typecheck/rust-hir-type-check-base.h: refactor
9392 * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): refactor
9393 * typecheck/rust-type-util.cc: New file.
9394 * typecheck/rust-type-util.h: New file.
9396 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9398 * expand/rust-macro-builtins.cc
9399 (MacroBuiltin::include_str_handler): Add check for valid UTF-8.
9401 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9403 * parse/rust-parse-impl.h
9404 (Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns.
9406 2023-04-06 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9408 * lex/rust-lex.h: Add file type check.
9410 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9412 * backend/rust-compile-pattern.cc
9413 (CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements.
9414 * backend/rust-compile-var-decl.h:
9415 (CompileVarDecl::visit): Remove variable declaration for WildcardPattern.
9416 * resolve/rust-ast-resolve-pattern.h:
9417 (PatternDeclaration::visit): Remove name resolution for WildcardPattern.
9419 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9421 * typecheck/rust-tyty-call.cc
9422 (TypeCheckCallExpr::visit): Add variadic argument type checking.
9423 (TypeCheckCallExpr::visit): Fix comment spelling ("varadic").
9425 2023-04-06 mxlol233 <mxlol233@outlook.com>
9427 * checks/errors/rust-feature-gate.cc: Add implementation for
9428 `void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature`
9429 construction process in `FeatureGate::check`.
9430 * checks/errors/rust-feature-gate.h: Add declaration for
9431 `void FeatureGate::visit (AST::ExternBlock &block)`. Add private
9432 variable `valid_feature`.
9433 * checks/errors/rust-feature.h: Change `issue` to `m_issue`.
9435 2023-04-06 Thomas Schwinge <thomas@codesourcery.com>
9437 * ast/rust-ast-fragment.cc: Update copyright years.
9438 * ast/rust-ast-fragment.h: Likewise.
9439 * ast/rust-macro.cc: Likewise.
9440 * checks/errors/rust-feature-gate.cc: Likewise.
9441 * checks/errors/rust-feature-gate.h: Likewise.
9442 * checks/errors/rust-feature.cc: Likewise.
9443 * checks/errors/rust-feature.h: Likewise.
9444 * hir/rust-ast-lower-expr.cc: Likewise.
9445 * hir/rust-ast-lower-type.cc: Likewise.
9446 * resolve/rust-early-name-resolver.cc: Likewise.
9447 * resolve/rust-early-name-resolver.h: Likewise.
9448 * rust-gcc.h: Likewise.
9449 * typecheck/rust-hir-path-probe.cc: Likewise.
9450 * typecheck/rust-hir-trait-reference.cc: Likewise.
9451 * typecheck/rust-tyty-bounds.h: Likewise.
9452 * typecheck/rust-tyty-subst.cc: Likewise.
9453 * typecheck/rust-tyty-subst.h: Likewise.
9454 * typecheck/rust-tyty-util.cc: Likewise.
9455 * typecheck/rust-tyty-util.h: Likewise.
9456 * typecheck/rust-unify.cc: Likewise.
9457 * typecheck/rust-unify.h: Likewise.
9458 * util/rust-inline-visitor.h: Likewise.
9460 2023-04-06 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9462 * rust-session-manager.cc (Session::compile_crate): Update the
9463 environment variable name.
9465 2023-04-06 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
9467 * Make-lang.in: Add `rust-hir-trait-reference.o`.
9468 * typecheck/rust-hir-trait-reference.h: Remove multiple function body.
9469 * typecheck/rust-hir-trait-reference.cc: Add multiple function body.
9471 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9473 * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
9474 Add documentation explaining the algorithm.
9476 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9478 * ast/rust-macro.cc: New file.
9479 * Make-lang.in: Add `rust-macro.o` object
9480 * ast/rust-ast-fragment.cc (Fragment::Fragment): Change API around
9481 the construction of AST fragments.
9482 (Fragment::operator=): Correct `Fragment::operator=` to take into
9483 account the fragment tokens.
9484 (Fragment::create_error): Use new constructor.
9485 (Fragment::complete): Remove in favor of new constructor.
9486 (Fragment::unexpanded): Remove as that Fragment type is no longer used
9488 (Fragment::get_tokens): Add helper to access a fragment's tokens.
9489 * ast/rust-ast-fragment.h (enum class): Remove `FragmentKind::Unused`
9490 * ast/rust-ast.cc (MacroInvocation::as_string): Display
9491 builtin macro invocations properly.
9492 * ast/rust-ast.h: Fix `DelimTokenTree` class copy constructors and
9493 handling of its token vector.
9494 * ast/rust-macro.h (class MacroMatcher): Format.
9495 (class MetaItemSeq): Likewise.
9496 (builtin_macro_from_string): Get a `BuiltinMacroKind` from a given
9497 string, i.e the name of the macro (`assert!`, `cfg!` and so on).
9498 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Do not expand
9499 macros recursively anymore.
9500 (AttrVisitor::maybe_expand_expr): Likewise.
9501 (AttrVisitor::maybe_expand_type): Likewise.
9502 * expand/rust-attribute-visitor.h: Likewise, and remove
9503 `expand_macro_fragment_recursively` function.
9504 * expand/rust-macro-builtins.cc (make_token): Add shorthand for
9505 returning `std::unique_ptr<AST::Token>`s.
9506 (make_macro_invocation): Add shorthand for returning fragments
9507 containing builtin macro invocations.
9508 (try_expand_macro_expression): Do not expand macros recursively.
9509 (try_expand_single_string_literal): Likewise.
9510 (try_expand_many_expr): Likewise.
9511 (parse_single_string_literal): Error out more appropriately.
9512 (MacroBuiltin::compile_error_handler): Add explanation for eager
9514 (MacroBuiltin::file_handler): Return the proper tokens associated with
9515 macro invocation, and builtin macros in the case of necessary eager
9517 (MacroBuiltin::column_handler): Likewise.
9518 (MacroBuiltin::include_bytes_handler): Likewise.
9519 (MacroBuiltin::include_str_handler): Likewise.
9520 (MacroBuiltin::concat_handler): Likewise.
9521 (MacroBuiltin::env_handler): Likewise.
9522 (MacroBuiltin::cfg_handler): Likewise.
9523 (MacroBuiltin::include_handler): Likewise.
9524 (MacroBuiltin::line_handler): Likewise.
9525 * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
9526 Add function to expand eager invocations *once* in the fixed point
9528 (MacroExpander::expand_invoc): Call into `expand_eager_invocations` for
9529 builtin macro invocations.
9530 (MacroExpander::expand_crate): Use new `AttrVisitor` API.
9531 (parse_many): Return tokens in `AST::Fragment`.
9532 (transcribe_expression): Likewise.
9533 (transcribe_type): Likewise.
9534 * expand/rust-macro-expand.h (struct MacroExpander): Add `has_changed`
9535 flag for fixed point checking.
9536 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver):
9537 Keep track of the current macro scope.
9538 (EarlyNameResolver::go): Use `scoped` API.
9539 (EarlyNameResolver::visit): Likewise.
9540 * resolve/rust-early-name-resolver.h: Add `scoped` API.
9541 * rust-session-manager.cc (Session::expansion): Perform macro expansion
9542 in a fixed-point fashion.
9544 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9546 * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::get_token_slice):
9547 Add API to retrieve token slices when lexing macro expansions.
9548 * expand/rust-macro-invoc-lexer.h: Declare `get_token_slice`.
9550 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9552 * parse/rust-parse.h: Move `parse_macro_invocation` to public API.
9554 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9556 * ast/rust-item.h (class BlockExpr): Remove forward declaration of
9559 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9561 * hir/tree/rust-hir-pattern.h
9562 (TuplePatternItemsRanged::get_lower_patterns): Add method.
9563 (TuplePatternItemsRanged::get_upper_patterns): Add method.
9564 * backend/rust-compile-pattern.cc
9565 (CompilePatternLet::visit): Implement TuplePattern visitor.
9566 * backend/rust-compile-pattern.h
9567 (CompilePatternLet::visit): Move TuplePattern visitor out of header file.
9569 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9571 * typecheck/rust-unify.cc (UnifyRules::go): ensure the bounds are checked
9573 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9575 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove error message
9577 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9579 * typecheck/rust-hir-trait-reference.h: add const infterface
9580 * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): make const
9581 (SubstitutionRef::monomorphize): fix issue
9582 * typecheck/rust-tyty-subst.h: constify interface
9584 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9586 * util/rust-lang-item.h:
9588 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9590 * typecheck/rust-tyty-subst.cc (SubstitutionArg::is_conrete): fix check
9592 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9594 * Make-lang.in: update names
9595 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
9596 update to use new interface
9597 * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_borrowed_pointer): likewise
9598 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): likewise
9599 * typecheck/rust-tyty.cc (BaseType::destructure): likewise
9600 (InferType::unify): removed old unify interface
9601 (ErrorType::unify): likewise
9602 (ADTType::unify): likewise
9603 (TupleType::unify): likewise
9604 (FnType::unify): likewise
9605 (FnPtr::unify): likewise
9606 (ClosureType::unify): likewise
9607 (ArrayType::unify): likewise
9608 (SliceType::unify): likewise
9609 (BoolType::unify): likewise
9610 (IntType::unify): likewise
9611 (UintType::unify): likewise
9612 (FloatType::unify): likewise
9613 (USizeType::unify): likewise
9614 (ISizeType::unify): likewise
9615 (CharType::unify): likewise
9616 (ReferenceType::unify): likewise
9617 (PointerType::unify): likewise
9618 (ParamType::unify): likewise
9619 (StrType::unify): likewise
9620 (NeverType::unify): likewise
9621 (PlaceholderType::unify): likewise
9622 (ProjectionType::unify): likewise
9623 (DynamicObjectType::unify): likewise
9624 * typecheck/rust-tyty.h: update destructure interface
9625 * typecheck/rust-tyty-rules.h: Removed.
9626 * typecheck/rust-unify.cc: New file.
9627 * typecheck/rust-unify.h: New file.
9629 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9631 * typecheck/rust-hir-trait-reference.h: change interface to return self
9632 * typecheck/rust-hir-trait-resolve.cc: likewise
9633 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): likewise
9634 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove monomorphization hack
9636 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9638 * typecheck/rust-tyty-subst.cc: add missing callback
9640 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9642 * typecheck/rust-tyty-subst.cc: update copy constructors
9644 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9646 * typecheck/rust-tyty-bounds.cc: refactor to take a reference
9647 * typecheck/rust-tyty-subst.cc: likewise
9648 (SubstitutionRef::get_substitution_arguments): likewise
9649 (SubstitutionRef::infer_substitions): likewise
9650 * typecheck/rust-tyty-subst.h: likewise
9651 * typecheck/rust-tyty.cc (ADTType::handle_substitions): likewise
9652 (TupleType::handle_substitions): likewise
9653 (FnType::handle_substitions): likewise
9654 (ClosureType::handle_substitions): likewise
9655 (ArrayType::handle_substitions): likewise
9656 (SliceType::handle_substitions): likewise
9657 (ReferenceType::handle_substitions): likewise
9658 (PointerType::handle_substitions): likewise
9659 (ParamType::handle_substitions): likewise
9660 (ProjectionType::handle_substitions): likewise
9661 * typecheck/rust-tyty.h: likewise
9663 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9665 * typecheck/rust-hir-trait-ref.h: Moved to...
9666 * typecheck/rust-hir-trait-reference.h: ...here.
9667 * typecheck/rust-hir-trait-resolve.cc: refactor
9668 * typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRAIT_RESOLVE_H): likewise
9669 * typecheck/rust-hir-type-check.h: likewise
9670 * typecheck/rust-tyty.cc: likewise
9672 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9674 * Make-lang.in: update name
9675 * typecheck/rust-tyctx.cc: Moved to...
9676 * typecheck/rust-typecheck-context.cc: ...here.
9678 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9680 * typecheck/rust-hir-type-check.h: refactor
9681 * typecheck/rust-tyctx.cc (TypeCheckContext::iterate): refactor
9682 (TypeCheckContext::have_loop_context): likewise
9683 (TypeCheckContext::push_new_loop_context): likewise
9684 (TypeCheckContext::push_new_while_loop_context): likewise
9685 (TypeCheckContext::peek_loop_context): likewise
9686 (TypeCheckContext::pop_loop_context): likewise
9687 (TypeCheckContext::swap_head_loop_context): likewise
9688 (TypeCheckContext::insert_trait_reference): likewise
9689 (TypeCheckContext::lookup_trait_reference): likewise
9690 (TypeCheckContext::insert_receiver): likewise
9691 (TypeCheckContext::lookup_receiver): likewise
9692 (TypeCheckContext::insert_associated_type_mapping): likewise
9693 (TypeCheckContext::clear_associated_type_mapping): likewise
9694 (TypeCheckContext::lookup_associated_type_mapping): likewise
9695 (TypeCheckContext::insert_variant_definition): likewise
9696 (TypeCheckContext::lookup_variant_definition): likewise
9697 (TypeCheckContext::insert_operator_overload): likewise
9698 (TypeCheckContext::lookup_operator_overload): likewise
9699 (TypeCheckContext::insert_unconstrained_check_marker): likewise
9700 (TypeCheckContext::have_checked_for_unconstrained): likewise
9701 (TypeCheckContext::insert_resolved_predicate): likewise
9702 (TypeCheckContext::lookup_predicate): likewise
9703 (TypeCheckContext::insert_query): likewise
9704 (TypeCheckContext::query_completed): likewise
9705 (TypeCheckContext::query_in_progress): likewise
9706 (TypeCheckContext::insert_trait_query): likewise
9707 (TypeCheckContext::trait_query_completed): likewise
9708 (TypeCheckContext::trait_query_in_progress): likewise
9709 (TypeCheckContextItem::Item::Item): likewise
9710 (TypeCheckContextItem::TypeCheckContextItem): likewise
9711 (TypeCheckContextItem::get_item): likewise
9712 (TypeCheckContextItem::get_impl_item): likewise
9713 (TypeCheckContextItem::get_trait_item): likewise
9714 (TypeCheckContextItem::get_type): likewise
9715 * typecheck/rust-tyty.cc (StructFieldType::StructFieldType): likewise
9716 (StructFieldType::get_ref): likewise
9717 (StructFieldType::get_name): likewise
9718 (StructFieldType::get_field_type): likewise
9719 (StructFieldType::set_field_type): likewise
9720 (StructFieldType::is_concrete): likewise
9721 (StructFieldType::debug): likewise
9722 (StructFieldType::get_locus): likewise
9723 (VariantDef::variant_type_string): likewise
9724 (VariantDef::VariantDef): likewise
9725 (VariantDef::operator=): likewise
9726 (VariantDef::get_error_node): likewise
9727 (VariantDef::is_error): likewise
9728 (VariantDef::get_id): likewise
9729 (VariantDef::get_defid): likewise
9730 (VariantDef::get_variant_type): likewise
9731 (VariantDef::is_data_variant): likewise
9732 (VariantDef::is_dataless_variant): likewise
9733 (VariantDef::get_identifier): likewise
9734 (VariantDef::num_fields): likewise
9735 (VariantDef::get_field_at_index): likewise
9736 (VariantDef::get_fields): likewise
9737 (VariantDef::lookup_field): likewise
9738 (VariantDef::get_discriminant): likewise
9739 (VariantDef::as_string): likewise
9740 (VariantDef::is_equal): likewise
9741 (VariantDef::clone): likewise
9742 (VariantDef::monomorphized_clone): likewise
9743 (VariantDef::get_ident): likewise
9744 (TupleType::TupleType): likewise
9745 (TupleType::get_unit_type): likewise
9746 (TupleType::is_unit): likewise
9747 (TupleType::num_fields): likewise
9748 (TupleType::is_concrete): likewise
9749 (TupleType::get_fields): likewise
9750 (BoolType::BoolType): likewise
9751 (BoolType::get_name): likewise
9752 (BoolType::is_concrete): likewise
9753 (IntType::IntType): likewise
9754 (IntType::get_name): likewise
9755 (IntType::get_int_kind): likewise
9756 (IntType::is_concrete): likewise
9757 (UintType::UintType): likewise
9758 (UintType::get_name): likewise
9759 (UintType::get_uint_kind): likewise
9760 (UintType::is_concrete): likewise
9761 (FloatType::FloatType): likewise
9762 (FloatType::get_name): likewise
9763 (FloatType::get_float_kind): likewise
9764 (FloatType::is_concrete): likewise
9765 (USizeType::USizeType): likewise
9766 (USizeType::get_name): likewise
9767 (USizeType::is_concrete): likewise
9768 (ISizeType::ISizeType): likewise
9769 (ISizeType::get_name): likewise
9770 (ISizeType::is_concrete): likewise
9771 (CharType::CharType): likewise
9772 (CharType::is_concrete): likewise
9773 (CharType::get_name): likewise
9774 (ReferenceType::ReferenceType): likewise
9775 (ReferenceType::is_concrete): likewise
9776 (ReferenceType::mutability): likewise
9777 (ReferenceType::is_mutable): likewise
9778 (ReferenceType::is_dyn_object): likewise
9779 (ReferenceType::is_dyn_slice_type): likewise
9780 (ReferenceType::is_dyn_str_type): likewise
9781 (PointerType::PointerType): likewise
9782 (PointerType::is_concrete): likewise
9783 (PointerType::mutability): likewise
9784 (PointerType::is_mutable): likewise
9785 (PointerType::is_const): likewise
9786 (PointerType::is_dyn_object): likewise
9787 (PointerType::is_dyn_slice_type): likewise
9788 (PointerType::is_dyn_str_type): likewise
9789 (ParamType::ParamType): likewise
9790 (ParamType::get_generic_param): likewise
9791 (ParamType::can_resolve): likewise
9792 (ParamType::is_concrete): likewise
9793 (StrType::StrType): likewise
9794 (StrType::get_name): likewise
9795 (StrType::is_concrete): likewise
9796 (NeverType::NeverType): likewise
9797 (NeverType::get_name): likewise
9798 (NeverType::is_unit): likewise
9799 (NeverType::is_concrete): likewise
9800 (PlaceholderType::PlaceholderType): likewise
9801 (PlaceholderType::get_name): likewise
9802 (PlaceholderType::is_unit): likewise
9803 (PlaceholderType::get_symbol): likewise
9804 (PlaceholderType::is_concrete): likewise
9805 (ProjectionType::is_unit): likewise
9806 (ProjectionType::get_name): likewise
9807 (ProjectionType::needs_generic_substitutions): likewise
9808 (ProjectionType::supports_substitutions): likewise
9809 (ProjectionType::has_subsititions_defined): likewise
9810 (ProjectionType::get): likewise
9811 (ProjectionType::is_concrete): likewise
9812 (DynamicObjectType::is_concrete): likewise
9813 * typecheck/rust-tyty.h: likewise
9815 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9817 * typecheck/rust-hir-path-probe.cc (PathProbeCandidate::Candidate::Candidate): refactor
9818 (PathProbeCandidate::PathProbeCandidate): likewise
9819 (PathProbeCandidate::as_string): likewise
9820 (PathProbeCandidate::is_enum_candidate): likewise
9821 (PathProbeCandidate::is_impl_candidate): likewise
9822 (PathProbeCandidate::is_trait_candidate): likewise
9823 (PathProbeCandidate::is_full_trait_item_candidate): likewise
9824 (PathProbeCandidate::get_error): likewise
9825 (PathProbeCandidate::is_error): likewise
9826 (PathProbeCandidate::get_defid): likewise
9827 (PathProbeCandidate::operator<): likewise
9828 * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
9830 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9832 * typecheck/rust-hir-path-probe.cc (PathProbeType::PathProbeType): refactor
9833 (PathProbeType::Probe): likewise
9834 (PathProbeType::visit): likewise
9835 (PathProbeType::process_enum_item_for_candiates): likewise
9836 (PathProbeType::process_impl_items_for_candidates): likewise
9837 (PathProbeType::is_reciever_generic): likewise
9838 (PathProbeImplTrait::PathProbeImplTrait): likewise
9839 (PathProbeImplTrait::Probe): likewise
9840 (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
9841 * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
9842 * typecheck/rust-hir-trait-resolve.cc
9843 (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
9845 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9847 * typecheck/rust-tyty.cc (BaseType::BaseType): refactor
9848 (BaseType::~BaseType): likewise
9849 (BaseType::get_ref): likewise
9850 (BaseType::set_ref): likewise
9851 (BaseType::get_ty_ref): likewise
9852 (BaseType::set_ty_ref): likewise
9853 (BaseType::is_equal): likewise
9854 (BaseType::is_unit): likewise
9855 (BaseType::get_kind): likewise
9856 (BaseType::get_combined_refs): likewise
9857 (BaseType::append_reference): likewise
9858 (BaseType::supports_substitutions): likewise
9859 (BaseType::has_subsititions_defined): likewise
9860 (BaseType::can_substitute): likewise
9861 (BaseType::needs_generic_substitutions): likewise
9862 (BaseType::contains_type_parameters): likewise
9863 (BaseType::get_ident): likewise
9864 (BaseType::get_locus): likewise
9865 (InferType::InferType): likewise
9866 (InferType::get_infer_kind): likewise
9867 (InferType::get_name): likewise
9868 (InferType::is_concrete): likewise
9869 (ErrorType::ErrorType): likewise
9870 (ErrorType::is_unit): likewise
9871 (ErrorType::is_concrete): likewise
9872 (ErrorType::get_name): likewise
9873 (ErrorType::monomorphized_clone): likewise
9874 * typecheck/rust-tyty.h (class SubstitutionArgumentMappings): likewise
9876 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9878 * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): refactor
9879 (SubstMapper::Resolve): likewise
9880 (SubstMapper::InferSubst): likewise
9881 (SubstMapper::have_generic_args): likewise
9882 (SubstMapper::visit): likewise
9883 (SubstMapperInternal::visit): likewise
9884 (SubstMapperFromExisting::SubstMapperFromExisting): likewise
9885 (SubstMapperFromExisting::Resolve): likewise
9886 (SubstMapperFromExisting::visit): likewise
9887 (GetUsedSubstArgs::GetUsedSubstArgs): likewise
9888 (GetUsedSubstArgs::From): likewise
9889 (GetUsedSubstArgs::visit): likewise
9890 * typecheck/rust-substitution-mapper.h: refactor
9891 * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): likewise
9893 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9895 * Make-lang.in: update the makefile
9896 * typecheck/rust-tyty.cc (SubstitutionParamMapping::need_substitution): likewise
9897 (SubstitutionParamMapping::override_context): likewise
9898 (SubstitutionRef::get_mappings_from_generic_args): likewise
9899 (SubstitutionRef::infer_substitions): likewise
9900 (SubstitutionRef::are_mappings_bound): likewise
9901 (SubstitutionRef::solve_missing_mappings_from_this): likewise
9902 (SubstitutionRef::monomorphize): likewise
9903 * typecheck/rust-tyty.h (class SubstitutionParamMapping): likewise
9904 (class SubstitutionArg): likewise
9905 (std::function<void): likewise
9906 (class SubstitutionArgumentMappings): likewise
9907 (class SubstitutionRef): likewise
9908 * typecheck/rust-tyty-subst.cc: New file.
9909 * typecheck/rust-tyty-subst.h: New file.
9911 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9913 * Make-lang.in: update makefile
9914 * typecheck/rust-tyty.cc (TyVar::TyVar): move to new file
9915 (TyVar::get_tyty): likewise
9916 (TyVar::get_implicit_infer_var): likewise
9917 (TyVar::subst_covariant_var): likewise
9918 (TyVar::clone): likewise
9919 (TyVar::monomorphized_clone): likewise
9920 (TyWithLocation::TyWithLocation): likewise
9921 * typecheck/rust-tyty.h (class BaseType): cleanup
9922 (class TypeBoundPredicate): move to its own file
9923 (class TypeBoundPredicateItem): likewise
9924 (class TypeBoundsMappings): likewise
9925 (class TyVar): likewise
9926 (class TyWithLocation): likewise
9927 * typecheck/rust-tyty-bounds.h: New file.
9928 * typecheck/rust-tyty-util.cc: New file.
9929 * typecheck/rust-tyty-util.h: New file.
9931 2023-04-06 Philip Herron <herron.philip@googlemail.com>
9933 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicateItem::error): refactor
9934 (TypeBoundPredicateItem::is_error): likewise
9935 (TypeBoundPredicateItem::get_parent): likewise
9936 * typecheck/rust-tyty.h: Move the implementation for the above
9938 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9940 * backend/rust-compile-expr.cc (CompileExpr::visit): Removed copy-pasted comment.
9942 2023-04-06 mxlol233 <mxlol233@outlook.com>
9944 * Make-lang.in: Add object files: `rust-feature.o` and `rust-feature-gate.o`
9945 * checks/errors/rust-feature-gate.cc: New file.
9946 * checks/errors/rust-feature-gate.h: New file.
9947 * checks/errors/rust-feature.cc: New file.
9948 * checks/errors/rust-feature.h: New file.
9949 * rust-session-manager.cc: Add FeatureGate check.
9951 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9953 * parse/rust-parse-impl.h (Parser::parse_closure_expr): Advance tokens
9954 properly when parsing closure param list.
9956 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
9958 * parse/rust-parse-impl.h (Parser::parse_generic_arg): Handle type
9959 paths and nested generics properly.
9961 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9963 * ast/rust-pattern.h:
9964 (ReferencePattern::is_double_reference): Add method.
9965 (ReferencePattern::get_is_mut): Add method.
9966 * hir/rust-ast-lower-pattern.cc
9967 (ASTLoweringPattern::visit): Add ReferencePattern visitor.
9968 * hir/rust-ast-lower-pattern.h:
9969 (ASTLoweringPattern::visit): Add ReferencePattern visitor.
9971 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9973 * hir/tree/rust-hir-pattern.h
9974 (class ReferencePattern): Remove has_two_amps field.
9975 * hir/tree/rust-hir-full-test.cc
9976 (ReferencePattern::as_string): Remove usage of ReferencePattern::has_two_amps.
9978 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
9980 * backend/rust-compile-fnparam.h
9981 (CompileFnParam::visit): Remove HIR::GroupedPattern visitor.
9982 * backend/rust-compile-pattern.cc
9983 (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
9984 (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
9985 * backend/rust-compile-pattern.h
9986 (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
9987 (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
9988 (CompilePatternLet::visit): Remove HIR::GroupedPattern visitor.
9989 * backend/rust-compile-resolve-path.h
9990 (ResolvePathRef::visit): Remove HIR::GroupedPattern visitor.
9991 * backend/rust-compile-var-decl.h
9992 (CompileVarDecl::visit): Remove HIR::GroupedPattern visitor.
9993 * checks/errors/rust-const-checker.cc
9994 (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
9995 * checks/errors/rust-const-checker.h
9996 (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
9997 * checks/errors/rust-unsafe-checker.cc
9998 (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
9999 * checks/errors/rust-unsafe-checker.h
10000 (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
10001 * hir/rust-hir-dump.cc (Dump::visit): Remove HIR::GroupedPattern visitor.
10002 * hir/rust-hir-dump.h (Dump::visit): Remove HIR::GroupedPattern visitor.
10003 * hir/tree/rust-hir-full-decls.h (class GroupedPattern): Remove class.
10004 * hir/tree/rust-hir-full-test.cc (GroupedPattern::accept_vis): Remove method.
10005 * hir/tree/rust-hir-pattern.h (class GroupedPattern): Remove class.
10006 * hir/tree/rust-hir-visitor.h
10007 (HIRFullVisitor::visit): Remove HIR::GroupedPattern visitor.
10008 (HIRFullVisitorBase::visit): Remove HIR::GroupedPattern visitor.
10009 (HIRPatternVisitor::visit): Remove HIR::GroupedPattern visitor.
10010 * typecheck/rust-hir-type-check-pattern.cc
10011 (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
10012 * typecheck/rust-hir-type-check-pattern.h
10013 (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
10015 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10017 * hir/rust-ast-lower-pattern.cc
10018 (ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern.
10020 2023-04-06 MAHAD <mahadtxt@gmail.com>
10022 * rust-buffered-queue.h: Moved to...
10023 * util/rust-buffered-queue.h: ...here.
10025 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
10027 * parse/rust-parse-impl.h (Parser::parse_type): Handle double ampersan
10029 (Parser::parse_reference_type): Call into `parse_reference_type_inner`
10030 and wrap double reference types in another `AST::ReferenceType` node
10031 (Parser::parse_reference_type_inner): Add parsing implementation
10032 which does not care about the leading token (& or &&)
10033 (Parser::parse_type_no_bounds): Handle double ampersand properly
10034 * parse/rust-parse.h: Declare `parse_reference_type_inner`
10036 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10038 * backend/rust-compile-pattern.cc (CompilePatternLet::visit): New function.
10039 * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
10040 * backend/rust-compile-pattern.h (class CompilePatternLet): New visitor.
10042 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
10044 * ast/rust-macro.h (enum class): Add `BuiltinMacro` enum class.
10045 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Mention
10046 switching on `macro.kind` once builtin macro invocations are properly
10048 * parse/rust-parse-impl.h (Parser::parse_macro_invocation): Switch to new MacroInvocation
10050 (Parser::parse_type): Likewise.
10051 (Parser::parse_type_no_bounds): Likewise.
10053 2023-04-06 Abdul Rafey <abdulrafeyq@gmail.com>
10055 * ast/rust-ast-dump.cc (Dump::visit): removed extra indentations in trait ast dump
10057 2023-04-06 Abdul Rafey <abdulrafeyq@gmail.com>
10059 * parse/rust-parse-impl.h (Parser::null_denotation): Add proper error
10060 when seeing wildcard var on right side of assignment.
10062 2023-04-06 Abdul Rafey <abdulrafeyq@gmail.com>
10064 * ast/rust-ast.cc: Fix include list.
10065 * ast/rust-expr.h: Likewise.
10066 * hir/tree/rust-hir-expr.h: Likewise.
10067 * rust-backend.h: Likewise.
10068 * util/rust-lang-item.h: Likewise.
10069 * operator.h: Moved to...
10070 * util/rust-operators.h: ...here.
10072 2023-04-06 Parthib <parthibdutta02@gmail.com>
10074 * Make-lang.in: Rename object file.
10075 * ast/rust-ast-full-test.cc: Moved to...
10076 * ast/rust-ast.cc: ...here.
10078 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10080 * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Add proper
10082 (CompilePatternBindings::visit): Likewise.
10083 * backend/rust-compile-pattern.h: Declare them.
10085 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10087 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add proper
10090 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10092 * hir/tree/rust-hir-pattern.h: Add get_item method.
10094 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10096 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Add proper visitor.
10097 * hir/rust-ast-lower-pattern.h: Declare it.
10099 2023-04-06 Lyra <teromene@teromene.fr>
10101 * expand/rust-macro-expand.cc (transcribe_expression): Fix ICE when expanding
10104 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10106 * resolve/rust-ast-resolve-pattern.h: Support GroupedPattern properly.
10108 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10110 * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block):
10111 Allow patterns to declare zero or multiple variables.
10112 * backend/rust-compile-var-decl.h: Change function declaration.
10114 2023-04-06 mxlol233 <mxlol233@outlook.com>
10116 * lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token.
10117 (Lexer::parse_byte_char): Likewise.
10118 (Lexer::parse_byte_string): Likewise.
10119 (Lexer::parse_raw_byte_string): Likewise.
10120 (Lexer::parse_raw_identifier): Likewise.
10121 (Lexer::parse_string): Likewise.
10122 (Lexer::parse_identifier_or_keyword): Likewise.
10123 (Lexer::parse_raw_string): Likewise.
10124 (Lexer::parse_non_decimal_int_literal): Likewise.
10125 (Lexer::parse_decimal_int_or_float): Likewise.
10126 (Lexer::parse_char_or_lifetime): Likewise.
10128 2023-04-06 mxlol233 <mxlol233@outlook.com>
10130 * ast/rust-ast.h: Add get_locus method.
10131 * ast/rust-expr.h: Likewise.
10132 * ast/rust-macro.h: Likewise.
10134 2023-04-06 Owen Avery <powerboat9.gamer@gmail.com>
10136 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Cleanup LetStmt
10139 2023-04-06 Philip Herron <herron.philip@googlemail.com>
10141 * hir/tree/rust-hir-path.h: Add const get_identifier and get_type method.
10142 * typecheck/rust-hir-path-probe.h: Use new SubstitutionArgumentMappings constructor.
10143 * typecheck/rust-hir-trait-resolve.cc: Likewise.
10144 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
10145 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
10146 Do not assert failure on size mismatch anymore.
10147 (TypeBoundPredicate::TypeBoundPredicate): Use new SubstitutionArgumentMappings constructor.
10148 (TypeBoundPredicate::operator=): Likewise.
10149 (TypeBoundPredicate::apply_generic_arguments): Likewise.
10150 (TypeBoundPredicateItem::get_tyty_for_receiver): Likewise.
10151 (TypeBoundPredicate::get_num_associated_bindings): Likewise.
10152 (TypeBoundPredicate::lookup_associated_type): Fix implementation for new system.
10153 (TypeBoundPredicate::get_associated_type_items): Likewise.
10154 * typecheck/rust-tyty.cc (SubstitutionRef::get_mappings_from_generic_args): Add new
10156 (SubstitutionRef::infer_substitions): Use new constructor and add comment.
10157 (SubstitutionRef::solve_missing_mappings_from_this): Use new constructor.
10158 * typecheck/rust-tyty.h: Define new constructors.
10160 2023-04-06 Philip Herron <herron.philip@googlemail.com>
10162 * resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to
10165 2023-04-06 Raiki Tamura <tamaron1203@gmail.com>
10167 * ast/rust-ast-full-decls.h (class MacroItem): Remove forward declaration.
10168 * ast/rust-ast-full-test.cc (MacroRulesDefinition):
10169 Rework MacroRulesDefinition class
10170 * ast/rust-ast.h (class MacroItem): Remove abstract class.
10171 * ast/rust-item.h (class MacroItem): Remove forward declaration.
10172 * ast/rust-macro.h (class MacroItem): Likewise.
10173 (class MacroRulesDefinition): Add MacroKind enum.
10174 (class MacroInvocation): Fix inheritance.
10175 * lex/rust-token.h: Token "macro" is now used.
10176 * parse/rust-parse-impl.h (Parser::parse_item): Add handling for MACRO.
10177 (Parser::parse_vis_item): Call into parse_decl_macro_def.
10178 (Parser::parse_macro_item): Delete function.
10179 (Parser::parse_macro_rules_def): Return MBE macros only.
10180 (Parser::parse_decl_macro_def): New function.
10181 (Parser::parse_stmt): Handle MACRO token.
10182 (Parser::parse_stmt_or_expr_without_block): Call into parse_macro_rules_def.
10183 * parse/rust-parse.h: Declare new function.
10185 2023-04-06 mxlol233 <mxlol233@outlook.com>
10187 * parse/rust-parse-impl.h (Parser::parse_generic_arg): Add proper bound parsing.
10189 2023-04-06 Dave <dme2223@gmail.com>
10191 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Use StackedContext
10194 2023-04-06 Prajwal S N <prajwalnadig21@gmail.com>
10196 * checks/errors/rust-unsafe-checker.cc (check_target_attr): New function.
10197 (UnsafeChecker::check_function_attr): Call into `check_target_attr`.
10198 (UnsafeChecker::visit): Check for target_feature attributes.
10199 * checks/errors/rust-unsafe-checker.h: Add declarations.
10200 * util/rust-attributes.cc: Add attribute.
10202 2023-04-06 Arthur Cohen <arthur.cohen@embecosm.com>
10204 * rust-session-manager.cc (Session::compile_crate): Fix typo.
10206 2023-02-22 Thomas Schwinge <thomas@codesourcery.com>
10208 * rust-lang.cc (grs_langhook_type_for_mode): Also consider all
10209 'int_n' modes/types.
10211 2023-02-22 Thomas Schwinge <thomas@codesourcery.com>
10213 * rust-lang.cc (grs_langhook_init): Do not initialize
10216 2023-02-22 Thomas Schwinge <thomas@codesourcery.com>
10218 * config-lang.in (target_libs): Remove.
10220 2023-02-21 Raiki Tamura <tamaron1203@gmail.com>
10222 * backend/rust-builtins.cc (BuiltinsContext::setup_math_fns): New functions.
10224 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10226 * backend/rust-constexpr.cc (get_nth_callarg): Remove function.
10227 (rs_bind_parameters_in_call): Use CALL_EXPR_ARG instead.
10228 (potential_constant_expression_1): Likewise.
10230 2023-02-21 Thomas Schwinge <thomas@codesourcery.com>
10232 * lang.opt: Fix ordering of file.
10234 2023-02-21 Philip Herron <herron.philip@googlemail.com>
10236 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Remove unused parameters.
10237 * backend/rust-constexpr.cc (constant_value_1): Likewise.
10238 (fold_non_dependent_init): Likewise.
10239 * backend/rust-tree.cc (publicly_uniquely_derived_p): Likewise.
10240 (instantiation_dependent_expression_p): Likewise.
10241 (type_has_nontrivial_copy_init): Likewise.
10242 (is_normal_capture_proxy): Likewise.
10243 (resolve_nondeduced_context): Likewise.
10244 (undeduced_auto_decl): Likewise.
10245 (require_deduced_type): Likewise.
10246 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
10247 * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
10248 * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
10249 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
10250 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
10251 * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
10252 * checks/lints/rust-lint-unused-var.cc (unused_var_walk_fn): Likewise.
10253 * expand/rust-macro-builtins.cc (try_expand_single_string_literal): Likewise.
10254 (try_expand_many_expr): Likewise.
10255 (parse_single_string_literal): Likewise.
10256 (MacroBuiltin::assert_handler): Likewise.
10257 (MacroBuiltin::file_handler): Likewise.
10258 (MacroBuiltin::column_handler): Likewise.
10259 (MacroBuiltin::concat_handler): Likewise.
10260 (MacroBuiltin::env_handler): Likewise.
10261 (MacroBuiltin::line_handler): Likewise.
10262 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
10263 (ASTLoweringBase::handle_doc_item_attribute): Likewise.
10264 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
10265 * hir/tree/rust-hir-full-test.cc (ConstGenericParam::accept_vis): Likewise.
10266 * lex/rust-lex.cc (Lexer::parse_utf8_escape): Likewise.
10267 (Lexer::parse_string): Likewise.
10268 (Lexer::parse_char_or_lifetime): Likewise.
10269 * lex/rust-lex.h: Likewise.
10270 * metadata/rust-export-metadata.cc: Likewise.
10271 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
10272 * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
10273 (ResolveTypeToCanonicalPath::visit): Likewise.
10274 * resolve/rust-ast-verify-assignee.h: Likewise.
10275 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
10276 * typecheck/rust-hir-type-check-expr.h: Likewise.
10277 * typecheck/rust-hir-type-check-item.h: Likewise.
10278 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
10279 * typecheck/rust-tyty-rules.h: Likewise.
10280 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
10282 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10284 * hir/tree/rust-hir-expr.h: Add const `get_method_name`.
10285 * hir/tree/rust-hir-full-decls.h (struct GenericArgs): Move from `struct`...
10286 (class GenericArgs): ...to `class`.
10287 * hir/tree/rust-hir-path.h (struct GenericArgs): Likewise.
10288 (class GenericArgs): Clear `type_args` in copy constructor.
10289 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Reorder
10291 * typecheck/rust-tyty.h: Add default constructors for `SubstitutionArgumentMappings`.
10293 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10295 * backend/rust-compile-context.cc (Context::push_closure_context): New function.
10296 (Context::pop_closure_context): Likewise.
10297 (Context::insert_closure_binding): Likewise.
10298 (Context::lookup_closure_binding): Likewise.
10299 * backend/rust-compile-context.h: Declare new functions and closure mappings.
10300 * backend/rust-compile-expr.cc (CompileExpr::visit): Visit captures properly.
10301 (CompileExpr::generate_closure_function): Compile captures properly.
10302 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Check for
10304 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Compile capture list's
10307 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10309 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Pass captures
10310 properly to `TyTy::ClosureType` constructor.
10311 * typecheck/rust-tyty.cc (ClosureType::as_string): Fix string representation.
10312 (ClosureType::clone): Pass `captures` argument.
10313 * typecheck/rust-tyty.h: Add `captures` field.
10315 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10317 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Use proper closure
10319 * resolve/rust-name-resolver.cc (Scope::lookup_decl_type): New function.
10320 (Scope::lookup_rib_for_decl): Likewise.
10321 (Resolver::insert_resolved_name): Insert captured items.
10322 (Resolver::push_closure_context): New function.
10323 (Resolver::pop_closure_context): Likewise.
10324 (Resolver::insert_captured_item): Likewise.
10325 (Resolver::decl_needs_capture): Likewise.
10326 (Resolver::get_captures): Likewise.
10327 * resolve/rust-name-resolver.h: Declare new functions.
10329 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10331 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add Rib argument.
10332 (ResolveExpr::resolve_closure_param): Likewise.
10333 * resolve/rust-ast-resolve-implitem.h: Likewise.
10334 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
10335 (ResolveItem::visit): Likewise.
10336 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
10337 * resolve/rust-ast-resolve-pattern.h: Likewise.
10338 * resolve/rust-ast-resolve-stmt.h: Likewise.
10339 * resolve/rust-ast-resolve-toplevel.h: Likewise.
10340 * resolve/rust-ast-resolve-type.h: Likewise.
10341 * resolve/rust-name-resolver.cc (Rib::lookup_decl_type): Likewise.
10342 (Scope::insert): Likewise.
10343 (Resolver::insert_builtin_types): Likewise.
10344 * resolve/rust-name-resolver.h: Likewise.
10346 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10348 * resolve/rust-name-resolver.cc (MKBUILTIN_TYPE): Remove macro.
10349 (Rib::Rib): Remove `mappings` field.
10350 (Resolver::generate_builtins): Use `setup_builtin` instead of macro.
10351 (Resolver::setup_builtin): New function.
10352 * resolve/rust-name-resolver.h: Declare `setup_builtin`, add FIXME
10355 2023-02-21 Raiki Tamura <tamaron1203@gmail.com>
10357 * lex/rust-lex.cc (Lexer::Lexer): Add `dump_lex` boolean flag.
10358 (Lexer::skip_token): Dump tokens if flag is enabled.
10359 (Lexer::dump_and_skip): New function.
10360 * lex/rust-lex.h: Include optional.h and declare functions.
10361 * parse/rust-parse-impl.h (Parser::debug_dump_lex_output): Remove old
10363 * parse/rust-parse.h: Likewise.
10364 * rust-session-manager.cc (Session::compile_crate): Pass lexer dump
10366 (Session::dump_lex): New function.
10367 * util/rust-optional.h: Add missing constructor.
10369 2023-02-21 Dave <dme2223@gmail.com>
10371 * ast/rust-item.h: Remoe default location for Visibility class.
10372 * parse/rust-parse-impl.h (Parser::parse_visibility): Pass proper location
10373 when instantiating visibilities.
10375 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10377 * ast/rust-ast-dump.cc (Dump::visit): Fix dumping of fn params.
10379 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10381 * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous string when
10382 dumping statements.
10384 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10386 * ast/rust-ast-dump.cc: Remove unused include.
10388 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10390 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10391 * ast/rust-ast-dump.h: Likewise.
10393 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10395 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10397 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10399 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10401 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10403 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10405 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10407 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10409 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10411 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10413 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10415 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10417 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10419 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10420 * ast/rust-ast-dump.h: Add missing getter declaration.
10421 * ast/rust-ast-full-test.cc (BareFunctionType::as_string): Fix bare function
10422 string representation.
10423 * ast/rust-type.h (class BareFunctionType): Declare said getter.
10425 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10427 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
10429 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10431 * ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor.
10433 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10435 * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor.
10437 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10439 * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor.
10441 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10443 * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor
10445 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10447 * ast/rust-ast-dump.cc (Dump::visit): Add missing slice visitor.
10449 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10451 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors.
10452 * ast/rust-ast-dump.h: Likewise.
10453 * ast/rust-ast.h: Add `get_lifetime_bounds` method.
10454 * ast/rust-item.h: Add missing getter for lifetimes.
10455 * ast/rust-type.h: Likewise.
10457 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10459 * ast/rust-ast-dump.cc (Dump::visit): Add new reference visitor wrapper.
10460 * ast/rust-ast-dump.h: Declare it.
10461 * ast/rust-item.h: Add mutable visibility getters.
10463 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10465 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call
10468 2023-02-21 Dave <dme2223@gmail.com>
10470 * ast/rust-item.h: Add location member.
10471 * hir/rust-ast-lower.cc (translate_visibility): Pass location argument.
10472 * hir/tree/rust-hir-item.h: Fix constructor to accept Location argument.
10474 2023-02-21 Raiki Tamura <tamaron1203@gmail.com>
10476 * util/rust-lang-item.h: Add handling for `phantom_data` lang item.
10478 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10480 * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures.
10482 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10484 * ast/rust-ast-dump.h: Fix documentation.
10486 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10488 * ast/rust-ast-dump.cc (Dump::go): Use new API.
10489 (Dump::format_function_param): Refactor.
10490 (Dump::visit_items_joined_by_separator): New function.
10491 (Dump::emit_attrib): Refactor.
10492 (Dump::visit_as_line): New function.
10493 (Dump::visit_items_as_lines): Likewise.
10494 (Dump::visit_items_as_block): Likewise.
10495 (Dump::visit): Use new API.
10496 (Dump::emit_visibility): Likewise.
10497 (Dump::emit_indented_string): Likewise.
10498 (Dump::emit_generic_params): Likewise.
10499 (Dump::format_tuple_field): Likewise.
10500 (Dump::format_struct_field): Likewise.
10501 (Dump::format_function_common): Likewise.
10502 (Dump::visit_function_common): Likewise.
10503 * ast/rust-ast-dump.h: Declare new functions and add documentation.
10505 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10507 * ast/rust-ast-dump.cc (Dump::visit): Add new visit function for overloading.
10508 * ast/rust-ast-dump.h: Add documentation for layer.
10510 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10512 * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): Declare atomic
10514 * backend/rust-compile-intrinsic.cc (atomic_load_handler_inner): New handler.
10515 (atomic_load_handler): Likewise.
10516 (unchecked_op_handler): Remove `static` function qualifier.
10517 (build_atomic_builtin_name): Handle load intrinsics.
10518 (atomic_store_handler_inner): New handler.
10520 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10522 * backend/rust-compile-intrinsic.cc (check_for_basic_integer_type): New function.
10523 (build_atomic_builtin_name): Use HIR Type instead of `tree`.
10524 (atomic_store_handler_inner): Cleanup error handling.
10525 (unchecked_op_inner): Likewise.
10527 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10529 * backend/rust-compile-intrinsic.cc (wrapping_op_handler): Refactor to return
10530 an `std::function`.
10531 (wrapping_op_handler_inner): Rename.
10532 (wrapping_add_handler): Remove function.
10533 (wrapping_sub_handler): Likewise.
10534 (wrapping_mul_handler): Likewise.
10536 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10538 * backend/rust-compile-intrinsic.cc (is_basic_integer_type): New function.
10539 (unchecked_op_inner): New handler.
10540 (unchecked_op_handler): New handler.
10542 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10544 * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): New function.
10545 (BuiltinsContext::setup): Call `setup_atomic_fns`.
10546 * backend/rust-builtins.h: Declare `setup_atomic_fns`.
10547 * backend/rust-compile-intrinsic.cc (atomic_store_handler_inner): New function.
10548 (atomic_store_handler): New handler.
10549 (make_unsigned_long_tree): Add helper around making unsigned long trees.
10550 (prefetch_data_handler): Use `make_unsigned_long_tree`.
10551 (build_atomic_builtin_name): New function.
10553 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10555 * backend/rust-constexpr.cc (build_anon_member_initialization): Workaround uninitialized
10557 (build_data_member_initialization): Likewise.
10559 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10561 * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler.
10563 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10565 * expand/rust-macro-builtins.cc (MacroBuiltin::assert): Rename to...
10566 (MacroBuiltin::assert_handler): ..this.
10567 (MacroBuiltin::file): Rename to...
10568 (MacroBuiltin::file_handler): ..this.
10569 (MacroBuiltin::column): Rename to...
10570 (MacroBuiltin::column_handler): ..this.
10571 (MacroBuiltin::include_bytes): Rename to...
10572 (MacroBuiltin::include_bytes_handler): ..this.
10573 (MacroBuiltin::include_str): Rename to...
10574 (MacroBuiltin::include_str_handler): ..this.
10575 (MacroBuiltin::compile_error): Rename to...
10576 (MacroBuiltin::compile_error_handler): ..this.
10577 (MacroBuiltin::concat): Rename to...
10578 (MacroBuiltin::concat_handler): ..this.
10579 (MacroBuiltin::env): Rename to...
10580 (MacroBuiltin::env_handler): ..this.
10581 (MacroBuiltin::cfg): Rename to...
10582 (MacroBuiltin::cfg_handler): ..this.
10583 (MacroBuiltin::include): Rename to...
10584 (MacroBuiltin::include_handler): ..this.
10585 (MacroBuiltin::line): Rename to...
10586 (MacroBuiltin::line_handler): ..this.
10587 * expand/rust-macro-builtins.h: Rename all handlers.
10588 * util/rust-hir-map.cc (Mappings::insert_macro_def): Use new handler
10591 2023-02-21 Simon Cook <simon.cook@embecosm.com>
10593 * util/rust-inline-visitor.h: Remove some offending system includes.
10595 2023-02-21 YizhePKU <yizhe@pku.edu.cn>
10597 * util/rust-inline-visitor.h: New file.
10599 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10601 * backend/rust-compile-expr.cc (CompileExpr::visit): Refactor checking of closures.
10602 (CompileExpr::generate_possible_fn_trait_call): New function.
10603 * backend/rust-compile-expr.h: Declare `generate_possible_fn_trait_call`.
10605 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10607 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Add missing
10610 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10612 * Make-lang.in: Compile rust-ast-lower-type.cc.
10613 * ast/rust-path.h: Add `get_locus` method to `TypePathFunction`.
10614 * hir/rust-ast-lower-base.cc (ASTLowerTypePath::visit): Move implementation to
10615 rust-ast-lower-type.cc.
10616 (ASTLowerQualifiedPathInType::visit): Likewise.
10617 (ASTLoweringType::visit): Likewise.
10618 * hir/rust-ast-lower-type.h: Move implementations to source file.
10619 * hir/tree/rust-hir-path.h: Likewise.
10620 * hir/rust-ast-lower-type.cc: New file.
10622 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10624 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of
10627 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10629 * backend/rust-compile-context.h: Add new functions: `insert_closure_decl` and
10630 `lookup_closure_decl`.
10631 * backend/rust-compile-expr.cc (CompileExpr::visit): Start compiling Closures properly.
10632 (CompileExpr::generate_closure_function): New function.
10633 (CompileExpr::generate_closure_fntype): Likewise.
10634 * backend/rust-compile-expr.h: Declare `generate_closure_function` and
10635 `generate_closure_fntype`.
10636 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Visit closure types properly.
10637 * backend/rust-mangle.cc (legacy_mangle_name): Add support for closures.
10638 * backend/rust-tree.h (RS_CLOSURE_FLAG): Add new tree macro.
10639 (RS_CLOSURE_TYPE_P): And checking for it on tree nodes.
10640 * typecheck/rust-tyty.cc (ClosureType::is_equal): Add implementation.
10642 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10644 * hir/tree/rust-hir-expr.h: Add `get_params` method.
10645 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Typecheck closure nodes.
10646 (TypeCheckExpr::resolve_fn_trait_call): New function.
10647 * typecheck/rust-hir-type-check-expr.h: Declare `resolve_fn_trait_call` and
10648 `resolve_possible_fn_trait_call_method_name`.
10649 * typecheck/rust-hir-type-check.h: Declare `get_context_type`.
10650 * typecheck/rust-tyctx.cc (TypeCheckContextItem::get_context_type): New function.
10651 * typecheck/rust-tyty-cmp.h: Visit closures properly.
10652 * typecheck/rust-tyty-rules.h: Likewise.
10653 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Add commented out assertin.
10654 (ClosureType::as_string): Implement it.
10655 (ClosureType::clone): Fix closure cloning.
10656 (ClosureType::setup_fn_once_output): New function.
10657 * typecheck/rust-tyty.h: Improve `ClosureType` class and declare `setup_fn_once_output`.
10659 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10661 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Visit closures properly.
10662 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
10663 * checks/lints/rust-lint-marklive.h: Likewise.
10665 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10667 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Simplify method
10668 call type checking by removing visitor and instead using one static cast. Use the
10670 * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
10671 (TypeCheckMethodCallExpr::go): Likewise.
10672 (TypeCheckMethodCallExpr::check): Likewise.
10673 * typecheck/rust-tyty-call.h (class TypeCheckMethodCallExpr): Likewise.
10674 (class Argument): Likewise.
10676 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10678 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Visit closure properly when
10680 (ResolveExpr::resolve_closure_param): Implement closure name resolving.
10681 * resolve/rust-ast-resolve-expr.h: Declare visitors for closure types.
10683 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10685 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::ASTLoweringPattern):
10686 Improve formatting.
10687 (ASTLoweringPattern::translate): Likewise.
10688 * hir/rust-ast-lower-pattern.h: Likewise.
10689 * resolve/rust-ast-resolve-expr.h: Likewise.
10691 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10693 * Make-lang.in: Add new object file for expression lowering.
10694 * ast/rust-expr.h: Move implementation of expr lowering to source file.
10695 * backend/rust-compile-block.h: Likewise.
10696 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
10697 * backend/rust-compile-expr.h: Likewise.
10698 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
10699 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
10700 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
10701 * checks/errors/rust-const-checker.h: Likewise.
10702 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
10703 * checks/errors/rust-unsafe-checker.h: Likewise.
10704 * hir/rust-ast-lower-base.h: Likewise.
10705 * hir/rust-ast-lower-expr.h (RUST_AST_LOWER_EXPR): Likewise.
10706 * hir/rust-ast-lower.cc (ASTLoweringBase::lower_closure_param): Likewise.
10707 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
10708 * hir/rust-hir-dump.h: Likewise.
10709 * hir/tree/rust-hir-expr.h (class ClosureExpr): Likewise.
10710 (class ClosureExprInner): Likewise.
10711 (class ClosureExprInnerTyped): Likewise.
10712 * hir/tree/rust-hir-full-decls.h (class ClosureExprInner): Likewise.
10713 (class ClosureExprInnerTyped): Likewise.
10714 * hir/tree/rust-hir-full-test.cc (ClosureExprInnerTyped::as_string): Likewise.
10715 (ClosureExprInner::as_string): Likewise.
10716 (ClosureExprInner::accept_vis): Likewise.
10717 (ClosureExpr::accept_vis): Likewise.
10718 (ClosureExprInnerTyped::accept_vis): Likewise.
10719 * hir/tree/rust-hir-visitor.h: Likewise.
10720 * hir/tree/rust-hir.h (class Expr): Likewise.
10721 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
10722 * typecheck/rust-hir-type-check-expr.h: Likewise.
10723 * hir/rust-ast-lower-expr.cc: New file.
10725 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10727 * util/rust-lang-item.h: Add handling for `fn_once_output`.
10729 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10731 * ast/rust-ast-fragment.cc (Fragment::Fragment): Add better APIs.
10732 (Fragment::complete): New function.
10733 (Fragment::unexpanded): New function.
10734 * ast/rust-ast-fragment.h: Declare new APIs and add documentation.
10735 * expand/rust-attribute-visitor.h: Use new Fragment API.
10736 * expand/rust-macro-builtins.cc (MacroBuiltin::file): Likewise.
10737 (MacroBuiltin::column): Likewise.
10738 (MacroBuiltin::include_bytes): Likewise.
10739 (MacroBuiltin::include_str): Likewise.
10740 (MacroBuiltin::concat): Likewise.
10741 (MacroBuiltin::env): Likewise.
10742 (MacroBuiltin::cfg): Likewise.
10743 (MacroBuiltin::include): Likewise.
10744 (MacroBuiltin::line): Likewise.
10745 * expand/rust-macro-expand.cc (parse_many): Likewise.
10746 (transcribe_expression): Likewise.
10747 (transcribe_type): Likewise.
10748 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
10750 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10752 * ast/rust-ast.h (class ASTFragment): Remove old ASTFragment class.
10753 * ast/rust-macro.h (class MacroRulesDefinition): Use new Fragment API.
10754 * expand/rust-attribute-visitor.h: Likewise.
10755 * expand/rust-macro-builtins.cc (macro_end_token): Likewise.
10756 (MacroBuiltin::assert): Likewise.
10757 (MacroBuiltin::file): Likewise.
10758 (MacroBuiltin::column): Likewise.
10759 (MacroBuiltin::include_bytes): Likewise.
10760 (MacroBuiltin::include_str): Likewise.
10761 (MacroBuiltin::compile_error): Likewise.
10762 (MacroBuiltin::concat): Likewise.
10763 (MacroBuiltin::env): Likewise.
10764 (MacroBuiltin::cfg): Likewise.
10765 (MacroBuiltin::include): Likewise.
10766 (MacroBuiltin::line): Likewise.
10767 * expand/rust-macro-builtins.h: Likewise.
10768 * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
10769 (MacroExpander::expand_invoc): Likewise.
10770 (MacroExpander::match_repetition): Likewise.
10771 (parse_many): Likewise.
10772 (transcribe_many_items): Likewise.
10773 (transcribe_many_ext): Likewise.
10774 (transcribe_many_trait_items): Likewise.
10775 (transcribe_many_impl_items): Likewise.
10776 (transcribe_many_trait_impl_items): Likewise.
10777 (transcribe_expression): Likewise.
10778 (transcribe_type): Likewise.
10779 (transcribe_on_delimiter): Likewise.
10780 (tokens_to_str): Likewise.
10781 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
10782 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
10784 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10786 * Make-lang.in: Add `rust-ast-fragment.o` object file.
10787 * ast/rust-ast-fragment.cc: New file.
10788 * ast/rust-ast-fragment.h: New file.
10790 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10792 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): Check if a
10793 trait query is currently in progress.
10794 * typecheck/rust-hir-type-check.h (class TraitQueryGuard): Add helpers around
10795 checking for trait queries and inserting them.
10797 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10799 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors for macro definition dumping.
10800 (get_delimiters): New function.
10801 * ast/rust-ast-dump.h: Declare `get_delimiters` and add documentation.
10802 * ast/rust-macro.h: Add `get_token_tree` method.
10804 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10806 * ast/rust-ast-dump.cc (Dump::visit): Properly handle unloaded modules.
10808 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10810 * ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules.
10812 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10814 * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly.
10816 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10818 * ast/rust-ast-dump.cc: Emit visibility when dumping items.
10820 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10822 * hir/rust-ast-lower-base.h (class ItemWrapper): New class.
10823 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Use
10824 `ItemWrapper` class.
10825 (ASTLoweringBase::handle_doc_item_attribute): Likewise.
10826 (ASTLoweringBase::handle_lang_item_attribute): Likewise.
10827 * hir/rust-ast-lower-implitem.h: Check outer attributes on items.
10828 * hir/tree/rust-hir-item.h: Add `get_trait_locus` methods.
10829 * hir/tree/rust-hir.h: Likewise.
10830 * util/rust-hir-map.h: Add defId mappings and associated functions.
10831 * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Implement insertion to said
10833 (Mappings::lookup_trait_item_defid): And looking up said mappings.
10835 2023-02-21 Jakub Dupak <dev@jakubdupak.com>
10837 * ast/rust-ast-dump.cc (Dump::visit): Add code for dumping type aliases.
10839 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10841 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::TraitResolver): Do not nullptr init
10842 `resolved_trait_reference` anymore.
10843 (TraitResolver::resolve_path): Simplify function and rename to...
10844 (TraitResolver::resolve_path_to_trait): ...this.
10845 (TraitResolver::lookup_path): Use new interface.
10846 * typecheck/rust-hir-trait-resolve.h (class TraitResolver): Do not inherit `HIRFullVisitor`
10849 2023-02-21 David Faust <david.faust@oracle.com>
10851 * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs.
10853 2023-02-21 David Faust <david.faust@oracle.com>
10855 * ast/rust-ast-dump.cc (Dump::visit): Add dump for, BorrowExpr, DereferenceExpr,
10856 ErrorPropagationExpr, NegationExpr, TypeCastExpr and GroupedExpr.
10858 2023-02-21 David Faust <david.faust@oracle.com>
10860 * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr.
10862 2023-02-21 David Faust <david.faust@oracle.com>
10864 * ast/rust-ast-dump.cc (Dump::visit): Add dumps for ComparisonExpr and
10867 2023-02-21 David Faust <david.faust@oracle.com>
10869 * ast/rust-ast-dump.cc (Dump::visit): Fix IfExpr formatting.
10871 2023-02-21 David Faust <david.faust@oracle.com>
10873 * ast/rust-ast-dump.cc (Dump::visit): Fix block formatting.
10875 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10877 * typecheck/rust-autoderef.cc: Add support for multiple resolution candidates.
10878 * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver): Edit
10879 `try_result` field and change constructor.
10880 (MethodResolver::Probe): Return set of candidates instead of singular candidate.
10881 (MethodResolver::select): Add better implementation to account for multiple
10883 * typecheck/rust-hir-dot-operator.h (struct MethodCandidate): Overload comparison
10884 operator in order to store them in `std::set`.
10885 * typecheck/rust-hir-inherent-impl-overlap.h: Do not fail assertion on missing type.
10886 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adapt code to use
10887 multiple candidates.
10888 * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): Add code to handle automatic
10890 (reset_cmp_autoderef_mode): Add helper function to reset said mode.
10891 * typecheck/rust-tyty.h (set_cmp_autoderef_mode): Declare function.
10892 (reset_cmp_autoderef_mode): Likewise.
10893 * typecheck/rust-tyty-cmp.h: Add handling of `autoderef_cmp_flag`
10895 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10897 * util/rust-abi.cc (get_abi_from_string): Add missing "rust-call"
10898 possibility for ABI variant.
10900 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10902 * util/rust-lang-item.h: Add `fn_once` lang item.
10904 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10906 * backend/rust-compile.cc: Add note about missing support for super
10908 * typecheck/rust-tyty.cc (BaseType::satisfies_bound): New function.
10909 (BaseType::bounds_compatible): New function.
10910 (DynamicObjectType::get_object_items): New function.
10911 * typecheck/rust-hir-trait-ref.h: Use new API to perform type resolution
10914 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10916 * Make-lang.in: Compile early name resolver.
10917 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Move macro
10919 * expand/rust-macro-builtins.cc (try_expand_macro_expression): Run ENR
10920 when recursively expanding macros.
10921 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): No longer
10922 perform name resolution in `expand_invoc`.
10923 * expand/rust-macro-expand.h (struct MacroExpander): Keep ENR within
10925 * rust-session-manager.cc (Session::expansion): Run ENR.
10926 * resolve/rust-early-name-resolver.cc: New file.
10927 * resolve/rust-early-name-resolver.h: New file.
10929 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10931 * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class.
10933 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10935 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for
10936 glob import resolving.
10938 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10940 * util/rust-hir-map.h: Add new mappings.
10941 * util/rust-hir-map.cc (Mappings::insert_macro_invocation): Add insertion
10942 function into mappings.
10943 (Mappings::lookup_macro_invocation): Add lookup function for mappings.
10945 2023-02-21 Marc Poulhiès <dkm@kataplop.net>
10947 * parse/rust-parse-impl.h (Parser::parse_stmt_or_expr_without_block):
10948 Check if `expr` is valid after parsing it.
10950 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
10952 * backend/rust-builtins.cc (BuiltinsContext::setup): Declare prefetch
10954 * backend/rust-compile-intrinsic.cc (enum class Prefetch): Add kinds of
10955 prefetch intrinsics.
10956 (prefetch_data_handler): New function.
10957 (prefetch_read_data): Likewise.
10958 (prefetch_write_data): Likewise.
10960 2023-02-21 David Faust <david.faust@oracle.com>
10962 * ast/rust-ast-dump.cc (Dump::visit): Fill empty functions for
10963 structs, enums and unions.
10965 2023-02-21 David Faust <david.faust@oracle.com>
10967 * ast/rust-ast-dump.cc (Dump::format_tuple_field): New.
10968 (Dump::format_struct_field): New.
10969 * ast/rust-ast-dump.h (format_tuple_field): New.
10970 (format_struct_field): New.
10972 2023-02-21 David Faust <david.faust@oracle.com>
10974 * ast/rust-ast-dump.cc (Dump::visit): move generic params dump ...
10975 (Dump::emit_generic_params): ... here.
10976 * ast/rust-ast-dump.h (emit_generic_params): New.
10978 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10980 * typecheck/rust-hir-trait-ref.h (lookup_trait_item): Add lookup
10983 2023-02-21 Philip Herron <philip.herron@embecosm.com>
10985 * backend/rust-compile-expr.cc
10986 (CompileExpr::resolve_method_address): Use auto and minor change
10988 * typecheck/rust-hir-type-check-path.cc
10989 (TypeCheckExpr::resolve_segments): Likewise.
10990 * typecheck/rust-hir-type-check-type.cc: Likewise.
10991 * backend/rust-compile-resolve-path.cc
10992 (HIRCompileBase::query_compile): Likewise. Removecall to
10994 * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): Add
10995 locus initializer in ctor, implement get_defid.
10996 (class PathProbeType::Probe): return a set instead of vector.
10998 (class ReportMultipleCandidateError): Do not inherit from
10999 HIRImplVisitor anymore and remove corresponding impl. Adjust for
11000 change in Probe. Simplify Report handling.
11001 (class PathProbeImplTrait::Probe): Adjust return type.
11003 2023-02-21 Philip Herron <philip.herron@embecosm.com>
11005 * typecheck/rust-hir-type-check-enumitem.cc
11006 (TypeCheckEnumItem::visit): Adjust VariantDef ctor calls with
11008 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
11010 * typecheck/rust-tyty.h (VariantDef): Add defid parameter to ctor.
11012 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
11014 * Make-lang.in: Add `rust-builtins.o` as target
11015 * backend/rust-builtins.h: Refactor to new file.
11016 * backend/rust-builtins.cc: New file.
11018 2023-02-21 David Faust <david.faust@oracle.com>
11020 * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for If
11023 2023-02-21 David Faust <david.faust@oracle.com>
11025 * ast/rust-ast-dump.cc (Dump::visit): Dump assignment and compound
11026 assignment expressions.
11028 2023-02-21 Philip Herron <philip.herron@embecosm.com>
11030 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type):
11031 Check for recursive queries.
11032 * typecheck/rust-hir-type-check.h: New functions: `query_completed`,
11033 `query_in_progress`, `insert_query`.
11034 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Use `query_type` API.
11036 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
11038 * ast/rust-ast-dump.cc (Dump::emit_visibility): New function.
11039 (Dump::visit): Call into `emit_visibility`.
11040 (Dump::format_function_common): Likewise.
11041 * ast/rust-ast-dump.h: Declare `emit_visibility`.
11043 2023-02-21 Arthur Cohen <arthur.cohen@embecosm.com>
11045 * ast/rust-item.h: Rename get_public_vis_type.
11046 * hir/rust-ast-lower.cc (translate_visibility): Use new name.
11048 2023-02-21 Philip Herron <philip.herron@embecosm.com>
11050 * resolve/rust-name-resolver.h: Add miscellenaous item mappings.
11051 * resolve/rust-name-resolver.cc (Resolver::insert_resolved_misc): Use
11053 (Resolver::lookup_resolved_misc): Likewise.
11054 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
11055 Adapt function to insert into miscelleanous mappings.
11056 * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
11057 Allow lookup in miscelleanous mappings in mark-live phase.
11059 2023-02-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
11061 * backend/rust-tree.cc: Include memmodel.h.
11063 2023-02-17 Thomas Schwinge <thomas@codesourcery.com>
11065 * backend/rust-tree.cc: '#include "tm_p.h"'.
11067 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11069 * Make-lang.in: Remove `rust-hir-typecheck-toplevel` object and add
11070 `rust-hir-path-probe` one.
11071 * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver):
11072 Remove no longer used `context` and `mapping` fields, and use new
11074 (MethodResolver::MethodResolver): Likewise.
11075 (MethodResolver::select): Use new `query_type` API.
11076 * typecheck/rust-hir-path-probe.h: New header.
11077 * typecheck/rust-hir-path-probe.cc: New file.
11078 * typecheck/rust-hir-dot-operator.h (class MethodResolver): Remove no
11079 longer used `context` and `mapping` fields, and use new `query_type` API.
11080 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): New function.
11081 * typecheck/rust-hir-type-check-base.h: Declare `query_type` function.
11082 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add debug print.
11083 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::Resolve):
11084 Refactor and make use of new query system.
11085 (TypeCheckTopLevelExternItem::Resolve): Likewise.
11086 (TypeCheckTopLevelExternItem::visit): Likewise.
11087 (TypeCheckTopLevelImplItem::visit): Likewise.
11088 (TypeCheckImplItem::visit): Likewise.
11089 (TypeCheckImplItem::TypeCheckImplItem): Likewise.
11090 (TypeCheckImplItem::Resolve): Likewise.
11091 (TypeCheckImplItemWithTrait::visit): Likewise.
11092 * typecheck/rust-hir-type-check-implitem.h (class TypeCheckTopLevelImplItem): Likewise.
11093 (class TypeCheckImplItemWithTrait): Likewise.
11094 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::TypeCheckItem): Likewise.
11095 (TypeCheckItem::Resolve): Likewise.
11096 (TypeCheckItem::ResolveImplItem): Likewise.
11097 (TypeCheckItem::ResolveImplBlockSelf): Likewise.
11098 (TypeCheckItem::visit): Likewise.
11099 (TypeCheckItem::resolve_impl_item): Likewise.
11100 (TypeCheckItem::resolve_impl_block_substitutions): Likewise.
11101 (TypeCheckItem::resolve_impl_block_self): Likewise.
11102 * typecheck/rust-hir-type-check-item.h: Likewise.
11103 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise.
11104 (TypeCheckExpr::resolve_segments): Likewise.
11105 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
11106 * typecheck/rust-hir-type-check-stmt.h: Likewise.
11107 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::Resolve): Likewise.
11108 (TypeCheckType::visit): Likewise.
11109 (TypeCheckType::resolve_root_path): Likewise.
11110 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
11111 * typecheck/rust-hir-type-check.h: Likewise.
11112 * typecheck/rust-substitution-mapper.h: Likewise.
11113 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
11114 (TypeCheckBase::get_predicate_from_bound): Likewise.
11115 (TypeBoundsMappings::add_bound): Likewise.
11116 * typecheck/rust-tyty-cmp.h: Likewise.
11117 * typecheck/rust-tyty.h: Likewise.
11118 * typecheck/rust-tyty.cc (SubstitutionRef::infer_substitions): Likewise.
11119 (ParamType::resolve): Do not infinite loop anymore.
11120 * util/rust-hir-map.h: Add new `hirImplBlockTypeMappings` and
11121 declare `lookup_impl_block_type`.
11122 * util/rust-hir-map.cc (Mappings::insert_hir_impl_block): Use new
11123 `hirImplBlockTypeMappings`
11124 (Mappings::lookup_impl_block_type): New function.
11126 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11128 * backend/rust-compile-context.h: Add new optional `asm_name` string
11129 argument to `lookup_function_decl`.
11130 * backend/rust-compile-item.cc (CompileItem::visit): Compute assembly
11131 name and pass it to `lookup_function_decl` when calling it.
11133 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11135 * backend/rust-constexpr.cc (eval_store_expression): Remove invalid
11136 assertion on constexpr constructors.
11138 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11140 * backend/rust-compile-expr.h: Formatting.
11142 2023-01-31 liushuyu <liushuyu011@gmail.com>
11144 * ast/rust-ast.h (class MacroInvocData): Store expander as
11145 member of the class.
11146 (class Expr): Add `is_literal` virtual method
11147 * ast/rust-expr.h: Override `is_literal` for `LiteralExpr`s.
11148 * expand/rust-macro-builtins.cc (try_expand_macro_expression): New function.
11149 (try_extract_string_literal_from_fragment): Likewise.
11150 (try_expand_single_string_literal): Likewise.
11151 (try_expand_many_expr): Likewise.
11152 (parse_single_string_literal): Add macro expander as argument.
11153 (MacroBuiltin::include_bytes): Pass expander as argument to
11154 `parse_single_string_literal`.
11155 (MacroBuiltin::include_str): Likewise.
11156 (MacroBuiltin::compile_error): Likewise.
11157 (MacroBuiltin::include): Likewise.
11158 (MacroBuiltin::concat): Likewise and add better error handling.
11159 (MacroBuiltin::env): Likewise.
11160 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Expand
11161 invocations recursively.
11163 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11165 * lang.opt: Add new ``-frust-compile-until` option.
11166 * rust-session-manager.cc (Session::compile_crate): Add stops around
11167 various compilation steps in the pipeline.
11168 * rust-session-manager.h (struct CompileOptions): Add `CompileStep` enum
11171 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11173 * backend/rust-tree.cc (rs_type_quals): Comment out bad assertion
11175 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11177 * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit):
11178 Make static items behave more similarly to const items.
11180 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11182 * backend/rust-compile-item.cc (CompileItem::visit): Const evaluate
11183 static item expressions.
11185 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11187 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Do not lower
11188 null items within modules.
11190 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11192 * util/rust-attributes.cc: Add `macro_use` to list of builtin
11195 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11197 * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Allow
11198 getting an error string from a specific constant context.
11199 (ConstChecker::ctx_allows_default): New function, check if a context
11200 allows default values for Const generics.
11201 (ConstChecker::visit): Call into `ctx_allows_default`.
11202 * checks/errors/rust-const-checker.h: Declare `ctx_allows_default`.
11204 2023-01-31 liushuyu <liushuyu011@gmail.com>
11206 * backend/rust-compile-expr.cc (CompileExpr::visit): Properly formulate
11207 exit condition when compiling while loops.
11209 2023-01-31 Faisal Abbas <90.abbasfaisal@gmail.com>
11211 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Turn
11212 constant item typechecking into a coercion site instead of a unify
11215 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11217 * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with
11220 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11222 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::contains_associated_types):
11223 Check if a type bound predicate contains assocated types.
11224 * typecheck/rust-tyty.h: Declare the above mentioned function.
11225 * typecheck/rust-hir-trait-resolve.cc: Use `contains_associated_types`
11228 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11230 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add
11231 more calls to `rust_debug` for development.
11233 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11235 * backend/rust-compile-base.cc: Improve compilation pipeline and simplify
11238 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11240 * backend/rust-tree.cc (comptypes): Remove some C++ specific checks in
11241 Rust const folder for now.
11243 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11245 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): Add
11246 better unification function with debug calls.
11247 * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): Add more debug
11248 calls and use new unify API.
11249 * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion): Likewise.
11250 (TypeCoercionRules::coerce_borrowed_pointer): Likewise.
11251 (TypeCoercionRules::select): Likewise.
11252 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Likewise.
11253 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item): Likewise.
11254 (TypeCheckBase::coercion_site): Likewise.
11255 (TypeCheckBase::cast_site): Likewise.
11256 * typecheck/rust-hir-type-check-base.h: Likewise.
11257 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
11258 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
11259 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelImplItem::visit): Likewise.
11260 (TypeCheckImplItem::visit): Likewise.
11261 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
11262 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): Likewise.
11263 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
11264 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
11265 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): Likewise.
11266 * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
11267 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
11268 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
11269 * typecheck/rust-tyctx.cc (TypeCheckContext::peek_return_type): Likewise.
11270 * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
11271 * typecheck/rust-tyty-cmp.h: Likewise.
11272 * typecheck/rust-tyty-rules.h: Likewise.
11273 * typecheck/rust-tyty.cc (BaseType::mappings_str): Likewise.
11274 (BaseType::debug): Print type name more clearly.
11275 (BaseType::debug_str): Add new function to print type pointer and name.
11276 (TupleType::get_name): Improve type name fetching function.
11277 (ReferenceType::get_name): Likewise.
11278 (PointerType::get_name): Likewise.
11279 * typecheck/rust-tyty.h: Refactor definitions outside of the header.
11281 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11283 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase):
11284 Remove constructor.
11285 (TypeCheckBase::coercion_site): Add `Location` argument to function.
11286 * typecheck/rust-hir-type-check-base.h: Use `TypeCheckBase::coercion_site`
11287 function with location argument.
11288 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
11289 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
11290 * typecheck/rust-hir-type-check-expr.h (class TypeCheckExpr): Likewise.
11291 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
11292 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
11293 * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
11294 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
11295 (TypeCheckMethodCallExpr::visit): Likewise.
11296 * typecheck/rust-tyty.h: Add missing locus field.
11297 * typecheck/rust-tyty.cc (StructFieldType::clone): Use locus field.
11298 (StructFieldType::monomorphized_clone): Likewise.
11300 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11302 * typecheck/rust-tyctx.cc (TypeCheckContext::pop_return_type): Add
11303 guards around `std::vector<T>.pop_back()`.
11304 (TypeCheckContext::peek_context): Likewise for `std::vector<T>.back()`.
11306 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11307 philberty <philip.herron@embecosm.com>
11309 * ast/rust-ast.h: Improve assertions within ASTFragment API.
11311 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11313 * ast/rust-ast.h: Add assertions and accessors for fragment nodes.
11314 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion
11315 context typo when visiting `InherentImpl` items.
11316 (AttrVisitor::maybe_expand_expr): Use new Fragment accessor to fetch
11317 properly typed node.
11318 (AttrVisitor::maybe_expand_type): Likewise.
11319 * expand/rust-macro-expand.cc (transcribe_type): Emit parse errors
11320 when trying to parse a type.
11322 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11324 * ast/rust-ast-dump.h: Add shorthand `AST::Dump::debug` function to
11325 dump an AST node on `stderr`.
11327 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11328 philberty <philip.herron@embecosm.com>
11330 * expand/rust-macro-expand.cc (parse_many): Return early from parsing
11331 loop if we encounter an error, and emit that error in the meantime.
11333 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11335 * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle
11336 fragments differently based on whether or not we are currently trying
11337 to match a matcher in a repetition context.
11338 (MacroExpander::match_n_matches): Use new `in_repetition` argument
11339 properly when calling `match_matcher`.
11340 * expand/rust-macro-expand.h (MacroExpander::match_matcher): Allow
11341 passing extra `in_repetition` bool argument
11343 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11345 * parse/rust-parse-impl.h: Allow parsing full range expressions without
11348 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11350 * checks/lints/rust-lint-scan-deadcode.h: Do not report public items
11353 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11355 * util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list
11356 of builtin attributes.
11358 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11360 * backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow
11362 (CompileExpr::array_copied_expr): Insert overflow checks logic.
11363 * backend/rust-compile-item.cc (CompileItem::visit): Insert overflow
11365 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Insert
11366 overflow checks logic.
11367 * rust-gcc.cc (Gcc_backend::arithmetic_or_logical_expression): Differentiate
11368 existing function from `arithmetic_or_logical_expression_checked`.
11369 This function does insert perform overflow checks.
11370 (Gcc_backend::arithmetic_or_logical_expression_checked): New
11372 (is_overflowing_expr): New function. Check if an expression is an
11373 overflowing one (ADD, SUB, MUL).
11374 (fetch_overflow_builtins): New function.
11375 * rust-backend.h: Declare `arithmetic_or_logical_expression_checked` in
11376 abstract `Backend` class.
11378 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11380 * backend/rust-builtins.h: Refactor builtin context class and add
11383 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
11385 * rust-gcc.cc (class Bvariable): Move class to `rust-gcc.h` header.
11386 * rust-gcc.h: New file.
11388 2023-01-31 Philip Herron <philip.herron@embecosm.com>
11390 * hir/rust-ast-lower-expr.h: Lower double borrow expressions to two
11391 `HIR::BorrowExpr`s.
11392 * hir/tree/rust-hir-expr.h: Remove `is_double_borrow` field from
11394 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Remove
11395 call to `gcc_unreachable` on double borrow expressions.
11397 2023-01-31 Faisal Abbas <90.abbasfaisal@gmail.com>
11399 * backend/rust-tree.cc : Add new includes.
11400 (scope_chain): New.
11401 (maybe_add_global): New.
11402 (init_modules): New (copied from cp)
11403 (var_in_constexpr_fn): Likewise.
11404 (member_vec_linear_search): Likewise.
11405 (member_vec_binary_search): Likewise.
11406 (is_overloaded_fn): Likewise.
11407 (ovl_make): Likewise.
11408 (lookup_add): Likewise.
11409 (type_memfn_quals): Likewise.
11410 (struct find_parameter_pack_data): Likewise.
11411 (struct conv_type_hasher): Likewise.
11412 (make_conv_op_name): Likewise.
11413 (builtin_pack_fn_p): Likewise.
11414 (builtin_pack_call_p): Likewise.
11415 (has_extra_args_mechanism_p): Likewise.
11416 (find_parameter_packs_r): Likewise.
11417 (WALK_SUBTREE): Likewise.
11418 (type_memfn_rqual): Likewise.
11419 (maybe_add_lang_type_raw): Likewise.
11420 (struct c_fileinfo): Likewise.
11421 (get_fileinfo): Likewise.
11422 (cxx_make_type): Likewise.
11423 (build_min_array_type): Likewise.
11424 (fields_linear_search): Likewise.
11425 (nothrow_spec_p): Likewise.
11426 (maybe_get_fns): Likewise.
11427 (get_fns): Likewise.
11428 (get_first_fn): Likewise.
11429 (dependent_name): Likewise.
11430 (called_fns_equal): Likewise.
11431 (canonical_eh_spec): Likewise.
11432 (rs_tree_code_length): Likewise.
11433 (rs_tree_operand_length): Likewise.
11434 (rs_tree_equal): Likewise.
11435 (publicly_uniquely_derived_p): Likewise.
11436 (comp_except_types): Likewise.
11437 (comp_except_specs): Likewise.
11438 (compparms): Likewise.
11439 (set_array_type_canon): Likewise.
11440 (struct cplus_array_info): Likewise.
11441 (struct cplus_array_hasher): Likewise.
11442 (cplus_array_hasher::hash): Likewise.
11443 (cplus_array_hasher::equal): Likewise.
11444 (is_byte_access_type): Likewise.
11445 (build_cplus_array_type): Likewise.
11446 (rs_build_qualified_type_real): Likewise.
11447 (vector_targets_convertible_p): Likewise.
11448 (comp_array_types): Likewise.
11449 (same_type_ignoring_top_level_qualifiers_p): Likewise.
11450 (comp_ptr_ttypes_const): Likewise.
11451 (similar_type_p): Likewise.
11452 (structural_comptypes): Likewise.
11453 (comptypes): Likewise.
11454 (next_initializable_field): Likewise.
11455 (sufficient_parms_p): Likewise.
11456 (default_ctor_p): Likewise.
11457 (user_provided_p): Likewise.
11458 (type_has_non_user_provided_default_constructor): Likewise.
11459 (default_init_uninitialized_part): Likewise.
11460 (extract_conversion_operator): Likewise.
11461 (get_class_binding_direct): Likewise.
11462 (lang_check_failed): Likewise.
11463 (skip_artificial_parms_for): Likewise.
11464 (in_class_defaulted_default_constructor): Likewise.
11465 (is_instantiation_of_constexpr): Likewise.
11466 (check_for_uninitialized_const_var): Likewise.
11467 (cv_unqualified): Likewise.
11468 (make_tree_vector): Likewise.
11469 (release_tree_vector): Likewise.
11470 (instantiation_dependent_expression_p): Likewise.
11471 (cp_get_callee): Likewise.
11472 (build_nop): Likewise.
11473 (scalarish_type_p): Likewise.
11474 (type_has_nontrivial_copy_init): Likewise.
11475 (build_local_temp): Likewise.
11476 (is_normal_capture_proxy): Likewise.
11477 (reject_gcc_builtin): Likewise.
11478 (is_bitfield_expr_with_lowered_type): Likewise.
11479 (maybe_undo_parenthesized_ref): Likewise.
11480 (fold_offsetof): Likewise.
11481 (char_type_p): Likewise.
11482 (resolve_nondeduced_context): Likewise.
11483 (instantiate_non_dependent_or_null): Likewise.
11484 (resolve_nondeduced_context_or_error): Likewise.
11485 (really_overloaded_fn): Likewise.
11486 (invalid_nonstatic_memfn_p): Likewise.
11487 (strip_top_quals): Likewise.
11488 (cxx_incomplete_type_inform): Likewise.
11489 (cxx_incomplete_type_diagnostic): Likewise.
11490 (decl_constant_var_p): Likewise.
11491 (undeduced_auto_decl): Likewise.
11492 (require_deduced_type): Likewise.
11493 * backend/rust-tree.h (enum c_tree_index): Likewise.
11495 (enum cp_tree_index): Likewise.
11496 (wchar_decl_node): Likewise.
11497 (vtable_entry_type): Likewise.
11498 (delta_type_node): Likewise.
11499 (vtable_index_type): Likewise.
11500 (class_type_node): Likewise.
11501 (unknown_type_node): Likewise.
11502 (init_list_type_node): Likewise.
11503 (explicit_void_list_node): Likewise.
11504 (vtbl_type_node): Likewise.
11505 (vtbl_ptr_type_node): Likewise.
11506 (std_node): Likewise.
11507 (abi_node): Likewise.
11508 (global_namespace): Likewise.
11509 (const_type_info_type_node): Likewise.
11510 (conv_op_marker): Likewise.
11511 (abort_fndecl): Likewise.
11512 (current_aggr): Likewise.
11513 (nullptr_node): Likewise.
11514 (nullptr_type_node): Likewise.
11515 (align_type_node): Likewise.
11516 (char8_type_node): Likewise.
11517 (char16_type_node): Likewise.
11518 (char32_type_node): Likewise.
11519 (wchar_type_node): Likewise.
11520 (underlying_wchar_type_node): Likewise.
11521 (wint_type_node): Likewise.
11522 (signed_size_type_node): Likewise.
11523 (unsigned_ptrdiff_type_node): Likewise.
11524 (intmax_type_node): Likewise.
11525 (uintmax_type_node): Likewise.
11526 (widest_integer_literal_type_node): Likewise.
11527 (widest_unsigned_literal_type_node): Likewise.
11528 (sig_atomic_type_node): Likewise.
11529 (int8_type_node): Likewise.
11530 (int16_type_node): Likewise.
11531 (int32_type_node): Likewise.
11532 (int64_type_node): Likewise.
11533 (uint8_type_node): Likewise.
11534 (c_uint16_type_node): Likewise.
11535 (c_uint32_type_node): Likewise.
11536 (c_uint64_type_node): Likewise.
11537 (int_least8_type_node): Likewise.
11538 (int_least16_type_node): Likewise.
11539 (int_least32_type_node): Likewise.
11540 (int_least64_type_node): Likewise.
11541 (uint_least8_type_node): Likewise.
11542 (uint_least16_type_node): Likewise.
11543 (uint_least32_type_node): Likewise.
11544 (uint_least64_type_node): Likewise.
11545 (int_fast8_type_node): Likewise.
11546 (int_fast16_type_node): Likewise.
11547 (int_fast32_type_node): Likewise.
11548 (int_fast64_type_node): Likewise.
11549 (uint_fast8_type_node): Likewise.
11550 (uint_fast16_type_node): Likewise.
11551 (uint_fast32_type_node): Likewise.
11552 (uint_fast64_type_node): Likewise.
11553 (intptr_type_node): Likewise.
11554 (uintptr_type_node): Likewise.
11555 (truthvalue_type_node): Likewise.
11556 (truthvalue_true_node): Likewise.
11557 (truthvalue_false_node): Likewise.
11558 (char_array_type_node): Likewise.
11559 (char8_array_type_node): Likewise.
11560 (char16_array_type_node): Likewise.
11561 (char32_array_type_node): Likewise.
11562 (wchar_array_type_node): Likewise.
11563 (string_type_node): Likewise.
11564 (const_string_type_node): Likewise.
11565 (default_function_type): Likewise.
11566 (function_name_decl_node): Likewise.
11567 (pretty_function_name_decl_node): Likewise.
11568 (c99_function_name_decl_node): Likewise.
11569 (saved_function_name_decls): Likewise.
11570 (null_node): Likewise.
11571 (ctor_identifier): Likewise.
11572 (complete_ctor_identifier): Likewise.
11573 (base_ctor_identifier): Likewise.
11574 (dtor_identifier): Likewise.
11575 (complete_dtor_identifier): Likewise.
11576 (base_dtor_identifier): Likewise.
11577 (deleting_dtor_identifier): Likewise.
11578 (conv_op_identifier): Likewise.
11579 (delta_identifier): Likewise.
11580 (in_charge_identifier): Likewise.
11581 (vtt_parm_identifier): Likewise.
11582 (as_base_identifier): Likewise.
11583 (this_identifier): Likewise.
11584 (pfn_identifier): Likewise.
11585 (vptr_identifier): Likewise.
11586 (global_identifier): Likewise.
11587 (anon_identifier): Likewise.
11588 (auto_identifier): Likewise.
11589 (decltype_auto_identifier): Likewise.
11590 (init_list_identifier): Likewise.
11591 (for_range__identifier): Likewise.
11592 (for_begin__identifier): Likewise.
11593 (for_end__identifier): Likewise.
11594 (for_range_identifier): Likewise.
11595 (for_begin_identifier): Likewise.
11596 (for_end_identifier): Likewise.
11597 (abi_tag_identifier): Likewise.
11598 (aligned_identifier): Likewise.
11599 (begin_identifier): Likewise.
11600 (end_identifier): Likewise.
11601 (get__identifier): Likewise.
11602 (gnu_identifier): Likewise.
11603 (tuple_element_identifier): Likewise.
11604 (tuple_size_identifier): Likewise.
11605 (type_identifier): Likewise.
11606 (value_identifier): Likewise.
11607 (fun_identifier): Likewise.
11608 (closure_identifier): Likewise.
11609 (heap_uninit_identifier): Likewise.
11610 (heap_identifier): Likewise.
11611 (heap_deleted_identifier): Likewise.
11612 (heap_vec_uninit_identifier): Likewise.
11613 (heap_vec_identifier): Likewise.
11614 (omp_identifier): Likewise.
11615 (lang_name_c): Likewise.
11616 (lang_name_cplusplus): Likewise.
11617 (empty_except_spec): Likewise.
11618 (noexcept_true_spec): Likewise.
11619 (noexcept_false_spec): Likewise.
11620 (noexcept_deferred_spec): Likewise.
11621 (terminate_fn): Likewise.
11622 (call_unexpected_fn): Likewise.
11623 (get_exception_ptr_fn): Likewise.
11624 (begin_catch_fn): Likewise.
11625 (end_catch_fn): Likewise.
11626 (allocate_exception_fn): Likewise.
11627 (free_exception_fn): Likewise.
11628 (throw_fn): Likewise.
11629 (rethrow_fn): Likewise.
11630 (atexit_fn_ptr_type_node): Likewise.
11631 (atexit_node): Likewise.
11632 (dso_handle_node): Likewise.
11633 (dynamic_cast_node): Likewise.
11634 (cleanup_type): Likewise.
11635 (vtt_parm_type): Likewise.
11636 (any_targ_node): Likewise.
11637 (source_location_impl): Likewise.
11638 (OVL_FUNCTION): Likewise.
11639 (OVL_CHAIN): Likewise.
11640 (OVL_DEDUP_P): Likewise.
11641 (OVL_USING_P): Likewise.
11642 (OVL_HIDDEN_P): Likewise.
11643 (OVL_NESTED_P): Likewise.
11644 (OVL_LOOKUP_P): Likewise.
11645 (OVL_EXPORT_P): Likewise.
11646 (OVL_FIRST): Likewise.
11647 (OVL_NAME): Likewise.
11649 (OVL_SINGLE_P): Likewise.
11650 (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise.
11651 (CLASSTYPE_LAZY_DEFAULT_CTOR): Likewise.
11652 (CLASSTYPE_CONSTRUCTORS): Likewise.
11653 (ATTR_IS_DEPENDENT): Likewise.
11654 (ABI_TAG_IMPLICIT): Likewise.
11655 (PARENTHESIZED_LIST_P): Likewise.
11656 (DECL_DEPENDENT_P): Likewise.
11657 (USING_DECL_SCOPE): Likewise.
11658 (USING_DECL_DECLS): Likewise.
11659 (USING_DECL_TYPENAME_P): Likewise.
11660 (USING_DECL_UNRELATED_P): Likewise.
11661 (DECL_DECLARES_FUNCTION_P): Likewise.
11662 (DECL_DECLARES_TYPE_P): Likewise.
11663 (IDENTIFIER_KIND_BIT_0): Likewise.
11664 (IDENTIFIER_KIND_BIT_1): Likewise.
11665 (IDENTIFIER_KIND_BIT_2): Likewise.
11666 (IDENTIFIER_MARKED): Likewise.
11667 (IDENTIFIER_VIRTUAL_P): Likewise.
11668 (IDENTIFIER_KEYWORD_P): Likewise.
11669 (IDENTIFIER_CDTOR_P): Likewise.
11670 (IDENTIFIER_CTOR_P): Likewise.
11671 (IDENTIFIER_DTOR_P): Likewise.
11672 (IDENTIFIER_ANY_OP_P): Likewise.
11673 (IDENTIFIER_OVL_OP_P): Likewise.
11674 (IDENTIFIER_ASSIGN_OP_P): Likewise.
11675 (IDENTIFIER_CONV_OP_P): Likewise.
11676 (IDENTIFIER_NEWDEL_OP_P): Likewise.
11677 (IDENTIFIER_NEW_OP_P): Likewise.
11678 (CLASSTYPE_DIAMOND_SHAPED_P): Likewise.
11679 (CLASSTYPE_REPEATED_BASE_P): Likewise.
11680 (CLASSTYPE_KEY_METHOD): Likewise.
11681 (CLASSTYPE_MEMBER_VEC): Likewise.
11682 (CLASSTYPE_DECL_LIST): Likewise.
11683 (CLASSTYPE_DESTRUCTOR): Likewise.
11684 (CLASSTYPE_HAS_PRIMARY_BASE_P): Likewise.
11685 (CLASSTYPE_PRIMARY_BINFO): Likewise.
11686 (CLASSTYPE_VBASECLASSES): Likewise.
11687 (CLASSTYPE_AS_BASE): Likewise.
11688 (DECL_CONV_FN_P): Likewise.
11689 (DECL_CONV_FN_TYPE): Likewise.
11690 (same_type_p): Likewise.
11691 (WILDCARD_TYPE_P): Likewise.
11692 (MAYBE_CLASS_TYPE_P): Likewise.
11693 (FUNCTION_REF_QUALIFIED): Likewise.
11694 (FUNCTION_RVALUE_QUALIFIED): Likewise.
11695 (TYPE_PTRMEMFUNC_FN_TYPE): Likewise.
11696 (TYPE_PTRMEMFUNC_FN_TYPE_RAW): Likewise.
11697 (TYPE_DEPENDENT_P): Likewise.
11698 (TYPE_DEPENDENT_P_VALID): Likewise.
11699 (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise.
11700 (TYPE_RAISES_EXCEPTIONS): Likewise.
11701 (IDENTIFIER_BINDING): Likewise.
11702 (LANG_IDENTIFIER_CAST): Likewise.
11703 (IF_COND): Likewise.
11704 (THEN_CLAUSE): Likewise.
11705 (ELSE_CLAUSE): Likewise.
11706 (IF_SCOPE): Likewise.
11707 (IF_STMT_CONSTEXPR_P): Likewise.
11708 (IF_STMT_CONSTEVAL_P): Likewise.
11709 (DECLTYPE_TYPE_EXPR): Likewise.
11710 (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise.
11711 (CLASSTYPE_INTERFACE_ONLY): Likewise.
11712 (TYPE_NAME_STRING): Likewise.
11713 (TYPE_NAME_LENGTH): Likewise.
11714 (CONSTRAINT_VAR_P): Likewise.
11715 (KOENIG_LOOKUP_P): Likewise.
11716 (DECL_PARM_INDEX): Likewise.
11717 (DECL_PARM_LEVEL): Likewise.
11718 (CONV_IMPLICIT): Likewise.
11719 (CONV_STATIC): Likewise.
11720 (CONV_CONST): Likewise.
11721 (CONV_REINTERPRET): Likewise.
11722 (CONV_PRIVATE): Likewise.
11723 (CONV_FORCE_TEMP): Likewise.
11724 (CONV_FOLD): Likewise.
11725 (CONV_OLD_CONVERT): Likewise.
11726 (CONV_C_CAST): Likewise.
11727 (CONV_BACKEND_CONVERT): Likewise.
11728 (WANT_INT): Likewise.
11729 (WANT_FLOAT): Likewise.
11730 (WANT_ENUM): Likewise.
11731 (WANT_POINTER): Likewise.
11732 (WANT_NULL): Likewise.
11733 (WANT_VECTOR_OR_COMPLEX): Likewise.
11734 (WANT_ARITH): Likewise.
11735 (COMPARE_STRICT): Likewise.
11736 (COMPARE_BASE): Likewise.
11737 (COMPARE_DERIVED): Likewise.
11738 (COMPARE_REDECLARATION): Likewise.
11739 (COMPARE_STRUCTURAL): Likewise.
11740 (SF_DEFAULT): Likewise.
11741 (SF_PRE_PARSED): Likewise.
11742 (SF_INCLASS_INLINE): Likewise.
11743 (SD_UNINITIALIZED): Likewise.
11744 (SD_INITIALIZED): Likewise.
11745 (SD_DECOMPOSITION): Likewise.
11746 (SD_DEFAULTED): Likewise.
11747 (SD_DELETED): Likewise.
11748 (TYPE_PTRDATAMEM_P): Likewise.
11749 (RS_TYPE_CONST_P): Likewise.
11750 (TYPE_MAIN_DECL): Likewise.
11751 (DECL_NONTRIVIALLY_INITIALIZED_P): Likewise.
11752 (DECL_DEFAULTED_FN): Likewise.
11753 (TYPE_HAS_USER_CONSTRUCTOR): Likewise.
11754 (DECL_INITIALIZED_IN_CLASS_P): Likewise.
11755 (DECL_DEFAULTED_IN_CLASS_P): Likewise.
11756 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Likewise.
11757 (DECL_HAS_IN_CHARGE_PARM_P): Likewise.
11758 (DECL_HAS_VTT_PARM_P): Likewise.
11759 (FUNCTION_FIRST_USER_PARMTYPE): Likewise.
11760 (FUNCTION_FIRST_USER_PARM): Likewise.
11761 (DECL_CONSTRUCTOR_P): Likewise.
11762 (DECL_DELETED_FN): Likewise.
11763 (BRACE_ENCLOSED_INITIALIZER_P): Likewise.
11764 (DECL_IMMEDIATE_FUNCTION_P): Likewise.
11765 (SET_DECL_IMMEDIATE_FUNCTION_P): Likewise.
11766 (CONSTRUCTOR_MUTABLE_POISON): Likewise.
11767 (PTRMEM_CST_MEMBER): Likewise.
11768 (REF_PARENTHESIZED_P): Likewise.
11769 (TYPE_PTRMEM_P): Likewise.
11770 (TYPE_PTR_OR_PTRMEM_P): Likewise.
11771 (DECL_DECOMPOSITION_P): Likewise.
11772 (DECL_DECOMP_BASE): Likewise.
11773 (DECL_MAYBE_IN_CHARGE_CDTOR_P): Likewise.
11774 (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
11775 (DECL_CLONED_FUNCTION_P): Likewise.
11776 (DECL_CLONED_FUNCTION): Likewise.
11777 (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
11778 (cp_function_chain): Likewise.
11779 (cdtor_label): Likewise.
11780 (current_class_ptr): Likewise.
11781 (current_class_ref): Likewise.
11782 (current_eh_spec_block): Likewise.
11783 (current_in_charge_parm): Likewise.
11784 (current_vtt_parm): Likewise.
11785 (current_retval_sentinel): Likewise.
11786 (current_function_returns_value): Likewise.
11787 (current_function_returns_null): Likewise.
11788 (current_function_returns_abnormally): Likewise.
11789 (current_function_infinite_loop): Likewise.
11790 (in_base_initializer): Likewise.
11791 (in_function_try_handler): Likewise.
11792 (current_function_return_value): Likewise.
11793 (current_class_type): Likewise.
11794 (TYPE_BEING_DEFINED): Likewise.
11795 (DECL_STATIC_FUNCTION_P): Likewise.
11796 (DECL_FUNCTION_MEMBER_P): Likewise.
11797 (LANG_DECL_MIN_CHECK): Likewise.
11798 (LANG_DECL_FN_CHECK): Likewise.
11799 (LANG_DECL_NS_CHECK): Likewise.
11800 (LANG_DECL_PARM_CHECK): Likewise.
11801 (LANG_DECL_DECOMP_CHECK): Likewise.
11802 (RS_INTEGRAL_TYPE_P): Likewise.
11803 (STAT_HACK_P): Likewise.
11804 (STAT_TYPE_VISIBLE_P): Likewise.
11805 (STAT_TYPE): Likewise.
11806 (STAT_DECL): Likewise.
11807 (STAT_VISIBLE): Likewise.
11808 (MAYBE_STAT_DECL): Likewise.
11809 (MAYBE_STAT_TYPE): Likewise.
11810 (STAT_TYPE_HIDDEN_P): Likewise.
11811 (STAT_DECL_HIDDEN_P): Likewise.
11812 (class warning_sentinel): Likewise.
11813 (struct uid_sensitive_constexpr_evaluation_checker): Likewise.
11814 (class iloc_sentinel): Likewise.
11815 (struct GTY): Likewise.
11816 (struct named_decl_hash): Likewise.
11817 (enum lang_decl_selector): Likewise.
11818 (LANG_DECL_HAS_MIN): Likewise.
11819 (struct named_label_entry): Likewise.
11820 (struct named_label_hash): Likewise.
11821 (enum ref_operator): Likewise.
11822 (struct c_fileinfo): Likewise.
11823 (class ovl_iterator): Likewise.
11824 (class lkp_iterator): Likewise.
11825 (enum rs_ref_qualifier): Likewise.
11826 (enum tsubst_flags): Likewise.
11827 (enum cp_identifier_kind): Likewise.
11828 (enum tag_types): Likewise.
11829 (enum compare_bounds_t): Likewise.
11830 (mark_rvalue_use): Likewise.
11831 (type_unknown_p): Likewise.
11832 (init_modules): Likewise.
11833 (var_in_constexpr_fn): Likewise.
11834 (ovl_first): Likewise.
11835 (lookup_add): Likewise.
11836 (ovl_make): Likewise.
11837 (is_overloaded_fn): Likewise.
11838 (maybe_add_lang_type_raw): Likewise.
11839 (type_memfn_rqual): Likewise.
11840 (builtin_pack_fn_p): Likewise.
11841 (make_conv_op_name): Likewise.
11842 (type_memfn_quals): Likewise.
11843 (get_fileinfo): Likewise.
11844 (cxx_make_type): Likewise.
11845 (build_cplus_array_type): Likewise.
11846 (is_byte_access_type): Likewise.
11847 (comptypes): Likewise.
11848 (canonical_eh_spec): Likewise.
11849 (cp_tree_operand_length): Likewise.
11850 (rs_tree_equal): Likewise.
11851 (compparms): Likewise.
11852 (rs_build_qualified_type_real): Likewise.
11853 (rs_build_qualified_type): Likewise.
11854 (cv_qualified_p): Likewise.
11855 (similar_type_p): Likewise.
11856 (vector_targets_convertible_p): Likewise.
11857 (same_type_ignoring_top_level_qualifiers_p): Likewise.
11858 (comp_ptr_ttypes_const): Likewise.
11859 (get_class_binding_direct): Likewise.
11860 (skip_artificial_parms_for): Likewise.
11861 (lang_check_failed): Likewise.
11862 (default_init_uninitialized_part): Likewise.
11863 (type_has_non_user_provided_default_constructor): Likewise.
11864 (default_ctor_p): Likewise.
11865 (user_provided_p): Likewise.
11866 (sufficient_parms_p): Likewise.
11867 (next_initializable_field): Likewise.
11868 (in_class_defaulted_default_constructor): Likewise.
11869 (is_instantiation_of_constexpr): Likewise.
11870 (check_for_uninitialized_const_var): Likewise.
11871 (reduced_constant_expression_p): Likewise.
11872 (cv_unqualified): Likewise.
11873 (cp_get_callee): Likewise.
11874 (cp_get_callee_fndecl_nofold): Likewise.
11875 (is_nondependent_static_init_expression): Likewise.
11876 (maybe_constant_init): Likewise.
11877 (build_nop): Likewise.
11878 (scalarish_type_p): Likewise.
11879 (is_bitfield_expr_with_lowered_type): Likewise.
11880 (convert_bitfield_to_declared_type): Likewise.
11881 (cp_fold_maybe_rvalue): Likewise.
11882 (maybe_undo_parenthesized_ref): Likewise.
11883 (fold_offsetof): Likewise.
11884 (cp_truthvalue_conversion): Likewise.
11885 (fold_non_dependent_expr): Likewise.
11886 (char_type_p): Likewise.
11887 (instantiation_dependent_expression_p): Likewise.
11888 (type_has_nontrivial_copy_init): Likewise.
11889 (build_local_temp): Likewise.
11890 (is_normal_capture_proxy): Likewise.
11891 (reject_gcc_builtin): Likewise.
11892 (resolve_nondeduced_context): Likewise.
11893 (cxx_incomplete_type_diagnostic): Likewise.
11894 (cxx_incomplete_type_error): Likewise.
11895 (invalid_nonstatic_memfn_p): Likewise.
11896 (really_overloaded_fn): Likewise.
11897 (resolve_nondeduced_context_or_error): Likewise.
11898 (instantiate_non_dependent_or_null): Likewise.
11899 (cxx_incomplete_type_inform): Likewise.
11900 (strip_top_quals): Likewise.
11901 (undeduced_auto_decl): Likewise.
11902 (require_deduced_type): Likewise.
11903 (decl_constant_var_p): Likewise.
11904 (type_of_this_parm): Likewise.
11905 (class_of_this_parm): Likewise.
11906 (identifier_p): Likewise.
11907 (gnu_vector_type_p): Likewise.
11908 (make_tree_vector): Likewise.
11909 (release_tree_vector): Likewise.
11910 (class releasing_vec): Likewise.
11911 (vec_safe_push): Likewise.
11912 (null_node_p): Likewise.
11913 * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Correctly
11914 set fndecl as constexpr from qualifiers.
11915 (HIRCompileBase::compile_function): Test if fndecl is constexpr.
11916 (HIRCompileBase::compile_constant_item): Set fndecl as constexpr.
11917 * backend/rust-compile-intrinsic.cc : Update include.
11918 (finalize_intrinsic_block): Set fndecl as constexpr.
11919 * backend/rust-constexpr.cc : Update include.
11920 (VERIFY_CONSTANT): New.
11921 (is_instantiation_of_constexpr): New.
11922 (literal_type_p): New.
11923 (verify_constant): New.
11924 (find_array_ctor_elt): New.
11925 (array_index_cmp): New.
11926 (potential_constant_expression_1): New.
11927 (get_nth_callarg): New.
11928 (unshare_constructor): New.
11929 (maybe_save_constexpr_fundef): New.
11934 (struct constexpr_global_ctx): Add new fields.
11935 (constexpr_fundef): New.
11936 (struct constexpr_call): New.
11937 (constexpr_call_hasher : ggc_ptr_hash<constexpr_call>): New.
11938 (enum constexpr_switch_state): New.
11939 (struct constexpr_ctx): Add new fields.
11940 (struct constexpr_fundef_hasher): New.
11941 (constexpr_fundef_table): New.
11942 (constexpr_fundef_hasher::equal): New.
11943 (constexpr_fundef_hasher::hash): New.
11944 (retrieve_constexpr_fundef): New.
11945 (uid_sensitive_constexpr_evaluation_value): New.
11946 (uid_sensitive_constexpr_evaluation_true_counter): New.
11947 (uid_sensitive_constexpr_evaluation_p): New.
11948 (class temp_override): New.
11949 (struct uid_sensitive_constexpr_evaluation_sentinel): New.
11950 (struct uid_sensitive_constexpr_evaluation_checker): New.
11951 (::uid_sensitive_constexpr_evaluation_sentinel): New.
11952 (::uid_sensitive_constexpr_evaluation_checker): New.
11953 (uid_sensitive_constexpr_evaluation_checker::evaluation_restricted_p): New.
11954 (constexpr_call_table): New.
11955 (constexpr_call_hasher::hash): New.
11956 (constexpr_call_hasher::equal): New.
11957 (maybe_initialize_constexpr_call_table): New.
11958 (fundef_copies_table): New.
11959 (get_fundef_copy): New.
11960 (save_fundef_copy): New.
11961 (constexpr_expression): Refactor in ...
11962 (eval_constant_expression): ...this.
11963 (eval_store_expression): Add 3 bool params.
11964 (eval_call_expression): Likewise.
11965 (eval_binary_expression): Likewise.
11966 (eval_statement_list): New.
11967 (extract_string_elt): New.
11968 (eval_conditional_expression): New.
11969 (eval_bit_field_ref): New.
11970 (eval_loop_expr): New.
11971 (eval_switch_expr): New.
11972 (eval_unary_expression): New.
11974 (call_stack_tick): New.
11975 (last_cx_error_tick): New.
11976 (push_cx_call_context): New.
11977 (pop_cx_call_context): New.
11978 (cx_error_context): New.
11979 (fold_expr): Adjust call to eval_constant_expression.
11980 (same_type_ignoring_tlq_and_bounds_p): New.
11981 (union_active_member): Port more for cxx constexpr.
11982 (fold_indirect_ref_1): New.
11983 (rs_fold_indirect_ref): Likewise.
11984 (rs_eval_indirect_ref): New (from corresponding cxx FE file).
11985 (eval_logical_expression): Adjust parameter list.
11986 (lookup_placeholder): New (from corresponding cxx FE file).
11987 (constant_value_1): Remove.
11988 (inline_asm_in_constexpr_error): New (from corresponding cxx FE file).
11989 (verify_ctor_sanity): New.
11990 (get_callee): Remove.
11991 (initialized_type): New.
11992 (maybe_constexpr_fn): Remove.
11993 (init_subob_ctx): New.
11994 (base_field_constructor_elt): New.
11995 (get_or_insert_ctor_field): New.
11996 (eval_vector_conditional_expression): New (from correponding cxx FE file).
11997 (eval_bare_aggregate): New.
11998 (cxx_eval_trinary_expression): New.
11999 (reduced_constant_expression_p): New.
12000 (adjust_temp_type): New.
12001 (free_constructor): New.
12002 (eval_and_check_array_index): New.
12003 (eval_array_reference): New.
12004 (eval_component_reference): New.
12005 (label_matches): New.
12006 (eval_constant_expression): New.
12007 (modifying_const_object_error): New.
12008 (is_empty_field): New.
12009 (eval_store_expression): New.
12010 (eval_binary_expression): New.
12011 (addr_of_non_const_var): New.
12012 (rs_bind_parameters_in_call): New.
12013 (eval_builtin_function_call): New.
12014 (eval_call_expression): New.
12015 (build_anon_member_initialization): New.
12016 (build_data_member_initialization): New.
12017 (constexpr_fn_retval): New.
12018 (constant_value_1): New.
12019 (decl_constant_value): New.
12020 (non_const_var_error): New.
12022 (get_function_named_in_call): New.
12023 (maybe_constexpr_fn): New.
12024 (get_nth_callarg): New.
12025 (var_in_maybe_constexpr_fn): New.
12026 (instantiate_cx_fn_r): New.
12027 (instantiate_constexpr_fns): New.
12028 (array_index_cmp): New.
12029 (unshare_constructor): New.
12030 (find_array_ctor_elt): New.
12031 (verify_constant): New.
12032 (find_heap_var_refs): New.
12033 (find_immediate_fndecl): New.
12034 (diag_array_subscript): New.
12035 (get_array_or_vector_nelts): New.
12036 (eval_and_check_array_index): New.
12037 (extract_string_elt): New.
12038 (is_valid_constexpr_fn): New.
12039 (explain_invalid_constexpr_fn): New.
12040 (register_constexpr_fundef): New.
12041 (maybe_save_constexpr_fundef): New.
12042 (eval_statement_list): New.
12043 (eval_conditional_expression): New.
12044 (eval_bit_field_ref): New.
12049 (eval_loop_expr): New.
12050 (eval_switch_expr): New.
12051 (eval_unary_expression): New.
12052 (cxx_eval_outermost_constant_expr): New.
12053 (is_static_init_expression): New.
12054 (is_constant_expression): New.
12055 (is_nondependent_static_init_expression): New.
12056 (maybe_constant_init_1): New.
12057 (maybe_constant_init): New.
12058 (is_nondependent_constant_expression): New.
12060 (maybe_constant_value): New.
12061 (potential_constant_expression): New.
12062 (struct check_for_return_continue_data): New.
12063 (check_for_return_continue): New.
12064 (decl_namespace_context): New.
12065 (decl_in_std_namespace_p): New.
12066 (is_std_construct_at): New.
12067 (cxx_dynamic_cast_fn_p): New.
12068 (is_std_allocator_allocate): New.
12069 (is_std_allocator_allocate): New.
12070 (potential_constant_expression_1): New.
12071 (potential_constant_expression_1): New.
12072 (fold_non_dependent_init): New.
12073 * backend/rust-constexpr.h (maybe_save_constexpr_fundef): New.
12075 2023-01-31 Arthur Cohen <arthur.cohen@embecosm.com>
12077 * rust-session-manager.cc (Session::compile_crate): Allow the dump of prettified AST
12078 (Session::dump_ast_pretty): New
12079 * rust-session-manager.h: Add new output file for pretty AST dump
12081 2023-01-05 David Malcolm <dmalcolm@redhat.com>
12083 * resolve/rust-ast-resolve-item.cc (selftest::rust_flatten_list):
12084 Remove output to stderr.
12086 2023-01-05 David Malcolm <dmalcolm@redhat.com>
12088 * Make-lang.in (selftest-rust-gdb): New.
12089 (selftest-rust-valgrind): New.
12091 2022-12-20 Marc Poulhiès <dkm@kataplop.net>
12094 * Make-lang.in (rust.serial): New variable.
12095 (rust1$(exeext)): Depend on $(rust.prev). Call LINK_PROGRESS.
12097 2022-12-14 Jakub Jelinek <jakub@redhat.com>
12100 * parse/rust-parse-impl.h (parse_closure_param): Store
12101 pattern->get_locus () in a temporary before std::move (pattern) is
12104 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12106 * CONTRIBUTING.md: New.
12110 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12112 * config-lang.in: New.
12114 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12116 * lang.opt (-frust-incomplete-and-experimental-compiler-do-not-use):
12118 * rust-session-manager.cc (Session::compile_crate): Check it.
12119 * Make-lang.in (RUST_SELFTEST_FLAGS): Add it.
12121 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12123 * Make-lang.in: New.
12125 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12129 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12131 * lang-specs.h: New.
12133 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12135 * rust-lang.cc: New.
12136 * rust-session-manager.cc: New.
12137 * rust-session-manager.h: New.
12139 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12141 * rustspec.cc: New.
12143 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12145 * rust-diagnostics.cc: New.
12146 * rust-diagnostics.h: New.
12147 * rust-gcc-diagnostics.cc: New.
12148 * rust-linemap.cc: New.
12149 * rust-linemap.h: New.
12150 * rust-location.h: New.
12151 * rust-system.h: New.
12153 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12154 David Faust <david.faust@oracle.com>
12155 Faisal Abbas <90.abbasfaisal@gmail.com>
12157 * backend/rust-compile-context.cc: New.
12158 * backend/rust-compile-context.h: New.
12159 * backend/rust-compile.cc: New.
12160 * backend/rust-compile.h: New.
12161 * backend/rust-constexpr.cc: New.
12162 * backend/rust-constexpr.h: New.
12164 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12165 David Faust <david.faust@oracle.com>
12167 * backend/rust-compile-block.cc: New.
12168 * backend/rust-compile-block.h: New.
12169 * backend/rust-compile-expr.cc: New.
12170 * backend/rust-compile-expr.h: New.
12171 * backend/rust-compile-extern.h: New.
12172 * backend/rust-compile-fnparam.cc: New.
12173 * backend/rust-compile-fnparam.h: New.
12174 * backend/rust-compile-implitem.cc: New.
12175 * backend/rust-compile-implitem.h: New.
12176 * backend/rust-compile-intrinsic.cc: New.
12177 * backend/rust-compile-intrinsic.h: New.
12178 * backend/rust-compile-item.cc: New.
12179 * backend/rust-compile-item.h: New.
12180 * backend/rust-compile-pattern.cc: New.
12181 * backend/rust-compile-pattern.h: New.
12182 * backend/rust-compile-resolve-path.cc: New.
12183 * backend/rust-compile-resolve-path.h: New.
12184 * backend/rust-compile-stmt.cc: New.
12185 * backend/rust-compile-stmt.h: New.
12186 * backend/rust-compile-struct-field-expr.cc: New.
12187 * backend/rust-compile-struct-field-expr.h: New.
12188 * backend/rust-compile-type.cc: New.
12189 * backend/rust-compile-type.h: New.
12190 * backend/rust-compile-var-decl.h: New.
12192 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12193 David Faust <david.faust@oracle.com>
12195 * backend/rust-builtins.h: New.
12196 * backend/rust-compile-base.cc: New.
12197 * backend/rust-compile-base.h: New.
12198 * backend/rust-mangle.cc: New.
12199 * backend/rust-mangle.h: New.
12200 * backend/rust-tree.cc: New.
12201 * backend/rust-tree.h: New.
12202 * rust-backend.h: New.
12203 * rust-gcc.cc: New.
12205 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12207 * metadata/rust-export-metadata.cc: New.
12208 * metadata/rust-export-metadata.h: New.
12209 * metadata/rust-extern-crate.cc: New.
12210 * metadata/rust-extern-crate.h: New.
12211 * metadata/rust-import-archive.cc: New.
12212 * metadata/rust-imports.cc: New.
12213 * metadata/rust-imports.h: New.
12214 * rust-object-export.cc: New.
12215 * rust-object-export.h: New.
12217 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12219 * checks/lints/rust-lint-unused-var.cc: New.
12220 * checks/lints/rust-lint-unused-var.h: New.
12222 2022-12-13 Thomas Young <wenzhang5800@gmail.com>
12224 * checks/lints/rust-lint-marklive-base.h: New.
12225 * checks/lints/rust-lint-marklive.cc: New.
12226 * checks/lints/rust-lint-marklive.h: New.
12227 * checks/lints/rust-lint-scan-deadcode.h: New.
12229 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12231 * checks/errors/privacy/rust-privacy-check.cc: New.
12232 * checks/errors/privacy/rust-privacy-check.h: New.
12233 * checks/errors/privacy/rust-privacy-common.h: New.
12234 * checks/errors/privacy/rust-privacy-ctx.cc: New.
12235 * checks/errors/privacy/rust-privacy-ctx.h: New.
12236 * checks/errors/privacy/rust-privacy-reporter.cc: New.
12237 * checks/errors/privacy/rust-privacy-reporter.h: New.
12238 * checks/errors/privacy/rust-pub-restricted-visitor.cc: New.
12239 * checks/errors/privacy/rust-pub-restricted-visitor.h: New.
12240 * checks/errors/privacy/rust-reachability.cc: New.
12241 * checks/errors/privacy/rust-reachability.h: New.
12242 * checks/errors/privacy/rust-visibility-resolver.cc: New.
12243 * checks/errors/privacy/rust-visibility-resolver.h: New.
12245 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12247 * checks/errors/rust-const-checker.cc: New.
12248 * checks/errors/rust-const-checker.h: New.
12250 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12252 * checks/errors/rust-unsafe-checker.cc: New.
12253 * checks/errors/rust-unsafe-checker.h: New.
12255 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12257 * typecheck/rust-autoderef.cc: New.
12258 * typecheck/rust-autoderef.h: New.
12259 * typecheck/rust-casts.cc: New.
12260 * typecheck/rust-casts.h: New.
12261 * typecheck/rust-coercion.cc: New.
12262 * typecheck/rust-coercion.h: New.
12263 * typecheck/rust-hir-dot-operator.cc: New.
12264 * typecheck/rust-hir-dot-operator.h: New.
12265 * typecheck/rust-hir-inherent-impl-overlap.h: New.
12266 * typecheck/rust-hir-path-probe.h: New.
12267 * typecheck/rust-hir-trait-ref.h: New.
12268 * typecheck/rust-hir-type-bounds.h: New.
12269 * typecheck/rust-substitution-mapper.cc: New.
12270 * typecheck/rust-substitution-mapper.h: New.
12271 * typecheck/rust-tycheck-dump.h: New.
12272 * typecheck/rust-tyctx.cc: New.
12273 * typecheck/rust-tyty-bounds.cc: New.
12274 * typecheck/rust-tyty-call.cc: New.
12275 * typecheck/rust-tyty-call.h: New.
12276 * typecheck/rust-tyty-cmp.h: New.
12277 * typecheck/rust-tyty-rules.h: New.
12279 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12281 * typecheck/rust-tyty.cc: New.
12282 * typecheck/rust-tyty.h: New.
12284 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12286 * typecheck/rust-hir-trait-resolve.cc: New.
12287 * typecheck/rust-hir-trait-resolve.h: New.
12288 * typecheck/rust-hir-type-check-base.cc: New.
12289 * typecheck/rust-hir-type-check-base.h: New.
12290 * typecheck/rust-hir-type-check-enumitem.cc: New.
12291 * typecheck/rust-hir-type-check-enumitem.h: New.
12292 * typecheck/rust-hir-type-check-expr.cc: New.
12293 * typecheck/rust-hir-type-check-expr.h: New.
12294 * typecheck/rust-hir-type-check-implitem.cc: New.
12295 * typecheck/rust-hir-type-check-implitem.h: New.
12296 * typecheck/rust-hir-type-check-item.cc: New.
12297 * typecheck/rust-hir-type-check-item.h: New.
12298 * typecheck/rust-hir-type-check-path.cc: New.
12299 * typecheck/rust-hir-type-check-pattern.cc: New.
12300 * typecheck/rust-hir-type-check-pattern.h: New.
12301 * typecheck/rust-hir-type-check-stmt.cc: New.
12302 * typecheck/rust-hir-type-check-stmt.h: New.
12303 * typecheck/rust-hir-type-check-struct-field.h: New.
12304 * typecheck/rust-hir-type-check-struct.cc: New.
12305 * typecheck/rust-hir-type-check-toplevel.cc: New.
12306 * typecheck/rust-hir-type-check-toplevel.h: New.
12307 * typecheck/rust-hir-type-check-type.cc: New.
12308 * typecheck/rust-hir-type-check-type.h: New.
12309 * typecheck/rust-hir-type-check-util.cc: New.
12310 * typecheck/rust-hir-type-check-util.h: New.
12311 * typecheck/rust-hir-type-check.cc: New.
12312 * typecheck/rust-hir-type-check.h: New.
12313 * typecheck/rust-tyty-visitor.h: New.
12315 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12317 * util/rust-canonical-path.h: New.
12318 * util/rust-common.h: New.
12319 * util/rust-hir-map.cc: New.
12320 * util/rust-hir-map.h: New.
12321 * util/rust-identifier.h: New.
12322 * util/rust-lang-item.h: New.
12323 * util/rust-mapping-common.h: New.
12324 * util/rust-stacked-contexts.h: New.
12326 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12328 * util/rust-attributes.cc: New.
12329 * util/rust-attributes.h: New.
12331 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12333 * util/rust-optional-test.cc: New.
12334 * util/rust-optional.h: New.
12336 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12338 * util/rust-base62.cc: New.
12339 * util/rust-base62.h: New.
12341 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12343 * util/rust-abi.cc: New.
12344 * util/rust-abi.h: New.
12346 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12348 * util/fnv-hash.h: New.
12350 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12352 * util/rust-make-unique.h: New.
12354 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12356 * hir/rust-ast-lower-base.cc: New.
12357 * hir/rust-ast-lower-base.h: New.
12358 * hir/rust-ast-lower-block.h: New.
12359 * hir/rust-ast-lower-enumitem.h: New.
12360 * hir/rust-ast-lower-expr.h: New.
12361 * hir/rust-ast-lower-extern.h: New.
12362 * hir/rust-ast-lower-implitem.h: New.
12363 * hir/rust-ast-lower-item.cc: New.
12364 * hir/rust-ast-lower-item.h: New.
12365 * hir/rust-ast-lower-pattern.cc: New.
12366 * hir/rust-ast-lower-pattern.h: New.
12367 * hir/rust-ast-lower-stmt.h: New.
12368 * hir/rust-ast-lower-struct-field-expr.h: New.
12369 * hir/rust-ast-lower-type.h: New.
12370 * hir/rust-ast-lower.cc: New.
12371 * hir/rust-ast-lower.h: New.
12372 * hir/rust-hir-dump.cc: New.
12373 * hir/rust-hir-dump.h: New.
12375 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12377 * hir/tree/rust-hir-full-decls.h: New.
12378 * hir/tree/rust-hir-full-test.cc: New.
12379 * hir/tree/rust-hir-full.h: New.
12380 * hir/tree/rust-hir-visitor.h: New.
12381 * hir/tree/rust-hir.h: New.
12383 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12385 * hir/tree/rust-hir-expr.h: New.
12386 * hir/tree/rust-hir-item.h: New.
12387 * hir/tree/rust-hir-path.h: New.
12388 * hir/tree/rust-hir-pattern.h: New.
12389 * hir/tree/rust-hir-stmt.h: New.
12390 * hir/tree/rust-hir-type.h: New.
12392 2022-12-13 Philip Herron <philip.herron@embecosm.com>
12394 * resolve/rust-ast-resolve-base.cc: New.
12395 * resolve/rust-ast-resolve-base.h: New.
12396 * resolve/rust-ast-resolve-expr.cc: New.
12397 * resolve/rust-ast-resolve-expr.h: New.
12398 * resolve/rust-ast-resolve-implitem.h: New.
12399 * resolve/rust-ast-resolve-item.cc: New.
12400 * resolve/rust-ast-resolve-item.h: New.
12401 * resolve/rust-ast-resolve-path.cc: New.
12402 * resolve/rust-ast-resolve-path.h: New.
12403 * resolve/rust-ast-resolve-pattern.cc: New.
12404 * resolve/rust-ast-resolve-pattern.h: New.
12405 * resolve/rust-ast-resolve-stmt.cc: New.
12406 * resolve/rust-ast-resolve-stmt.h: New.
12407 * resolve/rust-ast-resolve-struct-expr-field.cc: New.
12408 * resolve/rust-ast-resolve-struct-expr-field.h: New.
12409 * resolve/rust-ast-resolve-toplevel.h: New.
12410 * resolve/rust-ast-resolve-type.cc: New.
12411 * resolve/rust-ast-resolve-type.h: New.
12412 * resolve/rust-ast-resolve.cc: New.
12413 * resolve/rust-ast-resolve.h: New.
12414 * resolve/rust-ast-verify-assignee.h: New.
12415 * resolve/rust-name-resolver.cc: New.
12416 * resolve/rust-name-resolver.h: New.
12418 2022-12-13 Arthur Cohen <arthur.cohen@embecosm.com>
12419 Philip Herron <philip.herron@embecosm.com>
12420 Joel Phillips <simplytheother@gmail.com>
12422 * expand/rust-attribute-visitor.cc: New.
12423 * expand/rust-attribute-visitor.h: New.
12424 * expand/rust-macro-builtins.cc: New.
12425 * expand/rust-macro-builtins.h: New.
12426 * expand/rust-macro-expand.cc: New.
12427 * expand/rust-macro-expand.h: New.
12428 * expand/rust-macro-invoc-lexer.cc: New.
12429 * expand/rust-macro-invoc-lexer.h: New.
12430 * expand/rust-macro-substitute-ctx.cc: New.
12431 * expand/rust-macro-substitute-ctx.h: New.
12433 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12434 Philip Herron <philip.herron@embecosm.com>
12435 Arthur Cohen <arthur.cohen@embecosm.com>
12437 * parse/rust-parse-impl.h: New, second half.
12439 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12440 Philip Herron <philip.herron@embecosm.com>
12441 Arthur Cohen <arthur.cohen@embecosm.com>
12443 * parse/rust-cfg-parser.cc: New.
12444 * parse/rust-cfg-parser.h: New.
12445 * parse/rust-parse-impl.h: New.
12446 * parse/rust-parse.cc: New.
12447 * parse/rust-parse.h: New.
12449 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12450 Philip Herron <philip.herron@embecosm.com>
12451 Arthur Cohen <arthur.cohen@embecosm.com>
12452 Mark Wielaard <mark@klomp.org>
12454 * lex/rust-codepoint.h: New.
12455 * lex/rust-lex.cc: New.
12456 * lex/rust-lex.h: New.
12457 * lex/rust-token.cc: New.
12458 * lex/rust-token.h: New.
12459 * rust-buffered-queue.h: New.
12461 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12462 Philip Herron <philip.herron@embecosm.com>
12463 Arthur Cohen <arthur.cohen@embecosm.com>
12465 * ast/rust-ast-dump.cc: New.
12466 * ast/rust-ast-dump.h: New.
12467 * ast/rust-ast-visitor.h: New.
12468 * ast/rust-cond-compilation.h: New.
12470 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12471 Philip Herron <philip.herron@embecosm.com>
12473 * ast/rust-expr.h: New.
12474 * ast/rust-macro.h: New.
12475 * ast/rust-path.h: New.
12476 * ast/rust-pattern.h: New.
12477 * ast/rust-stmt.h: New.
12478 * ast/rust-type.h: New.
12480 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12481 Philip Herron <philip.herron@embecosm.com>
12483 * ast/rust-item.h: New.
12485 2022-12-13 Joel Phillips <simplytheother@gmail.com>
12486 Philip Herron <philip.herron@embecosm.com>
12487 Arthur Cohen <arthur.cohen@embecosm.com>
12489 * ast/rust-ast-full-decls.h: New.
12490 * ast/rust-ast-full-test.cc: New.
12491 * ast/rust-ast-full.h: New.
12492 * ast/rust-ast.h: New.
12496 Copyright (C) 2022-2024 Free Software Foundation, Inc.
12498 Copying and distribution of this file, with or without modification,
12499 are permitted in any medium without royalty provided the copyright
12500 notice and this notice are preserved.