Debian Codegraph @

gcc/rust/ChangeLog

raw
1 2026-06-12 Release Manager
2
3 * GCC 15.3.0 released.
4
5 2025-08-08 Release Manager
6
7 * GCC 15.2.0 released.
8
9 2025-07-18 Martin Jambor <[email protected]>
10
11 Backported from master:
12 2025-06-26 Martin Jambor <[email protected]>
13
14 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
15 (BorrowCheckerDiagnostics::get_loan): Type cast loan to uint32_t.
16
17 2025-07-18 Owen Avery <[email protected]>
18
19 Backported from master:
20 2025-04-28 Owen Avery <[email protected]>
21
22 * checks/errors/borrowck/rust-bir-place.h
23 (IndexVec::size_type): Add.
24 (IndexVec::MAX_INDEX): Add.
25 (IndexVec::size): Change the return type to the type of the
26 internal value used by the index type.
27 (PlaceDB::lookup_or_add_variable): Use the return value from the
28 PlaceDB::add_place call.
29 * checks/errors/borrowck/rust-bir.h
30 (struct BasicBlockId): Move this definition before the
31 definition of the struct Function.
32
33 2025-07-08 Arthur Cohen <[email protected]>
34
35 * resolve/rust-late-name-resolver-2.0.cc (Late::Late): False initialize the
36 funny_error field.
37
38 2025-04-25 Release Manager
39
40 * GCC 15.1.0 released.
41
42 2025-04-14 Arthur Cohen <[email protected]>
43
44 * util/rust-lang-item.h: Add new manually_drop lang item.
45 * util/rust-lang-item.cc: Likewise.
46
47 2025-04-14 Arthur Cohen <[email protected]>
48
49 * util/rust-attribute-values.h: Add RUSTFMT value.
50 * util/rust-attributes.cc: Define the attribute.
51 * util/rust-attributes.h (enum CompilerPass): Add EXTERNAL variant.
52 * expand/rust-macro-builtins.cc: Fix formatting.
53
54 2025-04-14 Arthur Cohen <[email protected]>
55
56 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): Remove assertion.
57
58 2025-04-14 Arthur Cohen <[email protected]>
59
60 * util/rust-attribute-values.h: Add missing attributes.
61 * util/rust-attributes.cc: Likewise.
62 * util/rust-attributes.h (enum CompilerPass): Mention adding something for const
63 functions.
64
65 2025-04-14 beamandala <[email protected]>
66
67 * expand/rust-macro-builtins.cc (MacroBuiltin::builtin_transcribers):
68 Add entry for track_caller.
69 * util/rust-attribute-values.h: add `TRACK_CALLER` attribute.
70 * util/rust-attributes.cc: add `track_caller` attribute definition.
71
72 2025-04-14 Owen Avery <[email protected]>
73
74 * checks/errors/rust-const-checker.cc
75 (ConstChecker::visit): Visit the enum items of enums.
76 * resolve/rust-ast-resolve-item.cc
77 (ResolveItem::visit): Resolve enum discriminants during nr1.0.
78
79 2025-04-14 Arthur Cohen <[email protected]>
80
81 * expand/rust-macro-builtins-format-args.cc (format_args_parse_arguments): Improve safety,
82 allow extra commas after end of argument list.
83
84 2025-04-14 Arthur Cohen <[email protected]>
85
86 * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Call into
87 TokenTreeDesugar.
88 * expand/rust-token-tree-desugar.cc: New file.
89 * expand/rust-token-tree-desugar.h: New file.
90 * Make-lang.in: Compile them.
91
92 2025-04-14 Arthur Cohen <[email protected]>
93
94 * expand/rust-macro-expand.cc (MacroExpander::match_n_matches): Do not
95 insert fragments and substack fragments if the matcher failed.
96
97 2025-04-14 Arthur Cohen <[email protected]>
98
99 * rust-session-manager.cc (Session::compile_crate): Call the visitor later in the pipeline.
100
101 2025-04-14 Arthur Cohen <[email protected]>
102
103 * ast/rust-ast.h (DelimTokenTree::get_locus): New function.
104
105 2025-04-14 Arthur Cohen <[email protected]>
106
107 * ast/rust-expr.h (class RangeExpr): Add empty outer attributes and allow getting them
108 and setting them.
109
110 2025-04-14 Arthur Cohen <[email protected]>
111
112 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Return if module
113 is unloaded.
114
115 2025-04-14 Arthur Cohen <[email protected]>
116
117 * typecheck/rust-hir-type-check-expr.cc (is_default_fn): New.
118 (emit_ambiguous_resolution_error): New.
119 (handle_multiple_candidates): Properly handle multiple candidates in
120 the case of specialization.
121 (TypeCheckExpr::visit): Call `handle_multiple_candidates`.
122
123 2025-04-14 Andrew Pinski <[email protected]>
124
125 PR rust/119342
126 * rust-gcc.cc (block): Add comment on why chaining
127 the variables of the scope toether.
128
129 2025-04-14 Andrew Pinski <[email protected]>
130
131 PR rust/119341
132 * rust-gcc.cc (function_type): Use range fors.
133 (function_type_variadic): Likewise.
134 (fill_in_fields): Likewise.
135 (statement_list): Likewise.
136 (block): Likewise.
137 (block_add_statements): Likewise.
138 (function_set_parameters): Likewise.
139 (write_global_definitions): Likewise.
140
141 2025-04-14 Andrew Pinski <[email protected]>
142
143 * rust-gcc.cc (Bvariable::get_tree): Use error_operand_p.
144 (pointer_type): Likewise.
145 (reference_type): Likewise.
146 (immutable_type): Likewise.
147 (function_type): Likewise.
148 (function_type_variadic): Likewise.
149 Cleanup the check for receiver.type first.
150 (function_ptr_type): Use error_operand_p.
151 (fill_in_fields): Likewise.
152 (fill_in_array): Likewise.
153 (named_type): Likewise.
154 (type_size): Likewise.
155 (type_alignment): Likewise.
156 (type_field_alignment): Likewise.
157 (type_field_offset): Likewise.
158 (zero_expression): Likewise.
159 (float_constant_expression): Likewise.
160 (convert_expression): Likewise.
161 (struct_field_expression): Likewise.
162 (compound_expression): Likewise.
163 (conditional_expression): Likewise.
164 (negation_expression): Likewise.
165 (arithmetic_or_logical_expression): Likewise.
166 (arithmetic_or_logical_expression_checked): Likewise.
167 (comparison_expression): Likewise.
168 (lazy_boolean_expression): Likewise.
169 (constructor_expression): Likewise.
170 (array_constructor_expression): Likewise.
171 (array_index_expression): Likewise.
172 (call_expression): Likewise.
173 (init_statement): Likewise.
174 (assignment_statement): Likewise.
175 (return_statement): Likewise.
176 (exception_handler_statement): Likewise.
177 (if_statement): Likewise.
178 (compound_statement): Likewise.
179 Tighten up the code, removing t variable.
180 (statement_list): Use error_operand_p.
181 (block): Likewise.
182 (block_add_statements): Likewise.
183 (convert_tree): Likewise.
184 (global_variable): Likewise.
185 (global_variable_set_init): Likewise.
186 (local_variable): Likewise.
187 (parameter_variable): Likewise.
188 (static_chain_variable): Likewise.
189 (temporary_variable): Likewise.
190 (function): Likewise. Tighten up the code.
191 (function_defer_statement): Use error_operand_p.
192 (function_set_parameters): Use error_operand_p.
193 (write_global_definitions): Use error_operand_p.
194 Tighten up the code around the loop.
195
196 2025-04-14 Andrew Pinski <[email protected]>
197
198 * rust-gcc.cc (is_floating_point): Use FLOAT_TYPE_P
199 instead of manually checking the type.
200
201 2025-04-08 Matty Kuhn <[email protected]>
202
203 * ast/rust-ast.h: (AST::Attribute): add empty_input function
204 * checks/errors/rust-feature-gate.cc: (FeatureGate::visit): check for empty feature gate
205
206 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
207
208 * ast/rust-ast-collector.cc (TokenCollector::visit): Update label
209 getter call.
210 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
211 * ast/rust-ast.cc (BreakExpr::as_string): Likewise.
212 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
213 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
214 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
215 * ast/rust-expr.h: Add optional getter and rename label getter to
216 get_label_unchecked.
217
218 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
219
220 * ast/rust-ast-collector.cc (TokenCollector::visit):
221 Call unchecked getter.
222 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
223 Likewise.
224 * ast/rust-ast.cc (ContinueExpr::as_string): Likewise.
225 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
226 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
227 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
228 * ast/rust-expr.h: Add new getter for the optional and rename getter
229 to get_label_unchecked.
230
231 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
232
233 * parse/rust-parse-impl.h (Parser::parse_loop_label): Change function
234 return type to expected.
235 (Parser::parse_labelled_loop_expr): Adapt call location to new return
236 type.
237 * parse/rust-parse.h (enum class): Update function prototype.
238
239 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
240
241 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add call
242 to label resolution if there is one label.
243 (Late::resolve_label): Look for labels and emit an error message on
244 failure.
245 * resolve/rust-late-name-resolver-2.0.h: Add function prototypes.
246
247 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
248
249 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
250 Change error message to match rustc.
251
252 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
253
254 * ast/rust-ast-builder.cc (Builder::self_ref_param): Remove error state
255 and use optional.
256 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check label
257 before visiting.
258 * ast/rust-ast.cc (ContinueExpr::as_string): Retrieve label value.
259 (Lifetime::as_string): Retrieve lifetime value.
260 (ReferenceType::as_string): Likewise.
261 (SelfParam::as_string): Likewise.
262 * ast/rust-ast.h: Remove lifetime and LifetimeParam error state.
263 * ast/rust-desugar-for-loops.cc (DesugarForLoops::DesugarCtx::make_break_arm):
264 Use optional instead of error state.
265 * ast/rust-expr.h (class ContinueExpr): Make label optional.
266 * ast/rust-item.h (class SelfParam): Make lifetime optional.
267 * ast/rust-type.h (class ReferenceType): Likewise.
268 * backend/rust-compile-base.cc: Use optional for self param instead
269 of error state.
270 * backend/rust-compile-base.h: Update function prototype.
271 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Use optional.
272 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Lower
273 lifetime only if it exists.
274 * hir/rust-ast-lower-block.h: Lower loop label only if it exists.
275 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
276 * hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::visit): Remove
277 references to error state.
278 (ASTLowerTraitItem::visit): Lower self param only if it exists.
279 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Use nullopt
280 for default value instead of SelfParam error state.
281 * hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): Lower label
282 only if it exists.
283 * hir/rust-hir-dump.cc (Dump::do_traitfunctiondecl): Print self only if
284 it exists.
285 (Dump::visit): Liewise.
286 * hir/tree/rust-hir-bound.h: Remove error state.
287 * hir/tree/rust-hir-expr.cc (ContinueExpr::ContinueExpr): Use optional
288 in constructor for loop label.
289 (BreakExpr::BreakExpr): Likewise.
290 * hir/tree/rust-hir-expr.h (class ContinueExpr): Remove error state
291 implementation.
292 (class BreakExpr): Likewise.
293 * hir/tree/rust-hir-generic-param.h: Likewise.
294 * hir/tree/rust-hir-item.cc (SelfParam::SelfParam): Make lifetime
295 optional.
296 (Function::Function): Make self param optional.
297 * hir/tree/rust-hir-item.h (class Function): Likewise.
298 * hir/tree/rust-hir-type.cc (ReferenceType::ReferenceType): Make
299 lifetime optional.
300 * hir/tree/rust-hir-type.h (class ReferenceType): Likewise.
301 * hir/tree/rust-hir.cc (ContinueExpr::as_string): Use new getter.
302 (BreakExpr::as_string): Likewise.
303 (Lifetime::as_string): Likewise.
304 (ReferenceType::as_string): Likewise.
305 (TraitFunctionDecl::as_string): Likewise.
306 (SelfParam::as_string): Remove error state checking.
307 * parse/rust-parse-impl.h (Parser::parse_generic_param): Adapt to
308 optional.
309 (Parser::parse_lifetime_params): Likewise.
310 (Parser::parse_lifetime_params_objs): Likewise.
311 (Parser::parse_lifetime_param): Likewise.
312 (Parser::parse_lifetime_where_clause_item): Likewise.
313 (Parser::parse_type_param_bound): Likewise.
314 (Parser::parse_lifetime_bounds): Likewise.
315 (Parser::parse_path_generic_args): Likewise.
316 (Parser::parse_self_param): Likewise.
317 (Parser::parse_break_expr): Likewise.
318 (Parser::parse_continue_expr): Likewise.
319 (Parser::parse_reference_type_inner): Likewise.
320 * parse/rust-parse.h (class ParseLifetimeParamError): Add new class for
321 lifetime param parsing errors.
322 (class ParseLifetimeError): Add new class for lifetime parsing errors.
323 (enum ParseSelfError): Add new class for self param parsing errors.
324 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit):
325 Use unchecked getter in checked context. And make anonymous region.
326 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
327 Likewise.
328
329 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
330
331 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Add
332 check for loop label before visiting it.
333
334 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
335
336 * ast/rust-expr.h: Remove error getter and constructor.
337
338 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
339
340 * ast/rust-ast-builder.cc (Builder::block): Call with a nullopt instead
341 of an error loop label.
342 (WhileLetLoopExpr::as_string): Use getter function and adapt to
343 newtype.
344 * ast/rust-ast.cc (WhileLoopExpr::as_string): Likewise.
345 (LoopExpr::as_string): Likewise.
346 (BreakExpr::as_string): Likewise.
347 (ForLoopExpr::as_string): Likewise.
348 * ast/rust-expr.h (class BlockExpr): Make loop label optional.
349 (class BreakExpr): Likewise.
350 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Use nullopt.
351 * expand/rust-derive-debug.cc (DeriveDebug::stub_debug_fn): Likewise.
352 * expand/rust-derive-default.cc (DeriveDefault::default_fn): Likewise.
353 * expand/rust-derive-eq.cc: Likewise.
354 * parse/rust-parse-impl.h (Parser::parse_block_expr): Use optional
355 for arguments.
356 (Parser::parse_loop_expr): Likewise.
357 (Parser::parse_while_loop_expr): Likewise.
358 (Parser::parse_while_let_loop_expr): Likewise.
359 (Parser::parse_for_loop_expr): Likewise.
360 (Parser::parse_labelled_loop_expr): Likewise.
361 (Parser::parse_loop_label): Return an optional.
362 * parse/rust-parse.h: Update function prototype and use nullopt for
363 default values.
364
365 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
366
367 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change default
368 visit order.
369
370 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
371
372 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit loop label
373 only if it exists.
374
375 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
376
377 * hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Lower label only if
378 it exists.
379 * hir/tree/rust-hir-expr.cc (BlockExpr::BlockExpr): Make loop label
380 optional.
381 (BaseLoopExpr::BaseLoopExpr): Likewise.
382 (LoopExpr::LoopExpr): Likewise.
383 (WhileLoopExpr::WhileLoopExpr): Likewise.
384 * hir/tree/rust-hir-expr.h: Use optional for lifetime and labels.
385 * hir/tree/rust-hir.cc (WhileLoopExpr::as_string): Use getter.
386 (WhileLetLoopExpr::as_string): Likewise.
387 (LoopExpr::as_string): Likewise.
388 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Resolve labels.
389 * resolve/rust-late-name-resolver-2.0.h: Add visit function prototype
390 for loop labels.
391
392 2025-04-08 Pierre-Emmanuel Patry <[email protected]>
393
394 * util/expected.h: Use gcc_unreachable within gcc context.
395
396 2025-04-08 Sri Ganesh Thota <[email protected]>
397
398 * resolve/rust-ast-resolve-base.h (redefined_error): created a function for
399 rust_error_at for redefined at multiple times.
400 * resolve/rust-ast-resolve-implitem.h: changed rust_error_at to redefined_error.
401 * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): changed rust_error_at to
402 redefined_error.
403 * resolve/rust-ast-resolve-stmt.h: changed rust_error_at to redefined_error.
404 * resolve/rust-ast-resolve-toplevel.h: changed rust_error_at to redefined_error.
405
406 2025-04-08 Owen Avery <[email protected]>
407
408 * ast/rust-ast-visitor.cc
409 (DefaultASTVisitor::visit): Remove explicit visitation of a
410 function's self parameter, as if it exists it'll be visited as
411 one of the function parameters.
412
413 2025-04-08 Philip Herron <[email protected]>
414
415 * typecheck/rust-typecheck-context.cc (TypeCheckContext::lookup_lifetime): emit error
416
417 2025-04-08 Arthur Cohen <[email protected]>
418
419 * ast/rust-ast.cc (Function::Function): Rename is_default -> has_default.
420 (Function::operator=): Likewise.
421 * ast/rust-item.h (class Function): Add `is_default` method.
422 * hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::visit): Lower default qualifier.
423 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
424 * hir/tree/rust-hir-item.cc (Function::Function): Add `is_default` member.
425 (Function::operator=): Likewise.
426 * hir/tree/rust-hir-item.h (enum class Defaultness): New enum.
427 (class Function): Use it.
428
429 2025-04-08 Arthur Cohen <[email protected]>
430
431 * checks/errors/rust-feature.cc (Feature::create): Handle `#![feature(min_specialization)]`.
432 * checks/errors/rust-feature.h: Likewise.
433
434 2025-04-08 Philip Herron <[email protected]>
435
436 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): fix error msg
437 * typecheck/rust-substitution-mapper.cc (SubstMapper::Resolve): add validation
438 (SubstMapper::valid_type): new check
439 (SubstMapper::visit): check if can resolve
440 * typecheck/rust-substitution-mapper.h: new prototype
441
442 2025-04-08 Philip Herron <[email protected]>
443
444 * backend/rust-compile-base.cc (HIRCompileBase::address_expression): allow optional type
445 * backend/rust-compile-base.h: update prototype
446 * backend/rust-compile-expr.cc (CompileExpr::visit): update borrow expr
447 * backend/rust-compile-extern.h: remove unused debug
448 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): update usage
449 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): lower raw ref
450 * hir/tree/rust-hir-expr.cc (BorrowExpr::BorrowExpr): add flag for raw ref
451 * hir/tree/rust-hir-expr.h (class BorrowExpr): add new raw ref field
452 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): add handle for raw ref
453
454 2025-04-08 Philip Herron <[email protected]>
455
456 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): emit error
457
458 2025-04-08 Philip Herron <[email protected]>
459
460 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): new argument
461 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase): new helper
462 * typecheck/rust-hir-type-check-base.h: new helper prototype
463 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
464 remove comment out code
465 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): check for null
466 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): likewise
467 (TypeResolveGenericParam::Resolve): new args
468 (TypeResolveGenericParam::ApplyAnyTraitBounds): new helper
469 (TypeResolveGenericParam::apply_trait_bounds): new field
470 (TypeResolveGenericParam::visit): update
471 * typecheck/rust-hir-type-check-type.h: new args
472 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): reuse helper
473 * typecheck/rust-type-util.cc (query_type): check for recursive query
474 * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::SubstitutionParamMapping):
475 remove const
476 (SubstitutionParamMapping::get_generic_param): likewise
477 * typecheck/rust-tyty-subst.h: likewise
478 * typecheck/rust-tyty-variance-analysis.cc (GenericTyVisitorCtx::process_type): likewise
479
480 2025-04-08 Philip Herron <[email protected]>
481
482 * backend/rust-compile-base.cc: new flag is_root_item
483 * backend/rust-compile-base.h: update prototype
484 * backend/rust-compile-implitem.cc (CompileTraitItem::visit): update call
485 * backend/rust-compile-implitem.h: remove old debug internal error
486 * backend/rust-compile-item.cc (CompileItem::visit): update call
487 * backend/rust-compile-item.h: remove old debug
488 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): update calls
489 * backend/rust-compile.cc: likewise
490 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
491 remove assertion and error
492
493 2025-04-08 Philip Herron <[email protected]>
494
495 * typecheck/rust-hir-type-check-base.cc: remove assertion
496
497 2025-04-08 Philip Herron <[email protected]>
498
499 * rust-gcc.cc (arithmetic_or_logical_expression): unwrap const decls
500
501 2025-04-08 Owen Avery <[email protected]>
502
503 * resolve/rust-forever-stack.h
504 (ForeverStack::ForeverStack): Initialize extern_prelude.
505 (ForeverStack::resolve_path): Add parameter
506 has_opening_scope_resolution.
507 (ForeverStack::extern_prelude): Add field.
508 * resolve/rust-forever-stack.hxx: Include rust-edition.h.
509 (ForeverStacl::resolve_path): Handle global paths (paths with an
510 opening scope resolution operator).
511 * resolve/rust-late-name-resolver-2.0.cc
512 (Late::visit): Handle global paths.
513 * resolve/rust-name-resolution-context.h
514 (NameResolutionContext::resolve_path): Handle global paths.
515
516 2025-04-08 Ryutaro Okada <[email protected]>
517
518 * backend/rust-compile-resolve-path.cc: Evaluate the enum's discriminant in a const context
519
520 2025-03-31 Philip Herron <[email protected]>
521
522 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
523 catch nullptr root_tyty
524
525 2025-03-31 Philip Herron <[email protected]>
526
527 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options):
528 check for null and empty and add missing delete call
529
530 2025-03-31 Philip Herron <[email protected]>
531
532 * typecheck/rust-tyty-subst.h: check for min range
533
534 2025-03-31 Philip Herron <[email protected]>
535
536 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): check for input
537
538 2025-03-31 Philip Herron <[email protected]>
539
540 * hir/rust-hir-dump.cc (Dump::visit): check has type
541 * hir/tree/rust-hir-type.cc (BareFunctionType::BareFunctionType): likewise
542
543 2025-03-31 Philip Herron <[email protected]>
544
545 * backend/rust-constexpr.cc (eval_store_expression): turn this back on
546
547 2025-03-31 Owen Avery <[email protected]>
548
549 * expand/rust-macro-builtins-log-debug.cc:
550 Add newline to end of file.
551
552 2025-03-31 Owen Avery <[email protected]>
553
554 * resolve/rust-forever-stack.h
555 (ForeverStack::get_prelude): Rename to...
556 (ForeverStack::get_lang_prelude): ...here.
557 (ForeverStack::prelude): Rename to...
558 (ForeverStack::lang_prelude): ...here.
559 (ForeverStack::ForeverStack): Handle renames.
560 * resolve/rust-forever-stack.hxx
561 (ForeverStack::push_inner): Likewise.
562 (ForeverStack::resolve_segments): Likewise.
563 (ForeverStack::resolve_path): Likewise.
564 (ForeverStack::get_prelude): Rename to...
565 (ForeverStack::get_lang_prelude): ...here and handle renames.
566 * resolve/rust-late-name-resolver-2.0.cc
567 (Late::visit): Handle renames.
568
569 2025-03-31 Philip Herron <[email protected]>
570
571 * backend/rust-compile-context.h: only push named types
572 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): run the type hasher
573
574 2025-03-31 Philip Herron <[email protected]>
575
576 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): check for Expr trait
577 * hir/rust-hir-dump.cc (Dump::visit): expr is optional
578
579 2025-03-31 Pierre-Emmanuel Patry <[email protected]>
580
581 * resolve/rust-forever-stack.hxx: Add a new specialized function
582 to retrieve the last "real" segment depending on the namespace.
583 * resolve/rust-forever-stack.h: Add new function prototype.
584 * resolve/rust-early-name-resolver-2.0.cc (Early::finalize_rebind_import):
585 Set declared name according to the selected segment, if there is a self
586 suffix in the use declaration then select the previous segment.
587
588 2025-03-31 Philip Herron <[email protected]>
589
590 * backend/rust-compile-base.cc (HIRCompileBase::unit_expression): pass ctx
591 * backend/rust-compile-base.h: cant be static
592 * backend/rust-compile-intrinsic.cc (try_handler_inner): pass ctx
593 * backend/rust-compile-type.cc
594 (TyTyResolveCompile::get_unit_type): update to grab the first locus
595 (TyTyResolveCompile::visit): pass ctx
596 * backend/rust-compile-type.h: likewise
597
598 2025-03-31 Philip Herron <[email protected]>
599
600 * typecheck/rust-hir-dot-operator.cc:
601
602 2025-03-31 Philip Herron <[email protected]>
603
604 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): check for super mid path
605
606 2025-03-31 Philip Herron <[email protected]>
607
608 * backend/rust-compile-base.cc (HIRCompileBase::address_expression): new helper constexpr
609 * backend/rust-compile-base.h: prototype
610 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call constexpr helper
611
612 2025-03-31 Philip Herron <[email protected]>
613
614 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
615 Track the polarity
616 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::validate_type_implements_this):
617 new validator
618 * typecheck/rust-tyty.h: new prototypes
619
620 2025-03-31 Philip Herron <[email protected]>
621
622 * backend/rust-compile-expr.cc (CompileExpr::array_value_expr): add value chk for array expr
623
624 2025-03-31 Philip Herron <[email protected]>
625
626 * typecheck/rust-hir-trait-reference.h: add default infer arg
627 * typecheck/rust-hir-trait-resolve.cc: dont add new infer vars
628 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): dont infer
629
630 2025-03-31 Owen Avery <[email protected]>
631
632 * checks/errors/rust-ast-validation.cc
633 (ASTValidation::visit): Allow constant items lacking expressions
634 if and only if they're associated with a trait definition, not a
635 trait implementation.
636
637 2025-03-31 Owen Avery <[email protected]>
638
639 * hir/rust-ast-lower-base.cc
640 (ASTLoweringBase::lower_literal): Lower raw string literals into
641 normal string literals.
642
643 2025-03-31 Arthur Cohen <[email protected]>
644
645 * checks/errors/borrowck/ffi-polonius/Cargo.lock: Regenerate.
646 * checks/errors/borrowck/ffi-polonius/Cargo.toml: Update to use source patching instead of
647 vendoring, lower edition to 2018.
648 * checks/errors/borrowck/ffi-polonius/vendor/log/Cargo.toml: Change edition to 2018.
649 * checks/errors/borrowck/ffi-polonius/vendor/log/src/lib.rs: Remove uses of unstable
650 feature.
651 * checks/errors/borrowck/ffi-polonius/.cargo/config.toml: Removed.
652
653 2025-03-31 Arthur Cohen <[email protected]>
654
655 * hir/tree/rust-hir-stmt.h (class LetStmt): Add optional diverging else expression.
656 * hir/tree/rust-hir-stmt.cc: Likewise.
657 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Add handling for lowering
658 diverging else.
659
660 2025-03-31 Arthur Cohen <[email protected]>
661
662 * resolve/rust-ast-resolve-stmt.h: Add handling for diverging else.
663 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
664
665 2025-03-31 Arthur Cohen <[email protected]>
666
667 * ast/rust-ast-collector.cc (TokenCollector::visit): Add handling for diverging else
668 expression.
669
670 2025-03-31 Arthur Cohen <[email protected]>
671
672 * parse/rust-parse-impl.h (Parser::parse_let_stmt): Add new parsing in case of `else` token.
673
674 2025-03-31 Arthur Cohen <[email protected]>
675
676 * ast/rust-stmt.h (class LetStmt): Add optional expression for diverging else.
677 * ast/rust-ast-builder.cc (Builder::let): Use new API.
678
679 2025-03-26 Iain Sandoe <[email protected]>
680
681 * metadata/rust-export-metadata.cc
682 (PublicInterface::write_to_path): Use 'lbasename()' instead of
683 'basename()'.
684
685 2025-03-24 Philip Herron <[email protected]>
686
687 * typecheck/rust-hir-path-probe.cc: update call
688 * typecheck/rust-hir-trait-reference.cc (TraitReference::lookup_trait_item): track predicate
689 (TraitReference::is_equal): likewise
690 (TraitReference::is_object_safe): likewise
691 (TraitReference::satisfies_bound): likewise
692 * typecheck/rust-hir-trait-reference.h: likewise
693 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): likewise
694 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate): track super traits
695 (TypeBoundPredicate::operator=): likewise
696 (TypeBoundPredicate::apply_generic_arguments): ensure we apply to super predicates
697 (TypeBoundPredicateItem::operator=): take copy of parent predicate
698 (TypeBoundPredicateItem::error): pass error instead of nullptr
699 (TypeBoundPredicateItem::is_error): update to no longer check for nullptr
700 (TypeBoundPredicateItem::get_parent): updated
701 (TypeBoundPredicateItem::get_tyty_for_receiver): likewise
702 (TypeBoundPredicate::get_associated_type_items): likewise
703 * typecheck/rust-tyty-bounds.h (class TypeBoundPredicateItem): move
704 * typecheck/rust-tyty-subst.cc: flag to handle placeholder Self on traits
705 * typecheck/rust-tyty-subst.h (class TypeBoundPredicateItem): likewise
706 * typecheck/rust-tyty.h (class TypeBoundPredicateItem): refactored
707
708 2025-03-24 Owen Avery <[email protected]>
709
710 * resolve/rust-late-name-resolver-2.0.cc
711 (Late::visit): Add visitor for StructExprFieldIdentifier.
712 * resolve/rust-late-name-resolver-2.0.h
713 (Late::visit): Likewise.
714
715 2025-03-24 Owen Avery <[email protected]>
716
717 * resolve/rust-late-name-resolver-2.0.cc
718 (Late::visit): Make sure to return early after a resolution
719 error, improve the resolution error message, fix a typo, handle
720 ambiguous resolutions, and remove an old comment.
721
722 2025-03-24 Owen Avery <[email protected]>
723
724 * resolve/rust-ast-resolve-expr.cc
725 (ResolveExpr::visit): Modify error message.
726 * resolve/rust-ast-resolve-implitem.h
727 (ResolveToplevelImplItem::visit): Likewise.
728 (ResolveTopLevelTraitItems::visit): Likewise.
729 (ResolveToplevelExternItem::visit): Likewise.
730 * resolve/rust-ast-resolve-stmt.cc
731 (ResolveStmt::visit): Likewise.
732 * resolve/rust-ast-resolve-stmt.h
733 (ResolveStmt::visit): Likewise.
734 * resolve/rust-ast-resolve-toplevel.h
735 (ResolveTopLevel::visit): Likewise.
736 * resolve/rust-ast-resolve-type.h
737 (ResolveGenericParams::visit): Likewise.
738
739 2025-03-24 Owen Avery <[email protected]>
740
741 * ast/rust-ast-visitor.cc
742 (DefaultASTVisitor::visit): Make sure to always visit the struct
743 name.
744 * resolve/rust-late-name-resolver-2.0.cc
745 (Late::visit): Avoid visiting the struct name twice.
746
747 2025-03-24 Owen Avery <[email protected]>
748
749 * expand/rust-derive-clone.cc
750 (DeriveClone::clone_impl): Avoid using the same node id multiple
751 times.
752 (DeriveClone::clone_enum_identifier): Likewise.
753 (DeriveClone::clone_enum_tuple): Likewise.
754 * expand/rust-derive-copy.cc
755 (DeriveCopy::copy_impl): Likewise.
756 * resolve/rust-ast-resolve-item.cc
757 (flatten_list): Likewise.
758 * resolve/rust-ast-resolve-path.cc
759 (ResolvePath::resolve_path): Prevent reinsertion of resolutions.
760 * resolve/rust-ast-resolve-type.cc
761 (ResolveRelativeTypePath::go): Likewise.
762 * typecheck/rust-hir-type-check-expr.cc
763 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
764 * resolve/rust-name-resolver.cc
765 (Resolver::insert_resolved_name): Catch multiple resolution
766 insertions.
767 (Resolver::insert_resolved_type): Likewise.
768
769 2025-03-24 Owen Avery <[email protected]>
770
771 * resolve/rust-ast-resolve-path.cc
772 (ResolvePath::resolve_path): Adjust the error message for a lower
773 self segment in the middle of a path.
774 * resolve/rust-ast-resolve-type.cc
775 (ResolveRelativeTypePath::go): Likewise.
776
777 2025-03-24 Ryutaro Okada <[email protected]>
778
779 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
780 emit an error for type or const parameters on foreign items
781
782 2025-03-24 Liam Naddell <[email protected]>
783
784 * resolve/rust-forever-stack.h (ForeverStack): Add a dedicated prelude node for
785 the Language prelude
786 * resolve/rust-forever-stack.hxx (ForeverStack): Add support code for the
787 prelude node
788 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Move
789 language prelude builtins to the prelude context
790 * resolve/rust-name-resolution-context.cc
791 (NameResolutionContext::scoped): Add code for handling
792 the prelude corner case
793 * resolve/rust-rib.h (Rib::Kind): Add a special Prelude rib type
794
795 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
796
797 * resolve/rust-forever-stack.hxx: Fix the id comparison.
798
799 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
800
801 * resolve/rust-forever-stack.hxx: Insert a new segment with the crate's
802 name as canonical's path prefix.
803
804 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
805
806 * util/rust-hir-map.cc (Mappings::lookup_crate_num): Add function to
807 retrieve crate number from it's node id.
808 (Mappings::node_is_crate): change function with call to
809 lookup_crate_num to avoid looping through all crates.
810 (Mappings::insert_ast_crate): Populate node id to crate number map.
811 * util/rust-hir-map.h: Change function prototype.
812
813 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
814
815 * resolve/rust-finalize-imports-2.0.cc (FinalizeImports::FinalizeImports):
816 Remove constructor.
817 (FinalizeImports::go): Remove function.
818 (FinalizeImports::visit): Likewise.
819 * resolve/rust-finalize-imports-2.0.h (class FinalizeImports): Remove
820 FinalizeImports class.
821
822 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
823
824 * resolve/rust-early-name-resolver-2.0.cc (Early::Early): Move the
825 top level visitor from the function scope to attributes.
826 (Early::go): Remove top level visitor creation and adapt calling code.
827 Remove call to mapping resolution and import finalization.
828 (Early::finalize_simple_import): Move the finalization from it's
829 visitor.
830 (Early::finalize_glob_import): Likewise.
831 (Early::finalize_rebind_import): Likewise.
832 (Early::visit): Add mapping resolution and finalization in
833 UseDeclaration visitor function.
834 * resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Move
835 function.
836 (finalize_glob_import): Likewise.
837 (finalize_rebind_import): Likewise.
838 (FinalizeImports::visit): Remove call to finalizers.
839 * resolve/rust-early-name-resolver-2.0.h (class Early): Add top level
840 attribute.
841 * resolve/rust-finalize-imports-2.0.h: Add function prototypes.
842 * resolve/rust-toplevel-name-resolver-2.0.h: Change getter return type
843 to reference.
844
845 2025-03-24 Philip Herron <[email protected]>
846
847 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::ResolveHirItem): new helper
848 * typecheck/rust-hir-trait-resolve.h: add helper prototype
849 * typecheck/rust-type-util.cc (query_type): add debug
850 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): check for recursion
851 * typecheck/rust-tyty.cc (VariantDef::is_equal): fix is equal check
852
853 2025-03-24 Philip Herron <[email protected]>
854
855 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): track DefId of origin
856 * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): likewise
857 (ADTType::ADTType): likewise
858 (ADTType::get_id): likewise
859 (ADTType::clone): likewise
860 * typecheck/rust-tyty.h: likewise
861
862 2025-03-24 Philip Herron <[email protected]>
863
864 * backend/rust-compile-resolve-path.cc (ResolvePathRef::Compile): remove visitor
865 (ResolvePathRef::ResolvePathRef): likewise
866 (ResolvePathRef::visit): likewise
867 * backend/rust-compile-resolve-path.h (class ResolvePathRef): likewise
868
869 2025-03-24 Owen Avery <[email protected]>
870
871 * backend/rust-compile-intrinsic.cc
872 (assume_handler): Fix copy/paste error.
873 * typecheck/rust-hir-type-check-pattern.cc
874 (TypeCheckPattern::visit): Fix spelling mistake.
875
876 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
877
878 * resolve/rust-rib.cc (Rib::Definition::to_string): Add enum variant
879 status.
880
881 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
882
883 * resolve/rust-forever-stack.h: Add new function to insert enum
884 variants and add argument to resolver's get function to explicitely
885 skip enum variants.
886 * resolve/rust-forever-stack.hxx: Update function
887 definitions.
888 * resolve/rust-name-resolution-context.cc (NameResolutionContext::insert_variant):
889 Add function to insert enum variants.
890 * resolve/rust-name-resolution-context.h: Add function's prototype.
891 * resolve/rust-rib.cc (Rib::Definition::Definition): Add new boolean to
892 hint at enum variant provenance.
893 (Rib::Definition::is_variant): New getter for variant status.
894 (Rib::Definition::Shadowable): Update constructor to opt out of enum
895 variants.
896 (Rib::Definition::Globbed): Likewise.
897 (Rib::Definition::NonShadowable): Change constructor to forward enum
898 variant provenance status.
899 * resolve/rust-rib.h: Update function prototypes.
900 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_enum_variant_or_error_out):
901 Add function to insert enum variants in the name resolver.
902 (TopLevel::visit): Update several enum variant's visitor function
903 with the new enum variant name resolving code.
904 * resolve/rust-toplevel-name-resolver-2.0.h: Update function
905 prototypes.
906
907 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
908
909 * resolve/rust-forever-stack.hxx: Output rib kind.
910 * resolve/rust-rib.h: Add function to get string representation from
911 a rib kind.
912
913 2025-03-24 Owen Avery <[email protected]>
914
915 * resolve/rust-forever-stack.h
916 (ForeverStack::ForeverStack): Set the node id of the root node
917 to that of the current crate.
918 * resolve/rust-forever-stack.hxx
919 (ForeverStack::find_starting_point): Use the node id of the root
920 node during resolution of crate segments.
921
922 2025-03-24 Arthur Cohen <[email protected]>
923
924 * expand/rust-macro-expand.cc: Use new SubstituteCtx API.
925 * expand/rust-macro-expand.h: Likewise.
926 * expand/rust-macro-substitute-ctx.cc: Implement proper expansion of $crate.
927 * expand/rust-macro-substitute-ctx.h: Adapt APIs to take macro definition when
928 substituting.
929 * util/rust-hir-map.cc (Mappings::insert_macro_def): Store crate information when
930 inserting macro definition in mappings.
931 (Mappings::lookup_macro_def_crate): New.
932 * util/rust-hir-map.h: Adapt mappings to store crate in which macros were defined.
933
934 2025-03-24 Owen Avery <[email protected]>
935
936 * resolve/rust-late-name-resolver-2.0.cc
937 (Late::visit): Call DefaultResolver::visit earlier, in order to
938 ensure it is called even if Late::visit returns early.
939
940 2025-03-24 Owen Avery <[email protected]>
941
942 * util/rust-edition.cc: New file.
943 * util/rust-edition.h: New file.
944 * Make-lang.in: Add rust-edition.o to the object list.
945 * ast/rust-pattern.cc: Remove inclusion of
946 rust-session-manager.h.
947 * expand/rust-macro-expand.cc: Likewise.
948 * expand/rust-macro-builtins-helpers.h: Likewise.
949 * expand/rust-macro-builtins-include.cc: Include
950 rust-session-manager.h.
951 * expand/rust-macro-builtins-utility.cc: Likewise.
952 * lex/rust-lex.cc: Include rust-edition.h instead of
953 rust-session-manager.h.
954 (Lexer::classify_keyword): Use get_rust_edition instead of
955 Session and CompileOptions.
956 * parse/rust-parse-impl.h: Include rust-edition.h instead of
957 rust-session-manager.h.
958 (Parser::parse_async_item): Use get_rust_edition instead of
959 Session and CompileOptions.
960 * checks/errors/rust-feature.h: Include rust-edition.h instead
961 of rust-session-manager.h.
962 (class Feature): Use Rust::Edition instead of
963 Rust::CompileOptions::Edition.
964
965 2025-03-24 Arthur Cohen <[email protected]>
966
967 * rust-session-manager.cc (Session::compile_crate): Call DesugarQuestionMark::go().
968
969 2025-03-24 Arthur Cohen <[email protected]>
970
971 * hir/rust-ast-lower-base.cc: Adapt functions for ErrorPropagationExpr and MacroInvocation.
972 * hir/rust-ast-lower-base.h: Mark them as final.
973 * hir/rust-ast-lower-expr.cc: Remove previous definition for those overrides.
974 * hir/rust-ast-lower-expr.h: Likewise.
975
976 2025-03-24 Arthur Cohen <[email protected]>
977
978 * Make-lang.in: Compile it.
979 * ast/rust-desugar-question-mark.cc: New file.
980 * ast/rust-desugar-question-mark.h: New file.
981
982 2025-03-24 Owen Avery <[email protected]>
983
984 * resolve/rust-early-name-resolver-2.0.cc
985 (Early::visit): Adjust error produced when macro resolution
986 fails.
987 * resolve/rust-early-name-resolver.cc
988 (EarlyNameResolver::visit): Likewise.
989
990 2025-03-24 Owen Avery <[email protected]>
991
992 * resolve/rust-forever-stack.hxx
993 (ForeverStack::find_starting_point): Stop when hitting a lang
994 item segment.
995 (ForeverStack::resolve_segments): Resolve lang item segments.
996 (ForeverStacl::resolve_path): Handle single segment lang item
997 paths and add comment.
998 * util/rust-unwrap-segment.cc
999 (unwrap_segment_get_lang_item): Add.
1000 * util/rust-unwrap-segment.h
1001 (unwrap_segment_get_lang_item): Add.
1002
1003 2025-03-24 Arthur Cohen <[email protected]>
1004
1005 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Correctly visit the generic args
1006 of a generic type path segment.
1007
1008 2025-03-24 Arthur Cohen <[email protected]>
1009
1010 * resolve/rust-early-name-resolver.cc: Remove definitions.
1011 * resolve/rust-early-name-resolver.h: Remove declarations.
1012
1013 2025-03-24 Arthur Cohen <[email protected]>
1014
1015 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add base implementation
1016 for visitor.
1017
1018 2025-03-24 Owen Avery <[email protected]>
1019
1020 * resolve/rust-early-name-resolver-2.0.cc:
1021 Include rust-attribute-values.h.
1022 (Early::visit): If a module has a macro_use attribute, avoid
1023 pushing a new textual macro scope.
1024
1025 2025-03-24 Owen Avery <[email protected]>
1026
1027 * resolve/rust-ast-resolve-type.cc
1028 (ResolveRelativeTypePath::go): Adjust error message to match
1029 the 2.0 name resolver.
1030
1031 2025-03-24 Arthur Cohen <[email protected]>
1032
1033 * hir/rust-hir-dump.cc: Check unique_ptr members are present before
1034 visiting them.
1035 * hir/tree/rust-hir-path.h: Add `has_{type, trait}` methods to
1036 QualifiedPathInType.
1037
1038 2025-03-24 Arthur Cohen <[email protected]>
1039
1040 * Make-lang.in: Compile it.
1041 * expand/rust-derive.cc (DeriveVisitor::derive): Call it.
1042 * expand/rust-derive-hash.cc: New file.
1043 * expand/rust-derive-hash.h: New file.
1044
1045 2025-03-24 Arthur Cohen <[email protected]>
1046
1047 * expand/rust-derive-debug.cc (ptrify): Remove function.
1048
1049 2025-03-24 Arthur Cohen <[email protected]>
1050
1051 * ast/rust-ast-builder.cc (Builder::statementify): New.
1052 (Builder::function): Add generic params optional argument.
1053 (Builder::path_in_expression): Add opening_scope_resolution optional argument.
1054 (Builder::block): Add function for creating empty blocks.
1055 (Builder::generic_type_param): New.
1056 * ast/rust-ast-builder.h (ptrify): New.
1057
1058 2025-03-24 Owen Avery <[email protected]>
1059
1060 * ast/rust-ast.h
1061 (SingleASTNode::take_trait_item): Remove.
1062 (SingleASTNode::take_impl_item): Remove.
1063 (SingleASTNode::take_trait_impl_item): Remove.
1064 * expand/rust-expand-visitor.cc
1065 (ExpandVisitor::visit): Replace calls to aforementioned
1066 functions with calls to SingleASTNode::take_assoc_item.
1067
1068 2025-03-24 Owen Avery <[email protected]>
1069
1070 * expand/rust-expand-visitor.cc
1071 (ExpandVisitor::visit): Override DefaultASTVisitor in order to
1072 expand a module's items, rather than directly visit them.
1073 * expand/rust-expand-visitor.h
1074 (ExpandVisitor::visit): Add override.
1075
1076 2025-03-24 Owen Avery <[email protected]>
1077
1078 * ast/rust-path.h
1079 (PathInExpression::get_pattern_node_id): Remove.
1080
1081 2025-03-24 Arthur Cohen <[email protected]>
1082
1083 * expand/rust-derive-eq.cc: Copy `Eq` typepath.
1084
1085 2025-03-24 Arthur Cohen <[email protected]>
1086
1087 * expand/rust-derive-eq.cc: Adapt functions to return two generated impls.
1088 * expand/rust-derive-eq.h: Likewise.
1089 * expand/rust-derive.cc (DeriveVisitor::derive): Likewise.
1090
1091 2025-03-24 Arthur Cohen <[email protected]>
1092
1093 * expand/rust-derive-partial-eq.cc: Adapt signatures to generate two impls.
1094 * expand/rust-derive-partial-eq.h: Likewise.
1095 * expand/rust-derive.cc (DeriveVisitor::derive): Adapt to multiple item generation.
1096
1097 2025-03-24 Arthur Cohen <[email protected]>
1098
1099 * expand/rust-derive.cc (DeriveVisitor::derive): Return a vector of items.
1100 * expand/rust-derive.h: Change return type.
1101 * expand/rust-expand-visitor.cc: Insert all generated items into the AST.
1102
1103 2025-03-24 Arthur Cohen <[email protected]>
1104
1105 * expand/rust-derive-partial-eq.cc: New file.
1106 * expand/rust-derive-partial-eq.h: New file.
1107 * expand/rust-derive.cc (DeriveVisitor::derive): Call them.
1108 * Make-lang.in: Compile them.
1109
1110 2025-03-24 Arthur Cohen <[email protected]>
1111
1112 * expand/rust-derive-clone.cc: Cleanup implementation, avoid repetitions.
1113 * expand/rust-derive-clone.h: Likewise.
1114
1115 2025-03-24 Arthur Cohen <[email protected]>
1116
1117 * ast/rust-ast-builder.cc (Builder::literal_bool): New method.
1118 (Builder::comparison_expr): Likewise.
1119 (Builder::boolean_operation): Likewise.
1120 * ast/rust-ast-builder.h: Declare them.
1121
1122 2025-03-24 Arthur Cohen <[email protected]>
1123
1124 * ast/rust-ast-builder.cc (Builder::block): Change return type.
1125 (Builder::loop): Use new APIs.
1126 * ast/rust-ast-builder.h: Change return type of block functions.
1127
1128 2025-03-24 Arthur Cohen <[email protected]>
1129
1130 * expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveEq.
1131 * expand/rust-derive-eq.cc: New file.
1132 * expand/rust-derive-eq.h: New file.
1133 * Make-lang.in: Compile them.
1134
1135 2025-03-24 Owen Avery <[email protected]>
1136
1137 * resolve/rust-late-name-resolver-2.0.cc
1138 (Late::visit): When visiting a PathInExpression instance, call
1139 into DefaultResolver::visit, ensuring generic arguments are
1140 visited.
1141
1142 2025-03-24 Owen Avery <[email protected]>
1143
1144 * resolve/rust-toplevel-name-resolver-2.0.cc
1145 (TopLevel::visit): When visiting an external crate declaration,
1146 handle failed crate name lookups. This can happen when
1147 Session::load_extern_crate fails to load a crate during the
1148 CfgStrip phase.
1149
1150 2025-03-24 Owen Avery <[email protected]>
1151
1152 * resolve/rust-forever-stack.hxx
1153 (ForeverStack::resolve_segments): Add comments explaining
1154 the behaviour of a while loop.
1155
1156 2025-03-24 Benjamin Thos <[email protected]>
1157
1158 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
1159 Add check on if-expr.
1160
1161 2025-03-24 Owen Avery <[email protected]>
1162
1163 * resolve/rust-forever-stack.hxx
1164 (ForeverStack::find_starting_point): Be more careful about
1165 applying ForeverStack::find_closest_module.
1166 (ForeverStack::resolve_segments): Allow traversal into parent
1167 nodes when not in a module node or root node, which
1168 ForeverStack::find_starting_point previously made moot through
1169 use of ForeverStack::find_closest_module. Also, when a child
1170 node lookup fails when resolving in the type namespace, attempt
1171 a rib lookup as a fallback.
1172 * resolve/rust-late-name-resolver-2.0.cc
1173 (Late::visit): Avoid throwing a resolution error for type paths
1174 when the typechecker may be able to finish the resolution. Also,
1175 throw an error when a resolution is ambiguous.
1176
1177 2025-03-24 Philip Herron <[email protected]>
1178
1179 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): new tyty::OpaqueType
1180 * backend/rust-compile-type.h: likewise
1181 * checks/errors/borrowck/rust-bir-fact-collector.h: likewise
1182 * checks/errors/borrowck/rust-bir-place.h: likewise
1183 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
1184 likewise
1185 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
1186 * typecheck/rust-hir-type-check-type.h: likewise
1187 * typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit): likewise
1188 * typecheck/rust-substitution-mapper.h: likewise
1189 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): likewise
1190 * typecheck/rust-tyty-call.h: likewise
1191 * typecheck/rust-tyty-cmp.h (class OpaqueCmp): likewise
1192 * typecheck/rust-tyty-variance-analysis-private.h: likewise
1193 * typecheck/rust-tyty-visitor.h: likewise
1194 * typecheck/rust-tyty.cc (TypeKindFormat::to_string): likewise
1195 (BaseType::is_unit): likewise
1196 (BaseType::destructure): likewise
1197 (BaseType::has_substitutions_defined): likewise
1198 (BaseType::needs_generic_substitutions): likewise
1199 (OpaqueType::OpaqueType): likewise
1200 (OpaqueType::can_resolve): likewise
1201 (OpaqueType::accept_vis): likewise
1202 (OpaqueType::as_string): likewise
1203 (OpaqueType::get_name): likewise
1204 (OpaqueType::can_eq): likewise
1205 (OpaqueType::clone): likewise
1206 (OpaqueType::resolve): likewise
1207 (OpaqueType::is_equal): likewise
1208 (OpaqueType::handle_substitions): likewise
1209 * typecheck/rust-tyty.h (enum TypeKind): likewise
1210 (class OpaqueType): likewise
1211 * typecheck/rust-unify.cc (UnifyRules::go): likewise
1212 (UnifyRules::expect_inference_variable): likewise
1213 (UnifyRules::expect_adt): likewise
1214 (UnifyRules::expect_str): likewise
1215 (UnifyRules::expect_reference): likewise
1216 (UnifyRules::expect_pointer): likewise
1217 (UnifyRules::expect_param): likewise
1218 (UnifyRules::expect_array): likewise
1219 (UnifyRules::expect_slice): likewise
1220 (UnifyRules::expect_fndef): likewise
1221 (UnifyRules::expect_fnptr): likewise
1222 (UnifyRules::expect_tuple): likewise
1223 (UnifyRules::expect_bool): likewise
1224 (UnifyRules::expect_char): likewise
1225 (UnifyRules::expect_int): likewise
1226 (UnifyRules::expect_uint): likewise
1227 (UnifyRules::expect_float): likewise
1228 (UnifyRules::expect_isize): likewise
1229 (UnifyRules::expect_usize): likewise
1230 (UnifyRules::expect_placeholder): likewise
1231 (UnifyRules::expect_projection): likewise
1232 (UnifyRules::expect_dyn): likewise
1233 (UnifyRules::expect_opaque): likewise
1234 * typecheck/rust-unify.h: likewise
1235
1236 2025-03-24 Philip Herron <[email protected]>
1237
1238 * checks/errors/borrowck/rust-bir-builder-struct.h: remove HIR::ImplTraitTypeOneBound
1239 * checks/errors/borrowck/rust-function-collector.h: likewise
1240 * checks/errors/rust-const-checker.cc (ConstChecker::visit): likewise
1241 * checks/errors/rust-const-checker.h: likewise
1242 * checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): likewise
1243 * checks/errors/rust-hir-pattern-analysis.h: likewise
1244 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): likewise
1245 * checks/errors/rust-unsafe-checker.h: likewise
1246 * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): likewise
1247 (ASTLoweringType::visit): likewise
1248 * hir/rust-ast-lower-type.h: cleanup
1249 * hir/rust-hir-dump.cc (Dump::visit): remove ImplTraitTypeOneBound
1250 * hir/rust-hir-dump.h: likewise
1251 * hir/tree/rust-hir-full-decls.h (class ImplTraitTypeOneBound): likewise
1252 * hir/tree/rust-hir-type.h (class ImplTraitTypeOneBound): likewise
1253 * hir/tree/rust-hir-visitor.h: likewise
1254 * hir/tree/rust-hir.cc (ImplTraitTypeOneBound::as_string): likewise
1255 (ImplTraitTypeOneBound::accept_vis): likewise
1256 * resolve/rust-ast-resolve-type.cc (ResolveType::go): likewise
1257 (ResolveType::visit): likewise
1258 * resolve/rust-ast-resolve-type.h: add name resolution
1259 * typecheck/rust-hir-type-check-type.h: likewise
1260
1261 2025-03-24 Philip Herron <[email protected]>
1262
1263 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): improve error diag
1264
1265 2025-03-24 Philip Herron <[email protected]>
1266
1267 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): add location mappings
1268 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): check for self
1269
1270 2025-03-24 Philip Herron <[email protected]>
1271
1272 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): use new api
1273 (ResolveItem::visit): likewise
1274 (ResolveExternItem::visit): likewise
1275 * resolve/rust-ast-resolve-stmt.h: likewise
1276 * resolve/rust-ast-resolve-type.h (class ResolveGenericParam): remove
1277 (class ResolveGenericParams): added new api
1278
1279 2025-03-24 Philip Herron <[email protected]>
1280
1281 * typecheck/rust-hir-type-check-base.cc (walk_types_to_constrain): recursive walker
1282 * typecheck/rust-tyty.cc (BaseType::get_subst_argument_mappings): new helper
1283 * typecheck/rust-tyty.h: prototype
1284
1285 2025-03-24 Philip Herron <[email protected]>
1286
1287 * typecheck/rust-hir-type-check-base.h: add flag
1288 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
1289 * typecheck/rust-tyty-bounds.cc: new diagnostic
1290
1291 2025-03-24 Philip Herron <[email protected]>
1292
1293 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): remove name resolution info
1294 (TypeCheckType::resolve_root_path): likewise
1295 * typecheck/rust-hir-type-check-type.h: likewise
1296
1297 2025-03-24 Philip Herron <[email protected]>
1298
1299 * backend/rust-compile-type.cc (TyTyResolveCompile::get_implicit_enumeral_node_type):
1300 use repr
1301 (TyTyResolveCompile::visit): update prototype
1302 * backend/rust-compile-type.h: likewise
1303
1304 2025-03-24 Philip Herron <[email protected]>
1305
1306 * backend/rust-compile-intrinsic.cc (variant_count_handler): new intrinsic
1307
1308 2025-03-24 Philip Herron <[email protected]>
1309
1310 * backend/rust-compile-intrinsic.cc (discriminant_value_handler): new handler
1311 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item): track the defid
1312 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): default isize
1313 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): special case CallExpr
1314 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): parse repr options enum
1315 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): remove bad diagnostic
1316 * typecheck/rust-tyty.cc (PlaceholderType::PlaceholderType): track defid
1317 (PlaceholderType::clone): likewise
1318 (PlaceholderType::get_def_id): likeiwse
1319 * typecheck/rust-tyty.h: placeholder track defid
1320 * util/rust-lang-item.cc: add new lang items
1321 * util/rust-lang-item.h: likewise
1322
1323 2025-03-24 GS-GOAT <[email protected]>
1324
1325 * typecheck/rust-autoderef.cc
1326 (insert_implicit_type): Update single-parameter call to
1327 pass explicit HirId.
1328 * typecheck/rust-hir-type-check-expr.cc: Same.
1329 * typecheck/rust-hir-type-check-pattern.cc: Same.
1330 * typecheck/rust-hir-type-check.h: Removed call
1331 to the duplicate interface.
1332 * typecheck/rust-typecheck-context.cc
1333 (TypeCheckContext::insert_implicit_type): Removed the
1334 interface with no HirId field.
1335
1336 2025-03-24 Philip Herron <[email protected]>
1337
1338 * typecheck/rust-tyty-subst.cc (SubstitutionRef::monomorphize): remove diagnostic
1339
1340 2025-03-24 Arthur Cohen <[email protected]>
1341
1342 * rust-session-manager.cc (Session::compile_crate): Call the visitor.
1343
1344 2025-03-24 Arthur Cohen <[email protected]>
1345
1346 * ast/rust-desugar-for-loops.cc: New file.
1347 * ast/rust-desugar-for-loops.h: New file.
1348 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Make lowering of for-loops an
1349 unreachable.
1350 * Make-lang.in: Compile it.
1351
1352 2025-03-24 Arthur Cohen <[email protected]>
1353
1354 * ast/rust-ast-builder.h: Mark all arguments as &&.
1355 * ast/rust-ast-builder.cc (Builder::let): Likewise.
1356
1357 2025-03-24 Owen Avery <[email protected]>
1358
1359 * util/rust-unwrap-segment.cc: New file.
1360 * util/rust-unwrap-segment.h: New file.
1361 * Make-lang.in: Add rust-unwrap-segment.o to the object list.
1362 * resolve/rust-forever-stack.hxx: Include rust-unwrap-segment.h.
1363 (ForeverStack::find_starting_point): Use unwrap_type_segment.
1364 (ForeverStack::resolve_segments): Likewise.
1365 (ForeverStack::resolve_path): Likewise.
1366 * resolve/rust-late-name-resolver-2.0.cc
1367 (Late::visit): Resolve type paths using
1368 NameResolutionContext::resolve_path.
1369 * resolve/rust-name-resolution-context.h
1370 (NameResolutionContext::resolve_path): Use
1371 unwrap_segment_node_id.
1372
1373 2025-03-24 Arthur Cohen <[email protected]>
1374
1375 * expand/rust-macro-builtins-asm.cc (strip_double_quotes): Special case empty
1376 strings ("\"\"").
1377 (parse_reg_operand): Remove use of the `struct` keyword.
1378 (parse_reg_operand_in): Likewise.
1379 (parse_reg_operand_out): Likewise.
1380 * expand/rust-macro-builtins.cc: Add llvm_asm! built-in macro as an alias to asm!.
1381
1382 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1383
1384 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
1385 warning about current code.
1386
1387 2025-03-24 Arthur Cohen <[email protected]>
1388
1389 * expand/rust-derive.cc (DeriveVisitor::derive): Call DeriveDefault.
1390 * expand/rust-derive-default.cc: New file.
1391 * expand/rust-derive-default.h: New file.
1392 * Make-lang.in: Compile them.
1393
1394 2025-03-24 Arthur Cohen <[email protected]>
1395
1396 * ast/rust-ast-builder.cc (Builder::qualified_path_in_expression): New.
1397 (Builder::function): Change the return type.
1398 * ast/rust-ast-builder.h: Declare qualified_path_in_expression functions.
1399 * expand/rust-derive-debug.cc (DeriveDebug::stub_debug_fn): Adapt to new APIs.
1400
1401 2025-03-24 Philip Herron <[email protected]>
1402
1403 * backend/rust-compile-expr.cc (CompileExpr::visit): remove receiver interface
1404 * backend/rust-compile-item.cc (CompileItem::visit): monomorphize trait to impl item
1405 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): use trait item Self
1406 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): remove receiver interface
1407 (TypeCheckExpr::resolve_fn_trait_call): likewise
1408 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): likewise
1409 (TypeCheckExpr::resolve_segments): likewise
1410 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
1411 * typecheck/rust-hir-type-check.h: likewise
1412 * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_receiver): remove
1413 (TypeCheckContext::lookup_receiver): remove
1414
1415 2025-03-24 Philip Herron <[email protected]>
1416
1417 * typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit):
1418 continue on for trait item mode.
1419
1420 2025-03-24 Philip Herron <[email protected]>
1421
1422 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
1423 Add guard for placeholder
1424
1425 2025-03-24 Philip Herron <[email protected]>
1426
1427 * typecheck/rust-type-util.cc (coercion_site): allow inference vars
1428
1429 2025-03-24 Philip Herron <[email protected]>
1430
1431 * typecheck/rust-hir-path-probe.cc (PathProbeType::visit): remove assertion
1432
1433 2025-03-24 Philip Herron <[email protected]>
1434
1435 * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): add checks for lang items
1436
1437 2025-03-24 Owen Avery <[email protected]>
1438
1439 * resolve/rust-early-name-resolver-2.0.cc
1440 (Early::resolve_glob_import): Use
1441 NameResolutionContext::resolve_path instead of
1442 ForeverStack::resolve_path.
1443 (Early::visit): Likewise.
1444 (Early::visit_attributes): Likewise.
1445 * resolve/rust-early-name-resolver-2.0.h
1446 (Early::resolve_path_in_all_ns): Likewise.
1447 * resolve/rust-late-name-resolver-2.0.cc
1448 (Late::visit): Likewise, insert segment resolutions not
1449 handled by NameResolutionContext::resolve_path, and avoid throwing
1450 an error when path resolution could be finished by the typechecker.
1451 * resolve/rust-name-resolution-context.h
1452 (NameResolutionContext::resolve_path): Add.
1453 * typecheck/rust-hir-type-check-path.cc
1454 (TypeCheckExpr::resolve_root_path): Use segment node ids instead
1455 of the path node id to look up segment resolutions when using
1456 the 2.0 resolver, as is done with the 1.0 resolver.
1457 * typecheck/rust-hir-type-check-type.cc
1458 (TypeCheckType::resolve_root_path): Likewise.
1459 * resolve/rust-forever-stack.h
1460 (ForeverStack::resolve_path): Add callback parameter for
1461 inserting segment resolutions.
1462 (ForeverStack::find_starting_point): Likewise.
1463 (ForeverStack::resolve_segments): Likewise.
1464 * resolve/rust-forever-stack.hxx
1465 (ForeverStack::find_starting_point): Likewise.
1466 (ForeverStack::resolve_segments): Likewise.
1467 (ForeverStack::resolve_path): Likewise and avoid resolving
1468 inside TraitOrImpl ribs.
1469
1470 2025-03-24 Owen Avery <[email protected]>
1471
1472 * backend/rust-compile-expr.cc
1473 (CompileExpr::generate_closure_function): Take
1474 NameResolutionContext by reference instead of by value.
1475 * backend/rust-compile-item.cc
1476 (CompileItem::visit): Likewise.
1477 * backend/rust-compile-resolve-path.cc
1478 (ResolvePathRef::resolve): Likewise.
1479 * checks/lints/rust-lint-marklive.cc
1480 (MarkLive::find_ref_node_id): Likewise.
1481 * typecheck/rust-hir-type-check-enumitem.cc
1482 (TypeCheckEnumItem::visit): Likewise.
1483 * typecheck/rust-hir-type-check-implitem.cc
1484 (TypeCheckImplItem::visit): Likewise.
1485 * typecheck/rust-hir-type-check-item.cc
1486 (TypeCheckItem::visit): Likewise.
1487 * typecheck/rust-hir-type-check-path.cc
1488 (TypeCheckExpr::resolve_root_path): Likewise.
1489 * typecheck/rust-hir-type-check-type.cc
1490 (TypeCheckType::resolve_root_path): Likewise.
1491
1492 2025-03-24 Arthur Cohen <[email protected]>
1493
1494 * ast/rust-ast-builder.h: Declare it.
1495 * ast/rust-ast-builder.cc (Builder::return_expr): Define it.
1496
1497 2025-03-24 Arthur Cohen <[email protected]>
1498
1499 * expand/rust-derive-debug.cc: New file.
1500 * expand/rust-derive-debug.h: New file.
1501 * Make-lang.in: Compile them.
1502 * expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveDebug.
1503
1504 2025-03-24 Arthur Cohen <[email protected]>
1505
1506 * expand/rust-derive-clone.cc: Cleanup using DeriveVisitor::setup_impl_generics.
1507 * expand/rust-derive-copy.cc: Likewise.
1508
1509 2025-03-24 Arthur Cohen <[email protected]>
1510
1511 * expand/rust-derive.cc (DeriveVisitor::setup_impl_generics): New method.
1512 * expand/rust-derive.h: Declare it, define DeriveVisitor::ImplGenerics struct.
1513
1514 2025-03-24 Arthur Cohen <[email protected]>
1515
1516 * ast/rust-ast-builder.cc: New methods.
1517 * ast/rust-ast-builder.h: Declare them.
1518
1519 2025-03-24 Arthur Cohen <[email protected]>
1520
1521 * ast/rust-ast-builder.cc (Builder::type_path): New functions.
1522 * ast/rust-ast-builder.h: Declare them.
1523
1524 2025-03-24 Arthur Cohen <[email protected]>
1525
1526 * checks/lints/rust-lint-scan-deadcode.h: Check if the field name starts with an
1527 underscore before warning.
1528
1529 2025-03-24 Arthur Cohen <[email protected]>
1530
1531 * util/rust-lang-item.cc: New items.
1532 * util/rust-lang-item.h: Likewise.
1533
1534 2025-03-24 Arthur Cohen <[email protected]>
1535
1536 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Special case lang item paths.
1537
1538 2025-03-24 Owen Avery <[email protected]>
1539
1540 * resolve/rust-forever-stack.hxx
1541 (ForeverStack::dfs_rib): Fix const implementation.
1542
1543 2025-03-24 Liam Naddell <[email protected]>
1544
1545 * expand/rust-macro-builtins-utility.cc: Add macro expansion for
1546 option_env with eager expansion
1547 * expand/rust-macro-builtins.cc: Add option_env to builtin list
1548 * expand/rust-macro-builtins.h: Add option_env handler to header
1549 file
1550 * resolve/rust-late-name-resolver-2.0.cc: Prevent NR2.0 from
1551 recursing into lang-item segments
1552
1553 2025-03-24 Arthur Cohen <[email protected]>
1554
1555 * ast/rust-ast.h: Add new Expr::Kinds.
1556 * ast/rust-expr.h: Implement missing get_expr_kind(), Add get_function_expr_ptr()
1557
1558 2025-03-24 Philip Herron <[email protected]>
1559
1560 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): make recursive
1561 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): handle ref flag
1562
1563 2025-03-24 Arthur Cohen <[email protected]>
1564
1565 * util/rust-lang-item.h: Declare it.
1566 * util/rust-lang-item.cc: Use it.
1567
1568 2025-03-24 Philip Herron <[email protected]>
1569
1570 * backend/rust-compile-expr.cc (CompileExpr::visit): disable overflow checks
1571 * lang.opt: new flag
1572
1573 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1574
1575 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Do
1576 not use query system for unit struct but compile it's constructor
1577 instead.
1578
1579 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1580
1581 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
1582 Query all namespaces.
1583
1584 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1585
1586 * resolve/rust-forever-stack.h: Make debug functions const.
1587 * resolve/rust-forever-stack.hxx: Likewise.
1588
1589 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1590
1591 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit):
1592 Clone expr instead of taking it.
1593
1594 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1595
1596 * backend/rust-compile-item.h: Remove query mode.
1597 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
1598 Likewise.
1599
1600 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1601
1602 * resolve/rust-ast-resolve-toplevel.h: Add struct to name namespace.
1603
1604 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1605
1606 * resolve/rust-name-resolver.h: Add new degug dump for old name
1607 resolver.
1608
1609 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1610
1611 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Change label
1612 push function from type rib to label rib.
1613 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
1614 Likewise.
1615 (ResolveItem::visit): Likewise.
1616 (ResolveExternItem::visit): Likewise.
1617 * resolve/rust-ast-resolve-stmt.h: Likewise.
1618 * resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
1619
1620 2025-03-24 Arthur Cohen <[email protected]>
1621
1622 * backend/rust-compile-resolve-path.cc (ResolvePathRef::visit): Call into
1623 resolve_path_like instead.
1624 (ResolvePathRef::resolve_path_like): New.
1625 (ResolvePathRef::resolve): Call into resolve_with_node_id.
1626 * backend/rust-compile-resolve-path.h: Declare new functions and document them.
1627
1628 2025-03-24 Arthur Cohen <[email protected]>
1629
1630 * ast/rust-path.h: New function.
1631
1632 2025-03-24 Arthur Cohen <[email protected]>
1633
1634 * checks/lints/rust-lint-marklive.cc (MarkLive::visit): Adapt to lang items.
1635
1636 2025-03-24 Arthur Cohen <[email protected]>
1637
1638 * backend/rust-compile-resolve-path.cc (ResolvePathRef::visit): Adapt visitor to lang item
1639 HIR::PathInExpressions.
1640 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): Likewise.
1641
1642 2025-03-24 Arthur Cohen <[email protected]>
1643
1644 * hir/tree/rust-hir-path.h: Adapt PathPattern to accept lang-item paths.
1645 * hir/tree/rust-hir-path.cc: Assert we are dealing with a segmented path, create lang-item
1646 constructors.
1647 * hir/tree/rust-hir.cc (PathPattern::convert_to_simple_path): Likewise.
1648
1649 2025-03-24 Arthur Cohen <[email protected]>
1650
1651 * ast/rust-ast-collector.cc (TokenCollector::visit): Adapt visitor to lang item
1652 PathInExpressions.
1653 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
1654 * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
1655 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
1656 * hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): Likewise.
1657 (ASTLowerPathInExpression::visit): Likewise.
1658 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
1659 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
1660
1661 2025-03-24 Arthur Cohen <[email protected]>
1662
1663 * util/rust-lang-item.cc (LangItem::IsEnumVariant): New function.
1664 * util/rust-lang-item.h: Declare it.
1665
1666 2025-03-24 Arthur Cohen <[email protected]>
1667
1668 * util/rust-hir-map.cc (Mappings::get_lang_item_node): Better formatting when a lang
1669 item does not exist when it should.
1670
1671 2025-03-24 Arthur Cohen <[email protected]>
1672
1673 * ast/rust-collect-lang-items.h: Declare visitor.
1674 * ast/rust-collect-lang-items.cc (CollectLangItems::visit): New.
1675
1676 2025-03-24 Philip Herron <[email protected]>
1677
1678 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): add guard
1679
1680 2025-03-24 Dylan Gardner <[email protected]>
1681
1682 * rust-session-manager.cc (Session::handle_crate_name): Remove
1683 crate name inference
1684 (Session::compile_crate): Add crate name inference and error if
1685 inferred name is empty. Remove CompileOptions::get_instance ()
1686 that returned a local copy of the options. Rename
1687 crate_name_changed to crate_name_found to match semantics.
1688 (rust_crate_name_validation_test): Test inferring ".rs" name
1689 * rust-session-manager.h: Modify handle_crate_name definition to
1690 include filename.
1691
1692 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1693
1694 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add
1695 ClosureExprInnerTyped visit implementation.
1696 (add_captures): Add a function to avoid code duplication.
1697 * resolve/rust-late-name-resolver-2.0.h: Add function prototype.
1698
1699 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1700
1701 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add environment
1702 collection.
1703 * resolve/rust-late-name-resolver-2.0.h: Add function prototype.
1704 * resolve/rust-name-resolver.cc (Resolver::get_captures): Add assertion
1705 to prevent NR2 usage with nr1 capture functions.
1706 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Use
1707 nr2 captures.
1708 * util/rust-hir-map.cc (Mappings::add_capture): Add function to
1709 register capture for a given closure.
1710 (Mappings::lookup_captures): Add a function to lookup all captures
1711 available for a given closure.
1712 * util/rust-hir-map.h: Add function prototypes.
1713
1714 2025-03-24 Owen Avery <[email protected]>
1715
1716 * resolve/rust-late-name-resolver-2.0.cc
1717 (Late::visit): Error out if a type path has multiple segments,
1718 as we currently ignore every segment except the last.
1719
1720 2025-03-24 Arthur Cohen <[email protected]>
1721
1722 * backend/rust-compile-expr.cc (check_match_scrutinee): Allow anything to be used as a
1723 match scrutinee, not just ADTs.
1724
1725 2025-03-24 Arthur Cohen <[email protected]>
1726
1727 * util/rust-lang-item.h: Add handling for Result::Ok, Result::Err, Try, Try::into_result,
1728 Try::from_ok, Try::from_err.
1729 * util/rust-lang-item.cc: Likewise.
1730
1731 2025-03-24 Pierre-Emmanuel Patry <[email protected]>
1732
1733 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add "rust"
1734 identifier detection akin to nr1.
1735 (funny_ice_finalizer): Copy ICE finalizer from nr1.
1736 * resolve/rust-late-name-resolver-2.0.h: Add funny_error member
1737 context state.
1738 * Make-lang.in: Add new translation unit for new ice finalizer.
1739 * resolve/rust-ast-resolve-expr.cc: Move ice
1740 finalizer to it's own file.
1741 * resolve/rust-ice-finalizer.cc: New file.
1742 * resolve/rust-ice-finalizer.h: New file.
1743
1744 2025-03-24 Arthur Cohen <[email protected]>
1745
1746 * expand/rust-derive-copy.cc: Always add an extra Copy bound on generic Copy impls.
1747
1748 2025-03-24 Arthur Cohen <[email protected]>
1749
1750 * expand/rust-derive-clone.cc (DeriveClone::visit_union): Use lang items for Copy and
1751 Sized bounds.
1752
1753 2025-03-24 Arthur Cohen <[email protected]>
1754
1755 * expand/rust-derive-clone.cc: Add extra bound when deriving generic Clone
1756
1757 2025-03-24 Arthur Cohen <[email protected]>
1758
1759 * ast/rust-ast-builder.cc (Builder::new_type_param): Add optional extra trait bounds.
1760 * ast/rust-ast-builder.h: Likewise.
1761
1762 2025-03-24 Arthur Cohen <[email protected]>
1763
1764 * hir/rust-hir-dump.cc (Dump::do_typepathsegment): Add handling for lang items.
1765
1766 2025-03-24 lishin <[email protected]>
1767
1768 * util/rust-lang-item.cc: Add receiver to map.
1769 * util/rust-lang-item.h: Define LangItem::Kind::RECEIVER.
1770
1771 2025-03-24 Arthur Cohen <[email protected]>
1772
1773 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Register auto traits in mappings.
1774 * util/rust-hir-map.cc (Mappings::insert_auto_trait): New.
1775 (Mappings::get_auto_traits): New.
1776 * util/rust-hir-map.h: Declare them.
1777 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Add auto trait bounds when
1778 scanning.
1779
1780 2025-03-24 Arthur Cohen <[email protected]>
1781
1782 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::add_trait_bound): New function.
1783 * typecheck/rust-hir-type-bounds.h: Declare it.
1784 (TypeBoundsProbe::assemble_builtin_candidate): Call into add_trait_bound.
1785
1786 2025-03-21 Arthur Cohen <[email protected]>
1787
1788 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Improve formatting.
1789
1790 2025-03-21 Arthur Cohen <[email protected]>
1791
1792 * expand/rust-derive-clone.cc (DeriveClone::clone_enum_struct): New function for deriving
1793 enum struct variants.
1794 (DeriveClone::visit_enum): Call into the new function.
1795
1796 2025-03-21 Arthur Cohen <[email protected]>
1797
1798 * expand/rust-derive-clone.cc (DeriveClone::variant_match_path): New function.
1799 (DeriveClone::clone_enum_identifier): Rename.
1800 (DeriveClone::clone_enum_tuple): New function.
1801 (DeriveClone::visit_enum): Visit tuple variants properly.
1802 * expand/rust-derive-clone.h: Declare new functions.
1803
1804 2025-03-21 Arthur Cohen <[email protected]>
1805
1806 * ast/rust-ast-builder.cc: Add new methods for constructing struct exprs.
1807 * ast/rust-ast-builder.h: Mention how to build tuple expressions.
1808
1809 2025-03-21 Arthur Cohen <[email protected]>
1810
1811 * expand/rust-derive-clone.cc: Clone enum identifier variants properly
1812 * expand/rust-derive-clone.h: Declare new functions used.
1813
1814 2025-03-21 Arthur Cohen <[email protected]>
1815
1816 * expand/rust-derive-clone.cc (DeriveClone::clone_call): Mention using `clone_fn`
1817 lang item in the future.
1818
1819 2025-03-21 Arthur Cohen <[email protected]>
1820
1821 * expand/rust-derive-clone.cc (DeriveClone::visit_union): Create a lang item path
1822 instead of a regular path.
1823
1824 2025-03-21 Arthur Cohen <[email protected]>
1825
1826 * ast/rust-ast-builder.cc: New functions.
1827 * ast/rust-ast-builder.h: Declare them.
1828
1829 2025-03-21 Arthur Cohen <[email protected]>
1830
1831 * expand/rust-derive-copy.cc: Use lang item path.
1832
1833 2025-03-21 Arthur Cohen <[email protected]>
1834
1835 * expand/rust-derive-clone.cc (DeriveClone::visit_union): Manually generate
1836 the struct used for asserting a union implements Copy.
1837
1838 2025-03-21 Arthur Cohen <[email protected]>
1839
1840 * ast/rust-ast-builder.cc (Builder::struct_struct): New function.
1841 * ast/rust-ast-builder.h (vec): New function.
1842
1843 2025-03-21 Arthur Cohen <[email protected]>
1844
1845 * ast/rust-ast-collector.cc (TokenCollector::visit): Visit tuple pattern items as
1846 separated by commas.
1847
1848 2025-03-21 Arthur Cohen <[email protected]>
1849
1850 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix collector to better
1851 handle lang item type path segments.
1852
1853 2025-03-21 Arthur Cohen <[email protected]>
1854
1855 * util/rust-hir-map.cc (Mappings::get_lang_item_node): New.
1856 * util/rust-hir-map.h: New function.
1857
1858 2025-03-21 Arthur Cohen <[email protected]>
1859
1860 * util/rust-lang-item.cc (LangItem::PrettyString): New.
1861 * util/rust-lang-item.h: New.
1862
1863 2025-03-21 Arthur Cohen <[email protected]>
1864
1865 * ast/rust-collect-lang-items.cc (CollectLangItems::visit): New.
1866 * ast/rust-collect-lang-items.h: New.
1867
1868 2025-03-21 Arthur Cohen <[email protected]>
1869
1870 * hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Adapt code to lang item
1871 type path segments.
1872
1873 2025-03-21 Arthur Cohen <[email protected]>
1874
1875 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Adapt
1876 code to handle lang item type paths.
1877
1878 2025-03-21 Arthur Cohen <[email protected]>
1879
1880 * ast/rust-path.h: Rework how lang item paths are represented.
1881 * ast/rust-path.cc: Likewise.
1882 * ast/rust-item.h: Likewise.
1883 * ast/rust-ast.cc: Likewise.
1884 * ast/rust-ast-collector.cc: Adapt to new lang item path system.
1885 * ast/rust-ast-collector.h: Likewise.
1886 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
1887 * ast/rust-ast-visitor.h: Likewise.
1888 * expand/rust-derive-copy.cc: Likewise.
1889 * expand/rust-derive.h: Likewise.
1890 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
1891 * hir/rust-ast-lower-base.h: Likewise.
1892 * hir/rust-ast-lower-type.cc (ASTLowerTypePath::translate): Likewise.
1893 (ASTLowerTypePath::visit): Likewise.
1894 * hir/rust-ast-lower-type.h: Likewise.
1895 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
1896 * resolve/rust-ast-resolve-base.h: Likewise.
1897 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
1898 * resolve/rust-ast-resolve-type.h: Likewise.
1899 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
1900 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
1901 * resolve/rust-late-name-resolver-2.0.h: Likewise.
1902 * hir/tree/rust-hir-path.cc (TypePathSegment::TypePathSegment): Likewise.
1903 (TypePathSegmentGeneric::TypePathSegmentGeneric): Likewise.
1904 * hir/tree/rust-hir-path.h: Likewise.
1905 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Likewise.
1906 * ast/rust-ast-builder.cc: Likewise.
1907 * ast/rust-ast-builder.h: Likewise.
1908
1909 2025-03-21 Arthur Cohen <[email protected]>
1910
1911 * ast/rust-collect-lang-items.cc (get_lang_item_attr): Show unknown attribute upon error.
1912
1913 2025-03-21 Arthur Cohen <[email protected]>
1914
1915 * util/rust-attribute-values.h: Declare new attribute value.
1916 * util/rust-attributes.cc: Use it.
1917
1918 2025-03-21 Arthur Cohen <[email protected]>
1919
1920 * ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Remove overzealous
1921 std::move
1922
1923 2025-03-21 Owen Avery <[email protected]>
1924
1925 * ast/rust-ast-collector.cc
1926 (TokenCollector::visit): Remove visitor for NamedFunctionParam.
1927 * ast/rust-ast-collector.h
1928 (TokenCollector::visit): Likewise.
1929 * ast/rust-ast-full-decls.h
1930 (class NamedFunctionParam): Remove forward declaration.
1931 * ast/rust-ast-visitor.cc
1932 (DefaultASTVisitor::visit): Remove visitor for
1933 NamedFunctionParam.
1934 * ast/rust-ast-visitor.h
1935 (DefaultASTVisitor::visit): Likewise.
1936 * ast/rust-ast.cc
1937 (NamedFunctionParam::as_string): Remove.
1938 * ast/rust-item.h
1939 (class NamedFunctionParam): Remove.
1940 (class ExternalFunctionItem): Remove.
1941 * parse/rust-parse-impl.h
1942 (Parser::parse_named_function_param): Remove.
1943 (Parser::parse_named_function_params): Remove.
1944 * parse/rust-parse.h
1945 (Parser::parse_named_function_param): Remove.
1946 (Parser::parse_named_function_params): Remove.
1947
1948 2025-03-21 Owen Avery <[email protected]>
1949
1950 * resolve/rust-early-name-resolver-2.0.cc
1951 (Early::visit): Resolve the pending eager invocations inside
1952 builtin macro invocations.
1953
1954 2025-03-21 Philip Herron <[email protected]>
1955
1956 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): hir lowering
1957 * hir/rust-ast-lower-stmt.h: likewise
1958 * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): name resolution
1959 * resolve/rust-ast-resolve-stmt.h: likewise
1960
1961 2025-03-21 Owen Avery <[email protected]>
1962
1963 * Make-lang.in: Handle rust-forever-stack.cc.
1964 * resolve/rust-forever-stack.h
1965 (class ForeverStackStore): Add.
1966 * resolve/rust-forever-stack.cc: New file, based on
1967 rust-forever-stack.hxx.
1968
1969 2025-03-21 Om Swaroop Nayak <[email protected]>
1970
1971 * ast/rust-collect-lang-items.cc (get_lang_item_attr): "removed checker fn"
1972 * util/rust-attributes.cc (Attributes::is_lang_item): "added fn"
1973 * util/rust-attributes.h: "added fn"
1974
1975 2025-03-21 Philip Herron <[email protected]>
1976
1977 * checks/errors/rust-readonly-check.cc (check_decl): improve mut check
1978 (emit_error): helper
1979 (check_modify_expr): likewise
1980 (readonly_walk_fn): reuse helper
1981 (ReadonlyCheck::Lint): cleanup context each run
1982
1983 2025-03-21 Owen Avery <[email protected]>
1984
1985 * ast/rust-ast-visitor.cc
1986 (DefaultASTVisitor::visit): When visiting a TraitImpl, visit its
1987 trait path.
1988
1989 2025-03-21 liushuyu <[email protected]>
1990
1991 * backend/rust-compile-intrinsic.cc: add the new `catch_unwind` variant
1992 of the `try` intrinsic: this variant can be seen on Rust 1.78+
1993 and returns `()` instead of `i32`.
1994
1995 2025-03-21 liushuyu <[email protected]>
1996
1997 * backend/rust-compile-intrinsic.cc: add `try` intrinsic handler.
1998 * lang.opt: add `-frust-panic` option.
1999 * rust-lang.cc: enable exception handler code generation.
2000 * rust-session-manager.cc: add getter and setter for panic
2001 strategy option.
2002 * rust-session-manager.h: Likewise.
2003
2004 2025-03-21 Philip Herron <[email protected]>
2005
2006 * backend/rust-compile-expr.cc (CompileExpr::visit): implement coercion
2007 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): this is an LUB
2008 * typecheck/rust-unify.cc (UnifyRules::go): remove unify ! coercion
2009
2010 2025-03-21 Nobel <[email protected]>
2011
2012 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): Add rule.
2013
2014 2025-03-21 Philip Herron <[email protected]>
2015
2016 * backend/rust-compile-expr.cc (CompileExpr::visit): new layout
2017 * backend/rust-compile-pattern.cc (CompilePatternCheckExpr::visit): likewise
2018 (CompilePatternBindings::visit): likewise
2019 * backend/rust-compile-resolve-path.cc: likewise
2020 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): implement new layout
2021 * rust-gcc.cc (constructor_expression): get rid of useless assert
2022
2023 2025-03-21 Owen Avery <[email protected]>
2024
2025 * resolve/rust-toplevel-name-resolver-2.0.cc
2026 (TopLevel::visit): Insert a definition for Self when visiting
2027 InherentImpl and TraitImpl instances.
2028 * resolve/rust-toplevel-name-resolver-2.0.h
2029 (TopLevel::visit): Add visitors for InherentImpl and TraitImpl.
2030
2031 2025-03-21 Philip Herron <[email protected]>
2032
2033 * hir/rust-hir-dump.cc (Dump::visit): add null guard
2034
2035 2025-03-21 Philip Herron <[email protected]>
2036
2037 * backend/rust-compile-expr.cc (CompileExpr::visit): handle partial_eq possible call
2038 * backend/rust-compile-expr.h: handle case where lang item calls differ from name
2039 * hir/tree/rust-hir-expr.cc (OperatorExprMeta::OperatorExprMeta): new helper
2040 * hir/tree/rust-hir-expr.h: likewise
2041 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): handle partial_eq
2042 (TypeCheckExpr::resolve_operator_overload): likewise
2043 * typecheck/rust-hir-type-check-expr.h: likewise
2044 * util/rust-lang-item.cc (LangItem::ComparisonToLangItem): map comparison to lang item
2045 (LangItem::ComparisonToSegment): likewise
2046 * util/rust-lang-item.h: new lang items PartialOrd and Eq
2047 * util/rust-operators.h (enum class): likewise
2048
2049 2025-03-21 Philip Herron <[email protected]>
2050
2051 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): check for error
2052 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): likewise and remove debug error
2053
2054 2025-03-21 Owen Avery <[email protected]>
2055
2056 * resolve/rust-default-resolver.cc
2057 (DefaultResolver::visit): Make sure to scope visitation of the
2058 children of type definition items.
2059 * resolve/rust-default-resolver.h
2060 (DefaultResolver::visit): Add overrides for TupleStruct, Union,
2061 and TypeAlias.
2062 * resolve/rust-late-name-resolver-2.0.cc
2063 (Late::visit): Remove override for Enum.
2064 * resolve/rust-late-name-resolver-2.0.h
2065 (Late::visit): Likewise.
2066 * resolve/rust-toplevel-name-resolver-2.0.cc
2067 (TopLevel::visit): Rely more on DefaultResolver::visit.
2068 * resolve/rust-toplevel-name-resolver-2.0.h
2069 (TopLevel::visit): Remove override for BlockExpr.
2070
2071 2025-03-21 Philip Herron <[email protected]>
2072
2073 * hir/rust-hir-dump.cc (Dump::do_qualifiedpathtype): add guard
2074 (Dump::do_traitfunctiondecl): likewise
2075 (Dump::visit): likewise
2076
2077 2025-03-21 Prajwal S N <[email protected]>
2078
2079 * typecheck/rust-hir-type-check.h (class TypeCheckContext): add
2080 header file and use StackedContexts for blocks
2081 * typecheck/rust-typecheck-context.cc: update methods
2082 * typecheck/rust-hir-trait-resolve.cc: refactor function calls
2083 * typecheck/rust-hir-type-check-implitem.cc: refactor function calls
2084 * typecheck/rust-hir-type-check-type.cc: refactor function calls
2085
2086 2025-03-21 Arthur Cohen <[email protected]>
2087
2088 * ast/rust-ast.h: Add new Kind enums, remove Node class.
2089 * ast/rust-builtin-ast-nodes.h: Use new Kind enums.
2090 * ast/rust-expr.h (class LoopLabel): Likewise.
2091 * ast/rust-item.h: Likewise.
2092 * ast/rust-macro.h: Likewise.
2093 * ast/rust-path.h: Likewise.
2094 * expand/rust-macro-builtins-helpers.cc: Likewise.
2095 * expand/rust-macro-builtins-utility.cc (MacroBuiltin::concat_handler): Likewise.
2096 (MacroBuiltin::stringify_handler): Likewise.
2097 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
2098 * resolve/rust-early-name-resolver.cc: Likewise.
2099 * hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Likewise.
2100
2101 2025-03-21 Owen Avery <[email protected]>
2102
2103 * resolve/rust-toplevel-name-resolver-2.0.cc
2104 (TopLevel::visit): Add visitor for TraitItemType.
2105 * resolve/rust-toplevel-name-resolver-2.0.h
2106 (TopLevel::visit): Likewise.
2107
2108 2025-03-21 Arthur Cohen <[email protected]>
2109
2110 * resolve/rust-ast-resolve-type.cc (ResolveType::visit): New visitor to handle
2111 ParenthesizedType.
2112 * resolve/rust-ast-resolve-type.h: Likewise.
2113 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
2114 * typecheck/rust-hir-type-check-type.h: Likewise.
2115
2116 2025-03-21 Arthur Cohen <[email protected]>
2117
2118 * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Add implementation for
2119 ParenthesizedType.
2120 * hir/rust-ast-lower-type.h: Declare that new visitor.
2121
2122 2025-03-21 Owen Avery <[email protected]>
2123
2124 * ast/rust-ast-builder-type.cc: Remove inclusion of
2125 rust-make-unique.h.
2126 * ast/rust-ast-builder.cc: Likewise.
2127 (Builder::array): Use std::make_unique instead of
2128 Rust::make_unique.
2129 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Likewise.
2130 * ast/rust-macro.h: Remove inclusion of rust-make-unique.h.
2131 (MacroRulesDefinition::mbe): Use std::make_unique instead of
2132 Rust::make_unique.
2133 (MacroRulesDefinition::decl_macro): Likewise.
2134 * ast/rust-path.h
2135 (PathInExpression::PathInExpression): Likewise.
2136 (QualifiedPathInExpression::QualifiedPathInExpression):
2137 Likewise.
2138 * backend/rust-compile-pattern.cc
2139 (CompilePatternCheckExpr::visit): Likewise.
2140 * expand/rust-derive-copy.cc
2141 (DeriveCopy::copy_impl): Likewise.
2142 * expand/rust-expand-format-args.cc
2143 (expand_format_args): Likewise.
2144 * expand/rust-macro-builtins-asm.cc: Remove inclusion of
2145 rust-make-unique.h.
2146 (parse_asm): Use std::make_unique instead of Rust::make_unique.
2147 * hir/rust-ast-lower-expr.cc
2148 (ASTLoweringExpr::visit): Likewise.
2149 * hir/tree/rust-hir-expr.cc
2150 (StructExprStructFields::StructExprStructFields): Likewise.
2151 (StructExprStructFields::operator=): Likewise.
2152 * hir/tree/rust-hir.cc
2153 (TypePath::to_trait_bound): Likewise.
2154 * lex/rust-token.h: Remove inclusion of rust-make-unique.h.
2155 (Token::Token): Use std::make_unique instead of
2156 Rust::make_unique.
2157 * metadata/rust-import-archive.cc: Remove inclusion of
2158 rust-make-unique.h.
2159 (Import::find_archive_export_data): Use std::make_unique instead
2160 of Rust::make_unique.
2161 * metadata/rust-imports.cc: Remove inclusion of
2162 rust-make-unique.h.
2163 (Import::find_export_data): Use std::make_unique instead of
2164 Rust::make_unique.
2165 (Import::find_object_export_data): Likewise.
2166 * parse/rust-parse-impl.h: Remove inclusion of
2167 rust-make-unique.h.
2168 (Parser::parse_function_param): Use std::make_unique instead of
2169 Rust::make_unique.
2170 (Parser::parse_self_param): Likewise.
2171 (Parser::parse_array_expr): Likewise.
2172 * typecheck/rust-hir-type-check-enumitem.cc
2173 (TypeCheckEnumItem::visit): Likewise.
2174 * typecheck/rust-hir-type-check-implitem.cc
2175 (TypeCheckTopLevelExternItem::visit): Likewise.
2176 (TypeCheckImplItem::visit): Likewise.
2177 * typecheck/rust-hir-type-check-type.cc
2178 (TypeResolveGenericParam::visit): Likewise.
2179 * typecheck/rust-hir-type-check.cc: Remove inclusion of
2180 rust-make-unique.h.
2181 (TraitItemReference::get_type_from_fn): Use std::make_unique
2182 instead of Rust::make_unique.
2183 * typecheck/rust-tyty-bounds.cc
2184 (TypeCheckBase::get_predicate_from_bound): Likewise.
2185 * util/rust-make-unique.h: Removed.
2186
2187 2025-03-21 Arthur Cohen <[email protected]>
2188
2189 * ast/rust-item.h: Add EnumItem::Kind for differentiating all variants that may be
2190 used inside an enum declaration.
2191
2192 2025-03-21 Owen Avery <[email protected]>
2193
2194 * ast/rust-ast-visitor.cc
2195 (DefaultASTVisitor::visit): Visit implicit Self parameters of
2196 traits.
2197 * resolve/rust-late-name-resolver-2.0.cc
2198 (Late::visit): Resolve implicit Self parameters of traits.
2199 * resolve/rust-late-name-resolver-2.0.h:
2200 (Late::visit): Add trait visitor.
2201 * resolve/rust-toplevel-name-resolver-2.0.cc
2202 (TopLevel::visit): Insert resolutions for Self type parameters
2203 as well.
2204
2205 2025-03-21 Liam Naddell <[email protected]>
2206
2207 * resolve/rust-late-name-resolver-2.0.cc:
2208 Change the late name resolver to enter proper lexical scope during typechecking
2209 * resolve/rust-late-name-resolver-2.0.h:
2210 Add needed prototype to header
2211 * resolve/rust-toplevel-name-resolver-2.0.cc:
2212 Add generic parameters to enum's scoped RIB to allow for proper name resolution on types.
2213
2214 2025-03-21 Arthur Cohen <[email protected]>
2215
2216 * ast/rust-ast-builder.cc: Add new functions.
2217 * ast/rust-ast-builder.h: Declare them.
2218
2219 2025-03-21 Arthur Cohen <[email protected]>
2220
2221 * ast/rust-path.h: Add two new constructors.
2222
2223 2025-03-21 Arthur Cohen <[email protected]>
2224
2225 * ast/rust-collect-lang-items.cc (CollectLangItems::visit): Add visitor for collecting
2226 functions that might be lang items.
2227 * ast/rust-collect-lang-items.h: Likewise.
2228
2229 2025-03-21 Arthur Cohen <[email protected]>
2230
2231 * util/rust-lang-item.h: Add new lang items.
2232 * util/rust-lang-item.cc: Likewise.
2233
2234 2025-03-21 Arthur Cohen <[email protected]>
2235
2236 * util/rust-lang-item.h: Add Sync marker trait.
2237 * util/rust-lang-item.cc: Likewise.
2238
2239 2025-03-21 Arthur Cohen <[email protected]>
2240
2241 * typecheck/rust-hir-type-check-type.cc: Add TODO note.
2242
2243 2025-03-21 Arthur Cohen <[email protected]>
2244
2245 * resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit): Resolve additional
2246 trait bounds.
2247 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Error out properly on unresolved
2248 type-path instead of crashing.
2249
2250 2025-03-21 Arthur Cohen <[email protected]>
2251
2252 * typecheck/rust-hir-path-probe.cc: Fix typos.
2253 * typecheck/rust-hir-path-probe.h: Likewise.
2254 * typecheck/rust-hir-type-check-path.cc: Likewise.
2255
2256 2025-03-21 Nobel <[email protected]>
2257
2258 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): Add rule.
2259
2260 2025-03-21 Sri Ganesh Thota <[email protected]>
2261
2262 * ast/rust-item.h: I have changed helper constructor for typepath
2263 to be a delegating constructor.
2264
2265 2025-03-21 Philip Herron <[email protected]>
2266
2267 * backend/rust-compile-fnparam.cc (CompileFnParam::visit): compile tuple patterns
2268 (CompileSelfParam::compile): update return type
2269 (CompileFnParam::create_tmp_param_var): return Bvariable not tree to stop ICE
2270 * backend/rust-compile-fnparam.h: update prototype
2271 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): implement TuplePattern
2272 * backend/rust-compile-pattern.h: update prototype
2273
2274 2025-03-21 Philip Herron <[email protected]>
2275
2276 * rust-gcc.cc (operator_to_tree_code): ! expressions are BIT_NOT_EXPR
2277
2278 2025-03-21 Arthur Cohen <[email protected]>
2279
2280 * ast/rust-path.h: Adapt children of Path to fix some NodeId issues.
2281
2282 2025-03-21 Arthur Cohen <[email protected]>
2283
2284 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): New.
2285 * resolve/rust-late-name-resolver-2.0.h: New.
2286
2287 2025-03-21 Arthur Cohen <[email protected]>
2288
2289 * hir/rust-ast-lower-type.cc (ASTLowerTypePath::translate): Adapt to
2290 handle lang item paths.
2291 (ASTLowerTypePath::visit): Likewise.
2292 (ASTLowerTypePath::translate_type_path): New.
2293 (ASTLowerTypePath::translate_lang_item_type_path): New.
2294 * hir/rust-ast-lower-type.h: Adapt to handle lang item paths.
2295 * resolve/rust-ast-resolve-type.h: Likewise.
2296
2297 2025-03-21 Arthur Cohen <[email protected]>
2298
2299 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Adapt resolver
2300 to lang item paths.
2301 * resolve/rust-ast-resolve-type.h: Likewise.
2302
2303 2025-03-21 Arthur Cohen <[email protected]>
2304
2305 * ast/rust-item.h: Add new method to specifically get a type-path.
2306 * ast/rust-path.cc (LangItemPath::as_string): Implement properly.
2307 * hir/rust-ast-lower-type.cc (ASTLowerTypePath::translate): Adapt
2308 visitor to use the new LangItemPath.
2309 * hir/rust-ast-lower-type.h: Likewise.
2310 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
2311 * resolve/rust-ast-resolve-type.h: Likewise.
2312
2313 2025-03-21 Arthur Cohen <[email protected]>
2314
2315 * expand/rust-derive-copy.cc: Use new LangItemPath for derive(Copy).
2316
2317 2025-03-21 Arthur Cohen <[email protected]>
2318
2319 * ast/rust-path.h (class LangItemPath): New.
2320 (class TypePath): Adapt to accomodate LangItemPath.
2321 * ast/rust-ast.cc (TraitImpl::as_string): Use new checks for lang items.
2322 (QualifiedPathType::as_string): Likewise.
2323 (FormatArgs::set_outer_attrs): Likewise.
2324 * ast/rust-item.h (class TraitImpl): Likewise.
2325
2326 2025-03-21 Owen Avery <[email protected]>
2327
2328 * resolve/rust-forever-stack.h
2329 (ForeverStack::find_starting_point): Use type
2330 'std::reference_wrapper<Node> &' instead of 'Node &' for
2331 parameter starting_point.
2332 * resolve/rust-forever-stack.hxx
2333 (ForeverStack::find_starting_point): Likewise.
2334 (ForeverStack::resolve_path): Handle change to
2335 ForeverStack::find_starting_point.
2336
2337 2025-03-21 Arthur Cohen <[email protected]>
2338
2339 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
2340 Remove unused capture in lambda.
2341
2342 2025-03-21 Arthur Cohen <[email protected]>
2343
2344 * util/rust-attributes.h (class Attributes): New.
2345 * util/rust-attributes.cc: Implement Attributes::is_known().
2346 * ast/rust-collect-lang-items.cc (is_known_attribute): Remove.
2347 (get_lang_item_attr): Call Attributes::is_known() instead.
2348 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Likewise.
2349 (ASTLoweringBase::is_known_attribute): Remove.
2350
2351 2025-03-21 Arthur Cohen <[email protected]>
2352
2353 * Make-lang.in: Add new object file.
2354 * rust-session-manager.cc (Session::compile_crate): Call CollectLangItems.
2355 * ast/rust-collect-lang-items.cc: New file.
2356 * ast/rust-collect-lang-items.h: New file.
2357
2358 2025-03-21 Arthur Cohen <[email protected]>
2359
2360 * util/rust-hir-map.h: Keep a NodeId mappings for lang items.
2361 * util/rust-hir-map.cc (Mappings::insert_lang_item_node): New function.
2362 (Mappings::lookup_lang_item_node): Likewise.
2363
2364 2025-03-21 Philip Herron <[email protected]>
2365
2366 * hir/rust-hir-dump.cc (Dump::visit): add missing check for no return value
2367
2368 2025-03-21 Philip Herron <[email protected]>
2369
2370 * backend/rust-constexpr.cc (eval_store_expression): check for null
2371 (eval_call_expression): remove bad warning
2372 * rust-gcc.cc (arithmetic_or_logical_expression): add warnings
2373
2374 2025-03-21 Philip Herron <[email protected]>
2375
2376 * backend/rust-compile-base.cc: apply coercion site to result
2377 * backend/rust-compile-base.h: update prototype
2378 * backend/rust-compile-implitem.cc (CompileTraitItem::visit): send in coercion info
2379 * backend/rust-compile-item.cc (CompileItem::visit): likewise
2380
2381 2025-03-21 Philip Herron <[email protected]>
2382
2383 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): remove assertions
2384
2385 2025-03-21 Arthur Cohen <[email protected]>
2386
2387 * ast/rust-ast-visitor.h: Replace context with StackedContexts.
2388 * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Use new APIs.
2389 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Likewise.
2390
2391 2025-03-21 Arthur Cohen <[email protected]>
2392
2393 * util/rust-stacked-contexts.h: Add new method to see what context we are currently in.
2394
2395 2025-03-21 Arthur Cohen <[email protected]>
2396
2397 * hir/tree/rust-hir-item.h: Remove TraitItemFunc::has_block_defined()
2398 * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
2399 Call TraitItemFunc::has_definition() instead.
2400 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
2401 * checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): Likewise.
2402 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
2403 * typecheck/rust-hir-trait-resolve.cc (ResolveTraitItemToRef::visit): Likewise.
2404
2405 2025-03-21 Arthur Cohen <[email protected]>
2406
2407 * util/rust-hir-map.h: Move definitions from header...
2408 * util/rust-hir-map.cc: ...to source file.
2409
2410 2025-03-21 Arthur Cohen <[email protected]>
2411
2412 * util/rust-lang-item.h: Fix comment location to align with other comments.
2413
2414 2025-03-21 Philip Herron <[email protected]>
2415
2416 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly
2417 * rust-backend.h (struct_type): add optional layout parameter
2418 (union_type): likewise
2419 (fill_in_fields): likewise
2420 * rust-gcc.cc (struct_type): likewise
2421 (union_type): likewise
2422 (fill_in_fields): only layout if we required
2423
2424 2025-03-21 Philip Herron <[email protected]>
2425
2426 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): allow casts to float
2427
2428 2025-03-21 Philip Herron <[email protected]>
2429
2430 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): track trait
2431 * typecheck/rust-hir-type-check-implitem.cc: trait block
2432 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): dont when dyn
2433 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): look at Self contenxt
2434 (TypeCheckType::resolve_root_path): track if Self
2435 (TypeCheckType::resolve_associated_type): look at current context for associated types
2436 * typecheck/rust-hir-type-check-type.h: change prototype
2437 * typecheck/rust-hir-type-check.h (class TypeCheckBlockContextItem):
2438 new context system to track current state
2439 * typecheck/rust-typecheck-context.cc (TypeCheckContext::have_block_context): likewise
2440 (TypeCheckContext::peek_block_context): likewise
2441 (TypeCheckContext::push_block_context): likewise
2442 (TypeCheckContext::pop_block_context): likewise
2443 (TypeCheckBlockContextItem::Item::Item): likewise
2444 (TypeCheckBlockContextItem::TypeCheckBlockContextItem): likewise
2445 (TypeCheckBlockContextItem::is_impl_block): likewise
2446 (TypeCheckBlockContextItem::is_trait_block): likewise
2447 (TypeCheckBlockContextItem::get_impl_block): likewise
2448 (TypeCheckBlockContextItem::get_trait): likewise
2449
2450 2025-03-21 Philip Herron <[email protected]>
2451
2452 * hir/rust-hir-dump.cc (Dump::visit): add missing null checks
2453
2454 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2455
2456 * backend/rust-compile-base.cc: Prepend crate name to function's ir
2457 name.
2458
2459 2025-03-21 Owen Avery <[email protected]>
2460
2461 * resolve/rust-name-resolver.cc: Include options.txt.
2462 (Resolver::insert_resolved_name): Assert that name resolution
2463 2.0 is disabled.
2464 (Resolver::lookup_resolved_name): Likewise.
2465 (Resolver::insert_resolved_type): Likewise.
2466 (Resolver::lookup_resolved_type): Likewise.
2467 (Resolver::insert_resolved_label): Likewise.
2468 (Resolver::lookup_resolved_label): Likewise.
2469 (Resolver::insert_resolved_macro): Likewise.
2470 (Resolver::lookup_resolved_macro): Likewise.
2471 (Resolver::insert_resolved_misc): Likewise.
2472 (Resolver::lookup_resolved_misc): Likewise.
2473
2474 2025-03-21 Philip Herron <[email protected]>
2475
2476 * backend/rust-compile-expr.cc (check_match_scrutinee): check for empty match
2477 (CompileExpr::visit): fix assertion
2478 * checks/errors/rust-hir-pattern-analysis.cc (check_match_usefulness): check for empty
2479 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): resolve to !
2480
2481 2025-03-21 Philip Herron <[email protected]>
2482
2483 * hir/rust-hir-dump.cc (Dump::visit): add guards
2484
2485 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2486
2487 * ast/rust-stmt.h: Remove stdlib include and use rust-system instead.
2488 * backend/rust-compile-expr.cc: Likewise.
2489 * backend/rust-mangle-legacy.cc: Likewise.
2490 * backend/rust-mangle-v0.cc: Likewise.
2491 * hir/rust-hir-dump.cc: Likewise.
2492 * typecheck/rust-hir-type-check-type.cc: Likewise.
2493 * typecheck/rust-tyty.cc: Likewise.
2494 * typecheck/rust-tyty.h: Likewise.
2495 * util/rust-common.h: Likewise.
2496 * util/rust-token-converter.cc: Likewise.
2497 * util/rust-token-converter.h: Likewise.
2498
2499 2025-03-21 Owen Avery <[email protected]>
2500
2501 * typecheck/rust-hir-type-check-expr.cc: Add includes.
2502 (TypeCheckExpr::visit): Use name resolver 2.0.
2503 (TypeCheckExpr::resolve_operator_overload): Likewise.
2504 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
2505 * typecheck/rust-hir-type-check-path.cc
2506 (TypeCheckExpr::visit): Likewise.
2507 (TypeCheckExpr::resolve_segments): Likewise.
2508 * typecheck/rust-hir-type-check-type.cc
2509 (TypeCheckType::resolve_segments): Likewise.
2510 (ResolveWhereClauseItem::visit): Likewise.
2511 (TypeCheckType::visit): Avoid usage of
2512 Resolver::get_unit_type_node_id when handling TupleType, use
2513 name resolver 2.0 when handling QualifiedPathInType.
2514
2515 2025-03-21 Owen Avery <[email protected]>
2516
2517 * resolve/rust-late-name-resolver-2.0.cc
2518 (Late::visit): Call DefaultResolver::visit when visiting
2519 TypePath.
2520
2521 2025-03-21 Owen Avery <[email protected]>
2522
2523 * checks/errors/privacy/rust-privacy-reporter.cc
2524 (PrivacyReporter::check_for_privacy_violation): Use name
2525 resolver 2.0.
2526
2527 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2528
2529 * backend/rust-compile-expr.cc (CompileExpr::visit): Change call.
2530 (CompileExpr::resolve_operator_overload): Update function arguments.
2531 * backend/rust-compile-expr.h: Change the function's prototype to use
2532 a reference wrapper instead of a reference within the optional.
2533
2534 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2535
2536 * typecheck/rust-tyty.h: Change initializer list to default constructor
2537 call.
2538
2539 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2540
2541 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Add template
2542 to tl::optional.
2543 * hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit): Likewise.
2544 * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit):
2545 Likewise.
2546
2547 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2548
2549 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Do not
2550 get a reference if the pattern does not exist.
2551 (TypeCheckMethodCallExpr::check): Likewise.
2552
2553 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2554
2555 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Change the
2556 ternary expression with a more readable if.
2557
2558 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2559
2560 * typecheck/rust-tyty.h: Reverse monomorphization during cloning and
2561 make a new function to explicitly monomorphize.
2562 * typecheck/rust-tyty.cc: Use monomorphization when required.
2563
2564 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2565
2566 * hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit): Forward
2567 an optional to the constructor.
2568 * hir/tree/rust-hir-item.cc (TypeParam::TypeParam): Use an optional
2569 in the constructor.
2570 (TypeParam::operator=): Ensure the TypeParam has a type properly.
2571 (TypeParam::get_type_mappings): Likewise.
2572 * hir/tree/rust-hir-item.h: Wrap the type smart pointer into an
2573 optional.
2574 * hir/tree/rust-hir.cc (TypeParam::as_string): Unwrap optional type
2575 correctly.
2576
2577 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2578
2579 * backend/rust-compile-expr.cc (CompileExpr::visit): Call getter
2580 instead of size function.
2581 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit):
2582 Only check privacy if the type is present.
2583 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Use an optional.
2584 * hir/tree/rust-hir-generic-param.h: Assert type before getting it.
2585 * hir/tree/rust-hir-item.h: Assert pointers before dereference, fix
2586 has_type condition.
2587 * hir/tree/rust-hir-path.h: Add more assertions.
2588 * hir/tree/rust-hir-stmt.cc: Change constructor with optionals.
2589 * hir/tree/rust-hir-stmt.h: Use optionals over smart pointers to
2590 emphasize these fields might be missing.
2591 * hir/tree/rust-hir.cc (LetStmt::as_string): Use getters.
2592 * typecheck/rust-hir-type-check-expr.cc: Clone structures to prevent
2593 parent's fields from being nulled by the move operation.
2594 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Use
2595 optionals.
2596 * typecheck/rust-tyty.cc: Likewise.
2597 * typecheck/rust-tyty.h: Likewise.
2598
2599 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2600
2601 * Make-lang.in: Add new files.
2602 * hir/tree/rust-hir-item.h: Move Item definition and remove
2603 implementations to their corresponding cc file.
2604 * hir/tree/rust-hir-expr.h: Move implementation to the corresponding
2605 cc file.
2606 * hir/tree/rust-hir-path.h: Likewise.
2607 * hir/tree/rust-hir-pattern.h: Likewise.
2608 * hir/tree/rust-hir-stmt.h: Likewise.
2609 * hir/tree/rust-hir-type.h: Likewise.
2610 * hir/tree/rust-hir-visitor.h: Likewise.
2611 * hir/tree/rust-hir.h: Likewise.
2612 * hir/tree/rust-hir.cc (Crate::Crate): Add implementations from Crate
2613 and remove ConstGenericParam implementations to move them to their
2614 own file.
2615 * hir/tree/rust-hir-attrs.h: New file.
2616 * hir/tree/rust-hir-bound-abstract.h: New file.
2617 * hir/tree/rust-hir-bound.h: New file.
2618 * hir/tree/rust-hir-expr-abstract.h: New file.
2619 * hir/tree/rust-hir-expr.cc: New file.
2620 * hir/tree/rust-hir-generic-param.cc: New file.
2621 * hir/tree/rust-hir-generic-param.h: New file.
2622 * hir/tree/rust-hir-item.cc: New file.
2623 * hir/tree/rust-hir-literal.h: New file.
2624 * hir/tree/rust-hir-node.h: New file.
2625 * hir/tree/rust-hir-path.cc: New file.
2626 * hir/tree/rust-hir-pattern-abstract.h: New file.
2627 * hir/tree/rust-hir-simple-path.h: New file.
2628 * hir/tree/rust-hir-stmt.cc: New file.
2629 * hir/tree/rust-hir-trait-bound.h: New file.
2630 * hir/tree/rust-hir-type-abstract.cc: New file.
2631 * hir/tree/rust-hir-type-abstract.h: New file.
2632 * hir/tree/rust-hir-type-no-bounds.h: New file.
2633 * hir/tree/rust-hir-type.cc: New file.
2634 * hir/tree/rust-hir-visibility.h: New file.
2635 * hir/tree/rust-hir-visitable.h: New file.
2636 * checks/lints/rust-lint-marklive.h: Use References.
2637 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Reformat
2638 vectors.
2639 * hir/rust-hir-dump.cc (Dump::visit): Use reference.
2640 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve):
2641 Use references.
2642 * typecheck/rust-tyty-bounds.cc: Likewise.
2643
2644 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2645
2646 * backend/rust-compile-base.cc: Use FnParam getter.
2647 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
2648 * backend/rust-compile-intrinsic.cc: Likewise.
2649 * backend/rust-compile-type.cc: Likewise.
2650 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit):
2651 Only visit childrens if not missing.
2652 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Use
2653 a reference instead of a raw pointer.
2654 * hir/tree/rust-hir-expr.h: Add presence function for return
2655 expression.
2656 * hir/tree/rust-hir-item.h: Remove take_param_name.
2657 * hir/tree/rust-hir.h: Make mapping getter const.
2658 * typecheck/rust-hir-dot-operator.cc (MethodResolver::Select): Use
2659 getter.
2660 * typecheck/rust-hir-type-check-expr.cc: Likewise.
2661 * typecheck/rust-hir-type-check-implitem.cc: Use FnParam vector instead
2662 of std::pair of Pattern and BaseType.
2663 * typecheck/rust-hir-type-check-item.cc: Likewise.
2664 * typecheck/rust-hir-type-check.cc: Likewise.
2665 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Use getters.
2666 (TypeCheckMethodCallExpr::check): Likewise.
2667 * typecheck/rust-tyty-cmp.h: Likewise.
2668 * typecheck/rust-tyty.cc: Use FnParam.
2669 * typecheck/rust-tyty.h (class FnParam): Add FnParam to handle function
2670 parameters instead of handling std::pairs.
2671 * typecheck/rust-unify.cc (UnifyRules::expect_fndef): Use getters.
2672 (UnifyRules::expect_fnptr): Likewise.
2673
2674 2025-03-21 Pierre-Emmanuel Patry <[email protected]>
2675
2676 * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body):
2677 Remove usage of get function to retrieve a raw pointer.
2678 * backend/rust-compile-base.h:
2679 Change API usage from raw pointer to a reference.
2680 * backend/rust-compile-block.cc (CompileBlock::compile): Likewise.
2681 (CompileBlock::visit): Likewise.
2682 (CompileConditionalBlocks::visit): Likewise.
2683 * backend/rust-compile-block.h: Likewise.
2684 * backend/rust-compile-expr.cc (CompileExpr::Compile): Likewise.
2685 (CompileExpr::visit): Likewise.
2686 (check_match_scrutinee): Likewise.
2687 (CompileExpr::array_value_expr): Likewise.
2688 (CompileExpr::array_copied_expr): Likewise.
2689 (CompileExpr::generate_closure_function): Likewise.
2690 (CompileExpr::generate_possible_fn_trait_call): Likewise.
2691 * backend/rust-compile-expr.h: Likewise.
2692 * backend/rust-compile-fnparam.cc (CompileFnParam::compile): Likewise.
2693 (CompileFnParam::visit): Likewise.
2694 * backend/rust-compile-fnparam.h: Likewise.
2695 * backend/rust-compile-implitem.cc (CompileTraitItem::visit): Likewise.
2696 * backend/rust-compile-intrinsic.cc (compile_fn_params): Likewise.
2697 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
2698 * backend/rust-compile-pattern.cc (CompilePatternCheckExpr::visit):
2699 Likewise.
2700 (compile_range_pattern_bound): Likewise.
2701 (CompilePatternBindings::visit): Likewise.
2702 (CompilePatternLet::visit): Likewise.
2703 * backend/rust-compile-pattern.h: Likewise.
2704 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
2705 Likewise.
2706 (HIRCompileBase::query_compile): Likewise.
2707 * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
2708 * backend/rust-compile-struct-field-expr.cc (CompileStructExprField::Compile):
2709 Likewise.
2710 (CompileStructExprField::visit): Likewise.
2711 * backend/rust-compile-struct-field-expr.h: Likewise.
2712 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
2713 * backend/rust-compile-var-decl.h: Likewise.
2714 * backend/rust-compile.cc: Likewise.
2715 * backend/rust-mangle-v0.cc (v0_inherent_or_trait_impl_path): Likewise.
2716 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
2717 Likewise.
2718 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise.
2719 * checks/errors/borrowck/rust-bir-builder-pattern.h: Likewise.
2720 * checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
2721 * checks/errors/borrowck/rust-bir-builder.h: Likewise.
2722 * checks/errors/borrowck/rust-function-collector.h: Likewise.
2723 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_type_privacy):
2724 Likewise.
2725 (PrivacyReporter::visit): Likewise.
2726 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
2727 * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit):
2728 Likewise.
2729 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
2730 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
2731 Likewise.
2732 * checks/lints/rust-lint-marklive.cc (MarkLive::visit): Likewise.
2733 * checks/lints/rust-lint-marklive.h: Likewise.
2734 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
2735 * hir/tree/rust-hir-expr.h: Likewise.
2736 * hir/tree/rust-hir-item.h: Likewise.
2737 * hir/tree/rust-hir-path.h: Likewise.
2738 * hir/tree/rust-hir-pattern.h: Likewise.
2739 * hir/tree/rust-hir-stmt.h: Likewise.
2740 * hir/tree/rust-hir-type.h: Likewise.
2741 * hir/tree/rust-hir.h: Likewise.
2742 * typecheck/rust-autoderef.cc: Likewise.
2743 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
2744 Likewise.
2745 * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
2746 * typecheck/rust-hir-path-probe.cc (PathProbeType::process_impl_item_candidate):
2747 Likewise.
2748 (PathProbeImplTrait::process_trait_impl_items_for_candidates): Likewise.
2749 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
2750 Likewise.
2751 (TraitItemReference::resolve_item): Likewise.
2752 * typecheck/rust-hir-type-check-base.cc: Likewise.
2753 * typecheck/rust-hir-type-check-base.h: Likewise.
2754 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::Resolve):
2755 Likewise.
2756 (TypeCheckEnumItem::visit): Likewise.
2757 * typecheck/rust-hir-type-check-enumitem.h: Likewise.
2758 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::Resolve):
2759 Likewise.
2760 (TypeCheckExpr::visit): Likewise.
2761 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
2762 * typecheck/rust-hir-type-check-expr.h: Likewise.
2763 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::Resolve):
2764 Likewise.
2765 (TypeCheckTopLevelExternItem::visit): Likewise.
2766 (TypeCheckImplItem::visit): Likewise.
2767 (TypeCheckImplItemWithTrait::visit): Likewise.
2768 * typecheck/rust-hir-type-check-implitem.h: Likewise.
2769 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
2770 (TypeCheckItem::resolve_impl_item): Likewise.
2771 (TypeCheckItem::resolve_impl_block_substitutions): Likewise.
2772 (TypeCheckItem::resolve_impl_block_self): Likewise.
2773 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): Likewise.
2774 (TypeCheckExpr::resolve_segments): Likewise.
2775 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::Resolve):
2776 Likewise.
2777 (TypeCheckPattern::visit): Likewise.
2778 (ClosureParamInfer::Resolve): Likewise.
2779 (ClosureParamInfer::visit): Likewise.
2780 * typecheck/rust-hir-type-check-pattern.h: Likewise.
2781 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::Resolve):
2782 Likewise.
2783 (TypeCheckStmt::visit): Likewise.
2784 * typecheck/rust-hir-type-check-stmt.h: Likewise.
2785 * typecheck/rust-hir-type-check-struct-field.h: Likewise.
2786 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::TypeCheckStructExpr):
2787 Likewise.
2788 (TypeCheckStructExpr::Resolve): Likewise.
2789 (TypeCheckStructExpr::resolve): Likewise.
2790 (TypeCheckStructExpr::visit): Likewise.
2791 * typecheck/rust-hir-type-check-type.cc (TypeCheckResolveGenericArguments::resolve):
2792 Likewise.
2793 (TypeCheckType::Resolve): Likewise.
2794 (TypeCheckType::visit): Likewise.
2795 (TypeCheckType::resolve_root_path): Likewise.
2796 (TypeResolveGenericParam::Resolve): Likewise.
2797 (TypeResolveGenericParam::visit): Likewise.
2798 (ResolveWhereClauseItem::visit): Likewise.
2799 * typecheck/rust-hir-type-check-type.h: Likewise.
2800 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
2801 Likewise.
2802 * typecheck/rust-hir-type-check.h: Likewise.
2803 * typecheck/rust-type-util.cc (query_type): Likewise.
2804 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::TypeCheckContextItem):
2805 Likewise.
2806 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
2807 (TypeCheckBase::get_predicate_from_bound): Likewise.
2808 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
2809 (TypeCheckMethodCallExpr::go): Likewise.
2810 (TypeCheckMethodCallExpr::check): Likewise.
2811 * typecheck/rust-tyty-subst.cc: Likewise.
2812 * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): Likewise.
2813 (VariantDef::VariantDef): Remove copy constructor.
2814 (VariantDef::operator=): Change to move operator.
2815 (VariantDef::get_discriminant): Replace return type to a reference
2816 instead of a reference to a unique pointer.
2817 (VariantDef::clone): Change to references.
2818 (VariantDef::monomorphized_clone): Likewise.
2819 (FnType::as_string): Likewise.
2820 (FnType::clone): Likewise.
2821 * typecheck/rust-tyty.h: Likewise.
2822 * util/rust-hir-map.cc (Mappings::insert_hir_impl_block): Likewise.
2823 * backend/rust-compile-asm.cc: Use a reference instead of the raw
2824 pointer value.
2825 * checks/errors/borrowck/rust-bir-builder-pattern.cc: Use references.
2826 * checks/errors/rust-hir-pattern-analysis.cc: Likewise.
2827
2828 2025-03-21 Owen Avery <[email protected]>
2829
2830 * resolve/rust-toplevel-name-resolver-2.0.cc
2831 (TopLevel::visit): Use DefaultResolver::visit and avoid a call
2832 to Identifier::as_string while handling instances of StaticItem.
2833
2834 2025-03-21 Owen Avery <[email protected]>
2835
2836 * resolve/rust-forever-stack.h
2837 (ForeverStack::push): Accept argument of type Rib::Kind rather
2838 than Rib.
2839 * resolve/rust-forever-stack.hxx
2840 (ForeverStack::push): Likewise.
2841 * resolve/rust-name-resolution-context.cc
2842 (NameResolutionContext::scoped): Likewise.
2843 * resolve/rust-name-resolution-context.h
2844 (NameResolutionContext::scoped): Likewise.
2845
2846 2025-03-21 Philip Herron <[email protected]>
2847
2848 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
2849 dont check for unconstrained when the self is not resolved
2850 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
2851 remove bad debug error diagnostic
2852 * typecheck/rust-tyty-subst.cc: likewise
2853
2854 2025-03-21 Arthur Cohen <[email protected]>
2855
2856 * ast/rust-expr.h: Remove invalid usage of `struct`.
2857 * backend/rust-compile-asm.h: Remove unused `translated` member.
2858 * backend/rust-compile-asm.cc (CompileAsm::CompileAsm): Remove usage
2859 of `translated` member.
2860 * checks/errors/rust-unsafe-checker.h: Mark visitor as `override`.
2861 * hir/tree/rust-hir-expr.h (struct AnonConst): Remove unused `locus`
2862 member.
2863
2864 2025-03-21 Arthur Cohen <[email protected]>
2865
2866 * typecheck/rust-tyty-call.h: Remove unused context member.
2867
2868 2025-03-21 Arthur Cohen <[email protected]>
2869
2870 * hir/tree/rust-hir.h: Add override qualifier to overriden method.
2871
2872 2025-03-21 Owen Avery <[email protected]>
2873
2874 * ast/rust-item.h
2875 (Trait::self_param): Add.
2876 (Trait::Trait): Initialize self_param.
2877 (Trait::operator=): Copy self_param.
2878 (Trait::insert_implicit_self): Remove.
2879 (Trait::get_implicit_self): Add.
2880 * hir/rust-ast-lower-item.cc
2881 (ASTLoweringItem::visit): Make sure implicit self is still
2882 lowered to HIR.
2883 * resolve/rust-ast-resolve-item.cc
2884 (ResolveItem::visit): Adjust handling of implicit self.
2885 * resolve/rust-early-name-resolver.cc
2886 (EarlyNameResolver::visit): Add commit to Trait visitor
2887 mentioning that implicit self is not visited.
2888 * resolve/rust-toplevel-name-resolver-2.0.cc
2889 (TopLevel::visit): Remove call to Trait::insert_implicit_self.
2890
2891 2025-03-21 Philip Herron <[email protected]>
2892
2893 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): fix the ty_id
2894
2895 2025-03-21 Philip Herron <[email protected]>
2896
2897 * typecheck/rust-tyty.cc (PlaceholderType::can_resolve): check for empty mappings
2898
2899 2025-03-21 Owen Avery <[email protected]>
2900
2901 * checks/errors/privacy/rust-privacy-reporter.cc:
2902 Include rust-immutable-name-resolution-context.h.
2903 (is_child_module): Use ForeverStack::is_module_descendant if name
2904 resolution 2.0 is enabled.
2905 * resolve/rust-forever-stack.h
2906 (ForeverStack::is_module_descendant): Add.
2907 (ForeverStack::dfs_node): Add.
2908 * resolve/rust-forever-stack.hxx
2909 (ForeverStack::dfs_rib): Use ForeverStack::dfs_node.
2910 (ForeverStack::dfs_node): Add.
2911 (ForeverStack::is_module_descendant): Add.
2912
2913 2025-03-21 Owen Avery <[email protected]>
2914
2915 * checks/errors/privacy/rust-visibility-resolver.cc:
2916 Add includes.
2917 (VisibilityResolver::resolve_module_path): Use name resolver 2.0
2918 (when enabled) to lookup path resolutions.
2919
2920 2025-03-21 Philip Herron <[email protected]>
2921
2922 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): dont infer here
2923
2924 2025-03-21 Owen Avery <[email protected]>
2925
2926 * resolve/rust-late-name-resolver-2.0.cc
2927 (Late::visit): Handle StructExprStruct and use
2928 ForeverStack::resolve_path instead of ForeverStack::get to
2929 resolve struct expression paths.
2930 * resolve/rust-late-name-resolver-2.0.h
2931 (Late::visit): Handle StructExprStruct.
2932
2933 2025-03-21 Owen Avery <[email protected]>
2934
2935 * backend/rust-compile-context.cc
2936 (Context::setup_builtins): Use TypeCheckContext::get_builtins
2937 instead of Resolver::get_builtin_types,
2938 TypeCheckContext::lookup_type_by_node_id, and
2939 TypeCheckContext::lookup_type.
2940 * typecheck/rust-hir-type-check.h
2941 (TypeCheckContext::get_builtins): Add.
2942 * typecheck/rust-typecheck-context.cc
2943 (TypeCheckContext::get_builtins): Add.
2944
2945 2025-03-21 Philip Herron <[email protected]>
2946
2947 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): remove hack
2948
2949 2025-03-21 Owen Avery <[email protected]>
2950
2951 * typecheck/rust-tyty.cc
2952 (TupleType::get_unit_type): Remove parameter, cache return
2953 value.
2954 * typecheck/rust-tyty.h
2955 (TupleType::get_unit_type): Remove parameter.
2956 * resolve/rust-late-name-resolver-2.0.cc
2957 (Late::setup_builtin_types): Adjust calls to get_unit_type.
2958 * resolve/rust-name-resolver.cc
2959 (Resolver::generate_builtins): Likewise.
2960 * typecheck/rust-hir-type-check-expr.cc
2961 (TypeCheckExpr::visit): Likewise.
2962 * typecheck/rust-hir-type-check-implitem.cc
2963 (TypeCheckTopLevelExternItem::visit): Likewise.
2964 (TypeCheckImplItem::visit): Likewise.
2965 * typecheck/rust-hir-type-check-item.cc
2966 (TypeCheckItem::visit): Likewise.
2967 * typecheck/rust-hir-type-check-stmt.cc
2968 (TypeCheckStmt::visit): Likewise.
2969 * typecheck/rust-hir-type-check-type.cc
2970 (TypeCheckType::visit): Likewise.
2971 * typecheck/rust-hir-type-check.cc
2972 (TraitItemReference::get_type_from_fn): Likewise.
2973
2974 2025-03-21 Owen Avery <[email protected]>
2975
2976 * resolve/rust-late-name-resolver-2.0.cc
2977 (Late::visit): Handle SelfParam.
2978 * resolve/rust-late-name-resolver-2.0.h
2979 (Late::visit): Likewise.
2980
2981 2025-03-21 Owen Avery <[email protected]>
2982
2983 * typecheck/rust-hir-trait-resolve.cc: Add includes.
2984 (TraitResolver::resolve_path_to_trait):
2985 Use name resolution 2.0 resolver when enabled.
2986
2987 2025-03-21 Marc Poulhiès <[email protected]>
2988
2989 * backend/rust-compile-block.h: Adjust after removal of
2990 HIR::IfLetExpr and HIR::IfLetExprConseqElse.
2991 * backend/rust-compile-expr.h: Likewise.
2992 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
2993 (ExprStmtBuilder::visit): Likewise.
2994 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise.
2995 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h:
2996 Likewise.
2997 * checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
2998 * checks/errors/borrowck/rust-function-collector.h: Likewise.
2999 * checks/errors/privacy/rust-privacy-reporter.cc
3000 (PrivacyReporter::visit): Likewise.
3001 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
3002 * checks/errors/rust-const-checker.cc (ConstChecker::visit):
3003 Likewise.
3004 * checks/errors/rust-const-checker.h: Likewise.
3005 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
3006 Likewise.
3007 * checks/errors/rust-unsafe-checker.h: Likewise.
3008 * hir/rust-ast-lower-block.h (ASTLoweringIfLetBlock::translate):
3009 Change return type.
3010 * hir/rust-ast-lower.cc (ASTLoweringIfLetBlock::desugar_iflet):
3011 New.
3012 (ASTLoweringIfLetBlock::visit(AST::IfLetExpr &)): Adjust and use
3013 desugar_iflet.
3014 * hir/rust-ast-lower.h: Add comment.
3015 * hir/rust-hir-dump.cc (Dump::do_ifletexpr): Remove.
3016 (Dump::visit(IfLetExpr&)): Remove.
3017 (Dump::visit(IfLetExprConseqElse&)): Remove.
3018 * hir/rust-hir-dump.h (Dump::do_ifletexpr): Remove.
3019 (Dump::visit(IfLetExpr&)): Remove.
3020 (Dump::visit(IfLetExprConseqElse&)): Remove.
3021 * hir/tree/rust-hir-expr.h (class IfLetExpr): Remove.
3022 (class IfLetExprConseqElse): Remove.
3023 * hir/tree/rust-hir-full-decls.h (class IfLetExpr): Remove.
3024 (class IfLetExprConseqElse): Remove.
3025 * hir/tree/rust-hir-visitor.h: Adjust after removal of
3026 HIR::IfLetExpr and HIR::IfLetExprConseqElse.
3027 * hir/tree/rust-hir.cc (IfLetExpr::as_string): Remove.
3028 (IfLetExprConseqElse::as_string): Remove.
3029 (IfLetExpr::accept_vis): Remove.
3030 (IfLetExprConseqElse::accept_vis): Remove.
3031 * hir/tree/rust-hir.h: Adjust after removal of HIR::IfLetExpr and
3032 HIR::IfLetExprConseqElse.
3033 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3034 Likewise.
3035 * typecheck/rust-hir-type-check-expr.h: Likewise.
3036 * checks/errors/rust-hir-pattern-analysis.cc
3037 (PatternChecker::visit (IfLetExpr &)): Remove.
3038 (PatternChecker::visit (IfLetExprConseqElse &)): Remove.
3039 * checks/errors/rust-hir-pattern-analysis.h (visit(IfLetExpr &)): Remove.
3040 (visit(IfLetExprConseqElse &)): Remove.
3041
3042 2025-03-21 Owen Avery <[email protected]>
3043
3044 * checks/errors/rust-unsafe-checker.cc: Add includes.
3045 (UnsafeChecker::visit): Use 2.0 version of resolver when name
3046 resolution 2.0 is enabled.
3047
3048 2025-03-21 Owen Avery <[email protected]>
3049
3050 * backend/rust-compile-implitem.cc
3051 (CompileTraitItem::visit): Use name resolver 2.0 (when enabled)
3052 to obtain canonical paths for instances of TraitItemConst and
3053 TraitItemFunc.
3054
3055 2025-03-21 Owen Avery <[email protected]>
3056
3057 * typecheck/rust-hir-type-check.cc: Add includes.
3058 (TraitItemReference::get_type_from_fn): Use
3059 ForeverStack::to_canonical_path when name resolution 2.0 is
3060 enabled.
3061
3062 2025-03-21 Owen Avery <[email protected]>
3063
3064 * ast/rust-path.h
3065 (PathIdentSegment::is_super_segment): Rename to...
3066 (PathIdentSegment::is_super_path_seg): ...here.
3067 (PathIdentSegment::is_crate_segment): Rename to...
3068 (PathIdentSegment::is_crate_path_seg): ...here.
3069 (PathIdentSegment::is_lower_self): Rename to...
3070 (PathIdentSegment::is_lower_self_seg): ...here.
3071 (PathIdentSegment::is_big_self): Rename to...
3072 (PathIdentSegment::is_big_self_seg): ...here.
3073 (PathExprSegment::is_super_path_seg): Handle renames.
3074 (PathExprSegment::is_crate_path_seg): Likewise.
3075 (PathExprSegment::is_lower_self_seg): Likewise.
3076 (TypePathSegment::is_crate_path_seg): Likewise.
3077 (TypePathSegment::is_super_path_seg): Likewise.
3078 (TypePathSegment::is_big_self_seg): Likewise.
3079 (TypePathSegment::is_lower_self_seg): Likewise.
3080 * ast/rust-ast-collector.cc
3081 (TokenCollector::visit): Likewise.
3082
3083 2025-03-21 Owen Avery <[email protected]>
3084
3085 * resolve/rust-late-name-resolver-2.0.cc
3086 (Late::visit): Visit the initialization expressions of let
3087 statements before visiting their patterns.
3088
3089 2025-03-21 Owen Avery <[email protected]>
3090
3091 * resolve/rust-toplevel-name-resolver-2.0.cc
3092 (TopLevel::visit): Insert trait names into the type namespace.
3093
3094 2025-03-21 Philip Herron <[email protected]>
3095
3096 * typecheck/rust-hir-trait-reference.h: new get locus helper
3097 * typecheck/rust-hir-trait-resolve.cc (AssociatedImplTrait::get_locus): implemention
3098 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_operator_overload):
3099 fix overload
3100
3101 2025-03-19 Owen Avery <[email protected]>
3102
3103 * resolve/rust-toplevel-name-resolver-2.0.cc
3104 (TopLevel::visit): Handle ExternalStaticItem.
3105 * resolve/rust-toplevel-name-resolver-2.0.h
3106 (TopLevel::visit): Likewise.
3107
3108 2025-03-19 Owen Avery <[email protected]>
3109
3110 * checks/errors/rust-hir-pattern-analysis.cc: Add includes.
3111 (PatternChecker::visit): Use name resolver 2.0 when enabled.
3112
3113 2025-03-19 Owen Avery <[email protected]>
3114
3115 * backend/rust-compile-expr.cc
3116 (CompileExpr::visit): Use name resolver 2.0 to lookup label
3117 definitions for break and continue statements when name
3118 resolution 2.0 is enabled.
3119
3120 2025-03-19 Owen Avery <[email protected]>
3121
3122 * checks/errors/rust-const-checker.cc: Add includes.
3123 (ConstChecker::visit): Use name resolver 2.0 to lookup
3124 function definitions when name resolution 2.0 is enabled.
3125
3126 2025-03-19 Owen Avery <[email protected]>
3127
3128 * resolve/rust-toplevel-name-resolver-2.0.cc
3129 (TopLevel::visit): Load unloaded modules before attempting to
3130 visit their items.
3131
3132 2025-03-19 Owen Avery <[email protected]>
3133
3134 * resolve/rust-forever-stack.h
3135 (ForeverStack::to_canonical_path): Make const.
3136 (ForeverStack::to_rib): Add const overload.
3137 (ForeverStack::reverse_iter): Add const overloads.
3138 (ForeverStack::ConstDfsResult): Add.
3139 (ForeverStack::dfs): Add const overload.
3140 (ForeverStack::dfs_rib): Likewise.
3141 * resolve/rust-forever-stack.hxx
3142 (ForeverStack::reverse_iter): Add const overloads.
3143 (ForeverStack::dfs): Add const overload.
3144 (ForeverStack::to_canonical_path): Make const.
3145 (ForeverStack::dfs_rib): Likewise.
3146 (ForeverStack::to_rib): Add const overload.
3147
3148 2025-03-19 Owen Avery <[email protected]>
3149
3150 * checks/lints/rust-lint-marklive.cc
3151 (MarkLive::visit_path_segment): Use name resolver 2.0 when
3152 enabled.
3153 (MarkLive::visit): Likewise.
3154
3155 2025-03-19 Owen Avery <[email protected]>
3156
3157 * resolve/rust-toplevel-name-resolver-2.0.cc
3158 (TopLevel::visit): Handle ConstGenericParam.
3159 * resolve/rust-toplevel-name-resolver-2.0.h
3160 (TopLevel::visit): Likewise.
3161
3162 2025-03-19 Owen Avery <[email protected]>
3163
3164 * resolve/rust-late-name-resolver-2.0.cc
3165 (Late::visit): Visit GenericArgs and GenericArg, the former
3166 because the latter involves a non-virtual member function call.
3167 * resolve/rust-late-name-resolver-2.0.h
3168 (Late::visit): Likewise.
3169
3170 2025-03-19 badumbatish <[email protected]>
3171
3172 * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Fix
3173 compiler error on ast wrong implicit construct push_back
3174
3175 2025-03-19 badumbatish <[email protected]>
3176
3177 * backend/rust-compile-asm.cc (CompileAsm::asm_construct_inputs):
3178 Provide input operand for gccrs
3179 * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in):
3180 Move expr to In
3181 (expand_inline_asm_strings):
3182 Add comments to debug strings
3183
3184 2025-03-19 Owen Avery <[email protected]>
3185
3186 * typecheck/rust-hir-type-check-pattern.cc: Add includes.
3187 (TypeCheckPattern::visit): Use name resolver 2.0 if enabled.
3188 * resolve/rust-name-resolution-context.cc
3189 (NameResolutionContext::lookup): Make const qualified.
3190 * resolve/rust-name-resolution-context.h
3191 (NameResolutionContext::lookup): Likewise.
3192
3193 2025-03-19 Owen Avery <[email protected]>
3194
3195 * resolve/rust-late-name-resolver-2.0.cc
3196 (Late::visit): Allow IdentifierExpr and PathInExpression to
3197 reference types as well as values, remove ability for
3198 IdentifierExpr to reference labels.
3199
3200 2025-03-19 Owen Avery <[email protected]>
3201
3202 * ast/rust-ast-visitor.cc
3203 (DefaultASTVisitor::visit): Visit fields of InlineAsm.
3204
3205 2025-03-19 Owen Avery <[email protected]>
3206
3207 * backend/rust-compile-item.cc
3208 (CompileItem::visit): Check canonical path of StaticItem
3209 properly when name resolution 2.0 is enabled.
3210 * resolve/rust-toplevel-name-resolver-2.0.cc
3211 (TopLevel::visit): Insert static items into the value namespace.
3212
3213 2025-03-19 Owen Avery <[email protected]>
3214
3215 * ast/rust-expr.h
3216 (InlineAsmOperand): Replace multiple mutually-exclusive tl::optional
3217 fields with a std::unique_ptr and modify nested classes to allow
3218 this. Also, make getters return references where possible.
3219 * expand/rust-macro-builtins-asm.cc
3220 (parse_reg_operand_out): Pass location when constructing
3221 InlineAsmOperand.
3222
3223 2025-03-19 Owen Avery <[email protected]>
3224
3225 * resolve/rust-toplevel-name-resolver-2.0.cc
3226 (TopLevel::visit): Handle TypeAlias.
3227 * resolve/rust-toplevel-name-resolver-2.0.h
3228 (TopLevel::visit): Likewise.
3229
3230 2025-03-19 Owen Avery <[email protected]>
3231
3232 * typecheck/rust-hir-type-check-enumitem.cc: Add includes.
3233 (TypeCheckEnumItem::visit): Fetch canonical paths properly when
3234 name resolution 2.0 is enabled.
3235 * typecheck/rust-hir-type-check-implitem.cc: Add includes.
3236 (TypeCheckImplItem::visit): Fetch canonical paths properly when
3237 name resolution 2.0 is enabled.
3238 * typecheck/rust-hir-type-check-item.cc: Add include.
3239 (TypeCheckItem::visit): Fetch canonical paths properly when name
3240 resolution 2.0 is enabled.
3241
3242 2025-03-19 Owen Avery <[email protected]>
3243
3244 * resolve/rust-finalize-imports-2.0.cc
3245 (GlobbingVisitor::visit): Replace calls to insert_shadowable with
3246 insert_globbed.
3247 * resolve/rust-forever-stack.h
3248 (ForeverStack::insert_globbed): Add.
3249 * resolve/rust-forever-stack.hxx
3250 (ForeverStack::insert_globbed): Add.
3251 (ForeverStack::dfs): Handle modifications to Rib::Definition
3252 fields.
3253 * resolve/rust-late-name-resolver-2.0.cc
3254 (Late::visit): Make IdentifierPattern-based declarations
3255 shadowable.
3256 * resolve/rust-name-resolution-context.cc
3257 (NameResolutionContext::insert_globbed): Add.
3258 * resolve/rust-name-resolution-context.h
3259 (NameResolutionContext::insert_globbed): Add.
3260 * resolve/rust-rib.cc
3261 (Rib::Definition::Definition): Use Rib::Definition::Mode to
3262 indicate shadowing mode instead of boolean, handle modifications
3263 to Rib::Definition fields.
3264 (Rib::Definition::is_ambiguous): Handle modifications to
3265 Rib::Definition fields.
3266 (Rib::Definition::to_string): Likewise.
3267 (Rib::Definition::Shadowable): Handle changed constructor
3268 signature.
3269 (Rib::Definition::NonShadowable): Likewise.
3270 (Rib::Definition::Globbed): Add.
3271 (Rib::insert): Handle changes to Rib::Definition fields.
3272 * resolve/rust-rib.h
3273 (Rib::Definition::Globbed): Add.
3274 (Rib::Definition::ids): Remove.
3275 (Rib::Definition::ids_shadowable): Add.
3276 (Rib::Definition::ids_non_shadowable): Add.
3277 (Rib::Definition::ids_globbed): Add.
3278 (Rib::Definition::get_node_id): Handle modifications to
3279 Rib::Definition fields.
3280 (Rib::Definition::Mode): Add.
3281 (Rib::Definition::Definition): Use Rib::Definition::Mode to
3282 indicate shadowing mode instead of boolean.
3283
3284 2025-03-19 Philip Herron <[email protected]>
3285
3286 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
3287 use error handling instead of assertion
3288 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): reuse trait reference
3289 * typecheck/rust-hir-type-check-item.h: update prototype
3290
3291 2025-03-19 Philip Herron <[email protected]>
3292
3293 * resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit): add unit-type catch
3294 * resolve/rust-ast-resolve-type.h: likewise
3295
3296 2025-03-19 Philip Herron <[email protected]>
3297
3298 * Make-lang.in: new objects
3299 * ast/rust-ast-builder.cc (Builder::generic_type_path_segment): new helper
3300 (Builder::single_generic_type_path): likewise
3301 (Builder::new_type): likewise
3302 (Builder::new_lifetime_param): likewise
3303 (Builder::new_type_param): likewise
3304 (Builder::new_lifetime): likewise
3305 (Builder::new_generic_args): likewise
3306 * ast/rust-ast-builder.h: new helper decls
3307 * ast/rust-ast.h: new const getters
3308 * ast/rust-path.h: likewise
3309 * ast/rust-type.h: likewise
3310 * expand/rust-derive-clone.cc (DeriveClone::clone_impl): take the types generics
3311 (DeriveClone::visit_tuple): likewise
3312 (DeriveClone::visit_struct): likewise
3313 (DeriveClone::visit_union): likewise
3314 * expand/rust-derive-clone.h: update header
3315 * expand/rust-derive-copy.cc (DeriveCopy::copy_impl): similarly take type generics
3316 (DeriveCopy::visit_struct): likewise
3317 (DeriveCopy::visit_tuple): likewise
3318 (DeriveCopy::visit_enum): likewise
3319 (DeriveCopy::visit_union): likewise
3320 * expand/rust-derive-copy.h: likewse
3321 * ast/rust-ast-builder-type.cc: New file.
3322 * ast/rust-ast-builder-type.h: New file.
3323
3324 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3325
3326 * rust-session-manager.cc (Session::expansion): Break on error after
3327 top level name resolution.
3328
3329 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3330
3331 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Resolve
3332 TypeParam.
3333 * resolve/rust-toplevel-name-resolver-2.0.h: Add visit function
3334 prototype.
3335
3336 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3337
3338 * ast/rust-ast.h: Node id getter could be const.
3339
3340 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3341
3342 * resolve/rust-late-name-resolver-2.0.h: Add visit function prototype.
3343 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change resolved
3344 type segment.
3345
3346 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3347
3348 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove
3349 assertion and explicitely tells why we ignore the insertion result.
3350
3351 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3352
3353 * Make-lang.in: Add new rust-bir-builder-pattern file.
3354 * checks/errors/borrowck/rust-bir-builder-pattern.h: Remove
3355 implementation.
3356 * checks/errors/borrowck/rust-bir-builder-pattern.cc: New file.
3357
3358 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3359
3360 * ast/rust-ast-visitor.h: Make visit functions public.
3361
3362 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3363
3364 * resolve/rust-finalize-imports-2.0.h: Add parent member functions
3365 from default resolver.
3366
3367 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3368
3369 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Use
3370 default visitor instead.
3371
3372 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3373
3374 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
3375 default visit code and replace it with call to default visitor.
3376 * resolve/rust-default-resolver.h: Remove removed function's
3377 prototypes.
3378
3379 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3380
3381 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
3382 empty visit function implementations.
3383 * resolve/rust-default-resolver.h: Remove corresponding prototypes.
3384
3385 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3386
3387 * resolve/rust-default-resolver.h: Make most visit function override.
3388
3389 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3390
3391 * resolve/rust-early-name-resolver-2.0.cc (Early::Early): Add dirty
3392 flag initialization.
3393 (Early::go): Set dirty flag using top level resolver.
3394 * resolve/rust-early-name-resolver-2.0.h: Add dirty flag.
3395 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::TopLevel):
3396 Initialize dirty flag.
3397 (TopLevel::insert_or_error_out): Set dirty flag on successful
3398 namespace modification.
3399 * resolve/rust-toplevel-name-resolver-2.0.h: Add dirty flag.
3400 * rust-session-manager.cc (Session::expansion): Modify fixed point
3401 condition to include name resolution modifications.
3402
3403 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3404
3405 * resolve/rust-rib.cc (Rib::insert): Emit an error when trying to
3406 insert an already inserted node.
3407
3408 2025-03-19 Arthur Cohen <[email protected]>
3409
3410 * resolve/rust-early-name-resolver-2.0.h: New class for imports.
3411 * resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Use
3412 the new API.
3413 (finalize_glob_import): Likewise.
3414 (finalize_rebind_import): Likewise.
3415 (FinalizeImports::FinalizeImports): Likewise.
3416 (FinalizeImports::visit): Likewise.
3417 * resolve/rust-finalize-imports-2.0.h: Likewise.
3418 * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): Likewise.
3419 (Early::resolve_simple_import): Likewise.
3420 (Early::resolve_rebind_import): Likewise.
3421
3422 2025-03-19 Arthur Cohen <[email protected]>
3423
3424 * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_simple_import):
3425 Insert import in all namespaces where they were resolved.
3426 (Early::resolve_rebind_import): Likewise.
3427 * resolve/rust-early-name-resolver-2.0.h: Improve APIs, make them
3428 accept multiple resolutions.
3429 * resolve/rust-finalize-imports-2.0.cc: Handle multiple resolutions.
3430 * resolve/rust-name-resolution-context.h (resolve_path): Remove function.
3431
3432 2025-03-19 Arthur Cohen <[email protected]>
3433
3434 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
3435 Store errors for later.
3436
3437 2025-03-19 Arthur Cohen <[email protected]>
3438
3439 * resolve/rust-finalize-imports-2.0.cc (FinalizeImports::go): Turn
3440 static method into method.
3441 (FinalizeImports::visit): New.
3442 * resolve/rust-finalize-imports-2.0.h (class FinalizeImports): Make
3443 FinalizeImports a visitor.
3444 * resolve/rust-early-name-resolver-2.0.cc (Early::go): Use new FinalizeImports API.
3445 (Early::resolve_glob_import): Use new API.
3446 (Early::resolve_simple_import): Likewise.
3447 (Early::resolve_rebind_import): Likewise.
3448 (Early::build_import_mapping): Likewise.
3449 * resolve/rust-early-name-resolver-2.0.h: Likewise.
3450 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Likewise.
3451 * resolve/rust-toplevel-name-resolver-2.0.h: Likewise.
3452
3453 2025-03-19 Arthur Cohen <[email protected]>
3454
3455 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add debug call.
3456 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Store
3457 imports using the new classes.
3458 * resolve/rust-toplevel-name-resolver-2.0.h: Use new classes.
3459
3460 2025-03-19 Arthur Cohen <[email protected]>
3461
3462 * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import):
3463 Use ImportData class.
3464 (Early::resolve_simple_import): Likewise.
3465 (Early::resolve_rebind_import): Likewise.
3466 (Early::build_import_mapping): Likewise.
3467 * resolve/rust-early-name-resolver-2.0.h: Likewise.
3468 * resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Likewise.
3469 (finalize_glob_import): Likewise.
3470 (finalize_rebind_import): Likewise.
3471 (FinalizeImports::go): Likewise.
3472 * resolve/rust-finalize-imports-2.0.h: Likewise.
3473 * resolve/rust-name-resolution-context.h: Likewise.
3474 * resolve/rust-rib.h: Define ImportData class.
3475
3476 2025-03-19 Arthur Cohen <[email protected]>
3477
3478 * Make-lang.in: Add new object file.
3479 * ast/rust-item.h: Constify method.
3480 * resolve/rust-early-name-resolver-2.0.cc (Early::go): Call into
3481 the imports finalizer.
3482 (Early::resolve_glob_import): Remove old resolution.
3483 (Early::resolve_rebind_import): Likewise.
3484 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::go):
3485 New function.
3486 (GlobbingVisitor::visit): Likewise.
3487 (TopLevel::visit): Do not call into handle_use_* functions anymore.
3488 * resolve/rust-toplevel-name-resolver-2.0.h (class GlobbingVisitor):
3489 New.
3490 * resolve/rust-finalize-imports-2.0.cc: New file.
3491 * resolve/rust-finalize-imports-2.0.h: New file.
3492
3493 2025-03-19 Arthur Cohen <[email protected]>
3494
3495 * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): New function.
3496 (Early::resolve_simple_import): Likewise.
3497 (Early::resolve_rebind_import): Likewise.
3498 (Early::build_import_mapping): Likewise.
3499 * resolve/rust-early-name-resolver-2.0.h: Add declarations and list of imports to
3500 resolve.
3501 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob): Remove function,
3502 which is now being handled by the Early name resolver.
3503 (TopLevel::handle_use_dec): Likewise.
3504 (TopLevel::handle_rebind): Likewise.
3505 * resolve/rust-toplevel-name-resolver-2.0.h: Likewise, and add functions for creating
3506 import list and fetching it.
3507
3508 2025-03-19 Arthur Cohen <[email protected]>
3509
3510 * resolve/rust-toplevel-name-resolver-2.0.cc: Comment out handle_use
3511 call and error emission.
3512 * resolve/rust-toplevel-name-resolver-2.0.h: Create ImportKind class.
3513
3514 2025-03-19 Arthur Cohen <[email protected]>
3515
3516 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
3517 Add notes on the problem.
3518 * resolve/rust-toplevel-name-resolver-2.0.h: Likewise.
3519
3520 2025-03-19 Arthur Cohen <[email protected]>
3521
3522 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Do not
3523 visit self's type if it does not have one.
3524
3525 2025-03-19 Philip Herron <[email protected]>
3526
3527 * hir/rust-ast-lower-type.cc (ASTLowerQualifiedPathInType::visit):
3528 check for valid as segment
3529
3530 2025-03-19 Philip Herron <[email protected]>
3531
3532 * resolve/rust-ast-resolve-type.cc (ResolveType::visit):
3533 handle never type
3534 (ResolveTypeToCanonicalPath::visit): likewise
3535 * resolve/rust-ast-resolve-type.h: missing never type
3536 * resolve/rust-name-resolver.cc (Resolver::generate_builtins):
3537 track never type node_id
3538 (Resolver::setup_builtin): likewise
3539 * resolve/rust-name-resolver.h: new never type getter
3540
3541 2025-03-19 Owen Avery <[email protected]>
3542
3543 * resolve/rust-default-resolver.cc
3544 (DefaultResolver::visit): Remove some empty overloads which
3545 DefaultASTVisitor::visit should be able to handle.
3546 * resolve/rust-default-resolver.h
3547 (DefaultResolver::visit): Likewise.
3548
3549 2025-03-19 Owen Avery <[email protected]>
3550
3551 * util/optional.h
3552 (optional): Add assertions to dereference operator overloads
3553 when C++14 is available.
3554
3555 2025-03-19 Marc Poulhiès <[email protected]>
3556
3557 * hir/rust-hir-dump.cc (Dump::visit): Add missing fields.
3558
3559 2025-03-19 Philip Herron <[email protected]>
3560
3561 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): the polarity was reversed
3562 * typecheck/rust-hir-type-check-item.cc: check the polarity
3563
3564 2025-03-19 benjamin.thos <[email protected]>
3565
3566 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add
3567 implementation of error propagation visitor
3568 * resolve/rust-ast-resolve-expr.h: Add prototype of error
3569 propagation
3570
3571 2025-03-19 Pierre-Emmanuel Patry <[email protected]>
3572
3573 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add optional
3574 check.
3575
3576 2025-03-19 JoanVC <[email protected]>
3577
3578 * backend/rust-compile-expr.cc
3579
3580 2025-03-19 JoanVC <[email protected]>
3581
3582 * backend/rust-compile-expr.cc: Fix range checking for both integers and floats.
3583 * hir/tree/rust-hir-expr.h: Add "negative_number" boolean to LiteralExpr class.
3584
3585 2025-03-19 Arthur Cohen <[email protected]>
3586
3587 * rust-session-manager.cc (Session::compile_crate): Use less repetition,
3588 fix a typo in `reports`, fix word order.
3589
3590 2025-03-19 benjamin.thos <[email protected]>
3591
3592 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Emit error
3593 on trait when auto field member true.
3594 * checks/errors/rust-feature-gate.h: add prototype of trait visitor.
3595 * checks/errors/rust-feature.cc (Feature::create): add
3596 optin_builtin_traits in match of feature.
3597
3598 2025-03-19 Raiki Tamura <[email protected]>
3599
3600 * Make-lang.in: Add rust-hir-pattern-analysis.o.
3601 * rust-session-manager.cc (Session::compile_crate):
3602 Add pattern analysis pass.
3603 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
3604 Do typecheck for subpatterns.
3605 * checks/errors/rust-hir-pattern-analysis.cc: New file.
3606 * checks/errors/rust-hir-pattern-analysis.h: New file.
3607
3608 2025-03-19 Liam Naddell <[email protected]>
3609
3610 * backend/rust-compile.cc:
3611 Modify compute_address_for_trait_item to support supertraits
3612 * typecheck/rust-tyty.cc:
3613 Remove auto
3614
3615 2025-03-19 Kushal Pal <[email protected]>
3616
3617 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Use strong
3618 type instead of size_t.
3619 (Dump::visit_place): Likewise.
3620 (Dump::visit_scope): Likewise.
3621 * checks/errors/borrowck/rust-bir-dump.h (class Dump): Use
3622 IndeVec for place_map.
3623
3624 2025-03-19 Kushal Pal <[email protected]>
3625
3626 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg):
3627 Used `IndexVec` for bb_fold_map.
3628 (Dump::go): Use strong type as index instead of value as now we
3629 are using `IndexVec`.
3630 (Dump::visit): Likewise.
3631 * checks/errors/borrowck/rust-bir-dump.h (class Dump): Use
3632 `IndexVec` for bb_fold_map.
3633 * checks/errors/borrowck/rust-bir-place.h: Add constructor for
3634 `IndexVec` that can reserve size.
3635
3636 2025-03-19 Kushal Pal <[email protected]>
3637
3638 * checks/errors/borrowck/rust-bir-place.h: Use strong types as
3639 index.
3640
3641 2025-03-19 Kushal Pal <[email protected]>
3642
3643 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
3644 (ExprStmtBuilder::visit): Use strong type as index and
3645 remove access to numeric value.
3646 * checks/errors/borrowck/rust-bir-builder-internal.h
3647 (struct BuilderContext): Likewise.
3648 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg):
3649 Likewise.
3650 (Dump::go): Likewise.
3651 (Dump::visit): Likewise.
3652 * checks/errors/borrowck/rust-bir-fact-collector.h
3653 (class FactCollector): Likewise.
3654 (points): Likewise.
3655 * checks/errors/borrowck/rust-bir.h (struct BasicBlockId): Used
3656 IndexVec for BasicBlocks.
3657 (struct Function): Likewise.
3658 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
3659 (BorrowCheckerDiagnostics::get_statement): Change the extracted
3660 index to strong type.
3661
3662 2025-03-19 Kushal Pal <[email protected]>
3663
3664 * checks/errors/borrowck/rust-bir-place.h: Used `IndexVec` with
3665 ScopeId as index.
3666 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
3667 (BorrowCheckerDiagnostics::get_loan): Convert Polonius::Loan to
3668 BIR::Loan, so we can use it as index.
3669
3670 2025-03-19 Kushal Pal <[email protected]>
3671
3672 * checks/errors/borrowck/rust-bir-place.h:
3673 Used `IndexVec` with ScopeId as index.
3674
3675 2025-03-19 Kushal Pal <[email protected]>
3676
3677 * checks/errors/borrowck/rust-bir-place.h (struct Loan):
3678 Introduce new class `IndexVec` inspired from IndexVec of rust.
3679 It acts as a wrapper around `std::vector` and lets user specify
3680 a strong type to use as index.
3681
3682 2025-03-19 Kushal Pal <[email protected]>
3683
3684 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
3685 Use value of BasicBlockId as index.
3686 * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext):
3687 Likewise.
3688 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h:
3689 Initialize with ENTRY_BASIC_BLOCK.
3690 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg):
3691 Use value of BasicBlockId as index.
3692 (Dump::go): Likewise.
3693 (Dump::visit): Likewise.
3694 * checks/errors/borrowck/rust-bir-fact-collector.h (class FactCollector):
3695 Initialize with ENTRY_BASIC_BLOCK.
3696 (points): Use value of BasicBlockId as index.
3697 * checks/errors/borrowck/rust-bir.h (struct BasicBlockId):
3698 BasicBlockId is a struct now.
3699
3700 2025-03-19 Kushal Pal <[email protected]>
3701
3702 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
3703 (ExprStmtBuilder::setup_loop): Use value of ScopeId.
3704 (ExprStmtBuilder::visit): Use continue scope id instead of
3705 continue basic block id.
3706 * checks/errors/borrowck/rust-bir-builder-internal.h: Use value
3707 of ScopeId.
3708 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Use
3709 ROOT_VALUE instead of hardcoded 0.
3710 (Dump::visit_scope): Use value of ScopeId.
3711 * checks/errors/borrowck/rust-bir-place.h (struct ScopeId):
3712 ScopeId is now a struct.
3713 (std::numeric_limits::max): Set invalid ScopeId.
3714
3715 2025-03-19 Kushal Pal <[email protected]>
3716
3717 * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit): Use new
3718 API, i.e get_loan_id() instead of get_loan().
3719 * checks/errors/borrowck/rust-bir-fact-collector.h (points): Use
3720 value of LoanId in Polonius facts.
3721 * checks/errors/borrowck/rust-bir-place.h (struct LoanId):
3722 LoanId is a struct now.
3723 * checks/errors/borrowck/rust-bir.h (class AbstractExpr): Use
3724 new API, as we are getting a LoanId and not a loan itself.
3725
3726 2025-03-19 Kushal Pal <[email protected]>
3727
3728 * checks/errors/borrowck/rust-bir-builder-internal.h: Use
3729 FreeRegions instead of making a temporary vector of FreeRegion.
3730 * checks/errors/borrowck/rust-bir-builder.h: Likewise.
3731 * checks/errors/borrowck/rust-bir-fact-collector.h (class FactCollector):
3732 Likewise.
3733 (points): Likewise.
3734 * checks/errors/borrowck/rust-bir-free-region.h: Remove obsolete
3735 set_from() helpers, add push_back().
3736 * checks/errors/borrowck/rust-bir-place.h: Use FreeRegions
3737 instead of making a temporary vector of Origin.
3738 * typecheck/rust-tyty-variance-analysis-private.h: Change type
3739 of `regions`.
3740 * typecheck/rust-tyty-variance-analysis.cc (CrateCtx::query_type_regions):
3741 Use new type.
3742 (GenericTyPerCrateCtx::query_generic_variance): Likewise.
3743 (TyVisitorCtx::add_constraints_from_generic_args): Likewise.
3744 (FieldVisitorCtx::add_constraints_from_region): Likewise.
3745 (FieldVisitorCtx::add_constrints_from_param): Likewise.
3746 * typecheck/rust-tyty-variance-analysis.h: Likewise.
3747
3748 2025-03-19 Kushal Pal <[email protected]>
3749
3750 * checks/errors/borrowck/rust-bir-builder-internal.h: Use
3751 STATIC_FREE_REGION, use value of FreeRegion for origin.
3752 * checks/errors/borrowck/rust-bir-builder.h: Use free region
3753 value.
3754 * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit_scope):
3755 Likewise.
3756 * checks/errors/borrowck/rust-bir-fact-collector.h (points):
3757 Likewise.
3758 * checks/errors/borrowck/rust-bir-free-region.h (struct FreeRegion):
3759 Make FreeRegion a struct.
3760 * checks/errors/borrowck/rust-bir-place.h: Use FreeRegion
3761 instead of Origin in PlaceDB.
3762 * typecheck/rust-tyty-variance-analysis.cc (FieldVisitorCtx::add_constraints_from_region):
3763 Use value of FreeRegion for origin.
3764 (FieldVisitorCtx::add_constrints_from_param): Likewise.
3765 (Term::make_transform): Likewise.
3766
3767 2025-03-19 Kushal Pal <[email protected]>
3768
3769 * checks/errors/borrowck/rust-bir-dump.cc (renumber_places):
3770 Use value of PlaceId as index.
3771 (Dump::visit_place): Likewise.
3772 (Dump::visit_scope): Likewise.
3773 (Dump::go): Refill `place_map` with for loop instead of
3774 using std::iota().
3775 * checks/errors/borrowck/rust-bir-fact-collector.h (points): Use
3776 value as index.
3777 * checks/errors/borrowck/rust-bir-place.h (struct PlaceId):
3778 PlaceId is now a class holding a uint32_t value. Overloaded
3779 comparision operators for easier comparision.
3780
3781 2025-03-19 Owen Avery <[email protected]>
3782
3783 * resolve/rust-ast-resolve-pattern.cc
3784 (PatternDeclaration::check_bindings_consistency): Check if
3785 outer_bindings_map contains an entry before indexing.
3786
3787 2025-03-19 Owen Avery <[email protected]>
3788
3789 * util/rust-canonical-path.h
3790 (CanonicalPath::CanonicalPath): Properly initialize crate_num
3791 with copy constructor.
3792
3793 2025-03-19 badumbatish <[email protected]>
3794
3795 * backend/rust-compile-asm.cc (CompileAsm::visit):
3796 Change API, public/private, comments, formatting from code
3797 review
3798 (CompileAsm::asm_build_expr): Likewise.
3799 (CompileAsm::tree_codegen_asm): Likewise.
3800 * backend/rust-compile-asm.h (class CompileAsm): Likewise.
3801 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
3802 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
3803 * expand/rust-macro-builtins-asm.cc (strip_double_quotes): Likewise.
3804 (parse_options): Likewise.
3805 (parse_asm_arg): Likewise.
3806 (expand_inline_asm_strings): Likewise.
3807 (parse_asm): Likewise.
3808 * expand/rust-macro-builtins-asm.h (strip_double_quotes): Likewise.
3809 (expand_inline_asm_strings): Likewise.
3810 (expand_inline_asm_string): Likewise.
3811 * hir/tree/rust-hir-expr.h: Likewise.
3812
3813 2025-03-19 badumbatish <[email protected]>
3814
3815 * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr):
3816 Remove debug
3817 * expand/rust-macro-builtins-asm.cc (expand_inline_asm_strings):
3818 properly formatted via rust instead of c
3819 (parse_asm): formatted comment
3820 (parse_format_strings): formatted comment
3821 * hir/tree/rust-hir-expr.h: fix is_simple_asm()
3822
3823 2025-03-19 badumbatish <[email protected]>
3824
3825 * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr):
3826 Use's array type when constring string tree
3827 (CompileAsm::asm_construct_string_tree):
3828 Use's array type when constring string tree
3829
3830 2025-03-19 badumbatish <[email protected]>
3831
3832 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3833 Added noreturn checking for nevertype
3834
3835 2025-03-19 badumbatish <[email protected]>
3836
3837 * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr):
3838 Add debug comment
3839 (CompileAsm::asm_construct_outputs):
3840 Perform lowering hir output operand to tree
3841
3842 2025-03-19 badumbatish <[email protected]>
3843
3844 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3845 Perform type check on InlineAsm's operand
3846 (typecheck_inline_asm_operand): Likewise
3847
3848 2025-03-19 badumbatish <[email protected]>
3849
3850 * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs):
3851 Lower the HIR to tree with CompileExpr
3852 * backend/rust-compile-asm.h: Remove static from method
3853
3854 2025-03-19 badumbatish <[email protected]>
3855
3856 * backend/rust-compile-asm.cc (strip_double_quotes):
3857 Move strip double quotes to parse phase
3858 (CompileAsm::asm_construct_string_tree): Likewise
3859 * backend/rust-compile-asm.h (strip_double_quotes): Likewise
3860 * expand/rust-macro-builtins-asm.cc (strip_double_quotes):
3861 Likewise
3862 (expand_inline_asm): Renamed to expand_inline_asm_strings
3863 (expand_inline_asm_strings): Renamed from expand_inline_asm
3864 (parse_asm): Move strip double quotes to parse phase
3865 (parse_format_strings): Likewise
3866 * expand/rust-macro-builtins-asm.h (strip_double_quotes):
3867 Likewise
3868 (expand_inline_asm_strings): Inline asm expansion fn
3869 (expand_inline_asm_string): Inline asm expansion fn
3870
3871 2025-03-19 badumbatish <[email protected]>
3872
3873 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
3874 Remove warnings
3875 (parse_reg_operand_out): Remove warnings
3876 (expand_inline_asm): New function for eventual expansion
3877 (parse_asm): Use expand_inline_asm
3878
3879 2025-03-19 badumbatish <[email protected]>
3880
3881 * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs):
3882 Set up counting to check
3883
3884 2025-03-19 badumbatish <[email protected]>
3885
3886 * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr):
3887 Use expr's is_simple_asm and is_inline_asm
3888 (CompileAsm::asm_is_simple): removed
3889 (CompileAsm::asm_is_inline): removed
3890 * backend/rust-compile-asm.h: Add docs to ASM_TREE_ARRAY_LENGTH
3891 * hir/tree/rust-hir-expr.h: Add is_simple_asm, is_inline_asm
3892 and remove #include tree
3893
3894 2025-03-19 badumbatish <[email protected]>
3895
3896 * backend/rust-compile-asm.cc (strip_double_quotes):
3897 Refactor compile-asm for first round review
3898 (CompileAsm::asm_build_asm_stmt): Likewise.
3899 (CompileAsm::asm_build_expr): Likewise.
3900 (CompileAsm::asm_get_locus): Likewise.
3901 (CompileAsm::asm_construct_string_tree): Likewise.
3902 (CompileAsm::asm_construct_outputs): Likewise.
3903 (CompileAsm::asm_construct_inputs): Likewise.
3904 (CompileAsm::asm_construct_clobber_tree): Likewise.
3905 (CompileAsm::asm_construct_label_tree): Likewise.
3906 (CompileAsm::asm_is_simple): Likewise.
3907 (CompileAsm::asm_is_inline): Likewise.
3908 * backend/rust-compile-asm.h (strip_double_quotes): Likewise.
3909 (class CompileAsm): Likewise.
3910
3911 2025-03-19 badumbatish <[email protected]>
3912
3913 * backend/rust-compile-asm.cc (CompileAsm::add_stmt):
3914 Deleted
3915 (CompileAsm::CompileAsm):
3916 Successfully produce pseudo-nop
3917 (CompileAsm::visit): Likewise
3918 (CompileAsm::asm_build_asm_stmt): Likewise
3919 (CompileAsm::asm_construct_string_tree): Likewise
3920 (CompileAsm::asm_is_inline): Likewise
3921 * backend/rust-compile-asm.h (class CompileAsm): Likewise
3922 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise
3923
3924 2025-03-19 badumbatish <[email protected]>
3925
3926 * backend/rust-compile-asm.cc (CompileAsm::add_stmt):
3927 Scaffolding code.
3928 (CompileAsm::asm_build_asm_stmt): Likewise.
3929 (CompileAsm::asm_build_expr): Likewise.
3930 (CompileAsm::asm_construct_string_tree): Likewise.
3931 * backend/rust-compile-asm.h: Likewise.
3932 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
3933
3934 2025-03-19 badumbatish <[email protected]>
3935
3936 * Make-lang.in:
3937 Scaffolding new compile-asm files
3938 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise
3939 * hir/tree/rust-hir-expr.h: Likewise
3940 * backend/rust-compile-asm.cc: New file. Likewise
3941 * backend/rust-compile-asm.h: New file. Likewise
3942
3943 2025-03-19 jjasmine <[email protected]>
3944
3945 * backend/rust-compile-expr.cc (CompileExpr::visit):
3946 Setting up interfaces for codegen
3947 * hir/tree/rust-hir-expr.h: Likewise.
3948
3949 2025-03-19 jjasmine <[email protected]>
3950
3951 * backend/rust-compile-expr.cc (CompileExpr::visit):
3952 Local testing for build_string and debug()
3953
3954 2025-03-19 jjasmine <[email protected]>
3955
3956 * hir/tree/rust-hir.cc (InlineAsm::accept_vis):
3957 Make sure CompileExpr::visit is reached
3958 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3959 Likewise
3960
3961 2025-03-19 jjasmine <[email protected]>
3962
3963 * backend/rust-compile-block.h:
3964 Scaffolding asm codegen
3965 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
3966 * backend/rust-compile-expr.h: Likewise.
3967 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Likewise.
3968 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise.
3969 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise.
3970 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
3971 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
3972 * hir/tree/rust-hir-expr.h: Likewise.
3973 * hir/tree/rust-hir-visitor.h: Likewise.
3974 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
3975 * typecheck/rust-hir-type-check-expr.h: Likewise.
3976
3977 2025-03-19 badumbatish <[email protected]>
3978
3979 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
3980 Fix parsing logic & reassignment logic
3981 (parse_reg_operand_in): Fix parsing
3982 (parse_reg_operand_out): Fix parsing
3983 (parse_reg_operand_inout): Fix parsing
3984 (parse_reg_operand_unexpected): Remove rust_unreachable()
3985 (parse_asm_arg): Fix parsing logic
3986
3987 2025-03-19 badumbatish <[email protected]>
3988
3989 * typecheck/rust-hir-type-check.h:
3990 Add pop guard for binder
3991
3992 2025-03-19 badumbatish <[email protected]>
3993
3994 * resolve/rust-ast-resolve.cc (NameResolution::go):
3995 Fix warnings from const auto& to const auto
3996
3997 2025-03-19 Raiki Tamura <[email protected]>
3998
3999 * lex/rust-lex.cc (Lexer::build_token): Emit error code.
4000 * lex/rust-lex.h: Fix comment.
4001
4002 2025-03-19 Raiki Tamura <[email protected]>
4003
4004 * hir/tree/rust-hir.cc (Item::item_kind_string): New function.
4005 * hir/tree/rust-hir.h: New function.
4006 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
4007 Modify to check all arms in match expressions even if some of them
4008 has errors.
4009 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
4010 Add and fix check for path patterns.
4011
4012 2025-03-19 Raiki Tamura <[email protected]>
4013
4014 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
4015 Add check for union patterns.
4016
4017 2025-03-19 Arthur Cohen <[email protected]>
4018
4019 * checks/errors/rust-feature.cc (Feature::create): Reuse variable,
4020 remove now optional parameters from constructor.
4021 * checks/errors/rust-feature.h: Cleanup class definition.
4022 * checks/errors/rust-feature-gate.cc (FeatureGate::gate): Use optional.
4023 * checks/errors/rust-feature-gate.h: Cleanup visitor implementation.
4024 * checks/errors/borrowck/ffi-polonius/Cargo.lock: New file.
4025
4026 2025-03-19 Arthur Cohen <[email protected]>
4027
4028 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Add base
4029 feature gating for `#[feature(prelude_import)]`.
4030 * checks/errors/rust-feature-gate.h: Likewise.
4031 * checks/errors/rust-feature.cc (Feature::create): Likewise.
4032 * checks/errors/rust-feature.h: Likewise.
4033 * util/rust-attribute-values.h: Add base handling for `#[prelude_import]`
4034 attribute.
4035 * util/rust-attributes.cc: Likewise.
4036
4037 2025-03-19 badumbatish <[email protected]>
4038
4039 * ast/rust-ast-full-decls.h (struct InlineAsmOperand):
4040 Change to class
4041 (class InlineAsmOperand): Change from struct
4042 * hir/tree/rust-hir-full-decls.h (struct InlineAsmRegOrRegClass):
4043 Removed from decl, used from AST
4044 (struct AnonConst): new decl from rust-hir-expr.h
4045 (class InlineAsmOperand): new decl from rust-hir-expr.h
4046
4047 2025-03-19 Arthur Cohen <[email protected]>
4048
4049 * ast/rust-ast-full-decls.h (class PathPattern): Rename PathPattern to...
4050 (class Path): ...Path
4051 * ast/rust-ast-collector.cc (TokenCollector::visit): Add required methods
4052 for LangItemPath and RegularPath.
4053 * ast/rust-ast-collector.h: Likewise.
4054 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
4055 * ast/rust-ast-visitor.h: Likewise.
4056 * ast/rust-path.cc (PathPattern::as_string): Likewise.
4057 (RegularPath::as_string): Likewise.
4058 (LangItemPath::as_string): Likewise.
4059 (PathPattern::convert_to_simple_path): Likewise.
4060 (RegularPath::convert_to_simple_path): Likewise.
4061 (RegularPath::accept_vis): Likewise.
4062 (LangItemPath::accept_vis): Likewise.
4063 (PathInExpression::as_string): Likewise.
4064 (QualifiedPathInExpression::as_string): Likewise.
4065 * ast/rust-path.h (class PathPattern): Likewise.
4066 (class Path): Likewise.
4067 (class RegularPath): Likewise.
4068 (class LangItemPath): Likewise.
4069 (class PathInExpression): Likewise.
4070 (class QualifiedPathInExpression): Likewise.
4071 * ast/rust-pattern.h (class PathPattern): Likewise.
4072 (class Path): Likewise.
4073 * expand/rust-derive.h: Likewise.
4074 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
4075 * hir/rust-ast-lower-base.h: Likewise.
4076 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
4077 * resolve/rust-ast-resolve-base.h: Likewise.
4078
4079 2025-03-19 Arthur Cohen <[email protected]>
4080
4081 * ast/rust-ast.h (class PathExpr): Remove class.
4082 * ast/rust-path.h (class PathInExpression): Inherit from ExprWithoutBlock.
4083 (class QualifiedPathInExpression): Likewise.
4084
4085 2025-03-19 Arthur Cohen <[email protected]>
4086
4087 * ast/rust-path.h (class PathInExpression): Remove `remove_all_segments`
4088 method, add a `marked_for_strip` flag instead.
4089
4090 2025-03-19 Muhammad Mahad <[email protected]>
4091
4092 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
4093 Add error code and update error message
4094
4095 2025-03-19 Kushal Pal <[email protected]>
4096
4097 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
4098 (BorrowCheckerDiagnostics::report_move_errors): Specify
4099 locations for code causing errors and related moves.
4100
4101 2025-03-19 Kushal Pal <[email protected]>
4102
4103 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
4104 (BorrowCheckerDiagnostics::report_subset_errors): Highlight
4105 lifetime locations while reporting subset errors.
4106 (BorrowCheckerDiagnostics::get_lifetime_param): Helper function
4107 to fetch HIR::Lifetime node from Polonius::Origin.
4108 * checks/errors/borrowck/rust-borrow-checker-diagnostics.h:
4109 Definition of helper function.
4110
4111 2025-03-19 Kushal Pal <[email protected]>
4112
4113 * checks/errors/borrowck/rust-bir-builder.h: Map regions to
4114 their respective HIR nodes.
4115 * checks/errors/borrowck/rust-bir.h (struct Function):
4116 Add unordered_map to maintain the mapping.
4117
4118 2025-03-19 Liam Naddell <[email protected]>
4119
4120 * typecheck/rust-hir-type-check-pattern.cc:
4121 Emit E0532 when trying to reference a Tuple or Struct variant
4122 using a non Tuple or Struct pattern.
4123
4124 2025-03-19 Liam Naddell <[email protected]>
4125
4126 * expand/rust-expand-visitor.h:
4127 remove auto keyword
4128 * expand/rust-macro-builtins-helpers.cc:
4129 allow for changing macro invoc types on eager expansions to
4130 semicoloned macros
4131 * expand/rust-macro-builtins-helpers.h:
4132 add default semicoloned argument
4133 * expand/rust-macro-builtins-include.cc:
4134 allow for eager expansion for include and include_bytes
4135 allow for parsing include invocations as items instead of
4136 expressions, which allows invocations at global scope
4137 * expand/rust-macro-expand.cc:
4138 push Expr type for eager invocations
4139
4140 2025-03-19 Kushal Pal <[email protected]>
4141
4142 * checks/errors/borrowck/rust-bir-builder-internal.h:
4143 Use `make_*` functions to create BIR::Statements.
4144 * checks/errors/borrowck/rust-bir.h: Make a complete constructor
4145 and introduce `make_*` functions to create various
4146 BIR::Statements.
4147
4148 2025-03-19 Kushal Pal <[email protected]>
4149
4150 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
4151 (BorrowCheckerDiagnostics::report_loan_errors): Add label to
4152 where the borrow occurs and where the invalid access occurs.
4153 (BorrowCheckerDiagnostics::get_statement):
4154 Fetch BIR::Statement from Polonius::Point
4155 (BorrowCheckerDiagnostics::get_loan):
4156 Fetch BIR::Loan from Polonius::Loan
4157 * checks/errors/borrowck/rust-borrow-checker-diagnostics.h:
4158 Function definition of helpers.
4159
4160 2025-03-19 Kushal Pal <[email protected]>
4161
4162 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
4163 Add location parameter.
4164 * checks/errors/borrowck/rust-bir-builder.h: Likewise.
4165 * checks/errors/borrowck/rust-bir-builder-internal.h: Add helper
4166 function for pushing return statements.
4167 * checks/errors/borrowck/rust-bir.h: Remove `expr` parameter as
4168 it is only needed for ASSIGNMENT statements, for which we
4169 already have a constructor.
4170
4171 2025-03-19 badumbatish <[email protected]>
4172
4173 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
4174 Implement resolve expr for inline asm ast
4175 (translate_operand): Likewise.
4176 * resolve/rust-ast-resolve-expr.h: Likewise.
4177
4178 2025-03-19 Kushal Pal <[email protected]>
4179
4180 * checks/errors/borrowck/rust-bir-builder-internal.h:
4181 Fill location for loan.
4182 * checks/errors/borrowck/rust-bir-place.h (struct Loan):
4183 Add location field.
4184
4185 2025-03-19 Kushal Pal <[email protected]>
4186
4187 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
4188 (ExprStmtBuilder::visit): Added location parameter.
4189 * checks/errors/borrowck/rust-bir-builder-internal.h: Likewise.
4190 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h:
4191 Likewise.
4192 * checks/errors/borrowck/rust-bir-builder-pattern.h: Likewise.
4193 * checks/errors/borrowck/rust-bir-builder.h: Likewise.
4194 * checks/errors/borrowck/rust-bir.h: Likewise.
4195
4196 2025-03-19 badumbatish <[email protected]>
4197
4198 * hir/rust-ast-lower-expr.cc (translate_operand_in):
4199 Turn to switch case, use new helper functions
4200 (translate_operand_out): Likewise.
4201 (translate_operand_inout): Likewise.
4202 (translate_operand_split_in_out): Likewise.
4203 (translate_operand_const): Likewise.
4204 (translate_operand_sym): Likewise.
4205 (translate_operand_label): Likewise.
4206 (from_operand): Likewise.
4207 (ASTLoweringExpr::visit): Likewise.
4208
4209 2025-03-19 badumbatish <[email protected]>
4210
4211 * hir/rust-ast-lower-expr.cc (from_operand):
4212 Set up the lowering for operand
4213 (ASTLoweringExpr::visit): Likewise
4214 * hir/tree/rust-hir-expr.h (struct InlineAsmRegOrRegClass):
4215 Not necessary, kept from ast
4216 (struct AnonConst): Set up lowering for operand
4217 (class InlineAsmOperand): Likewise, add getters
4218
4219 2025-03-19 Kushal Pal <[email protected]>
4220
4221 * checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint):
4222 Added comments and made extraction of statement more verbose for
4223 better understanding.
4224 * checks/errors/borrowck/ffi-polonius/src/lib.rs: Likewise.
4225
4226 2025-03-19 badumbatish <[email protected]>
4227
4228 * ast/rust-expr.h (struct InlineAsmOperand): changed to class
4229 (class InlineAsmOperand): Have appropriate constructor,
4230 and getter
4231 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4232 Use the new implement constructors and new control flow.
4233 (parse_reg_operand_in): Likewise
4234 (parse_reg_operand_out): Likewise
4235 (parse_reg_operand_inout): Likewise
4236 (parse_reg_operand_const): Likewise
4237
4238 2025-03-19 badumbatish <[email protected]>
4239
4240 * ast/rust-expr.h (struct InlineAsmOperand):
4241 Add construction for register_type
4242 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4243 Fix parsing logic & reassignment logic
4244 (parse_reg_operand_in): Fix parsing
4245 (parse_reg_operand_out): Fix parsing
4246 (parse_reg_operand_inout): Fix parsing
4247 (parse_reg_operand_unexpected): Remove rust_unreachable()
4248 (parse_asm_arg): Fix parsing logic
4249 * expand/rust-macro-builtins-asm.h: Add = operator overloading
4250
4251 2025-03-19 Kushal Pal <[email protected]>
4252
4253 * checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint):
4254 This is the correct way of extracting the required bits.
4255
4256 2025-03-19 Arthur Cohen <[email protected]>
4257
4258 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Remove extern
4259 type feature.
4260 * checks/errors/borrowck/ffi-polonius/src/lib.rs: Define FFIVector
4261 per the nomicon's recommendation
4262 https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs
4263
4264 2025-03-19 Liam Naddell <[email protected]>
4265
4266 * ast/rust-ast.cc:
4267 Fix Attribute constructors to copy inner_attribute
4268 * checks/errors/rust-unsafe-checker.cc:
4269 Add pass for #[may_dangle] in safe impl's
4270 * hir/rust-ast-lower-item.cc:
4271 Add support for unsafe impl's
4272 * hir/rust-ast-lower-type.cc:
4273 Lower attributes in impl's from AST to HIR
4274 * hir/rust-hir-dump.cc:
4275 Change single attribute to AttrVec
4276 * hir/tree/rust-hir-item.h:
4277 Add unsafe support to Impl blocks in HIR
4278 * hir/tree/rust-hir.cc:
4279 Change single attribute to AttrVec
4280 * hir/tree/rust-hir.h:
4281 Add has/get_outer_attribute to GenericParam
4282
4283 2025-03-19 Antonio Gomes <[email protected]>
4284
4285 * expand/rust-cfg-strip.cc:
4286 Strip struct expr fields and strip fields in struct definition
4287 * expand/rust-cfg-strip.h:
4288 Signatures for new function maybe_strip_struct_expr_fields
4289
4290 2025-03-18 Marc Poulhiès <[email protected]>
4291
4292 PR rust/119333
4293 * Make-lang.in: Force offline mode for cargo
4294
4295 2025-03-18 Arthur Cohen <[email protected]>
4296
4297 * checks/errors/borrowck/ffi-polonius/.cargo/config.toml: New file, force vendored deps.
4298 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/.cargo-checksum.json: New file.
4299 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/CODE_OF_CONDUCT.md: New file.
4300 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/Cargo.toml: New file.
4301 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/LICENSE-APACHE: New file.
4302 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/LICENSE-MIT: New file.
4303 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/README.md: New file.
4304 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/RELEASES.md: New file.
4305 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/examples/borrow_check.rs: New file.
4306 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/examples/graspan1.rs: New file.
4307 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/src/join.rs: New file.
4308 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/src/lib.rs: New file.
4309 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/src/map.rs: New file.
4310 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/src/test.rs: New file.
4311 * checks/errors/borrowck/ffi-polonius/vendor/datafrog/src/treefrog.rs: New file.
4312 * checks/errors/borrowck/ffi-polonius/vendor/log/.cargo-checksum.json: New file.
4313 * checks/errors/borrowck/ffi-polonius/vendor/log/CHANGELOG.md: New file.
4314 * checks/errors/borrowck/ffi-polonius/vendor/log/Cargo.toml: New file.
4315 * checks/errors/borrowck/ffi-polonius/vendor/log/LICENSE-APACHE: New file.
4316 * checks/errors/borrowck/ffi-polonius/vendor/log/LICENSE-MIT: New file.
4317 * checks/errors/borrowck/ffi-polonius/vendor/log/README.md: New file.
4318 * checks/errors/borrowck/ffi-polonius/vendor/log/benches/value.rs: New file.
4319 * checks/errors/borrowck/ffi-polonius/vendor/log/src/__private_api.rs: New file.
4320 * checks/errors/borrowck/ffi-polonius/vendor/log/src/kv/error.rs: New file.
4321 * checks/errors/borrowck/ffi-polonius/vendor/log/src/kv/key.rs: New file.
4322 * checks/errors/borrowck/ffi-polonius/vendor/log/src/kv/mod.rs: New file.
4323 * checks/errors/borrowck/ffi-polonius/vendor/log/src/kv/source.rs: New file.
4324 * checks/errors/borrowck/ffi-polonius/vendor/log/src/kv/value.rs: New file.
4325 * checks/errors/borrowck/ffi-polonius/vendor/log/src/lib.rs: New file.
4326 * checks/errors/borrowck/ffi-polonius/vendor/log/src/macros.rs: New file.
4327 * checks/errors/borrowck/ffi-polonius/vendor/log/src/serde.rs: New file.
4328 * checks/errors/borrowck/ffi-polonius/vendor/log/triagebot.toml: New file.
4329 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/.cargo-checksum.json: New file.
4330 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/Cargo.toml: New file.
4331 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/README.md: New file.
4332 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/facts.rs: New file.
4333 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/lib.rs: New file.
4334 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/output/datafrog_opt.rs:
4335 New file.
4336 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/output/initialization.rs:
4337 New file.
4338 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/output/liveness.rs:
4339 New file.
4340 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/output/location_insensitive.rs:
4341 New file.
4342 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/output/mod.rs: New file.
4343 * checks/errors/borrowck/ffi-polonius/vendor/polonius-engine/src/output/naive.rs: New file.
4344 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/.cargo-checksum.json: New file.
4345 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/CODE_OF_CONDUCT.md: New file.
4346 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/Cargo.toml: New file.
4347 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/LICENSE-APACHE: New file.
4348 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/LICENSE-MIT: New file.
4349 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/README.md: New file.
4350 * checks/errors/borrowck/ffi-polonius/vendor/rustc-hash/src/lib.rs: New file.
4351
4352 2025-03-17 Muhammad Mahad <[email protected]>
4353
4354 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
4355 Add rich error message and error code similiar to rustc with
4356 associaed type and trait name
4357
4358 2025-03-17 Liam Naddell <[email protected]>
4359
4360 * expand/rust-expand-visitor.cc:
4361 Fix ICE caused by unique_ptr UB and buggy iterator use
4362
4363 2025-03-17 badumbatish <[email protected]>
4364
4365 * ast/rust-fmt.h (enum ParseMode):
4366 Drop typedef in Cpp
4367
4368 2025-03-17 badumbatish <[email protected]>
4369
4370 * ast/rust-fmt.cc (Pieces::collect):
4371 Added options for ParseMode
4372 * ast/rust-fmt.h (collect_pieces): Likewise.
4373 (struct Pieces): Likewise.
4374 * expand/rust-macro-builtins-format-args.cc (MacroBuiltin::format_args_handler):
4375 Likewise.
4376
4377 2025-03-17 badumbatish <[email protected]>
4378
4379 * ast/rust-expr.h (struct AnonConst):
4380 Change assertion of constructor
4381 (struct InlineAsmOperand):
4382 Change assertion of constructor
4383
4384 2025-03-17 Liam Naddell <[email protected]>
4385
4386 * typecheck/rust-hir-type-check-expr.cc:
4387 Fix ICE caused by not finding enum variant by adding new error
4388 message
4389
4390 2025-03-17 Antonio Gomes <[email protected]>
4391
4392 * hir/tree/rust-hir-expr.h: Add new get_operator_str method in
4393 ArithmeticOrLogicalExpr and CompoundAssignmentExpr
4394 * hir/tree/rust-hir.cc: Likewise
4395 * typecheck/rust-hir-type-check-expr.cc: Improve error message for
4396 operator expressions to display the correct operator symbol
4397
4398 2025-03-17 Kushal Pal <[email protected]>
4399
4400 * Make-lang.in: Compile new file.
4401 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
4402 Use new class to report errors.
4403 * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc: New file.
4404 * checks/errors/borrowck/rust-borrow-checker-diagnostics.h:
4405 New file, adds new class.
4406
4407 2025-03-17 Kushal Pal <[email protected]>
4408
4409 * Make-lang.in: Compile new file, rust-polonius.cc
4410 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Opaque
4411 type to represent FFIVector from C++.
4412 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs:
4413 Change types of fields in Output.
4414 * checks/errors/borrowck/ffi-polonius/src/lib.rs: Added helper
4415 functions to contruct Polonius output on C++ side,
4416 used helpers to contruct Polonius output on C++ side.
4417 * checks/errors/borrowck/polonius/rust-polonius-ffi.h (make_vector):
4418 FFIVector is a wrapper around std::vector for transfering data
4419 from Rust to C++.
4420 (struct Output): Use pointers to FFIVector instead of bool to
4421 store Polonius output data.
4422 * checks/errors/borrowck/polonius/rust-polonius.h (FFIVector__new):
4423 Helper function.
4424 (FFIVector__new_vec_pair): Likewise.
4425 (FFIVector__new_vec_triple): Likewise.
4426 (FFIVector__push): Likewise.
4427 (FFIVector__push_vec_pair): Likewise.
4428 (FFIVector__push_vec_triple): Likewise.
4429 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
4430 Convert FFIVector to std::vector representation for easier
4431 navigation.
4432 * checks/errors/borrowck/polonius/rust-polonius.cc: New file,
4433 implementation of helper functions.
4434
4435 2025-03-17 Marc Poulhiès <[email protected]>
4436
4437 * hir/rust-hir-dump.cc (Dump::do_matcharm): New.
4438 (Dump::do_matchcase): New.
4439 (Dump::visit(MatchExpr)): Adjust, don't use as_string.
4440 * hir/rust-hir-dump.h (Dump::do_matcharm, Dump::do_matchcase): New.
4441
4442 2025-03-17 Liam Naddell <[email protected]>
4443
4444 * ast/rust-expr.h:
4445 Remove unnecessary include.
4446
4447 2025-03-17 badumbatish <[email protected]>
4448
4449 * ast/rust-expr.h (struct AnonConst):
4450 Safe-guard InlineAsm structs
4451 (struct InlineAsmOperand): Likewise.
4452 * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in):
4453 Likewise.
4454 (parse_reg_operand_out): Likewise.
4455 (parse_reg_operand_inout): Likewise.
4456
4457 2025-03-17 badumbatish <[email protected]>
4458
4459 * ast/rust-expr.h (struct TupleTemplateStr):
4460 Store parse result of parse_format_string(s)
4461 * expand/rust-macro-builtins-asm.cc (parse_format_strings):
4462 Likewise
4463
4464 2025-03-17 jjasmine <[email protected]>
4465
4466 * expand/rust-macro-builtins-asm.cc (parse_asm):
4467 Clean up monadic operations on expected<>
4468
4469 2025-03-17 jjasmine <[email protected]>
4470
4471 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4472 Addresses warning, put warn unused in right place
4473 (parse_reg_operand_inout): Likewise.
4474 (parse_asm_arg): Likewise.
4475 * expand/rust-macro-builtins-asm.h (enum WARN_UNUSED_RESULT): Likewise.
4476 (enum InlineAsmParseError): Likewise.
4477 (validate): Likewise.
4478 (parse_asm_arg): Likewise.
4479 (parse_format_strings): Likewise.
4480 (parse_clobber_abi): Likewise.
4481 (parse_reg_operand): Likewise.
4482 (parse_reg_operand_in): Likewise.
4483 (parse_reg_operand_out): Likewise.
4484 (parse_reg_operand_lateout): Likewise.
4485 (parse_reg_operand_inout): Likewise.
4486 (parse_reg_operand_inlateout): Likewise.
4487 (parse_reg_operand_const): Likewise.
4488 (parse_reg_operand_sym): Likewise.
4489 (parse_reg_operand_unexpected): Likewise.
4490 (parse_asm): Likewise.
4491 (check_and_set): Likewise.
4492 (parse_options): Likewise.
4493 (parse_reg): Likewise.
4494 (parse_format_string): Likewise.
4495
4496 2025-03-17 jjasmine <[email protected]>
4497
4498 * expand/rust-macro-builtins-asm.h (enum InlineAsmParseError):
4499 Add WARN_UNUSED_RESULT parse error
4500 (enum WARN_UNUSED_RESULT): Likewise.
4501
4502 2025-03-17 jjasmine <[email protected]>
4503
4504 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
4505 added comments
4506 (parse_options): Likewise
4507 (parse_asm_arg): Likewise
4508 (parse_asm): Likewise
4509 * expand/rust-macro-builtins-asm.h: Likewise
4510
4511 2025-03-17 jjasmine <[email protected]>
4512
4513 * ast/rust-expr.h:
4514 Added tl::expected to parse_operand
4515 * expand/rust-macro-builtins-asm.cc (parse_reg): Likewise.
4516 (parse_reg_operand): Likewise.
4517 (parse_reg_operand_const): Likewise.
4518 (parse_reg_operand_inout): Likewise.
4519 (parse_asm_arg): Likewise.
4520 * expand/rust-macro-builtins-asm.h: Likewise.
4521
4522 2025-03-17 jjasmine <[email protected]>
4523
4524 * expand/rust-macro-builtins-asm.cc (check_and_set):
4525 Scaffold expected on parse_options and asm_arg
4526 (parse_options): Likewise
4527 (parse_asm_arg): Likewise
4528 * expand/rust-macro-builtins-asm.h (check_and_set): Likewise
4529 (parse_label): Likewise
4530
4531 2025-03-17 jjasmine <[email protected]>
4532
4533 * expand/rust-macro-builtins-asm.cc (parse_reg_operand_in):
4534 Finish expected parse_reg_operand
4535 (parse_reg_operand_unexpected): Likewise
4536 * expand/rust-macro-builtins-asm.h (parse_reg_operand_unexpected): Likewise
4537
4538 2025-03-17 jjasmine <[email protected]>
4539
4540 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
4541 Finish incorporating expected of parse_reg_operand
4542 (parse_reg): Likewise.
4543 (parse_reg_operand): Likewise.
4544 (parse_reg_operand_in): Likewise.
4545 (parse_reg_operand_out): Likewise.
4546 (parse_reg_operand_lateout): Likewise.
4547 (parse_reg_operand_const): Likewise.
4548 (parse_reg_operand_inout): Likewise.
4549 (parse_reg_operand_sym): Likewise.
4550 (MacroBuiltin::asm_handler): Likewise.
4551 (parse_asm_arg): Likewise.
4552 (parse_asm): Likewise.
4553 (parse_format_strings): Likewise.
4554 (validate): Likewise.
4555 * expand/rust-macro-builtins-asm.h (class InlineAsmParseError): Likewise.
4556 (enum InlineAsmParseError): Likewise.
4557 (validate): Likewise.
4558 (parse_format_strings): Likewise.
4559 (parse_reg_operand_in): Likewise.
4560 (parse_reg_operand_out): Likewise.
4561 (parse_reg_operand_lateout): Likewise.
4562 (parse_reg_operand_inout): Likewise.
4563 (parse_reg_operand_inlateout): Likewise.
4564 (parse_reg_operand_const): Likewise.
4565 (parse_reg_operand_sym): Likewise.
4566
4567 2025-03-17 ansh <[email protected]>
4568
4569 * ast/rust-ast-collector.cc (TokenCollector::visit):
4570 Handle case for RAW_STRING_LITERAL.
4571 * ast/rust-ast.cc (AttributeParser::parse_meta_item_inner):
4572 Likewise.
4573 (AttributeParser::parse_literal): Likewise.
4574 * ast/rust-ast.h: Likewise.
4575 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_literal):
4576 Likewise.
4577 * lex/rust-lex.cc (Lexer::parse_raw_string): Likewise.
4578 * lex/rust-token.cc (Token::as_string): Likewise.
4579 * lex/rust-token.h (enum PrimitiveCoreType): Likewise.
4580 * parse/rust-parse-impl.h (Parser::parse_attr_input): Likewise.
4581 (Parser::parse_literal_expr): Likewise.
4582 (Parser::parse_pattern_no_alt): Likewise.
4583
4584 2025-03-17 jjasmine <[email protected]>
4585
4586 * hir/tree/rust-hir-expr.h:
4587 Added ExprType::InlineAsm
4588 * hir/tree/rust-hir.h:
4589 Added ExprType::InlineAsm
4590
4591 2025-03-17 Arthur Cohen <[email protected]>
4592
4593 * ast/rust-ast-fragment.h (enum class): Add InvocKind and AsmKind enums.
4594 * ast/rust-macro.h: Switch semicolon boolean to InvocKind enum.
4595 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
4596 * expand/rust-macro-builtins-asm.cc (MacroBuiltin::asm_handler): Likewise.
4597 (parse_asm): Likewise.
4598 * expand/rust-macro-builtins-asm.h (parse_asm): Likewise.
4599 * expand/rust-macro-builtins-format-args.cc (MacroBuiltin::format_args_handler): Likewise.
4600 * expand/rust-macro-builtins-include.cc (MacroBuiltin::include_bytes_handler): Likewise.
4601 (MacroBuiltin::include_str_handler): Likewise.
4602 (MacroBuiltin::include_handler): Likewise.
4603 * expand/rust-macro-builtins-location.cc (MacroBuiltin::file_handler): Likewise.
4604 (MacroBuiltin::column_handler): Likewise.
4605 (MacroBuiltin::line_handler): Likewise.
4606 * expand/rust-macro-builtins-log-debug.cc (MacroBuiltin::assert_handler): Likewise.
4607 * expand/rust-macro-builtins-utility.cc (MacroBuiltin::compile_error_handler): Likewise.
4608 (MacroBuiltin::concat_handler): Likewise.
4609 (MacroBuiltin::env_handler): Likewise.
4610 (MacroBuiltin::cfg_handler): Likewise.
4611 (MacroBuiltin::stringify_handler): Likewise.
4612 * expand/rust-macro-builtins.cc (format_args_maker): Likewise.
4613 (enum class): Likewise.
4614 (inline_asm_maker): Likewise.
4615 (MacroBuiltin::sorry): Likewise.
4616 (MacroBuiltin::proc_macro_builtin): Likewise.
4617 * expand/rust-macro-builtins.h: Likewise.
4618 * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
4619 (MacroExpander::expand_eager_invocations): Likewise.
4620 (MacroExpander::expand_invoc): Likewise.
4621 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
4622
4623 2025-03-17 Arthur Cohen <[email protected]>
4624
4625 * ast/rust-ast-fragment.h: Pass `is_semicolon` information to builtin
4626 macro transcribers.
4627 * ast/rust-macro.h: Pass semicolon information to transcriber..
4628 * expand/rust-macro-builtins-asm.cc (MacroBuiltin::asm_handler): Likewise.
4629 (parse_asm): Likewise.
4630 * expand/rust-macro-builtins-asm.h (parse_asm): Likewise.
4631 * expand/rust-macro-builtins-format-args.cc (MacroBuiltin::format_args_handler): Likewise.
4632 * expand/rust-macro-builtins-include.cc (MacroBuiltin::include_bytes_handler): Likewise.
4633 (MacroBuiltin::include_str_handler): Likewise.
4634 (MacroBuiltin::include_handler): Likewise.
4635 * expand/rust-macro-builtins-location.cc (MacroBuiltin::file_handler): Likewise.
4636 (MacroBuiltin::column_handler): Likewise.
4637 (MacroBuiltin::line_handler): Likewise.
4638 * expand/rust-macro-builtins-log-debug.cc (MacroBuiltin::assert_handler): Likewise.
4639 * expand/rust-macro-builtins-utility.cc (MacroBuiltin::compile_error_handler): Likewise.
4640 (MacroBuiltin::concat_handler): Likewise.
4641 (MacroBuiltin::env_handler): Likewise.
4642 (MacroBuiltin::cfg_handler): Likewise.
4643 (MacroBuiltin::stringify_handler): Likewise.
4644 * expand/rust-macro-builtins.cc (format_args_maker): Likewise.
4645 (inline_asm_maker): Likewise.
4646 (MacroBuiltin::sorry): Likewise.
4647 (MacroBuiltin::proc_macro_builtin): Likewise.
4648 * expand/rust-macro-builtins.h: Likewise.
4649 * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
4650 (MacroExpander::expand_invoc): Likewise.
4651 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Remove rust_unreachable.
4652 * ast/rust-ast.cc (InlineAsm::accept_vis): Likewise.
4653 * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
4654
4655 2025-03-17 dave <[email protected]>
4656
4657 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Check for ?Trait in visitor
4658
4659 2025-03-17 jjasmine <[email protected]>
4660
4661 * expand/rust-macro-builtins-asm.cc (parseDirSpec):
4662 Partial second layer of expected in parsing asm
4663 (parse_clobber_abi): Likewise
4664 (parse_operand): Likewise
4665 (parse_reg_operand): Likewise
4666 (parse_asm_arg): Likewise
4667 * expand/rust-macro-builtins-asm.h (parse_clobber_abi): Likewise
4668 (parse_reg_operand): Likewise
4669 (parse_operand): Likewise
4670
4671 2025-03-17 jjasmine <[email protected]>
4672
4673 * expand/rust-macro-builtins-asm.cc (parse_reg):
4674 Expected first layer done
4675 (parse_reg_operand): Likewise.
4676 (parse_asm_arg): Likewise.
4677 (parse_format_strings): Likewise.
4678 (parse_asm): Likewise.
4679 (validate): Likewise.
4680 * expand/rust-macro-builtins-asm.h (parse_asm_arg): Likewise.
4681 (validate): Likewise.
4682 (parse_format_strings): Likewise.
4683
4684 2025-03-17 jjasmine <[email protected]>
4685
4686 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
4687 Move parser and last_token_id to InlineAsmCtx to prepapre
4688 for tl::expected.
4689 (parse_reg): Likewise.
4690 (parse_operand): Likewise.
4691 (parse_reg_operand): Likewise.
4692 (check_and_set): Likewise.
4693 (parse_options): Likewise.
4694 (parse_format_string): Likewise.
4695 (parse_asm_arg): Likewise.
4696 (parse_asm): Likewise.
4697 * expand/rust-macro-builtins-asm.h (class InlineAsmParseError): Likewise.
4698 (parse_asm_arg): Likewise.
4699 (check_and_set): Likewise.
4700 (parse_operand): Likewise.
4701 (parse_reg_operand): Likewise.
4702 (parse_options): Likewise.
4703 (parse_reg): Likewise.
4704 (parse_clobber_abi): Likewise.
4705 (parse_format_string): Likewise.
4706
4707 2025-03-17 jjasmine <[email protected]>
4708
4709 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4710 Update parser to parse strings in the first stage
4711 (parse_label): not needed right now
4712
4713 2025-03-17 jjasmine <[email protected]>
4714
4715 * expand/rust-macro-builtins-asm.cc (parse_asm):
4716 Scaffolding validation of asm!
4717 (validate): Likewise
4718 * expand/rust-macro-builtins-asm.h (validate): Likewise
4719
4720 2025-03-17 jjasmine <[email protected]>
4721
4722 * ast/rust-expr.h (struct InlineAsmOperand):
4723 Partial support for operand
4724 * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise.
4725 (parse_label): Likewise.
4726 * expand/rust-macro-builtins-asm.h (parse_label): Likewise.
4727
4728 2025-03-17 jjasmine <[email protected]>
4729
4730 * ast/rust-expr.h (struct InlineAsmOperand):
4731 Refactoring and supporting more parse_reg_operand
4732 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4733 Likewise.
4734 (rust_debug): Likewise.
4735
4736 2025-03-17 jjasmine <[email protected]>
4737
4738 * ast/rust-ast-collector.cc (TokenCollector::visit):
4739 Fix visitor-related warnings
4740 * ast/rust-ast-collector.h: Likewise.
4741 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
4742 * ast/rust-ast-visitor.h: Likewise.
4743 * checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
4744 * checks/errors/borrowck/rust-function-collector.h: Likewise.
4745 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
4746 * checks/errors/rust-const-checker.h: Likewise.
4747 * expand/rust-derive.h: Likewise.
4748 * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise.
4749 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
4750 * hir/rust-hir-dump.h: Likewise.
4751 * hir/tree/rust-hir-visitor.h: Likewise.
4752 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
4753 * resolve/rust-ast-resolve-base.h: Likewise.
4754
4755 2025-03-17 jjasmine <[email protected]>
4756
4757 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4758 Add potentially_nonpromoted_keywords set str
4759 (check_identifier): likewise
4760 * expand/rust-macro-builtins-asm.h (parse_format_string):
4761 likewise
4762
4763 2025-03-17 jjasmine <[email protected]>
4764
4765 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4766 Successful parse of in and inout, albeit with str
4767 (check_identifier): Likewise.
4768 (parse_asm_arg): Likewise.
4769 * expand/rust-macro-builtins-asm.h (parse_format_string): Likewise.
4770
4771 2025-03-17 jjasmine <[email protected]>
4772
4773 * ast/rust-ast-visitor.h:
4774 Scaffolding HIRFullVisitor for inline asm
4775 * ast/rust-ast.cc (InlineAsm::accept_vis): Likewise.
4776 * hir/tree/rust-hir-visitor.h (RUST_HIR_VISITOR_H): Likewise.
4777 * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
4778
4779 2025-03-17 jjasmine <[email protected]>
4780
4781 * ast/rust-ast-visitor.h:
4782 Scaffolding ast visitor for InlineAsm
4783 * ast/rust-ast.cc (InlineAsm::accept_vis): Likewise.
4784 * ast/rust-expr.h: Likewise.
4785
4786 2025-03-17 jjasmine <[email protected]>
4787
4788 * expand/rust-macro-builtins-asm.cc (parse_reg_operand):
4789 Fix compile warnings.
4790 (parse_options): Likewise.
4791 (parse_asm): Likewise.
4792
4793 2025-03-17 jjasmine <[email protected]>
4794
4795 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
4796 Partial unsafe support for inline asm
4797 * checks/errors/rust-unsafe-checker.h: Likewise.
4798 * hir/tree/rust-hir-expr.h: Likewise.
4799 * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
4800
4801 2025-03-17 jjasmine <[email protected]>
4802
4803 * ast/rust-expr.h:
4804 Add support for AST to HIR inline asm translation
4805 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
4806 * hir/rust-ast-lower-base.h: Likewise.
4807 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
4808 * hir/rust-ast-lower-expr.h: Likewise.
4809 * hir/tree/rust-hir-expr.h (class InlineAsm): Likewise.
4810
4811 2025-03-17 jjasmine <[email protected]>
4812
4813 * ast/rust-expr.h (struct AnonConst):
4814 major refactoring of inline asm, mostly concerns
4815 naming convention, trinary conditionals, warnings,
4816 adding rust_unreachables in not-yet supported errors.
4817 (struct InlineAsmRegOrRegClass): Likewise.
4818 (struct InlineAsmOperand): Likewise.
4819 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): Likewise.
4820 (parse_reg): Likewise.
4821 (parse_operand): Likewise.
4822 (parse_reg_operand): Likewise.
4823 (check_and_set): Likewise.
4824 (parse_options): Likewise.
4825 (parse_format_string): Likewise.
4826 (parse_asm_arg): Likewise.
4827 (parse_asm): Likewise.
4828 * expand/rust-macro-builtins-asm.h (parse_asm_arg): Likewise.
4829 (check_identifier): Likewise.
4830 (check_and_set): Likewise.
4831 (parse_operand): Likewise.
4832 (parse_reg_operand): Likewise.
4833 (parse_options): Likewise.
4834 (parse_reg): Likewise.
4835 (parse_clobber_abi): Likewise.
4836 * expand/rust-macro-builtins.cc (enum class): Likewise.
4837 (inline_asm_maker): Likewise.
4838 * checks/errors/borrowck/ffi-polonius/Cargo.lock: Removed. Likewise.
4839
4840 2025-03-17 jjasmine <[email protected]>
4841
4842 * ast/rust-expr.h (struct AnonConst):
4843 Got AST::Fragment to be created from InlineAsm.
4844 (struct InlineAsmOperand): Likewise.
4845 (class InlineAsm): Likewise.
4846 * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise.
4847 (parse_asm): likewise
4848
4849 2025-03-17 jjasmine <[email protected]>
4850
4851 * expand/rust-macro-builtins-asm.cc (parse_reg):
4852 Working towards parse_reg and parse_reg_operand
4853 (parse_reg_operand):
4854 Working towards parse_reg and parse_reg_operand
4855 (parse_asm_arg):
4856 Add todo about errors
4857 * expand/rust-macro-builtins-asm.h (parse_global_asm):
4858 remove dead code.
4859 (parse_nonglobal_asm):
4860 remove dead code.
4861
4862 2025-03-17 jjasmine <[email protected]>
4863
4864 * expand/rust-macro-builtins-asm.cc (parseAsmArg):
4865 Renamed parseAsmArg to conform to other function names
4866 (parse_asm_arg): Likewise.
4867 (parse_asm): Likewise.
4868 * expand/rust-macro-builtins-asm.h (parseAsmArg): Likewise.
4869 (parse_asm_arg): Likewise.
4870
4871 2025-03-17 jjasmine <[email protected]>
4872
4873 * ast/rust-expr.h (struct InlineAsmRegOrRegClass):
4874 Remove union
4875 (struct InlineAsmOperand): Make instances of inside struct.
4876 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
4877 Change signature with inlineAsmCtx.
4878 (parse_reg): Likewise.
4879 (parse_operand): Likewise.
4880 (parse_reg_operand): Likewise.
4881 (check_and_set): Likewise.
4882 (parse_options): Likewise.
4883 (parse_format_string): Likewise.
4884 (parseAsmArg): Likewise.
4885 (parse_asm): Likewise.
4886 * expand/rust-macro-builtins-asm.h (class InlineAsmContext): Likewise.
4887 (parseAsmArg): Likewise.
4888 (check_and_set): Likewise.
4889 (parse_reg_operand): Likewise.
4890 (parse_options): Likewise.
4891 (parse_reg): Likewise.
4892 (parse_clobber_abi): Likewise.
4893
4894 2025-03-17 jjasmine <[email protected]>
4895
4896 * expand/rust-macro-builtins-asm.cc
4897 (MacroBuiltin::global_asm_handler):
4898 Remove global_asm and non_global_asm handler
4899 (MacroBuiltin::nonglobal_asm_handler): Likewise.
4900 (MacroBuiltin::asm_handler): Likewise.
4901 * expand/rust-macro-builtins.cc (enum class): Likewise.
4902 (inline_asm_maker): Likewise.
4903 * expand/rust-macro-builtins.h: Likewise.
4904
4905 2025-03-17 jjasmine <[email protected]>
4906
4907 * ast/rust-expr.h:
4908 Safegaurd InlineAsm's clone_expr_... with unreachable.
4909
4910 2025-03-17 jjasmine <[email protected]>
4911
4912 * ast/rust-ast-full-decls.h (enum class):
4913 Rename InlineAsmOptions to InlineAsmOption for clarity
4914 * ast/rust-expr.h (enum class): Likewise.
4915 * expand/rust-macro-builtins-asm.cc (check_and_set): Likewise.
4916 (parse_options): Likewise.
4917 * expand/rust-macro-builtins-asm.h (check_and_set): Likewise.
4918 * hir/tree/rust-hir-expr.h: Likewise.
4919
4920 2025-03-17 jjasmine <[email protected]>
4921
4922 * ast/rust-expr.h (struct InlineAsmRegOrRegClass):
4923 Scaffolding parse_reg
4924 * expand/rust-macro-builtins-asm.cc (parse_reg): Likewise.
4925 (parse_operand): Likewise.
4926 (parseAsmArg): Likewise.
4927 * checks/errors/borrowck/ffi-polonius/Cargo.lock: New file.
4928
4929 2025-03-17 jjasmine <[email protected]>
4930
4931 * expand/rust-macro-builtins-asm.h (parseAsmArg):
4932 Resolve static decl warning
4933 (parse_nonglobal_asm):
4934 Resolve static decl warning
4935
4936 2025-03-17 jjasmine <[email protected]>
4937
4938 * expand/rust-macro-builtins-asm.cc (check_and_set):
4939 Add checks for duplicate options in inline asm
4940 (parse_options): likewise.
4941
4942 2025-03-17 jjasmine <[email protected]>
4943
4944 * ast/rust-expr.h: parsing of options(...)
4945 * expand/rust-macro-builtins-asm.cc (check_and_set):
4946 likewise.
4947 (parse_options): likewise.
4948 (parseAsmArg): likewise.
4949 * expand/rust-macro-builtins-asm.h (check_and_set):
4950 likewise.
4951
4952 2025-03-17 jjasmine <[email protected]>
4953
4954 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
4955 implemented parse_clobber_abi
4956 (parse_format_string): likewise.
4957 (parseAsmArg): likewise.
4958 (parse_asm): likewise.
4959 * expand/rust-macro-builtins-asm.h (parseAsmArg): likewise.
4960
4961 2025-03-17 jjasmine <[email protected]>
4962
4963 * expand/rust-macro-builtins-asm.cc (parseDirSpec): replace
4964 scaffolded InlineAsm with real InlineAsm.
4965 (parse_clobber_abi): likewise.
4966 (check_and_set): likewise.
4967 (parse_options): likewise.
4968 (parseAsmArg): likewise.
4969 (parse_asm): likewise.
4970 * expand/rust-macro-builtins-asm.h (struct AsmParseError): likewise.
4971 (enum InlineAsmDirSpec): likewise.
4972 (enum InlineAsmRegOrRegClass): likewise.
4973 (struct AsmArg): likewise.
4974 (parseAsmArg): likewise.
4975 (check_and_set): likewise.
4976 (parse_operand): likewise.
4977 (parse_options): likewise.
4978 (parse_reg): likewise.
4979 (parse_clobber_abi): likewise.
4980
4981 2025-03-17 jjasmine <[email protected]>
4982
4983 * ast/rust-expr.h: Make InlineAsm non-abstract for usage in parsing.
4984
4985 2025-03-17 jjasmine <[email protected]>
4986
4987 * ast/rust-expr.h: Introduced is_global_asm to InlineAsm AST
4988
4989 2025-03-17 jjasmine <[email protected]>
4990
4991 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): format
4992 (check_and_set): helper function, is try_set_option equivalent
4993 (parse_options): new function
4994 * expand/rust-macro-builtins-asm.h (enum InlineAsmOptions):
4995 removed
4996 (check_and_set): decl of helper function
4997
4998 2025-03-17 jjasmine <[email protected]>
4999
5000 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title.
5001
5002 2025-03-17 jjasmine <[email protected]>
5003
5004 * expand/rust-macro-builtins-asm.cc (parse_options): title.
5005
5006 2025-03-17 jjasmine <[email protected]>
5007
5008 * expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title.
5009 (parseAsmArg): title.
5010 * expand/rust-macro-builtins-asm.h (parse_clobber_abi): title.
5011
5012 2025-03-17 jjasmine <[email protected]>
5013
5014 * expand/rust-macro-builtins-asm.cc (enum InlineAsmRegOrRegClass): title.
5015 (parseAsmArg): title.
5016 (check_identifier): title.
5017 (parse_operand): title.
5018 (parse_options): title.
5019 (parse_reg): title.
5020 (parseDirSpec): title.
5021 (parse_asm): title.
5022 * expand/rust-macro-builtins-asm.h: New file.
5023
5024 2025-03-17 jjasmine <[email protected]>
5025
5026 * expand/rust-macro-builtins-asm.cc (struct AsmParseError): title.
5027 (enum InlineAsmDirSpec): title.
5028 (enum InlineAsmOptions): title.
5029 (struct AsmArg): title.
5030 (parseAsmArg): title.
5031 (parse_global_asm): title.
5032 (parse_nonglobal_asm): title.
5033 (parse_asm): title.
5034 (parseDirSpec): title.
5035 (parse_format_string): title.
5036 (MacroBuiltin::global_asm_handler): title.
5037 (MacroBuiltin::nonglobal_asm_handler): title.
5038 * expand/rust-macro-builtins.cc: title.
5039 * expand/rust-macro-builtins.h: title.
5040
5041 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5042
5043 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate the
5044 excluded pattern.
5045 * checks/errors/rust-feature-gate.h: Update the function prototype
5046 and delete two empty implementations in order to use default visitor
5047 behavior.
5048 * checks/errors/rust-feature.cc (Feature::create): Add the new
5049 exclusive range pattern feature gate.
5050 * checks/errors/rust-feature.h: Add new feature enum variant for
5051 exclusive range patterns.
5052 * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Forward the
5053 token location to the AST.
5054 (Parser::parse_ident_leading_pattern): Likewise.
5055
5056 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5057
5058 * ast/rust-pattern.cc (tokenid_to_rangekind): Add a new function to
5059 get a range kind from the current token type.
5060 (RangePattern::as_string): Change the string representation for range
5061 pattern in order to handle excluded ranges.
5062 * ast/rust-pattern.h (enum class): Add new enum class to differentiate
5063 range kinds.
5064 (tokenid_to_rangekind): New prototype for a function that converts a
5065 token id to it's corresponding range kind.
5066 (class RangePattern): Change the class to accept a range kind instead
5067 of an ellipsis boolean.
5068 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Abort
5069 when an excluded pattern has been found as we do not handle their
5070 lowering yet.
5071 * parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern):
5072 Parse excluded range patterns.
5073 (Parser::parse_pattern_no_alt): Likewise.
5074 (Parser::parse_ident_leading_pattern): Likewise.
5075
5076 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5077
5078 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate raw
5079 borrow.
5080 * checks/errors/rust-feature-gate.h: Update function prototype.
5081 * checks/errors/rust-feature.cc: Add raw_ref_op gate.
5082 * checks/errors/rust-feature.h: Likewise.
5083
5084 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5085
5086 * ast/rust-expr.h: Add a getter for mutability.
5087 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Panic when a
5088 raw reference is met.
5089
5090 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5091
5092 * ast/rust-ast-builder.cc (Builder::ref): Adapt constructor to the new
5093 API.
5094 * ast/rust-ast-collector.cc (TokenCollector::visit): Emit a raw weak
5095 keyword when required.
5096 * ast/rust-ast.cc (BorrowExpr::as_string): Change as_string
5097 representation to handle raw ref operator.
5098 * ast/rust-expr.h (class BorrowExpr): Add raw discriminant.
5099 * expand/rust-macro-builtins-include.cc: Adapt constructor to the new
5100 API.
5101 * parse/rust-parse-impl.h: Handle the raw weak keyword.
5102
5103 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5104
5105 * ast/rust-ast-collector.cc (TokenCollector::visit): Output field
5106 attributes.
5107 * ast/rust-expr.h (class StructExprField): Add outer attributes member.
5108 * parse/rust-parse-impl.h (Parser::parse_struct_expr_field): Parse
5109 outer attributes and store them in the appropriate AST node.
5110
5111 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5112
5113 * checks/errors/rust-feature-gate.cc: Visit and gate may_dangle
5114 attributes.
5115 * checks/errors/rust-feature-gate.h: Update visit function prototype
5116 and add a new member function to check on a set of attributes whether
5117 one is may_dangle.
5118 * checks/errors/rust-feature.cc (Feature::create): Add new
5119 dropck_eyepatch feature.
5120 * checks/errors/rust-feature.h: Likewise.
5121 * util/rust-attribute-values.h: Add new may_dangle attribute value.
5122
5123 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5124
5125 * ast/rust-ast-collector.cc (TokenCollector::visit): Visit outer
5126 attributes.
5127 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change outer
5128 attribute visit, we need to visit all of them.
5129 * ast/rust-ast.cc (LifetimeParam::as_string): Change as_string
5130 implementation to allow multiple outer attributes.
5131 (TypeParam::as_string): Likewise.
5132 * ast/rust-ast.h (class LifetimeParam): Allow multiple outer
5133 attributes.
5134 * ast/rust-item.h (class TypeParam): Likewise.
5135 * ast/rust-path.h: Likewise.
5136 * parse/rust-parse-impl.h (Parser::parse_generic_param): Change call
5137 to outer attribute parsing to collect several attributes.
5138 (Parser::parse_lifetime_param): Likewise.
5139 (Parser::parse_type_param): Likewise.
5140
5141 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5142
5143 * parse/rust-parse-impl.h (Parser::parse_generic_param): Change token
5144 reference to be the last token after all outer attributes have been
5145 parsed.
5146
5147 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5148
5149 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Allow
5150 visitor recursion in functions. Also add the gate for the box syntax.
5151 * checks/errors/rust-feature-gate.h: Remove several recursion fences
5152 in the feature gate visitor.
5153 * checks/errors/rust-feature.cc (Feature::create): Add a new feature.
5154 (Feature::as_name): Likewise.
5155 * checks/errors/rust-feature.h: Add box_syntax gate.
5156
5157 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5158
5159 * ast/rust-ast-collector.cc (TokenCollector::visit): Add visit member
5160 function for BoxExpr nodes.
5161 * ast/rust-ast-collector.h: Add visit function prototype.
5162 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Add visit member
5163 function to default ast visitor.
5164 * ast/rust-ast-visitor.h: Add visit function's prototype.
5165 * ast/rust-ast.cc (BoxExpr::as_string): Add as_string function
5166 implementation for BoxExpr.
5167 (BoxExpr::accept_vis): Add accept_vis implementation to BoxExpr.
5168 * ast/rust-expr.h (class BoxExpr): Add BoxExpr class to represent boxed
5169 expressions.
5170 * expand/rust-derive.h: Add BoxExpr visit function prototype.
5171 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add BoxExpr
5172 visitor implementation.
5173 * hir/rust-ast-lower-base.h: Add visit function's prototype.
5174 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Add BoxExpr
5175 visitor implementation.
5176 * hir/rust-ast-lower-expr.h: Add visit function's prototype.
5177 * parse/rust-parse-impl.h (Parser::parse_box_expr): Add parse_box_expr
5178 function's implementation.
5179 * parse/rust-parse.h: Add parse_box_expr function's prototype.
5180 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add resolver
5181 visit implementation.
5182 * resolve/rust-ast-resolve-base.h: Add resolver's visit function
5183 prototype.
5184
5185 2025-03-17 Owen Avery <[email protected]>
5186
5187 * resolve/rust-default-resolver.cc
5188 (DefaultResolver::visit):
5189 Scope with Rib::Kind::ConstantItem instead
5190 of Rib::Kind::Item.
5191 * resolve/rust-toplevel-name-resolver-2.0.cc
5192 (TopLevel::visit): Remove redundancy in override of
5193 ConstantItem visitor.
5194
5195 2025-03-17 Owen Avery <[email protected]>
5196
5197 * expand/rust-macro-builtins.cc
5198 (MacroBuiltin::builtin_transcribers):
5199 Add entries for "rustc_const_stable" and "rustc_const_unstable".
5200 * util/rust-attributes.cc
5201 (__definitions): Add entries for RUSTC_CONST_STABLE and
5202 RUSTC_CONST_UNSTABLE.
5203 * util/rust-attribute-values.h
5204 (Attributes::RUSTC_CONST_STABLE): New.
5205 (Attributes::RUSTC_CONST_UNSTABLE): New.
5206
5207 2025-03-17 Kushal Pal <[email protected]>
5208
5209 * ast/rust-expr.h (class OperatorExpr):
5210 Location should be private.
5211 * hir/tree/rust-hir-expr.h (class OperatorExpr): Likewise.
5212
5213 2025-03-17 jjasmine <[email protected]>
5214
5215 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): make
5216 gccrs recognize negative_impls
5217 * checks/errors/rust-feature-gate.h: likewise.
5218 * checks/errors/rust-feature.cc (Feature::create): likewise.
5219 * checks/errors/rust-feature.h: likewise.
5220
5221 2025-03-17 SIGMazer <[email protected]>
5222
5223 * rust-system.h: Add system include <stack>
5224
5225 2025-03-17 Owen Avery <[email protected]>
5226
5227 * resolve/rust-default-resolver.cc
5228 (DefaultResolver::visit):
5229 New for AST::CallExpr and AST::MethodCallExpr.
5230 * resolve/rust-default-resolver.h
5231 (DefaultResolver::visit): Likewise.
5232
5233 2025-03-17 jjasmine <[email protected]>
5234
5235 * ast/rust-fmt.h: Remove useless cstddef header from rust-fmt
5236
5237 2025-03-17 Arthur Cohen <[email protected]>
5238
5239 * checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Remove.
5240 (BorrowChecker::go): Use `mkdir` instead.
5241 * expand/rust-proc-macro.cc (register_callback): Use Windows APIs to
5242 open dynamic proc macro library.
5243 (load_macros_array): Likewise.
5244 * parse/rust-parse.cc (defined): Replace separators in paths using
5245 std::replace.
5246
5247 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5248
5249 * metadata/rust-export-metadata.cc (ExportContext::emit_trait):
5250 Adapt call site to the new return type.
5251 (ExportContext::emit_function): Likewise.
5252 (ExportContext::emit_macro): Likewise.
5253 * util/rust-hir-map.cc (Mappings::lookup_ast_item): Change the
5254 function's return type.
5255 * util/rust-hir-map.h: Update the function's prototype.
5256
5257 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5258
5259 * checks/errors/privacy/rust-privacy-reporter.cc: Change call site
5260 to accomodate new return type.
5261 * checks/errors/privacy/rust-pub-restricted-visitor.cc: Likewise.
5262 * util/rust-hir-map.cc (Mappings::lookup_visibility): Change the
5263 function's return type.
5264 * util/rust-hir-map.h: Update the function's prototype.
5265
5266 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5267
5268 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Adapt
5269 the function call to match its new prototype.
5270 * resolve/rust-early-name-resolver-2.0.cc (Early::insert_once):
5271 Likewise.
5272 (Early::visit): Likewise.
5273 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
5274 Likewise.
5275 * util/rust-hir-map.cc (Mappings::lookup_macro_invocation): Change the
5276 function's return type.
5277 * util/rust-hir-map.h: Update the function's prototype.
5278
5279 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5280
5281 * resolve/rust-early-name-resolver-2.0.cc (Early::insert_once): Change
5282 call site to accomodate the new return type.
5283 (Early::visit): Likewise.
5284 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
5285 Likewise.
5286 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
5287 Likewise.
5288 * util/rust-hir-map.cc (Mappings::lookup_macro_def): Change the
5289 function's return type.
5290 * util/rust-hir-map.h: Update the function's prototype.
5291
5292 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5293
5294 * backend/rust-compile-base.cc: Change call site to accomodate new
5295 return type.
5296 * backend/rust-compile-base.h: Change parameter to use a reference.
5297 * backend/rust-compile-extern.h: Likewise.
5298 * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
5299 Change call site for new return type.
5300 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
5301 * resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit):
5302 Likewise.
5303 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit):
5304 Likewise.
5305 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit):
5306 Likewise.
5307 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
5308 Likewise.
5309 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
5310 Likewise.
5311 * util/rust-hir-map.h: Update the function's prototype and change the
5312 function's return type.
5313
5314 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5315
5316 * util/rust-hir-map.cc (Mappings::insert_hir_pattern): Change call site
5317 in order to accomodate new return type.
5318 (Mappings::lookup_hir_pattern): Change the function's return type.
5319 * util/rust-hir-map.h: Update the function's prototype.
5320
5321 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5322
5323 * util/rust-hir-map.cc (Mappings::insert_hir_struct_field): Change
5324 call site to accomodate new return type.
5325 (Mappings::lookup_hir_struct_field): Change the function's return
5326 type.
5327 * util/rust-hir-map.h: Update the function's prototype.
5328
5329 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5330
5331 * util/rust-hir-map.cc (Mappings::insert_hir_self_param): Adapt call
5332 site to new return type.
5333 (Mappings::lookup_hir_self_param): Change the function's return type.
5334 * util/rust-hir-map.h: Update the function's prototype.
5335
5336 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5337
5338 * util/rust-hir-map.cc (Mappings::insert_hir_param): Change call site
5339 to accomodate new return type.
5340 (Mappings::lookup_hir_param): Change the function's return type.
5341 * util/rust-hir-map.h: Updat ethe function's prototype.
5342
5343 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5344
5345 * util/rust-hir-map.cc (Mappings::insert_hir_stmt): Change call site
5346 to accomodate new return type.
5347 (Mappings::lookup_hir_stmt): Change the function's return type.
5348 (Mappings::resolve_nodeid_to_stmt): Adapt call site to new return type.
5349 * util/rust-hir-map.h: Update the function's prototype.
5350
5351 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5352
5353 * util/rust-hir-map.cc (Mappings::insert_hir_type): Change call site
5354 to accomodate the new return type.
5355 (Mappings::lookup_hir_type): Change the function's return type.
5356 * util/rust-hir-map.h: Update the function's prototype.
5357
5358 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5359
5360 * util/rust-hir-map.cc (Mappings::insert_hir_generic_param): Change
5361 call site to accomodate the new return type.
5362 (Mappings::lookup_hir_generic_param): Wrap the function's return type
5363 with an optional.
5364 * util/rust-hir-map.h: Update the function's prototype.
5365
5366 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5367
5368 * util/rust-hir-map.cc (Mappings::insert_hir_path_expr_seg): Change
5369 call site to accomodate the new return type.
5370 (Mappings::lookup_hir_path_expr_seg): Wrap the function's return type
5371 with an optional.
5372 * util/rust-hir-map.h: Update the function's prototype.
5373
5374 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5375
5376 * backend/rust-mangle-v0.cc (v0_path): Adapt call site to new returned
5377 type.
5378 * util/rust-hir-map.cc (Mappings::lookup_hir_expr): Change the
5379 function's return type.
5380 * util/rust-hir-map.h: Update the function's prototype.
5381
5382 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5383
5384 * backend/rust-compile-item.cc (CompileItem::visit): Change call site
5385 to accept new return type.
5386 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
5387 Likewise.
5388 * backend/rust-mangle-v0.cc (v0_path): Likewise.
5389 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
5390 Likewise.
5391 * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
5392 (MarkLive::visit): Likewise.
5393 * typecheck/rust-type-util.cc (query_type): Likewise.
5394 * util/rust-hir-map.cc (Mappings::insert_hir_implitem): Likewise.
5395 (Mappings::lookup_hir_implitem): Change return type.
5396 * util/rust-hir-map.h: Update the function's prototype.
5397
5398 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5399
5400 * typecheck/rust-autoderef.cc: Adapt calling code to new return type.
5401 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5402 Likewise.
5403 (TypeCheckExpr::resolve_operator_overload): Likewise.
5404 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_builtin_candidate):
5405 Likewise.
5406 * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
5407 * util/rust-hir-map.cc (Mappings::get_lang_item): Change return type.
5408 * util/rust-hir-map.h: Update the function's prototype.
5409
5410 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5411
5412 * checks/errors/privacy/rust-visibility-resolver.cc: Update function
5413 call to match the new return type.
5414 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
5415 Likewise.
5416 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
5417 Likewise.
5418 * util/rust-hir-map.cc (Mappings::insert_module): Likewise.
5419 (Mappings::lookup_module): Change the function's return type.
5420 * util/rust-hir-map.h: Update the function's prototype.
5421
5422 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5423
5424 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
5425 Adapt code around new return type.
5426 * checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
5427 Likewise.
5428 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::check_use_of_static):
5429 Likewise.
5430 (UnsafeChecker::check_function_call): Likewise.
5431 * typecheck/rust-type-util.cc (query_type): Likewise.
5432 * util/rust-hir-map.cc (Mappings::insert_hir_extern_item): Likewise.
5433 (Mappings::lookup_hir_extern_item): Change return type.
5434 * util/rust-hir-map.h: Update the function's prototype.
5435
5436 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5437
5438 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
5439 Update code around lookup return type.
5440 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
5441 Likewise.
5442 * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output):
5443 Likewise.
5444 * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Likewise.
5445 (Mappings::lookup_trait_item_defid): Update return type with an
5446 optional.
5447 (Mappings::get_lang_item): Likewise.
5448 * util/rust-hir-map.h: Update the functions prototype.
5449
5450 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5451
5452 * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Adapt call
5453 to new return type.
5454 (Mappings::insert_local_defid_mapping): Likewise.
5455 (Mappings::lookup_local_defid): Change return type to wrap it with an
5456 optional.
5457 * util/rust-hir-map.h: Update the function's prototype.
5458
5459 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5460
5461 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
5462 Change calling code to accomodate new return type.
5463 * checks/errors/privacy/rust-privacy-reporter.cc:
5464 Likewise.
5465 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate):
5466 Likewise.
5467 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5468 Likewise.
5469 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_builtin_candidate):
5470 Likewise.
5471 * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
5472 * util/rust-hir-map.cc (Mappings::lookup_defid): Change function's
5473 return type.
5474 * util/rust-hir-map.h: Update function's prototype.
5475
5476 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5477
5478 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
5479 Adapt the code to the new return types.
5480 * resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
5481 * util/rust-hir-map.cc (Mappings::get_crate_name): Change return type
5482 to const string reference optional.
5483 (Mappings::get_current_crate_name): Likewise.
5484 * util/rust-hir-map.h: Update function prototypes.
5485
5486 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5487
5488 * resolve/rust-ast-resolve-toplevel.h: Adapt the code to the new
5489 return type.
5490 * rust-session-manager.cc (Session::load_extern_crate): Likewise.
5491 * util/rust-hir-map.cc (Mappings::crate_num_to_nodeid): Change the
5492 return type.
5493 * util/rust-hir-map.h: Update the function's prototype.
5494
5495 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5496
5497 * resolve/rust-ast-resolve-toplevel.h: Adapt the code to the new
5498 return type.
5499 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
5500 Likewise.
5501 * rust-session-manager.cc (Session::load_extern_crate): Likewise.
5502 * util/rust-hir-map.cc (Mappings::lookup_crate_name): Change the return
5503 type to an optional.
5504 * util/rust-hir-map.h: Update the function's prototype.
5505
5506 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5507
5508 * typecheck/rust-type-util.cc (query_type): Adapt code to accomodate
5509 the new return type.
5510 * util/rust-hir-map.cc (Mappings::lookup_impl_block_type): Change
5511 the function's return type and remove the out pointer argument.
5512 * util/rust-hir-map.h: Update the function's prototype.
5513
5514 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5515
5516 * typecheck/rust-type-util.cc (query_type): Change call to the function
5517 in order to accomodate the new return type.
5518 * util/rust-hir-map.cc (Mappings::lookup_hir_impl_block): Change the
5519 function's return type to an optional.
5520 * util/rust-hir-map.h: Update the function's prototype.
5521
5522 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5523
5524 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::check_function_call):
5525 Adapt function call to new return type.
5526 * typecheck/rust-type-util.cc (query_type): Likewise.
5527 * util/rust-hir-map.cc (Mappings::insert_hir_extern_block): Likewise.
5528 (Mappings::lookup_hir_extern_block): Change return type to an optional.
5529 * util/rust-hir-map.h: Update the function's prototype.
5530
5531 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5532
5533 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
5534 Adapt return type to new optional.
5535 * backend/rust-mangle-v0.cc (v0_function_path): Change prototype to use
5536 the generic arguments vector instead of the whole HIR function.
5537 (v0_path): Fix a bug with a null pointer being used to create the
5538 trait function mangling.
5539 * util/rust-hir-map.cc (Mappings::insert_hir_trait_item): Adapt code
5540 to new return type.
5541 (Mappings::lookup_hir_trait_item): Change the return type of the
5542 function to an optional.
5543 * util/rust-hir-map.h: Update the function's prototype.
5544
5545 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5546
5547 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
5548 Adapt function call to new return type.
5549 * backend/rust-mangle-v0.cc (v0_path): Likewise.
5550 * checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
5551 Likewise.
5552 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::check_use_of_static):
5553 Likewise.
5554 (UnsafeChecker::check_function_call): Likewise.
5555 (UnsafeChecker::check_function_attr): Likewise.
5556 * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
5557 (MarkLive::visit): Likewise.
5558 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
5559 Likewise.
5560 * typecheck/rust-type-util.cc (query_type): Likewise.
5561 * util/rust-hir-map.cc (Mappings::insert_hir_item): Likewise.
5562 (Mappings::lookup_hir_item): Change function return type to use
5563 optional.
5564 * util/rust-hir-map.h: Update function prototype.
5565
5566 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5567
5568 * util/rust-hir-map.cc (Mappings::resolve_nodeid_to_stmt): Change the
5569 return type and remove pointer out argument.
5570 * util/rust-hir-map.h: Update function prototype.
5571
5572 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5573
5574 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
5575 Adapt code for new optional return type.
5576 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
5577 Likewise.
5578 * util/rust-hir-map.cc (Mappings::lookup_hir_to_node): Change return
5579 type to an optional.
5580 * util/rust-hir-map.h: Adapt function prototype with the new return
5581 type.
5582
5583 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5584
5585 * backend/rust-compile-expr.cc (CompileExpr::visit): Change call to use
5586 the returned optional.
5587 (CompileExpr::generate_closure_function): Likewise.
5588 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
5589 Likewise.
5590 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
5591 * backend/rust-mangle-v0.cc (v0_path): Likewise.
5592 * checks/errors/privacy/rust-visibility-resolver.cc:
5593 Likewise.
5594 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
5595 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
5596 Likewise.
5597 * checks/lints/rust-lint-marklive.cc (MarkLive::visit): Likewise.
5598 (MarkLive::visit_path_segment): Likewise.
5599 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
5600 Likewise.
5601 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
5602 Likewise.
5603 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
5604 Likewise.
5605 (ResolveWhereClauseItem::visit): Likewise.
5606 * util/rust-hir-map.cc (Mappings::lookup_node_to_hir): Return an
5607 optional instead of a boolean.
5608 * util/rust-hir-map.h: Change function prototype to match the new
5609 return type.
5610
5611 2025-03-17 Owen Avery <[email protected]>
5612
5613 * resolve/rust-default-resolver.cc
5614 (DefaultResolver::visit):
5615 Verify constant item has expression before attempting to visit
5616 the later.
5617
5618 2025-03-17 Owen Avery <[email protected]>
5619
5620 * backend/rust-compile-expr.cc
5621 (check_match_scrutinee): Add assertion.
5622 * backend/rust-compile-pattern.cc
5623 (CompilePatternCheckExpr::visit):
5624 Handle HIR::PathInExpression matching a non-enum.
5625
5626 2025-03-17 Nobel Singh <[email protected]>
5627
5628 * backend/rust-compile-expr.cc (check_match_scrutinee): Handle structs
5629
5630 2025-03-17 Owen Avery <[email protected]>
5631
5632 * backend/rust-compile-base.cc
5633 (HIRCompileBase::compile_function_body):
5634 Adjust unit_expression calls.
5635 (HIRCompileBase::unit_expression):
5636 Remove unused Context parameter.
5637 * backend/rust-compile-base.h
5638 (HIRCompileBase::unit_expression): Likewise.
5639 * backend/rust-compile-block.cc
5640 (CompileBlock::visit): Adjust unit_expression calls.
5641 * backend/rust-compile-expr.cc
5642 (CompileExpr::visit): Likewise.
5643 * backend/rust-compile-pattern.cc
5644 (CompilePatternLet::visit): Likewise.
5645 * backend/rust-compile-resolve-path.cc
5646 (ResolvePathRef::attempt_constructor_expression_lookup):
5647 Likewise.
5648 * backend/rust-compile-type.cc
5649 (TyTyResolveCompile::get_implicit_enumeral_node_type):
5650 Remove unused Context parameter.
5651 (TyTyResolveCompile::get_unit_type):
5652 Likewise.
5653 (TyTyResolveCompile::visit):
5654 Adjust get_implicit_enumeral_node_type and get_unit_type calls.
5655 * backend/rust-compile-type.h
5656 (TyTyResolveCompile::get_implicit_enumeral_node_type):
5657 Remove unused Context parameter.
5658 (TyTyResolveCompile::get_unit_type):
5659 Likewise.
5660
5661 2025-03-17 Pierre-Emmanuel Patry <[email protected]>
5662
5663 * ast/rust-ast.h: Change dereference from a pointer to a reference
5664 accessor.
5665 * ast/rust-expr.h: Likewise.
5666 * ast/rust-item.h: Likewise.
5667 * ast/rust-macro.h: Likewise.
5668 * ast/rust-path.h: Likewise.
5669 * ast/rust-pattern.h: Likewise.
5670 * ast/rust-type.h: Likewise.
5671 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
5672 Likewise.
5673 * backend/rust-compile-context.h: Likewise.
5674 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
5675 (CompileExpr::generate_closure_function): Likewise.
5676 * backend/rust-compile-extern.h: Likewise.
5677 * backend/rust-compile-implitem.cc (CompileTraitItem::visit): Likewise.
5678 * backend/rust-compile-intrinsic.cc (Intrinsics::compile): Likewise.
5679 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
5680 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
5681 Likewise.
5682 (HIRCompileBase::query_compile): Likewise.
5683 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
5684 (TyTyResolveCompile::create_dyn_obj_record): Likewise.
5685 * backend/rust-compile.cc (HIRCompileBase::coerce_to_dyn_object):
5686 Likewise.
5687 * backend/rust-mangle-v0.cc (v0_path): Likewise.
5688 (v0_mangle_item): Likewise.
5689 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
5690 Likewise.
5691 * checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve):
5692 Likewise.
5693 * checks/errors/rust-const-checker.cc (ConstChecker::ConstChecker):
5694 Likewise.
5695 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::UnsafeChecker):
5696 Likewise.
5697 * checks/lints/rust-lint-marklive-base.h: Likewise.
5698 * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
5699 (MarkLive::visit): Likewise.
5700 (MarkLive::visit_path_segment): Likewise.
5701 * checks/lints/rust-lint-marklive.h: Likewise.
5702 * checks/lints/rust-lint-scan-deadcode.h: Likewise.
5703 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Likewise.
5704 * expand/rust-macro-expand.h (struct MacroExpander): Change mapping
5705 from pointer to a reference.
5706 * expand/rust-proc-macro.cc (BangProcMacro::BangProcMacro): Replace
5707 pointer accessor with reference accessor.
5708 (AttributeProcMacro::AttributeProcMacro): Likewise.
5709 (CustomDeriveProcMacro::CustomDeriveProcMacro): Likewise.
5710 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime):
5711 Likewise.
5712 (ASTLoweringBase::lower_loop_label): Likewise.
5713 (ASTLoweringBase::lower_path_expr_seg): Likewise.
5714 (ASTLoweringBase::lower_self): Likewise.
5715 (ASTLoweringBase::handle_lang_item_attribute): Likewise.
5716 (ASTLoweringBase::lower_extern_block): Likewise.
5717 (ASTLoweringBase::lower_macro_definition): Likewise.
5718 * hir/rust-ast-lower-base.h: Likewise.
5719 * hir/rust-ast-lower-block.h: Likewise.
5720 * hir/rust-ast-lower-enumitem.h: Likewise.
5721 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::translate): Likewise.
5722 (ASTLoweringExpr::visit): Likewise.
5723 * hir/rust-ast-lower-extern.h: Likewise.
5724 * hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::translate):
5725 Likewise.
5726 (ASTLowerImplItem::visit): Likewise.
5727 (ASTLowerTraitItem::translate): Likewise.
5728 (ASTLowerTraitItem::visit): Likewise.
5729 * hir/rust-ast-lower-item.cc (ASTLoweringItem::translate): Likewise.
5730 (ASTLoweringItem::visit): Likewise.
5731 (ASTLoweringSimplePath::lower): Likewise.
5732 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate):
5733 Likewise.
5734 (ASTLoweringPattern::visit): Likewise.
5735 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::translate): Likewise.
5736 (ASTLoweringStmt::visit): Likewise.
5737 * hir/rust-ast-lower-struct-field-expr.h: Likewise.
5738 * hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Likewise.
5739 (ASTLowerQualifiedPathInType::visit): Likewise.
5740 (ASTLoweringType::translate): Likewise.
5741 (ASTLoweringType::visit): Likewise.
5742 (ASTLowerGenericParam::translate): Likewise.
5743 (ASTLowerGenericParam::visit): Likewise.
5744 (ASTLoweringTypeBounds::translate): Likewise.
5745 (ASTLoweringTypeBounds::visit): Likewise.
5746 (ASTLowerWhereClauseItem::translate): Likewise.
5747 (ASTLowerWhereClauseItem::visit): Likewise.
5748 * hir/rust-ast-lower.cc (ASTLowering::go): Likewise.
5749 (ASTLoweringBlock::visit): Likewise.
5750 (ASTLoweringIfBlock::visit): Likewise.
5751 (ASTLoweringIfLetBlock::visit): Likewise.
5752 (ASTLowerStructExprField::visit): Likewise.
5753 (ASTLoweringExprWithBlock::visit): Likewise.
5754 (ASTLowerPathInExpression::visit): Likewise.
5755 (ASTLoweringBase::lower_qual_path_type): Likewise.
5756 (ASTLowerQualPathInExpression::visit): Likewise.
5757 * metadata/rust-export-metadata.cc (ExportContext::emit_trait):
5758 Likewise.
5759 (ExportContext::emit_function): Likewise.
5760 (ExportContext::emit_macro): Likewise.
5761 (PublicInterface::PublicInterface): Likewise.
5762 (PublicInterface::expected_metadata_filename): Likewise.
5763 * metadata/rust-export-metadata.h: Likewise.
5764 * resolve/rust-ast-resolve-base.h: Likewise.
5765 * resolve/rust-ast-resolve-implitem.h: Likewise.
5766 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
5767 Likewise.
5768 (ResolveItem::visit): Likewise.
5769 (ResolveExternItem::visit): Likewise.
5770 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
5771 Likewise.
5772 * resolve/rust-ast-resolve-stmt.h: Likewise.
5773 * resolve/rust-ast-resolve-toplevel.h: Likewise.
5774 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
5775 Likewise.
5776 (ResolveTypeToCanonicalPath::visit): Likewise.
5777 * resolve/rust-ast-resolve-type.h: Likewise.
5778 * resolve/rust-ast-resolve.cc (NameResolution::NameResolution):
5779 Likewise.
5780 (NameResolution::go): Likewise.
5781 * resolve/rust-ast-resolve.h: Likewise.
5782 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
5783 Likewise.
5784 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver):
5785 Likewise.
5786 * resolve/rust-late-name-resolver-2.0.cc (next_node_id): Likewise.
5787 (next_hir_id): Likewise.
5788 * resolve/rust-name-resolution-context.cc (NameResolutionContext::NameResolutionContext):
5789 Likewise.
5790 * resolve/rust-name-resolver.cc (Resolver::Resolver): Likewise.
5791 (Resolver::generate_builtins): Likewise.
5792 (Resolver::setup_builtin): Likewise.
5793 * resolve/rust-name-resolver.h: Likewise.
5794 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
5795 Likewise.
5796 (TopLevel::handle_use_glob): Likewise.
5797 * rust-session-manager.cc (Session::get_instance): Likewise.
5798 (Session::handle_input_files): Likewise.
5799 (Session::handle_crate_name): Likewise.
5800 (Session::compile_crate): Likewise.
5801 (Session::load_extern_crate): Likewise.
5802 * rust-session-manager.h: Likewise.
5803 * typecheck/rust-autoderef.cc (Adjuster::try_unsize_type): Likewise.
5804 * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion):
5805 Likewise.
5806 (TypeCoercionRules::coerce_unsafe_ptr): Likewise.
5807 (TypeCoercionRules::coerce_borrowed_pointer): Likewise.
5808 (TypeCoercionRules::coerce_unsized): Likewise.
5809 * typecheck/rust-coercion.h: Likewise.
5810 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
5811 Likewise.
5812 * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
5813 * typecheck/rust-hir-path-probe.cc (PathProbeType::process_enum_item_for_candiates):
5814 Likewise.
5815 (PathProbeType::process_impl_items_for_candidates): Likewise.
5816 (PathProbeImplTrait::process_trait_impl_items_for_candidates):
5817 Likewise.
5818 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
5819 Likewise.
5820 (TraitItemReference::get_parent_trait_mappings): Likewise.
5821 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal):
5822 Likewise.
5823 (TypeCheckBase::get_marker_predicate): Likewise.
5824 * typecheck/rust-hir-type-check-base.h: Likewise.
5825 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit):
5826 Likewise.
5827 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5828 Likewise.
5829 (TypeCheckExpr::resolve_operator_overload): Likewise.
5830 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
5831 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
5832 Likewise.
5833 (TypeCheckImplItem::visit): Likewise.
5834 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
5835 Likewise.
5836 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
5837 Likewise.
5838 (TypeCheckExpr::resolve_segments): Likewise.
5839 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::emit_pattern_size_error):
5840 Likewise.
5841 (ClosureParamInfer::Resolve): Likewise.
5842 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve):
5843 Likewise.
5844 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
5845 (TypeCheckType::resolve_root_path): Likewise.
5846 (TypeResolveGenericParam::visit): Likewise.
5847 (ResolveWhereClauseItem::visit): Likewise.
5848 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
5849 Likewise.
5850 * typecheck/rust-type-util.cc (query_type): Likewise.
5851 * typecheck/rust-typecheck-context.cc (TypeCheckContext::compute_inference_variables):
5852 Likewise.
5853 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
5854 (TypeBoundsProbe::assemble_builtin_candidate): Likewise.
5855 (TypeCheckBase::get_predicate_from_bound): Likewise.
5856 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
5857 (TypeCheckMethodCallExpr::check): Likewise.
5858 * typecheck/rust-tyty-call.h: Likewise.
5859 * typecheck/rust-tyty-cmp.h: Likewise.
5860 * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::override_context):
5861 Likewise.
5862 (SubstitutionRef::monomorphize): Likewise.
5863 * typecheck/rust-tyty-util.cc (TyVar::get_implicit_infer_var):
5864 Likewise.
5865 (TyVar::monomorphized_clone): Likewise.
5866 (TyWithLocation::TyWithLocation): Likewise.
5867 * typecheck/rust-tyty.cc (BaseType::satisfies_bound): Likewise.
5868 (InferType::clone): Likewise.
5869 (ADTType::handle_substitions): Likewise.
5870 (TupleType::handle_substitions): Likewise.
5871 (FnType::handle_substitions): Likewise.
5872 (ClosureType::setup_fn_once_output): Likewise.
5873 (ArrayType::handle_substitions): Likewise.
5874 (SliceType::handle_substitions): Likewise.
5875 (ReferenceType::handle_substitions): Likewise.
5876 (PointerType::handle_substitions): Likewise.
5877 (ParamType::handle_substitions): Likewise.
5878 * typecheck/rust-tyty.h: Likewise.
5879 * typecheck/rust-unify.cc (UnifyRules::UnifyRules): Likewise.
5880 (UnifyRules::commit): Likewise.
5881 * util/rust-hir-map.cc: Change getter return type to a reference.
5882 * util/rust-hir-map.h: Update function's prototype.
5883
5884 2025-03-17 Mael Cravero <[email protected]>
5885
5886 * rust-gcc.cc: remove unnecessary TREE_SIDE_EFFECTS and TREE_READONLY
5887 macros used in arithmetic overflow checks.
5888
5889 2025-03-17 Jakub Dupak <[email protected]>
5890
5891 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
5892 (ExprStmtBuilder::visit): Use std::ignore.
5893
5894 2025-03-17 Jakub Dupak <[email protected]>
5895
5896 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs: Error reporting.
5897 * checks/errors/borrowck/ffi-polonius/src/lib.rs: Error reporting.
5898 * checks/errors/borrowck/polonius/rust-polonius-ffi.h (struct FactsView):
5899 Error reporting.
5900 (struct Output): Error reporting.
5901 * checks/errors/borrowck/polonius/rust-polonius.h (struct Facts): Error reporting.
5902 * checks/errors/borrowck/rust-borrow-checker.cc: Error reporting.
5903
5904 2025-03-17 Jakub Dupak <[email protected]>
5905
5906 * Make-lang.in: Link Polonius.
5907 * checks/errors/borrowck/rust-borrow-checker.cc: Run Polonius.
5908
5909 2025-03-17 Jakub Dupak <[email protected]>
5910
5911 * Make-lang.in: Build Polonius.
5912
5913 2025-03-17 Jakub Dupak <[email protected]>
5914
5915 * checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint):
5916 Polonius facts dump.
5917 (struct Facts): Polonius facts dump.
5918 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go):
5919 Polonius facts dump.
5920 (Dump::visit): Polonius facts dump.
5921 (Dump::visit_place): Polonius facts dump.
5922 (Dump::visit_move_place): Polonius facts dump.
5923 (Dump::visit_scope): Polonius facts dump.
5924 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Polonius facts dump.
5925
5926 2025-03-17 Kushal Pal <[email protected]>
5927
5928 * backend/rust-compile-expr.cc (CompileExpr::visit): Lines
5929 removed as the objects are unused.
5930
5931 2025-03-17 zhanghe9702 <[email protected]>
5932
5933 * backend/rust-tree.h: removing the CLASSTYPE_VBASECLASSES macro
5934 which is duplicated three times.
5935
5936 2025-03-06 Simon Martin <[email protected]>
5937
5938 * rust-diagnostics.h (RUST_ATTRIBUTE_GCC_DIAG): Fix comment
5939 typo, paramter -> parameter.
5940
5941 2024-12-02 Owen Avery <[email protected]>
5942 Thomas Schwinge <[email protected]>
5943
5944 * typecheck/rust-hir-type-check-toplevel.cc: Removed.
5945 * typecheck/rust-hir-type-check-toplevel.h: Removed.
5946
5947 2024-11-28 David Malcolm <[email protected]>
5948
5949 PR c/104896
5950 * backend/rust-compile-expr.cc
5951 (CompileExpr::compile_integer_literal): Replace "%<%s%>" with
5952 "%qs" in message wording.
5953 (CompileExpr::compile_float_literal): Likewise.
5954 * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
5955 Likewise.
5956 * backend/rust-tree.cc (maybe_warn_nodiscard): Likewise.
5957 * checks/lints/rust-lint-scan-deadcode.h: Likewise.
5958 * lex/rust-lex.cc (Lexer::parse_partial_unicode_escape): Likewise.
5959 (Lexer::parse_raw_byte_string): Likewise.
5960 * lex/rust-token.cc (Token::get_str): Likewise.
5961 * metadata/rust-export-metadata.cc
5962 (PublicInterface::write_to_path): Likewise.
5963 * parse/rust-parse.cc
5964 (peculiar_fragment_match_compatible_fragment): Likewise.
5965 (peculiar_fragment_match_compatible): Likewise.
5966 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
5967 Likewise.
5968 * resolve/rust-ast-resolve-toplevel.h: Likewise.
5969 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
5970 Likewise.
5971 * rust-session-manager.cc (validate_crate_name): Likewise.
5972 (Session::load_extern_crate): Likewise.
5973 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5974 Likewise.
5975 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
5976 * typecheck/rust-hir-type-check-implitem.cc
5977 (TypeCheckImplItemWithTrait::visit): Likewise.
5978 * typecheck/rust-hir-type-check-item.cc
5979 (TypeCheckItem::validate_trait_impl_block): Likewise.
5980 * typecheck/rust-hir-type-check-struct.cc
5981 (TypeCheckStructExpr::visit): Likewise.
5982 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
5983 Likewise.
5984 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Likewise.
5985 * typecheck/rust-unify.cc (UnifyRules::emit_abi_mismatch):
5986 Likewise.
5987 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
5988
5989 2024-11-22 Andrew Pinski <[email protected]>
5990
5991 PR bootstrap/117737
5992 * resolve/rust-ast-resolve-expr.cc (INCLUDE_MEMORY): Remove.
5993 * rust-attribs.cc (INCLUDE_MEMORY): Remove.
5994 * rust-system.h (INCLUDE_MEMORY): Remove.
5995
5996 2024-11-01 David Malcolm <[email protected]>
5997
5998 PR bootstrap/117361
5999 * Make-lang.in (s-selftest-rust): Use GCC_FOR_SELFTESTS.
6000 (selftest-rust-gdb): Likewise.
6001 (selftest-rust-valgrind): Likewise.
6002
6003 2024-10-25 Jakub Jelinek <[email protected]>
6004
6005 * util/optional.h: Remove trailing whitespace.
6006 * util/expected.h: Likewise.
6007 * util/rust-unicode-data.h: Likewise.
6008
6009 2024-10-24 David Malcolm <[email protected]>
6010 Gaius Mulley <[email protected]>
6011
6012 PR other/116613
6013 * resolve/rust-ast-resolve-expr.cc: Add #define INCLUDE_MEMORY.
6014 * rust-attribs.cc: Likewise.
6015 * rust-system.h: Likewise.
6016
6017 2024-10-18 Alejandro Colomar <[email protected]>
6018
6019 * backend/rust-tree.h (array_type_nelts_top)
6020 * backend/rust-tree.cc (array_type_nelts_top):
6021 Remove function.
6022
6023 2024-10-18 Alejandro Colomar <[email protected]>
6024
6025 * backend/rust-tree.cc (array_type_nelts_top):
6026 Rename array_type_nelts => array_type_nelts_minus_one
6027
6028 2024-09-26 Owen Avery <[email protected]>
6029
6030 * checks/errors/borrowck/rust-bir.h
6031 (class AbstractExpr): Add virtual destructor.
6032
6033 2024-09-25 Mikael Morin <[email protected]>
6034
6035 PR other/116801
6036 * lang.opt.urls: Regenerate.
6037
6038 2024-09-20 David Malcolm <[email protected]>
6039
6040 PR other/116613
6041 * resolve/rust-ast-resolve-expr.cc
6042 (funny_ice_finalizer): : Convert first param from
6043 diagnostic_context * to diagnostic_text_output_format &.
6044 (ResolveExpr::visit): Update for renaming.
6045
6046 2024-08-12 Arthur Cohen <[email protected]>
6047
6048 * checks/errors/borrowck/rust-bir-builder.h: Cast size_t values to unsigned
6049 long before printing.
6050 * checks/errors/borrowck/rust-bir-fact-collector.h: Likewise.
6051
6052 2024-08-12 Arthur Cohen <[email protected]>
6053
6054 * checks/errors/borrowck/rust-bir-fact-collector.h (points): Rename
6055 `push_subset(PlaceId, PlaceId)` to `push_subset_place(PlaceId, PlaceId)`
6056
6057 2024-08-05 Thomas Schwinge <[email protected]>
6058
6059 * Make-lang.in (RUST_LIBDEPS): Inline into all users.
6060
6061 2024-08-05 Thomas Schwinge <[email protected]>
6062
6063 * Make-lang.in (LIBS): Don't override.
6064 (crab1$(exeext):): Use 'CRAB1_LIBS'.
6065
6066 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6067
6068 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
6069 inherent impl type.
6070
6071 2024-08-01 Jakub Dupak <[email protected]>
6072
6073 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Bump copyright.
6074 * checks/errors/borrowck/ffi-polonius/src/lib.rs: Bump copyright.
6075 * checks/errors/borrowck/polonius/rust-polonius-ffi.h: Bump copyright.
6076 * checks/errors/borrowck/polonius/rust-polonius.h: Bump copyright.
6077 * checks/errors/borrowck/rust-bir-dump.cc: Bump copyright.
6078 * checks/errors/borrowck/rust-bir-fact-collector.h: Bump copyright.
6079 * checks/errors/borrowck/rust-bir-free-region.h: Bump copyright.
6080
6081 2024-08-01 Jakub Dupak <[email protected]>
6082
6083 * checks/errors/borrowck/rust-bir-dump.cc (renumber_places):
6084 Remove unecessary braces.
6085 (Dump::go): Remove unecessary braces.
6086 (Dump::visit): Remove unecessary braces.
6087 (Dump::visit_scope): Remove unecessary braces.
6088 * checks/errors/borrowck/rust-bir-fact-collector.h (class FactCollector):
6089 Remove unecessary braces.
6090 (points): Remove unecessary braces.
6091 * checks/errors/borrowck/rust-bir-free-region.h: Remove unecessary braces.
6092 * checks/errors/borrowck/rust-bir-place.h: Remove unecessary braces.
6093 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
6094 Remove unecessary braces.
6095 * checks/errors/borrowck/rust-function-collector.h: Remove unecessary braces.
6096
6097 2024-08-01 Jakub Dupak <[email protected]>
6098
6099 * checks/errors/borrowck/rust-bir-fact-collector.h: New file.
6100 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
6101 Enable fact collection.
6102
6103 2024-08-01 Jakub Dupak <[email protected]>
6104
6105 * checks/errors/borrowck/rust-bir-place.h (struct Lifetime):
6106 Extended regions and loans.
6107 (struct Loan): Representation of loan (result of borrowing)
6108 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
6109 Fix let stmt handling.
6110 * checks/errors/borrowck/rust-bir-builder-pattern.h: improved
6111 pattern translation
6112 * checks/errors/borrowck/rust-bir-builder-internal.h: region binding
6113 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h (class ExprStmtBuilder):
6114 Region support.
6115 (class RenumberCtx): Region support.
6116 * checks/errors/borrowck/rust-bir-builder.h (class Builder): Region support.
6117 * checks/errors/borrowck/rust-bir-dump.cc (get_lifetime_name): Region support.
6118 (renumber_places): Region support.
6119 (Dump::go): Region support.
6120 (Dump::visit): Region support.
6121 (Dump::visit_lifetime): Region support.
6122 (Dump::visit_scope): Region support.
6123 * checks/errors/borrowck/rust-bir.h (class AbstractExpr): Region support.
6124 (struct Function): Region support.
6125 (class BorrowExpr): Region support.
6126 (class CallExpr): Region support.
6127
6128 2024-08-01 Jakub Dupak <[email protected]>
6129
6130 * typecheck/rust-tyty-variance-analysis-private.h (class FieldVisitorCtx):
6131 Region extraction.
6132 * typecheck/rust-tyty-variance-analysis.cc (query_field_regions): Region extraction.
6133 (FieldVisitorCtx::collect_regions): Region extraction.
6134 (FieldVisitorCtx::add_constraints_from_ty): Region extraction.
6135 (FieldVisitorCtx::add_constraints_from_region): Region
6136 extraction.
6137 (FieldVisitorCtx::add_constrints_from_param): Region extraction.
6138 * typecheck/rust-tyty-variance-analysis.h (query_field_regions):
6139 Region extraction.
6140
6141 2024-08-01 Jakub Dupak <[email protected]>
6142
6143 * checks/errors/borrowck/rust-bir-free-region.h: New file.
6144
6145 2024-08-01 Jakub Dupak <[email protected]>
6146
6147 * checks/errors/borrowck/ffi-polonius/Cargo.toml: New file.
6148 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: New file.
6149 * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs: New file.
6150 * checks/errors/borrowck/ffi-polonius/src/lib.rs: New file.
6151 * checks/errors/borrowck/polonius/rust-polonius-ffi.h: New file.
6152 * checks/errors/borrowck/polonius/rust-polonius.h: New file.
6153
6154 2024-08-01 Jakub Dupak <[email protected]>
6155
6156 * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit): const
6157 visitor
6158 * checks/errors/borrowck/rust-bir-dump.h: const visitor
6159 * checks/errors/borrowck/rust-bir-visitor.h: const visitor
6160 * checks/errors/borrowck/rust-bir.h: const getter
6161
6162 2024-08-01 Jakub Dupak <[email protected]>
6163
6164 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Emit moves.
6165 * checks/errors/borrowck/rust-bir-builder-internal.h: Emit moves.
6166 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Emit moves.
6167 * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit_move_place): Emit moves.
6168 (Dump::visit): Emit moves.
6169 * checks/errors/borrowck/rust-bir-place.h (struct Place): Emit moves.
6170 * checks/errors/borrowck/rust-bir-visitor.h: Emit moves.
6171 * checks/errors/borrowck/rust-bir.h (enum class): Emit moves.
6172 (class AbstractExpr): Emit moves.
6173 (BasicBlock::is_terminated): Emit moves.
6174
6175 2024-08-01 Jakub Dupak <[email protected]>
6176
6177 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop):
6178 Loop handling.
6179 (ExprStmtBuilder::visit): Handle scopes.
6180 * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext):
6181 Handle scopes.
6182 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Dump scopes.
6183 (Dump::visit): Add scopes dump.
6184 (Dump::indent): Add indentation logic.
6185 (Dump::visit_scope): Dump scope.
6186 * checks/errors/borrowck/rust-bir-dump.h: Dump methods.
6187 * checks/errors/borrowck/rust-bir-place.h (std::numeric_limits::max): Scope constants.
6188 (struct Scope): Scope representation.
6189 (class PlaceDB): Scope tracking.
6190
6191 2024-08-01 Jakub Dupak <[email protected]>
6192
6193 * checks/errors/borrowck/rust-bir-place.h:
6194 Create place tree traverse API.
6195
6196 2024-08-01 Jakub Dupak <[email protected]>
6197
6198 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
6199 Use callable API
6200
6201 2024-08-01 Jakub Dupak <[email protected]>
6202
6203 * checks/errors/borrowck/bir-design-notes.md (nodes): Rename node to statement.
6204 (Nodes): Rename node to statement.
6205 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
6206 Rename node to statement.
6207 * checks/errors/borrowck/rust-bir-builder-internal.h: Rename node to statement.
6208 * checks/errors/borrowck/rust-bir-builder.h: Rename node to statement.
6209 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Rename node to statement.
6210 (Dump::visit): Rename node to statement.
6211 * checks/errors/borrowck/rust-bir-dump.h (class Dump): Rename node to statement.
6212 * checks/errors/borrowck/rust-bir-visitor.h (class Node): Rename node to statement.
6213 (class Statement): Rename node to statement.
6214 * checks/errors/borrowck/rust-bir.h (class Node): Rename node to statement.
6215 (class Statement): Rename node to statement.
6216 (class AbstractExpr): Rename node to statement.
6217 (struct Function): Rename node to statement.
6218 (struct BasicBlock): Rename node to statement.
6219
6220 2024-08-01 Jakub Dupak <[email protected]>
6221
6222 * checks/errors/borrowck/rust-bir-dump.cc: Use rust-system.h
6223 * checks/errors/borrowck/rust-bir-dump.h (RUST_BIR_DUMP_H): Use rust-system.h
6224 * checks/errors/borrowck/rust-bir-place.h (RUST_BIR_PLACE_H): Use rust-system.h
6225 * checks/errors/borrowck/rust-function-collector.h: Use rust-system.h
6226 * rust-system.h: Use rust-system.h
6227 * typecheck/rust-hir-type-check.h: Use rust-system.h
6228 * typecheck/rust-tyty-subst.cc: Use rust-system.h
6229 * typecheck/rust-tyty-subst.h: Use rust-system.h
6230 * typecheck/rust-tyty.h: Use rust-system.h
6231
6232 2024-08-01 Arthur Cohen <[email protected]>
6233
6234 * typecheck/rust-unify.cc (UnifyRules::go): Always unify to `ltype` if
6235 we are matching against a `Never` in `rtype`.
6236 (UnifyRules::expect_never): Always unify to the expected type.
6237
6238 2024-08-01 Owen Avery <[email protected]>
6239
6240 * lex/rust-lex.cc
6241 (Lexer::parse_raw_string):
6242 Bring handling of edge cases to par with parse_raw_byte_string.
6243
6244 2024-08-01 Owen Avery <[email protected]>
6245
6246 * parse/rust-parse-impl.h
6247 (Parser::parse_vis_item):
6248 Call parse_function instead of parse_async_item when finding
6249 UNSAFE or EXTERN_KW during lookahead.
6250
6251 2024-08-01 Owen Avery <[email protected]>
6252
6253 * util/rust-attribute-values.h
6254 (Attributes::UNSTABLE): New.
6255 * util/rust-attributes.cc
6256 (__definitions): Add Attributes::UNSTABLE.
6257
6258 2024-08-01 Owen Avery <[email protected]>
6259
6260 * util/rust-attribute-values.h
6261 (Attributes::RUSTC_DEPRECATED): New.
6262 * util/rust-attributes.cc
6263 (__definitions): Add Attributes::RUSTC_DEPRECATED.
6264
6265 2024-08-01 Owen Avery <[email protected]>
6266
6267 * lex/rust-lex.cc
6268 (Lexer::parse_raw_byte_string):
6269 Bring handling of edge cases to par with parse_byte_string.
6270
6271 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6272
6273 * resolve/rust-forever-stack.h: Change dfs function prototype and
6274 declare dfs return type structure.
6275 * resolve/rust-forever-stack.hxx: Adapt dfs function to the new return
6276 type.
6277
6278 2024-08-01 Arthur Cohen <[email protected]>
6279
6280 * backend/rust-compile-resolve-path.cc: Attempt to resolve names
6281 also using new name resolution context.
6282 * backend/rust-compile-resolve-path.h: Add new declaration.
6283
6284 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6285
6286 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob):
6287 Change function prototype to use a reference instead.
6288 (TopLevel::handle_use_dec): Likewise.
6289 (TopLevel::handle_rebind): Add name resolution on rebind use
6290 declarations.
6291 (flatten_rebind): Change prototype to accept a pair of path/alias.
6292 (flatten_list): Adapt call to flatten_rebind.
6293 (flatten): Adapt call to flatten_rebind.
6294 (flatten_glob): Remove unused part.
6295 (TopLevel::visit): Add rebind resolution.
6296 * resolve/rust-toplevel-name-resolver-2.0.h: Adapt function prototypes.
6297
6298 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6299
6300 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add mapping
6301 implementation.
6302 * resolve/rust-late-name-resolver-2.0.h: Add function visitor prototype
6303 override.
6304
6305 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6306
6307 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
6308 Replace the string format %<%s%> with the proper %qs format.
6309
6310 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6311
6312 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
6313 Only get immutable name resolution context when name resolution 2.0 is
6314 used.
6315 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
6316 Likewise.
6317
6318 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6319
6320 * util/rust-canonical-path.h: Also assign crate number.
6321
6322 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6323
6324 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
6325 Self generic parameter injection and a warning.
6326 * resolve/rust-toplevel-name-resolver-2.0.h: Add function prototype.
6327
6328 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6329
6330 * backend/rust-compile-item.cc (CompileItem::visit): Check the resolver
6331 flag and use the new one when required.
6332
6333 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6334
6335 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
6336 empty visit function.
6337 * resolve/rust-default-resolver.h: Remove function prototype.
6338
6339 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6340
6341 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
6342 visitor implementation and scoping.
6343 * resolve/rust-default-resolver.h: Remove function prototype.
6344
6345 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6346
6347 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
6348 constant identifiers to the resolver.
6349
6350 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6351
6352 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Change
6353 search location for struct types.
6354
6355 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6356
6357 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
6358 Change enum type namespace.
6359
6360 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6361
6362 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
6363 Add tuple struct type to the resolver's context.
6364
6365 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6366
6367 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
6368 Add the struct constructor when the struct is a unit.
6369
6370 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6371
6372 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change the
6373 namespace for values from "label" to "values".
6374
6375 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6376
6377 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
6378 function implementation.
6379 * resolve/rust-default-resolver.h: Remove function prototype.
6380
6381 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6382
6383 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
6384 constant item's types.
6385
6386 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6387
6388 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
6389 function return type.
6390
6391 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6392
6393 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
6394 Change error message to match old resolver and test case.
6395
6396 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6397
6398 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
6399 the struct constructor to the value namespace.
6400
6401 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6402
6403 * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Adapt
6404 resolved type to the new API.
6405 (Early::visit_attributes): Retrieve the node id from the definition.
6406 * resolve/rust-forever-stack.h: Change the return type of getter
6407 functions. Those functions now return a definition type instead of a
6408 node id.
6409 * resolve/rust-forever-stack.hxx: Change member function implementation
6410 in the forever stack to accomodate it's API changes.
6411 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Use internal
6412 node id. Emit an error when resolving multiple ambiguous values.
6413 * resolve/rust-rib.cc (Rib::Definition::Definition): Add a default
6414 constructor.
6415 (Rib::Definition::is_ambiguous): Add a new function to determine
6416 whether a function definition is ambiguous or not.
6417 (Rib::Definition::to_string): Add a member function to convert a given
6418 definition to a string.
6419 (Rib::insert): Add new rules for value insertion in a rib. Insertion
6420 order does not impact the result anymore: inserting a shadowable value
6421 after a non shadowable one does not trigger an error anymore. All
6422 shadowable values inserted in a rib are kepts until being replaced by a
6423 non shadowable one.
6424 (Rib::get): Return a definition instead of a node id.
6425 * resolve/rust-rib.h: Update function prototypes.
6426 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob):
6427 Update return value container to match the new function's prototype.
6428 (TopLevel::handle_use_dec): Likewise.
6429 (flatten_glob): Likewise.
6430
6431 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6432
6433 * resolve/rust-forever-stack.h: Add a new function prototype to insert
6434 a shadowable definition.
6435 * resolve/rust-forever-stack.hxx: Add the new insert_shadowable
6436 function to insert shadowable definition into the forever stack.
6437 * resolve/rust-name-resolution-context.cc (NameResolutionContext::insert_shadowable):
6438 Likewise with the name resolution context.
6439 * resolve/rust-name-resolution-context.h: Add name resolution context
6440 insert_shadowable member function prototype.
6441 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
6442 Insert shadowable definition into the forever stack for glob use
6443 declaration.
6444
6445 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6446
6447 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add a check
6448 for missing item.
6449 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::go):
6450 Add a new function in the visitor to dispatch the visitor to items in
6451 the given module.
6452 (TopLevel::handle_use_glob): Change call to visitor to use the pointer.
6453 * resolve/rust-toplevel-name-resolver-2.0.h: Add prototype for new
6454 member function.
6455
6456 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6457
6458 * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
6459 Add code path for the resolver 2.0
6460 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove failing
6461 label context resolve call.
6462
6463 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6464
6465 * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
6466 Insert names into their namespace.
6467 (TopLevel::visit): Insert ast module.
6468 (TopLevel::handle_use_dec): Resolve use declaration.
6469 (TopLevel::handle_use_glob): Use globbing visitor.
6470 (flatten_list): Use globbing path vector.
6471 (flatten_glob): Likewise.
6472 (flatten): Likewise.
6473 (prefix_subpaths): Add a function to prefix subpath.
6474 * resolve/rust-toplevel-name-resolver-2.0.h (class GlobbingVisitor):
6475 Add globbing visitor.
6476 * util/rust-hir-map.cc (Mappings::insert_ast_module): Add function to
6477 insert module in module hashmap.
6478 (Mappings::lookup_ast_module): Add function to retrieve ast module.
6479 * util/rust-hir-map.h: Add module map and getter/setter prototypes.
6480
6481 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6482
6483 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Module
6484 should be added to the type namespace in order to be retrieved later.
6485
6486 2024-08-01 Arthur Cohen <[email protected]>
6487
6488 * resolve/rust-late-name-resolver-2.0.cc (Late::setup_builtin_types):
6489 Setup bool as builtin type.
6490
6491 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6492
6493 * resolve/rust-toplevel-name-resolver-2.0.cc (insert_macros): Add
6494 constraint over the ast node id.
6495 (TopLevel::visit): Likewise.
6496
6497 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6498
6499 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Change
6500 error message.
6501
6502 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6503
6504 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
6505 Use the new dict to track down already resolved use declarations.
6506 * resolve/rust-toplevel-name-resolver-2.0.h: Add new dict to store
6507 previous use declarations.
6508
6509 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6510
6511 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_or_error_out):
6512 Add new constraint to duplicate errors.
6513
6514 2024-08-01 Arthur Cohen <[email protected]>
6515
6516 * resolve/rust-forever-stack.hxx: Start using Rib::Definition for
6517 shadowable information.
6518 * resolve/rust-late-name-resolver-2.0.cc (next_node_id): New.
6519 (next_hir_id): New.
6520 (Late::setup_builtin_types): Improve builtin type setup.
6521 * resolve/rust-rib.cc (Rib::Definition::Definition): New constructor.
6522 (Rib::Definition::Shadowable): Likewise.
6523 (Rib::Definition::NonShadowable): Likewise.
6524 (Rib::Rib): Fix general constructor.
6525 (Rib::insert): Use Definition class.
6526 (Rib::get): Likewise.
6527 * resolve/rust-rib.h: New Definition class, new prototypes.
6528
6529 2024-08-01 Arthur Cohen <[email protected]>
6530
6531 * resolve/rust-name-resolution-context.cc (NameResolutionContext::map_usage):
6532 Use newtype pattern.
6533 (NameResolutionContext::lookup): Likewise.
6534 * resolve/rust-name-resolution-context.h (class Usage): New class.
6535 (class Definition): Likewise.
6536 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Create instances
6537 of Usage and Definition.
6538
6539 2024-08-01 Arthur Cohen <[email protected]>
6540
6541 * backend/rust-compile-base.cc: Use new ImmutableNrCtx.
6542 * backend/rust-compile-context.h: Likewise.
6543 * backend/rust-compile-expr.cc: Likewise.
6544 * backend/rust-compile-item.cc: Likewise.
6545
6546 2024-08-01 Arthur Cohen <[email protected]>
6547
6548 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Start
6549 fetching name resolution information in the typechecker.
6550 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
6551 Likewise.
6552 * typecheck/rust-hir-type-check-path.cc: Use nr 2.0.
6553
6554 2024-08-01 Arthur Cohen <[email protected]>
6555
6556 * resolve/rust-name-resolution-context.cc (NameResolutionContext::lookup):
6557 Add lookup function.
6558 * resolve/rust-name-resolution-context.h: Include mappings and optional.
6559
6560 2024-08-01 Arthur Cohen <[email protected]>
6561
6562 * rust-session-manager.cc (Session::compile_crate): Create an immutable
6563 view of the name resolution context.
6564
6565 2024-08-01 Arthur Cohen <[email protected]>
6566
6567 * rust-session-manager.cc: Add files for dumping name resolution, call
6568 name resolution dump function.
6569 (Session::dump_name_resolution): New.
6570 * rust-session-manager.h: New declaration.
6571
6572 2024-08-01 Arthur Cohen <[email protected]>
6573
6574 * rust-session-manager.cc (Session::compile_crate): Create name resolution
6575 context for Session::expansion and subsequent name resolution passes.
6576 (Session::expansion): Take name resolution context as a parameter
6577 instead.
6578 * rust-session-manager.h (Session::expansion): Fix declaration.
6579
6580 2024-08-01 Arthur Cohen <[email protected]>
6581
6582 * Make-lang.in: Compile it.
6583 * resolve/rust-immutable-name-resolution-context.cc: New file.
6584 * resolve/rust-immutable-name-resolution-context.h: New file.
6585
6586 2024-08-01 Thomas Schwinge <[email protected]>
6587
6588 * lex/rust-lex.cc (is_identifier_start): Placate clang-format.
6589
6590 2024-08-01 jjasmine <[email protected]>
6591
6592 * Make-lang.in: add new .o builds for new .cc files
6593 * expand/rust-cfg-strip.h (RUST_CFG_STRIP_H): Add include guards
6594 for rust-cfg-strip
6595 * expand/rust-macro-builtins.cc (make_macro_path_str): moved to new respective files
6596 (make_token): moved to new respective files
6597 (make_string): moved to new respective files
6598 (macro_end_token): moved to new respective files
6599 (try_extract_string_literal_from_fragment): moved to new respective files
6600 (try_expand_many_expr): moved to new respective files
6601 (parse_single_string_literal): moved to new respective files
6602 (source_relative_path): moved to new respective files
6603 (load_file_bytes): moved to new respective files
6604 (MacroBuiltin::assert_handler): moved to new respective files
6605 (MacroBuiltin::file_handler): moved to new respective files
6606 (MacroBuiltin::column_handler): moved to new respective files
6607 (MacroBuiltin::include_bytes_handler): moved to new respective files
6608 (MacroBuiltin::include_str_handler): moved to new respective files
6609 (MacroBuiltin::compile_error_handler): moved to new respective files
6610 (MacroBuiltin::concat_handler): moved to new respective files
6611 (MacroBuiltin::env_handler): moved to new respective files
6612 (MacroBuiltin::cfg_handler): moved to new respective files
6613 (MacroBuiltin::include_handler): moved to new respective files
6614 (MacroBuiltin::line_handler): moved to new respective files
6615 (MacroBuiltin::stringify_handler): moved to new respective files
6616 (struct FormatArgsInput): moved to new respective files
6617 (struct FormatArgsParseError): moved to new respective files
6618 (format_args_parse_arguments): moved to new respective files
6619 (MacroBuiltin::format_args_handler): moved to new respective files
6620 * expand/rust-macro-builtins.h (builtin_macro_from_string):
6621 merge tl::optional from master
6622 * expand/rust-macro-builtins-asm.cc: New file.
6623 * expand/rust-macro-builtins-format-args.cc: New file.
6624 * expand/rust-macro-builtins-helpers.cc: New file.
6625 * expand/rust-macro-builtins-helpers.h: New file.
6626 * expand/rust-macro-builtins-include.cc: New file.
6627 * expand/rust-macro-builtins-location.cc: New file.
6628 * expand/rust-macro-builtins-log-debug.cc: New file.
6629 * expand/rust-macro-builtins-test-bench.cc: New file.
6630 * expand/rust-macro-builtins-trait.cc: New file.
6631 * expand/rust-macro-builtins-utility.cc: New file.
6632
6633 2024-08-01 Guillaume Gomez <[email protected]>
6634
6635 * expand/rust-derive.cc (DeriveVisitor::derive): Fix typo
6636
6637 2024-08-01 jjasmine <[email protected]>
6638
6639 * hir/rust-ast-lower-extern.h: Add translate_visiblity
6640 * hir/tree/rust-hir-item.h: Fix constructor of ExternalTypeItem
6641
6642 2024-08-01 Jakub Dupak <[email protected]>
6643
6644 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
6645 Collect variance info from types.
6646
6647 2024-08-01 Jakub Dupak <[email protected]>
6648
6649 * Make-lang.in: Add new .cc file.
6650 * rust-session-manager.cc (Session::compile_crate): Run
6651 analysis.
6652 * typecheck/rust-tyty-variance-analysis-private.h: New file.
6653 * typecheck/rust-tyty-variance-analysis.cc: New file.
6654 * typecheck/rust-tyty-variance-analysis.h: New file.
6655 * typecheck/rust-typecheck-context.cc
6656 (TypeCheckContext::get_variance_analysis_ctx):
6657 Variance analysis context.
6658 * typecheck/rust-hir-type-check.h (TypeCheckItem::visit):
6659 Variance analysis context.
6660
6661 2024-08-01 Jakub Dupak <[email protected]>
6662
6663 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_arg_at):
6664 Add unified API.
6665
6666 2024-08-01 Arthur Cohen <[email protected]>
6667
6668 * expand/rust-macro-builtins.cc (struct FormatArgsInput): Store the format_str
6669 as a string instead of an AST::Expr.
6670 (format_args_parse_arguments): Transform format_expr into a format string
6671 properly - add note for handling eager macro invocations later on.
6672 (MacroBuiltin::format_args_handler): Parse the correct input, append
6673 newline to format_str if necessary.
6674
6675 2024-08-01 Arthur Cohen <[email protected]>
6676
6677 * ast/rust-ast-builder.h: Rename AST::AstBuilder -> AST::Builder
6678 * ast/rust-ast-builder.cc: Likewise.
6679 * expand/rust-derive.cc: Use new AST::Builder name.
6680 * expand/rust-derive.h: Likewise.
6681 * ast/rust-builtin-ast-nodes.h: Add required getters.
6682 * expand/rust-expand-format-args.cc (format_arg): New.
6683 (get_trait_name): New.
6684 (expand_format_args): Properly expand basic format_args!() invocations.
6685 * expand/rust-expand-format-args.h (expand_format_args): Fix signature.
6686 * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
6687 Call into expand_format_args().
6688
6689 2024-08-01 Arthur Cohen <[email protected]>
6690
6691 * ast/rust-fmt.cc (ffi::RustHamster::to_string): New.
6692 (Pieces::collect): Adapt to use new handle API.
6693 (Pieces::~Pieces): Likewise.
6694 (Pieces::Pieces): Likewise.
6695 (Pieces::operator=): Likewise.
6696 * ast/rust-fmt.h (struct RustString): Add members.
6697 (struct FormatArgsHandle): New.
6698 (clone_pieces): Adapt for new FFI API.
6699 (destroy_pieces): Likewise.
6700 (struct Pieces): Store new FormatArgsHandle type.
6701 * expand/rust-expand-format-args.cc (expand_format_args): Use proper
6702 namespace.
6703 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): FormatArgs
6704 nodes are already resolved, so do nothing.
6705
6706 2024-08-01 Arthur Cohen <[email protected]>
6707
6708 * Make-lang.in: Add new object.
6709 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Remove calls to
6710 FormatArgsLowering.
6711 * expand/rust-expand-format-args.cc: New file.
6712 * expand/rust-expand-format-args.h: New file.
6713
6714 2024-08-01 Arthur Cohen <[email protected]>
6715
6716 * ast/rust-macro.h: Use proper node id instead of the one in the base
6717 Expr class - which is uninitialized.
6718
6719 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6720
6721 * ast/rust-ast-collector.cc (TokenCollector::visit): Remove reference
6722 to unique pointer and replace it with a direct reference to the wrapped
6723 data.
6724 * ast/rust-ast.cc (VariadicParam::as_string): Likewise.
6725 (BlockExpr::normalize_tail_expr): Likewise.
6726 * ast/rust-expr.h: Likewise and add pointer getter in order to allow
6727 pointer reseat.
6728 * ast/rust-item.h: Likewise and add pointer getter for reseat.
6729 * ast/rust-path.h: Likewise.
6730 * ast/rust-pattern.h: Likewise.
6731 * ast/rust-stmt.h: Likewise.
6732 * ast/rust-type.h: Likewise.
6733 * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_struct_fields):
6734 Remove references to unique pointers and replace it with direct
6735 references to the wrapped object.
6736 (CfgStrip::maybe_strip_tuple_fields): Likewise.
6737 (CfgStrip::maybe_strip_generic_args): Likewise.
6738 (CfgStrip::maybe_strip_qualified_path_type): Likewise.
6739 (CfgStrip::visit): Likewise.
6740 * expand/rust-expand-visitor.cc (ExpandVisitor::maybe_expand_expr):
6741 Likewise.
6742 (ExpandVisitor::maybe_expand_type): Likewise.
6743 (ExpandVisitor::visit): Likewise.
6744 * expand/rust-expand-visitor.h: Likewise.
6745 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_binding):
6746 Likewise.
6747 (ASTLoweringBase::lower_generic_args): Likewise.
6748 (ASTLoweringBase::lower_self): Likewise.
6749 (ASTLoweringBase::lower_type_no_bounds): Likewise.
6750 (ASTLoweringBase::lower_bound): Likewise.
6751 (ASTLoweringBase::lower_range_pattern_bound): Likewise.
6752 * hir/rust-ast-lower-base.h: Likewise.
6753 * hir/rust-ast-lower-block.h: Likewise.
6754 * hir/rust-ast-lower-enumitem.h: Likewise.
6755 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::translate): Likewise.
6756 (ASTLoweringExpr::visit): Likewise.
6757 * hir/rust-ast-lower-expr.h: Likewise.
6758 * hir/rust-ast-lower-extern.h: Likewise.
6759 * hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::translate):
6760 Likewise.
6761 (ASTLowerImplItem::visit): Likewise.
6762 (ASTLowerTraitItem::translate): Likewise.
6763 (ASTLowerTraitItem::visit): Likewise.
6764 * hir/rust-ast-lower-implitem.h: Likewise.
6765 * hir/rust-ast-lower-item.cc (ASTLoweringItem::translate): Likewise.
6766 (ASTLoweringItem::visit): Likewise.
6767 * hir/rust-ast-lower-item.h: Likewise.
6768 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate):
6769 Likewise.
6770 (ASTLoweringPattern::visit): Likewise.
6771 * hir/rust-ast-lower-pattern.h: Likewise.
6772 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
6773 * hir/rust-ast-lower-struct-field-expr.h: Likewise.
6774 * hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Likewise.
6775 (ASTLowerQualifiedPathInType::visit): Likewise.
6776 (ASTLoweringType::translate): Likewise.
6777 (ASTLoweringType::visit): Likewise.
6778 (ASTLowerGenericParam::translate): Likewise.
6779 (ASTLowerGenericParam::visit): Likewise.
6780 (ASTLoweringTypeBounds::translate): Likewise.
6781 (ASTLoweringTypeBounds::visit): Likewise.
6782 (ASTLowerWhereClauseItem::visit): Likewise.
6783 * hir/rust-ast-lower-type.h: Likewise.
6784 * hir/rust-ast-lower.cc (ASTLowering::go): Likewise.
6785 (ASTLoweringBlock::visit): Likewise.
6786 (ASTLoweringIfBlock::visit): Likewise.
6787 (ASTLoweringIfLetBlock::visit): Likewise.
6788 (ASTLowerStructExprField::visit): Likewise.
6789 (ASTLoweringExprWithBlock::visit): Likewise.
6790 (ASTLoweringBase::lower_qual_path_type): Likewise.
6791 (ASTLoweringBase::lower_closure_param): Likewise.
6792 * resolve/rust-ast-resolve-base.cc (ResolverBase::resolve_visibility):
6793 Likewise.
6794 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::go): Likewise.
6795 (ResolveExpr::visit): Likewise.
6796 (ResolveExpr::resolve_closure_param): Likewise.
6797 * resolve/rust-ast-resolve-expr.h: Likewise.
6798 * resolve/rust-ast-resolve-implitem.h: Likewise.
6799 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
6800 Likewise.
6801 (ResolveItem::go): Likewise.
6802 (ResolveItem::visit): Likewise.
6803 (ResolveItem::resolve_impl_item): Likewise.
6804 (ResolveItem::resolve_extern_item): Likewise.
6805 (ResolveImplItems::go): Likewise.
6806 (ResolveExternItem::go): Likewise.
6807 (ResolveExternItem::visit): Likewise.
6808 * resolve/rust-ast-resolve-item.h: Likewise.
6809 * resolve/rust-ast-resolve-path.cc (ResolvePath::go): Likewise.
6810 (ResolvePath::resolve_path): Likewise.
6811 * resolve/rust-ast-resolve-path.h: Likewise.
6812 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
6813 Likewise.
6814 (PatternDeclaration::visit): Likewise.
6815 (resolve_range_pattern_bound): Likewise.
6816 * resolve/rust-ast-resolve-pattern.h: Likewise.
6817 * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): Likewise.
6818 * resolve/rust-ast-resolve-stmt.h: Likewise.
6819 * resolve/rust-ast-resolve-struct-expr-field.cc (ResolveStructExprField::go):
6820 Likewise.
6821 (ResolveStructExprField::visit): Likewise.
6822 * resolve/rust-ast-resolve-struct-expr-field.h: Likewise.
6823 * resolve/rust-ast-resolve-toplevel.h: Likewise.
6824 * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
6825 (ResolveRelativeTypePath::go): Likewise.
6826 (ResolveRelativeQualTypePath::resolve_qual_seg): Likewise.
6827 (ResolveTypeToCanonicalPath::go): Likewise.
6828 (ResolveTypeToCanonicalPath::visit): Likewise.
6829 (ResolveGenericArgs::resolve_disambiguated_generic): Likewise.
6830 (ResolveGenericArgs::go): Likewise.
6831 * resolve/rust-ast-resolve-type.h: Likewise.
6832 * resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
6833 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
6834 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_qualified_path_type):
6835 Likewise.
6836 (EarlyNameResolver::visit): Likewise.
6837 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
6838 Likewise.
6839 * checks/errors/rust-ast-validation.cc: Likewise.
6840
6841 2024-08-01 Pierre-Emmanuel Patry <[email protected]>
6842
6843 * ast/rust-item.h: Change getter function prototype to return a
6844 reference directly instead of a reference to the wrapper type.
6845 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Fix
6846 the code to accept references instead.
6847 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Change
6848 function implementation to return a reference.
6849 * hir/rust-ast-lower-base.h: Accept a reference instead of a unique
6850 pointer reference.
6851 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Adapt the code
6852 to a reference instead of a unique pointer.
6853
6854 2024-08-01 Thomas Schwinge <[email protected]>
6855
6856 * backend/rust-tree.cc (c_common_type_for_mode): Placate clang-format.
6857
6858 2024-08-01 0xn4utilus <[email protected]>
6859
6860 * ast/rust-ast-collector.cc (TokenCollector::visit):
6861 Remove dead code.
6862 * ast/rust-ast-collector.h: Likewise.
6863 * ast/rust-ast-full-decls.h (class ExternalFunctionItem):
6864 Likewise.
6865 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
6866 Likewise.
6867 * ast/rust-ast-visitor.h: Likewise.
6868 * ast/rust-ast.cc (ExternalFunctionItem::as_string): Likewise.
6869 (ExternalFunctionItem::accept_vis): Likewise.
6870 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
6871 Likewise.
6872 * checks/errors/rust-ast-validation.h: Likewise.
6873 * checks/errors/rust-feature-gate.h: Likewise.
6874 * expand/rust-cfg-strip.cc (CfgStrip::visit):
6875 Likewise.
6876 * expand/rust-cfg-strip.h: Likewise.
6877 * expand/rust-derive.h: Likewise.
6878 * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
6879 Likewise.
6880 * expand/rust-expand-visitor.h: Likewise.
6881 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit):
6882 Likewise.
6883 * hir/rust-ast-lower-base.h: Likewise.
6884 * metadata/rust-export-metadata.cc (ExportContext::emit_function):
6885 Likewise.
6886 * parse/rust-parse-impl.h: Likewise.
6887 * parse/rust-parse.h: Likewise.
6888 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit):
6889 Likewise.
6890 * resolve/rust-ast-resolve-base.h: Likewise.
6891 * resolve/rust-default-resolver.cc (DefaultResolver::visit):
6892 Likewise.
6893 * resolve/rust-default-resolver.h: Likewise.
6894 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
6895 * util/rust-attributes.h: Likewise.
6896
6897 2024-08-01 0xn4utilus <[email protected]>
6898
6899 * checks/errors/rust-feature-gate.cc (FeatureGate::visit):
6900 Check if function is_external or not.
6901 * hir/rust-ast-lower-extern.h: Use AST::Function
6902 instead of AST::ExternalFunctionItem.
6903 * parse/rust-parse-impl.h (Parser::parse_external_item):
6904 Likewise.
6905 (Parser::parse_pattern): Fix clang format.
6906 * resolve/rust-ast-resolve-implitem.h: Likewise.
6907 * resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
6908 Likewise.
6909 * resolve/rust-ast-resolve-item.h: Likewise.
6910 * resolve/rust-default-resolver.cc (DefaultResolver::visit):
6911 Check if param has_pattern before using get_pattern.
6912
6913 2024-08-01 0xn4utilus <[email protected]>
6914
6915 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
6916 Add external function validation support. Add ErrorCode::E0130.
6917 * parse/rust-parse-impl.h (Parser::parse_function): Parse
6918 external functions from `parse_function`.
6919 (Parser::parse_external_item): Clang format.
6920 (Parser::parse_pattern): Clang format.
6921 * parse/rust-parse.h: Add default parameter
6922 `is_external` in `parse_function`.
6923
6924 2024-08-01 0xn4utilus <[email protected]>
6925
6926 * ast/rust-ast.h: Add Kind Enum to
6927 Pattern.
6928 * ast/rust-macro.h: Add get_pattern_kind().
6929 * ast/rust-path.h: Likewise.
6930 * ast/rust-pattern.h: Likewise.
6931
6932 2024-08-01 0xn4utilus <[email protected]>
6933
6934 * ast/rust-ast.cc (Function::Function): Add `is_external_function` field.
6935 (Function::operator=): Likewise.
6936 * ast/rust-ast.h: New constructor for ExternalItem.
6937 * ast/rust-item.h (class Function): Add `is_external_function`
6938 field. Update `get_node_id`.
6939 * ast/rust-macro.h: Update copy constructor.
6940
6941 2024-08-01 Sourabh Jaiswal <[email protected]>
6942
6943 * expand/rust-expand-visitor.cc
6944 (ExpandVisitor::expand_inner_items): Adjust to use has_value ()
6945 (ExpandVisitor::expand_inner_stmts): Likewise
6946 * expand/rust-macro-builtins.cc (builtin_macro_from_string): Likewise
6947 (make_macro_path_str): Likewise
6948 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise
6949 * util/rust-lang-item.cc (LangItem::Parse): Adjust to return tl::optional
6950 (LangItem::toString) Likewise
6951 * util/rust-token-converter.cc (handle_suffix): Adjust to use value.or ()
6952 (from_literal) Likewise
6953 * util/bi-map.h (BiMap::lookup): Adjust to use tl::optional for
6954 lookups
6955
6956 2024-08-01 Owen Avery <[email protected]>
6957
6958 * ast/rust-pattern.h
6959 (class TupleStructPattern): Assert that items != nullptr.
6960 (class TuplePattern): Likewise.
6961 (TupleStructPattern::has_items): Remove.
6962 (TuplePattern::has_tuple_pattern_items): Likewise.
6963 * parse/rust-parse-impl.h
6964 (Parser::parse_ident_leading_pattern):
6965 Prevent construction of TupleStructPattern with
6966 (items == nullptr).
6967 (Parser::parse_pattern_no_alt): Likewise.
6968 * ast/rust-ast-collector.cc
6969 (TokenCollector::visit): Remove usage of
6970 TupleStructPattern::has_items.
6971 * ast/rust-ast-visitor.cc
6972 (DefaultASTVisitor::visit): Likewise.
6973 * resolve/rust-early-name-resolver.cc
6974 (EarlyNameResolver::visit): Likewise.
6975
6976 2024-08-01 jjasmine <[email protected]>
6977
6978 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
6979
6980 2024-08-01 jjasmine <[email protected]>
6981
6982 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
6983
6984 2024-08-01 Arthur Cohen <[email protected]>
6985
6986 * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Add
6987 documentation regarding future tasks.
6988
6989 2024-08-01 Arthur Cohen <[email protected]>
6990
6991 * Make-lang.in: Compile the new source file.
6992 * ast/rust-ast-collector.cc (TokenCollector::visit): Error out when
6993 visiting FormatArgs nodes.
6994 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
6995 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
6996 * ast/rust-ast.cc (FormatArgs::get_locus): New.
6997 * ast/rust-builtin-ast-nodes.h: Improve FormatArgs API.
6998 * ast/rust-fmt.cc (Pieces::~Pieces): Cleanup.
6999 (Pieces::Pieces): Likewise.
7000 * ast/rust-fmt.h (struct Pieces): Add pieces_vector member.
7001 * hir/rust-ast-lower-format-args.cc: New file.
7002 * hir/rust-ast-lower-format-args.h: New file.
7003
7004 2024-08-01 Arthur Cohen <[email protected]>
7005
7006 * ast/rust-ast.cc: Make FormatArgs inherit from AST::Expr
7007 * ast/rust-builtin-ast-nodes.h: Improve FormatArg* nodes and helpers.
7008 * ast/rust-fmt.cc (Pieces::collect): Fix interface to match FFI function.
7009 * ast/rust-fmt.h (collect_pieces): Likewise.
7010 (struct Pieces): Add append_newline parameter.
7011 * expand/rust-macro-builtins.cc: Add proper parsing of format_args
7012 input.
7013 * hir/rust-ast-lower-base.cc: Include diagnostics header.
7014
7015 2024-08-01 Arthur Cohen <[email protected]>
7016
7017 * parse/rust-parse.h: New method.
7018
7019 2024-08-01 Arthur Cohen <[email protected]>
7020
7021 * expand/rust-macro-builtins.cc (format_args_maker): New function.
7022 (try_expand_many_expr): Add comment about reworking function.
7023 (MacroBuiltin::format_args_handler): Add newline parameter.
7024 * expand/rust-macro-builtins.h: Likewise.
7025
7026 2024-08-01 Arthur Cohen <[email protected]>
7027
7028 * ast/rust-builtin-ast-nodes.h: New file.
7029 * ast/rust-ast-full-decls.h (class FormatArgs): Declare new class.
7030 * ast/rust-ast-collector.cc: Handle FormatArgs nodes properly.
7031 * ast/rust-ast-collector.h: Likewise.
7032 * ast/rust-ast-full.h: Likewise.
7033 * ast/rust-ast-visitor.cc: Likewise.
7034 * ast/rust-ast-visitor.h: Likewise.
7035 * ast/rust-ast.cc: Likewise.
7036 * ast/rust-ast.h: Likewise.
7037 * expand/rust-derive.h: Likewise.
7038 * hir/rust-ast-lower-base.cc: Likewise.
7039 * hir/rust-ast-lower-base.h: Likewise.
7040 * hir/rust-ast-lower-expr.cc: Likewise.
7041 * hir/rust-ast-lower-expr.h: Likewise.
7042 * resolve/rust-ast-resolve-base.cc: Likewise.
7043 * resolve/rust-ast-resolve-base.h: Likewise.
7044
7045 2024-08-01 Owen Avery <[email protected]>
7046
7047 * resolve/rust-default-resolver.cc
7048 (DefaultResolver::visit): Visit inner AST nodes of ClosureExprInner,
7049 ClosureExprInnerTyped, IfExpr, IfExprConseqElse, MatchExpr,
7050 PathInExpression, EnumItemTuple, EnumItemStruct, and
7051 EnumItemDiscriminant.
7052 * ast/rust-item.h
7053 (EnumItemDiscriminant::has_expr): New function.
7054
7055 2024-08-01 Arthur Cohen <[email protected]>
7056
7057 * hir/rust-ast-lower-extern.h: Lower to HIR::ExternalTypeItem nodes.
7058 * hir/tree/rust-hir-item.h (class ExternalTypeItem): Create private
7059 visibility by default as extern types have no visibility - add a comment
7060 about the correctness of this.
7061
7062 2024-08-01 Arthur Cohen <[email protected]>
7063
7064 * hir/tree/rust-hir-item.h (class ExternalTypeItem): New class.
7065 * hir/tree/rust-hir.cc (ExternalTypeItem::as_string): Likewise.
7066 * backend/rust-compile-extern.h: Add base for handling HIR::ExternalTypeItem
7067 node.
7068 * checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
7069 * checks/errors/borrowck/rust-function-collector.h: Likewise.
7070 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
7071 * checks/errors/rust-const-checker.h: Likewise.
7072 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
7073 * checks/errors/rust-unsafe-checker.h: Likewise.
7074 * hir/rust-ast-lower-extern.h: Likewise.
7075 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
7076 * hir/rust-hir-dump.h: Likewise.
7077 * hir/tree/rust-hir-full-decls.h (class ExternalTypeItem): Likewise.
7078 * hir/tree/rust-hir-visitor.h: Likewise.
7079 (ExternalTypeItem::accept_vis): Likewise.
7080 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise.
7081 * typecheck/rust-hir-type-check-implitem.h: Likewise.
7082
7083 2024-08-01 Arthur Cohen <[email protected]>
7084
7085 * resolve/rust-ast-resolve-implitem.h: Declare external types as new
7086 types.
7087
7088 2024-08-01 Arthur Cohen <[email protected]>
7089
7090 * util/rust-lang-item.h (class RustLangItem): Renamed to...
7091 (class LangItem): ...this. Rename ItemType enum to Kind
7092 * util/rust-lang-item.cc: Rename methods to use new class name.
7093 * backend/rust-compile-expr.cc (CompileExpr::visit): Use new lang-item API.
7094 (CompileExpr::resolve_operator_overload): Likewise.
7095 * backend/rust-compile-expr.h: Likewise.
7096 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_lang_item_attribute): Likewise.
7097 * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): Likewise.
7098 (AutoderefCycle::cycle): Likewise.
7099 * typecheck/rust-autoderef.h: Likewise.
7100 * typecheck/rust-hir-type-bounds.h: Likewise.
7101 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate): Likewise.
7102 * typecheck/rust-hir-type-check-base.h: Likewise.
7103 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
7104 * typecheck/rust-hir-type-check-expr.h: Likewise.
7105 * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise.
7106 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): Likewise.
7107 (TypeBoundsProbe::assemble_builtin_candidate): Likewise.
7108 (TypeCheckBase::get_predicate_from_bound): Likewise.
7109 * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
7110 * util/rust-hir-map.cc (Mappings::get_lang_item): Likewise.
7111 (Mappings::lookup_trait_item_lang_item): Likewise.
7112 * util/rust-hir-map.h: Likewise.
7113
7114 2024-08-01 Arthur Cohen <[email protected]>
7115
7116 * Make-lang.in: Compile new rust-lang-item.o.
7117 * util/rust-lang-item.h: Split into header and source.
7118 * util/rust-lang-item.cc: Cleanup parsing of lang items by using a hashmap
7119 and returning optional values, cleanup handling of exhaustive lang item
7120 lookups.
7121 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_lang_item_attribute): Use
7122 new optional API.
7123
7124 2024-08-01 jjasmine <[email protected]>
7125
7126 * expand/rust-macro-builtins.cc: Change BuiltinMacro in
7127 builtin_macro_from_string to tl::optional<>
7128 * expand/rust-macro-builtins.h (enum class): Change BuiltinMacro
7129 in builtin_macro_from_string to tl::optional<>
7130 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
7131 Resolved wrong type dependency of builtin_macro_from_string
7132
7133 2024-08-01 Arthur Cohen <[email protected]>
7134
7135 * ast/rust-fmt.cc (Pieces::collect): Fix signature to take ownership
7136 of the given string.
7137 * ast/rust-fmt.h (struct Pieces): Store parsed string in the struct.
7138
7139 2024-08-01 Arthur Cohen <[email protected]>
7140
7141 * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
7142 Transform entire invocation token stream into string for the parser.
7143
7144 2024-08-01 Arthur Cohen <[email protected]>
7145
7146 * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
7147 Construct string to parser properly.
7148
7149 2024-08-01 Arthur Cohen <[email protected]>
7150
7151 * ast/rust-fmt.cc (Pieces::~Pieces): Call libformat_parser's release
7152 function in destructor.
7153 * ast/rust-fmt.h (struct PieceSlice): Add capacity.
7154 (destroy_pieces): New.
7155 (struct Pieces): Add destructor.
7156
7157 2024-08-01 Arthur Cohen <[email protected]>
7158
7159 * ast/rust-fmt.cc (Pieces::collect): Use new Pieces API.
7160 * ast/rust-fmt.h: Update interface with new FFI bindings.
7161
7162 2024-08-01 Arthur Cohen <[email protected]>
7163
7164 * ast/rust-fmt.h: Add remaining FFI types.
7165
7166 2024-08-01 Thomas Schwinge <[email protected]>
7167
7168 * Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
7169 build in libgrust.
7170 (%.toml:, $(LIBFORMAT_PARSER):): Remove.
7171
7172 2024-08-01 Thomas Schwinge <[email protected]>
7173
7174 * Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
7175 directory.
7176 * ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
7177
7178 2024-08-01 Thomas Schwinge <[email protected]>
7179
7180 * Make-lang.in (LIBFORMAT_PARSER): Point to the actual build artifact.
7181 ($(LIBFORMAT_PARSER)): Don't cache it.
7182
7183 2024-08-01 Thomas Schwinge <[email protected]>
7184
7185 * Make-lang.in (LIBPROC_MACRO_INTERNAL): New.
7186 (RUST_LIBDEPS, crab1$(exeext), rust/libformat_parser.a): Use it.
7187
7188 2024-08-01 Arthur Cohen <[email protected]>
7189
7190 * Make-lang.in: Compile libformat_parser.
7191 * ast/rust-fmt.cc: New FFI definitions.
7192 * ast/rust-fmt.h: Likewise.
7193 * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Call
7194 into libformat_parser.
7195 * expand/rust-macro-builtins.h: Define format_args!() handler proper.
7196
7197 2024-08-01 Arthur Cohen <[email protected]>
7198
7199 * Make-lang.in: Compile rust-fmt object
7200 * ast/rust-fmt.cc: New file.
7201 * ast/rust-fmt.h: New file.
7202
7203 2024-08-01 Marc Poulhiès <[email protected]>
7204
7205 * rust-lang.cc (grs_langhook_type_for_mode): simplify code for
7206 xImode. Add missing long_double_type_node.
7207
7208 2024-08-01 Owen Avery <[email protected]>
7209
7210 * hir/rust-ast-lower-pattern.cc
7211 (ASTLoweringPattern::visit):
7212 Reset is_let_top_level while visiting GroupedPattern.
7213
7214 2024-08-01 Thomas Schwinge <[email protected]>
7215
7216 * backend/rust-compile-base.cc (HIRCompileBase::compile_function):
7217 For 'main', initialize 'main_identifier_node'.
7218
7219 2024-07-12 Daniel Bertalan <[email protected]>
7220
7221 * metadata/rust-imports.cc (Import::try_package_in_directory):
7222 Change NULL to nullptr.
7223
7224 2024-06-25 Kewen Lin <[email protected]>
7225
7226 * rust-gcc.cc (float_type): Use TYPE_PRECISION of
7227 {float,double,long_double}_type_node to replace
7228 {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE.
7229
7230 2024-06-11 Arthur Cohen <[email protected]>
7231
7232 * Make-lang.in: Remove overazealous LIBS = -ldl -lpthread line, link
7233 crab1 against CRAB1_LIBS.
7234
7235 2024-04-15 Thomas Schwinge <[email protected]>
7236
7237 * Make-lang.in (RUST_LIBDEPS): Inline into single user.
7238
7239 2024-04-15 Thomas Schwinge <[email protected]>
7240
7241 * Make-lang.in (LIBPROC_MACRO_INTERNAL): New.
7242 (RUST_LIBDEPS, crab1$(exeext)): Use it.
7243
7244 2024-04-15 Thomas Schwinge <[email protected]>
7245
7246 * Make-lang.in (RUST_LDFLAGS): Inline into single user.
7247
7248 2024-04-15 Thomas Schwinge <[email protected]>
7249
7250 * Make-lang.in (RUST_LDFLAGS): Remove
7251 'libgrust/libproc_macro_internal'.
7252
7253 2024-04-09 Christophe Lyon <[email protected]>
7254
7255 * Make-lang.in (rust.install-dvi, rust.install-html): New rules.
7256
7257 2024-03-04 Mark Wielaard <[email protected]>
7258
7259 * lang.opt.urls: Regenerate.
7260
7261 2024-02-21 0xn4utilus <[email protected]>
7262
7263 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
7264 Add variadic check on all parameters.
7265
7266 2024-02-21 Owen Avery <[email protected]>
7267
7268 * backend/rust-compile-pattern.cc
7269 (CompilePatternLet::visit):
7270 Lookup type of sub-pattern, not tuple pattern itself.
7271
7272 2024-02-21 Marc Poulhiès <[email protected]>
7273
7274 * backend/rust-builtins.cc
7275 (BuiltinsContext::register_rust_mappings): Add powi and reformat.
7276 * backend/rust-builtins.h: Add missing copyright header.
7277
7278 2024-02-21 Arthur Cohen <[email protected]>
7279
7280 * expand/rust-macro-expand.h (struct MacroExpander): Nitpick: fix
7281 formatting of emitted error.
7282
7283 2024-02-21 Owen Avery <[email protected]>
7284
7285 * resolve/rust-ast-resolve-item.cc
7286 (flatten_glob): Use Import class.
7287 (flatten_rebind): Likewise.
7288 (flatten_list): Likewise.
7289 (flatten): Likewise.
7290 (flatten_use_dec_to_paths): Likewise.
7291 (flatten_use_dec_to_imports): Likewise.
7292 (ResolveItem::visit): Likewise.
7293 (Import::add_prefix): New.
7294 (rust_flatten_nested_glob): Adjust test.
7295 (rust_flatten_glob): Likewise.
7296 (rust_flatten_rebind_none): Likewise.
7297 (rust_flatten_rebind): Likewise.
7298 (rust_flatten_rebind_nested): Likewise.
7299 (rust_flatten_list): Likewise.
7300 * resolve/rust-ast-resolve-item.h
7301 (class Import): New.
7302
7303 2024-02-21 Arthur Cohen <[email protected]>
7304
7305 * typecheck/rust-hir-type-check-implitem.h: Fix typo in field
7306 (region_costraints -> region_constraints).
7307
7308 2024-02-07 Kushal Pal <[email protected]>
7309
7310 * parse/rust-parse-impl.h (Parser::parse_trait_item):
7311 Handle macros in trait items similar to how its handled for trait
7312 implementation items.
7313
7314 2024-02-07 Kushal Pal <[email protected]>
7315
7316 * ast/rust-ast-collector.cc (TokenCollector::visit):
7317 Remove obsolete classes and functions.
7318 * ast/rust-ast-collector.h:
7319 Likewise.
7320 * ast/rust-ast-full-decls.h (class TraitFunctionDecl):
7321 Likewise.
7322 (class TraitItemFunc):
7323 Likewise.
7324 (class TraitMethodDecl):
7325 Likewise.
7326 (class TraitItemMethod):
7327 Likewise.
7328 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
7329 Likewise.
7330 * ast/rust-ast-visitor.h:
7331 Likewise.
7332 * ast/rust-ast.cc (TraitItemFunc::TraitItemFunc):
7333 Likewise.
7334 (TraitItemFunc::operator=):
7335 Likewise.
7336 (TraitItemFunc::as_string):
7337 Likewise.
7338 (TraitFunctionDecl::as_string):
7339 Likewise.
7340 (TraitItemMethod::TraitItemMethod):
7341 Likewise.
7342 (TraitItemMethod::operator=):
7343 Likewise.
7344 (TraitItemMethod::as_string):
7345 Likewise.
7346 (TraitMethodDecl::as_string):
7347 Likewise.
7348 (TraitItemFunc::accept_vis):
7349 Likewise.
7350 (TraitItemMethod::accept_vis):
7351 Likewise.
7352 * ast/rust-item.h (class TraitFunctionDecl):
7353 Likewise.
7354 (class TraitItemFunc):
7355 Likewise.
7356 (class TraitMethodDecl):
7357 Likewise.
7358 (class TraitItemMethod):
7359 Likewise.
7360 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
7361 Likewise.
7362 * checks/errors/rust-ast-validation.h:
7363 Likewise.
7364 * checks/errors/rust-feature-gate.h:
7365 Likewise.
7366 * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_trait_function_decl):
7367 Likewise.
7368 (CfgStrip::maybe_strip_trait_method_decl):
7369 Likewise.
7370 (CfgStrip::visit):
7371 Likewise.
7372 * expand/rust-cfg-strip.h:
7373 Likewise.
7374 * expand/rust-derive.h:
7375 Likewise.
7376 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_trait_function_decl):
7377 Likewise.
7378 (ExpandVisitor::expand_trait_method_decl):
7379 Likewise.
7380 (ExpandVisitor::visit):
7381 Likewise.
7382 * expand/rust-expand-visitor.h:
7383 Likewise.
7384 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit):
7385 Likewise.
7386 * hir/rust-ast-lower-base.h:
7387 Likewise.
7388 * hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit):
7389 Likewise.
7390 * hir/rust-ast-lower-implitem.h:
7391 Likewise.
7392 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit):
7393 Likewise.
7394 * resolve/rust-ast-resolve-base.h:
7395 Likewise.
7396 * resolve/rust-ast-resolve-implitem.h (visit):
7397 Likewise.
7398 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
7399 Likewise.
7400 * resolve/rust-ast-resolve-item.h:
7401 Likewise.
7402 * resolve/rust-default-resolver.cc (DefaultResolver::visit):
7403 Likewise.
7404 * resolve/rust-default-resolver.h:
7405 Likewise.
7406 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
7407 Likewise.
7408 * resolve/rust-toplevel-name-resolver-2.0.h:
7409 Likewise.
7410 * util/rust-attributes.cc (AttributeChecker::visit):
7411 Likewise.
7412 * util/rust-attributes.h:
7413 Likewise.
7414
7415 2024-02-07 Kushal Pal <[email protected]>
7416
7417 * parse/rust-parse-impl.h (Parser::parse_trait_item):
7418 Use parse_function() to parse trait functions.
7419
7420 2024-02-07 Kushal Pal <[email protected]>
7421
7422 * hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit):
7423 Provide visitor for AST::Function.
7424 * hir/rust-ast-lower-implitem.h:
7425 Likewise.
7426 * resolve/rust-ast-resolve-implitem.h:
7427 Likewise.
7428 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
7429 Likewise.
7430 * resolve/rust-ast-resolve-item.h:
7431 Likewise.
7432
7433 2024-02-07 Kushal Pal <[email protected]>
7434
7435 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
7436 Add checks for Trait functions.
7437
7438 2024-02-07 Kushal Pal <[email protected]>
7439
7440 * ast/rust-ast.h: Replace TraitItem with AssociatedItem.
7441 * ast/rust-item.h (class Trait): Likewise.
7442 * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
7443 Likewise.
7444 * parse/rust-parse-impl.h (Parser::parse_trait): Likewise.
7445 * parse/rust-parse.h: Likewise.
7446
7447 2024-02-07 Philip Herron <[email protected]>
7448
7449 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): use destructure
7450
7451 2024-02-07 Nobel Singh <[email protected]>
7452
7453 * Make-lang.in: Add rust-ast-lower-implitem.cc to list of objects.
7454 * hir/rust-ast-lower-implitem.h (RUST_AST_LOWER_IMPLITEM_H): Remove
7455 implementation.
7456 * hir/rust-ast-lower-implitem.cc: Copy implementation from header.
7457
7458 2024-02-07 Philip Herron <[email protected]>
7459
7460 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): refactor
7461 * typecheck/rust-hir-type-check.h: new prototype
7462 * typecheck/rust-typecheck-context.cc (TypeCheckContext::compute_inference_variables): x
7463
7464 2024-02-07 Philip Herron <[email protected]>
7465
7466 * typecheck/rust-hir-type-check-type.cc: remove hack
7467
7468 2024-02-07 Philip Herron <[email protected]>
7469
7470 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): remove hack
7471
7472 2024-02-07 Philip Herron <[email protected]>
7473
7474 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): fix
7475
7476 2024-02-07 Nobel Singh <[email protected]>
7477
7478 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
7479 Change default ABI to C for extern functions
7480 (ASTLoweringBase::lower_extern_block): Likewise
7481
7482 2024-02-07 Jakub Dupak <[email protected]>
7483
7484 * typecheck/rust-tyty.cc (BaseType::BaseType): Store orig ref.
7485 (BaseType::get_orig_ref): Add getter.
7486 * typecheck/rust-tyty.h: Store orig ref.
7487
7488 2024-02-07 Jakub Dupak <[email protected]>
7489
7490 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
7491 Add region constraints.
7492 (TypeCheckImplItem::visit): Add region constraints.
7493 * typecheck/rust-hir-type-check-implitem.h: Add region constraints.
7494 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelf):
7495 Add region constraints.
7496 (TypeCheckItem::visit): Add region constraints.
7497 (TypeCheckItem::resolve_impl_item): Add region constraints.
7498 (TypeCheckItem::resolve_impl_block_substitutions): Add region constraints.
7499 * typecheck/rust-hir-type-check-item.h: Add region constraints.
7500 * typecheck/rust-hir-type-check-type.cc (ResolveWhereClauseItem::Resolve):
7501 Add region constraints.
7502 (ResolveWhereClauseItem::visit): Add region constraints.
7503 * typecheck/rust-hir-type-check-type.h (class ResolveWhereClauseItem):
7504 Add region constraints.
7505 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
7506 Add region constraints.
7507 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate):
7508 Add region constraints.
7509 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_region_constraints):
7510 Add region constraints.
7511 * typecheck/rust-tyty-subst.h (class BaseType): Add region constraints.
7512 (struct RegionConstraints): Add region constraints.
7513 * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): Add region constraints.
7514 (ADTType::clone): Add region constraints.
7515 (FnType::clone): Add region constraints.
7516 (ProjectionType::clone): Add region constraints.
7517 * typecheck/rust-tyty.h: Add region constraints.
7518
7519 2024-02-07 Jakub Dupak <[email protected]>
7520
7521 * typecheck/rust-hir-trait-resolve.cc: add regions
7522 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal):
7523 add regions, resolve generic lifetimes
7524 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): add regions
7525 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
7526 add regions, resolve lifetimes
7527 (TypeCheckImplItem::visit): add regions, resove lifetimes
7528 * typecheck/rust-hir-type-check-implitem.h: add default value for result
7529 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): add regions,
7530 resove lifetimes
7531 (TypeCheckItem::resolve_impl_block_substitutions): add regions, resove lifetimes
7532 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): add regions,
7533 resove lifetimes
7534 (TypeCheckExpr::resolve_root_path): add regions, resove lifetimes
7535 (TypeCheckExpr::resolve_segments): add regions, resove lifetimes
7536 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): add regions,
7537 resove lifetimes
7538 (TypeCheckType::resolve_root_path): add regions, resove lifetimes
7539 (ResolveWhereClauseItem::Resolve): add regions, resove lifetimes
7540 (ResolveWhereClauseItem::visit): add regions, resove lifetimes
7541 * typecheck/rust-hir-type-check.cc (TypeCheckContext::LifetimeResolver::resolve):
7542 add regions, resolve lifetimes
7543 (TraitItemReference::get_type_from_fn): add regions, resove lifetimes
7544 * typecheck/rust-hir-type-check.h: add regions, resove lifetimes
7545 * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): add regions,
7546 resove lifetimes
7547 (SubstMapper::Resolve): add regions, resove lifetimes
7548 (SubstMapper::InferSubst): add regions, resove lifetimes
7549 (SubstMapper::visit): add regions, resove lifetimes
7550 * typecheck/rust-substitution-mapper.h: add regions, resove lifetimes
7551 * typecheck/rust-typecheck-context.cc (TypeCheckContext::TypeCheckContext):
7552 lifetime resolution
7553 (TypeCheckContext::regions_from_generic_args): lifetime resolution helper
7554 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate):
7555 add regions, resove lifetimes
7556 (TypeBoundPredicate::operator=): add regions, resove lifetimes
7557 (TypeBoundPredicate::apply_generic_arguments): add regions, resove lifetimes
7558 (TypeBoundPredicateItem::get_tyty_for_receiver): add regions, resove lifetimes
7559 * typecheck/rust-tyty-subst.cc (SubstitutionArgumentMappings::get_regions):
7560 add regions, resove lifetimes
7561 (SubstitutionArgumentMappings::get_mut_regions): getter
7562 (SubstitutionArgumentMappings::error): split error and empty
7563 (SubstitutionArgumentMappings::empty): split error and empty
7564 (SubstitutionArgumentMappings::find_symbol): helper
7565 (SubstitutionRef::get_num_lifetime_params): getter
7566 (SubstitutionRef::get_num_type_params): getter
7567 (SubstitutionRef::needs_substitution): extend to regions
7568 (SubstitutionRef::get_mappings_from_generic_args): helper
7569 (SubstitutionRef::infer_substitions): add regions
7570 * typecheck/rust-tyty-subst.h (class RegionParamList): region param handler
7571 * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): add regions, resove lifetimes
7572 (InferType::default_type): add regions, resove lifetimes
7573 (FnType::clone): add regions, resove lifetimes
7574 (ReferenceType::ReferenceType): add regions
7575 (ReferenceType::get_region): getter
7576 (ReferenceType::clone): add regions
7577 * typecheck/rust-tyty.h: add regions, resove
7578
7579 2024-02-07 Jakub Dupak <[email protected]>
7580
7581 * hir/tree/rust-hir-item.h: Add missing getter
7582
7583 2024-02-07 Jakub Dupak <[email protected]>
7584
7585 * typecheck/rust-tyty-region.h: New file.
7586
7587 2024-02-07 Jakub Dupak <[email protected]>
7588
7589 * typecheck/rust-hir-type-check.h (class Lifetime): add interned lifetime class
7590 * typecheck/rust-typecheck-context.cc (TypeCheckContext::TypeCheckContext): add
7591 resolution tool
7592 (TypeCheckContext::intern_lifetime): add method to intern lifetime from tyctx
7593 (TypeCheckContext::lookup_lifetime): add method to lookup lifetime from tyctx
7594 (TypeCheckContext::intern_and_insert_lifetime): add a helper method
7595
7596 2024-02-07 Raiki Tamura <[email protected]>
7597
7598 * rust-lang.cc (run_rust_tests): Add test.
7599 * rust-system.h: Add <algorithm>.
7600 * util/make-rust-unicode.py: Output NFC_Quick_Check table.
7601 * util/rust-codepoint.h (struct Codepoint): Add is_supplementary
7602 method.
7603 * util/rust-unicode-data.h: Generated.
7604 * util/rust-unicode.cc (binary_search_sorted_array): Removed.
7605 (lookup_cc): Remove namespace.
7606 (is_alphabetic): Use std::binary_search
7607 (nfc_quick_check): New function.
7608 (nfc_normalize): Use nfc_quick_check.
7609 (is_nfc_qc_maybe): New function.
7610 (is_nfc_qc_no): New function.
7611 (rust_nfc_qc_test): New test.
7612 * util/rust-unicode.h (is_nfc_qc_no): New function.
7613 (is_nfc_qc_maybe): New function.
7614 (enum class): New enum class.
7615 (nfc_quick_check): New function.
7616 (rust_nfc_qc_test): New test.
7617
7618 2024-02-07 Kushal Pal <[email protected]>
7619
7620 * parse/rust-parse-impl.h (Parser::parse_function):
7621 Skip token if its a COMMA.
7622
7623 2024-01-30 Owen Avery <[email protected]>
7624
7625 * ast/rust-ast-full-decls.h
7626 (class TraitImplItem): Remove forward declaration.
7627 (class AssociatedItem): Add forward declaration.
7628 * ast/rust-ast.h
7629 (class TraitImplItem): Remove.
7630 (class TraitItem): Inherit from AssociatedItem.
7631 (SingleASTNode::take_trait_impl_item):
7632 Return std::unique_ptr<AssociatedItem> instead of
7633 std::unique_ptr<TraitImplItem>.
7634 * ast/rust-item.h
7635 (class Function): Inherit from AssociatedItem instead of
7636 TraitImplItem.
7637 (class TypeAlias): Likewise.
7638 (class ConstantItem): Likewise.
7639 (class TraitImpl): Store items as AssociatedItem.
7640 * expand/rust-derive-clone.cc
7641 (DeriveClone::clone_fn): Return std::unique_ptr<AssociatedItem>.
7642 (DeriveClone::clone_impl): Take std::unique_ptr<AssociatedItem>.
7643 * expand/rust-derive-clone.h
7644 (DeriveClone::clone_fn): Return std::unique_ptr<AssociatedItem>.
7645 (DeriveClone::clone_impl): Take std::unique_ptr<AssociatedItem>.
7646 * expand/rust-expand-visitor.cc
7647 (ExpandVisitor::visit): Handle changes to
7648 SingleASTNode::take_trait_impl_item.
7649 * parse/rust-parse-impl.h
7650 (Parser::parse_impl): Parse TraitImpl as containing AssociatedItem.
7651 (Parser::parse_trait_impl_item): Return
7652 std::unique_ptr<AssociatedItem>.
7653 (Parser::parse_trait_impl_function_or_method): Likewise.
7654 * parse/rust-parse.h
7655 (Parser::parse_trait_impl_item): Return
7656 std::unique_ptr<AssociatedItem>.
7657 (Parser::parse_trait_impl_function_or_method): Likewise.
7658
7659 2024-01-30 Robert Goss <[email protected]>
7660
7661 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit) Add additional check
7662 * typecheck/rust-hir-type-check-struct-field.h: A helper method to make error added
7663 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve) Update message
7664
7665 2024-01-30 Jakub Dupak <[email protected]>
7666
7667 * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): fix for lifetimes
7668 (ASTLowerWhereClauseItem::visit): fix for lifetimes
7669
7670 2024-01-30 Jakub Dupak <[email protected]>
7671
7672 * parse/rust-parse-impl.h (Parser::parse_where_clause): fix parsing
7673 (Parser::parse_where_clause_item): fix parsing
7674 (Parser::parse_type_bound_where_clause_item): fix parsing
7675 (Parser::parse_trait_bound): fix parsing
7676 * parse/rust-parse.h: fix parsing
7677
7678 2024-01-30 Kushal Pal <[email protected]>
7679
7680 * lex/rust-lex.cc (Lexer::dump_and_skip):
7681 Changed " " to '\n'
7682
7683 2024-01-30 Owen Avery <[email protected]>
7684
7685 * ast/rust-ast-fragment.cc
7686 (Fragment::assert_single_fragment): Update.
7687 * ast/rust-ast.h
7688 (class TraitImplItem): Move definition before that of TraitItem.
7689 (class TraitItem):
7690 Inherit from TraitImplItem instead of AssociatedItem.
7691 (class SingleASTNode): Unify handling of associated items.
7692 (SingleASTNode::take_assoc_item): Move from...
7693 (SingleASTNode::take_impl_item): ...here, but leave stub calling
7694 take_assoc_item behind.
7695 (SingleASTNode::take_trait_item):
7696 Cast associated item to TraitItem.
7697 (SingleASTNode::take_trait_impl_item):
7698 Cast associated item to TraitImplItem.
7699 * ast/rust-ast.cc
7700 (SingleASTNode::SingleASTNode):
7701 Unify handling of associated items.
7702 (SingleASTNode::operator=): Likewise.
7703 (SingleASTNode::accept_vis): Likewise.
7704 (SingleASTNode::is_error): Likewise.
7705 (SingleASTNode::as_string): Likewise.
7706 * ast/rust-item.h
7707 (class Function): Remove direct inheritence from AssociatedItem.
7708 (class ConstantItem): Likewise.
7709 * ast/rust-macro.h
7710 (class MacroInvocation):
7711 Remove direct inheritence from AssociatedItem and TraitImplItem.
7712
7713 2024-01-30 Robert Goss <[email protected]>
7714
7715 * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool
7716 * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields
7717
7718 2024-01-30 Kushal Pal <[email protected]>
7719
7720 * parse/rust-parse-impl.h (Parser::parse_inherent_impl_item):
7721 Added switch-case for ASYNC token.
7722
7723 2024-01-30 Kushal Pal <[email protected]>
7724
7725 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
7726 Enclose const in single quotes.
7727
7728 2024-01-30 Kushal Pal <[email protected]>
7729
7730 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
7731 Added check for `async` functions inside trait.
7732 * parse/rust-parse-impl.h (Parser::parse_trait_item):
7733 Added switch-case for ASYNC token.
7734
7735 2024-01-30 Nirmal Patel <[email protected]>
7736
7737 * lex/rust-lex.cc (Lexer::parse_byte_string): Handle newline
7738 while parsing byte strings
7739 (Lexer::parse_string): Handle newline while parsing strings
7740
7741 2024-01-30 Jakub Dupak <[email protected]>
7742
7743 * backend/rust-compile-expr.cc (CompileExpr::visit): Use new API.
7744 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Use new API.
7745 * typecheck/rust-tyty-cmp.h: Remove old API.
7746 * typecheck/rust-tyty.cc (FnPtr::is_equal): Use new API.
7747 * typecheck/rust-tyty.h: Remove old API.
7748 * typecheck/rust-unify.cc (UnifyRules::expect_fnptr): Use new API.
7749
7750 2024-01-30 Jakub Dupak <[email protected]>
7751
7752 * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): For lifetimes.
7753
7754 2024-01-30 Jakub Dupak <[email protected]>
7755
7756 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime): Propagate static
7757 requirement.
7758 * hir/rust-ast-lower-base.h: Propagate static requirement.
7759 * hir/rust-ast-lower-implitem.h: Propagate static requirement.
7760 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Propagate static requirement.
7761 * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): Propagate static requirement.
7762 (ASTLoweringType::visit): Propagate static requirement.
7763 * hir/rust-ast-lower-type.h: Propagate static requirement.
7764
7765 2024-01-30 Jakub Dupak <[email protected]>
7766
7767 * parse/rust-parse-impl.h (Parser::parse_generic_param): Lifetime elision control.
7768 (Parser::parse_lifetime_where_clause_item): Lifetime elision control.
7769 (Parser::parse_type_param_bound): Lifetime elision control.
7770 (Parser::parse_lifetime_bounds): Lifetime elision control.
7771 (Parser::parse_lifetime): Lifetime elision control.
7772 (Parser::parse_path_generic_args): Lifetime elision control.
7773 (Parser::parse_self_param): Lifetime elision control.
7774 (Parser::parse_break_expr): Lifetime elision control.
7775 (Parser::parse_continue_expr): Lifetime elision control.
7776 (Parser::parse_reference_type_inner): Lifetime elision control.
7777 * parse/rust-parse.h: Lifetime elision control.
7778
7779 2024-01-30 Jakub Dupak <[email protected]>
7780
7781 * ast/rust-ast.h: Elided lifetime static constructor
7782 * ast/rust-type.h: Default lifetime to elided.
7783 * parse/rust-parse-impl.h (Parser::parse_lifetime_param): Use elided lifetime.
7784 (Parser::parse_lifetime): Use elided lifetime/
7785 (Parser::lifetime_from_token): Use elided lifetime.
7786 (Parser::parse_self_param): Use elided lifetime.
7787 (Parser::parse_reference_type_inner): Use elided lifetime.
7788
7789 2024-01-30 Jakub Dupak <[email protected]>
7790
7791 * parse/rust-parse-impl.h (Parser::lifetime_from_token): Fix matched pattern.
7792
7793 2024-01-30 Kushal Pal <[email protected]>
7794
7795 * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
7796 Added check for `async` function inside trait.
7797
7798 2024-01-30 Kushal Pal <[email protected]>
7799
7800 * parse/rust-parse-impl.h (Parser::parse_trait_impl_item):
7801 Handled `async` items
7802
7803 2024-01-30 Raiki Tamura <[email protected]>
7804
7805 * Make-lang.in: Add .o files
7806 * backend/rust-mangle.cc (struct V0Path): moved to splitted files
7807 (v0_path): Likewise.
7808 (legacy_mangle_name): Likewise.
7809 (legacy_mangle_canonical_path): Likewise.
7810 (legacy_hash): Likewise.
7811 (v0_tuple_prefix): Likewise.
7812 (v0_numeric_prefix): Likewise.
7813 (v0_simple_type_prefix): Likewise.
7814 (v0_complex_type_prefix): Likewise.
7815 (v0_integer_62): Likewise.
7816 (v0_opt_integer_62): Likewise.
7817 (v0_disambiguator): Likewise.
7818 (v0_type_prefix): Likewise.
7819 (v0_generic_args): Likewise.
7820 (v0_identifier): Likewise.
7821 (v0_type_path): Likewise.
7822 (v0_function_path): Likewise.
7823 (v0_scope_path): Likewise.
7824 (v0_crate_path): Likewise.
7825 (v0_inherent_or_trait_impl_path): Likewise.
7826 (v0_closure): Likewise.
7827 (legacy_mangle_item): Likewise.
7828 (v0_mangle_item): Likewise.
7829 * backend/rust-mangle.h (legacy_mangle_item): Likewise.
7830 (v0_mangle_item): Likewise.
7831 * backend/rust-mangle-legacy.cc: New file.
7832 * backend/rust-mangle-v0.cc: New file.
7833
7834 2024-01-30 Jakub Dupak <[email protected]>
7835
7836 * checks/errors/borrowck/rust-bir-place.h: Cleanup.
7837 * checks/errors/borrowck/rust-borrow-checker.h: Cleanup.
7838
7839 2024-01-30 Jakub Dupak <[email protected]>
7840
7841 * typecheck/rust-tyty.h (BaseType::is): Cast API.
7842 (SubstitutionRef>): Cast API.
7843 (BaseType::as): Cast API.
7844 (BaseType::try_as): Cast API.
7845
7846 2024-01-30 Jakub Dupak <[email protected]>
7847
7848 * typecheck/rust-tyty.h (class ClosureType): Inherit interface.
7849 (class FnPtr): Inherit interface.
7850 (class FnType): Inherit interface.
7851 (class CallableTypeInterface): New interface.
7852 (BaseType::is): Detect interface members API.
7853
7854 2024-01-30 Jakub Dupak <[email protected]>
7855
7856 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Refactor.
7857
7858 2024-01-30 Jakub Dupak <[email protected]>
7859
7860 * checks/errors/borrowck/rust-bir-builder-internal.h: Replace nodiscard.
7861 * checks/errors/borrowck/rust-bir-place.h: Replace nodiscard.
7862
7863 2024-01-30 Jakub Dupak <[email protected]>
7864
7865 * typecheck/rust-tyty.h: Fix nodiscard to warn unused.
7866
7867 2024-01-30 Jakub Dupak <[email protected]>
7868
7869 * hir/tree/rust-hir-item.h: Ad lifetime getter.
7870 * hir/tree/rust-hir-path.h: Make getter const ref.
7871 * hir/tree/rust-hir.h: Const ref and new getter.
7872
7873 2024-01-30 Arthur Cohen <[email protected]>
7874
7875 * Make-lang.in (GRS_OBJS): Add rust-attribs.o.
7876 * backend/rust-builtins.cc (builtin_const, builtin_noreturn)
7877 (builtin_novops): Remove.
7878 (BuiltinsContext::lookup_simple_builtin): Adjust.
7879 (BuiltinsContext::setup_overflow_fns): Remove.
7880 (BuiltinsContext::define_function_type): Set builtin type to
7881 errormark so the builtin is considered unavailable.
7882 (BuiltinsContext::setup_math_fns): Remove.
7883 (BuiltinsContext::setup_atomic_fns): Remove.
7884 (build_c_type_nodes): Refactor based on D frontend.
7885 (BuiltinsContext::define_builtin_types): Likewise.
7886 (DEF_PRIMITIVE_TYPE): New.
7887 (DEF_FUNCTION_TYPE_0): New.
7888 (DEF_FUNCTION_TYPE_1): New.
7889 (DEF_FUNCTION_TYPE_2): New.
7890 (DEF_FUNCTION_TYPE_3): New.
7891 (DEF_FUNCTION_TYPE_4): New.
7892 (DEF_FUNCTION_TYPE_5): New.
7893 (DEF_FUNCTION_TYPE_6): New.
7894 (DEF_FUNCTION_TYPE_7): New.
7895 (DEF_FUNCTION_TYPE_8): New.
7896 (DEF_FUNCTION_TYPE_9): New.
7897 (DEF_FUNCTION_TYPE_10): New.
7898 (DEF_FUNCTION_TYPE_11): New.
7899 (DEF_FUNCTION_TYPE_VAR_0): New.
7900 (DEF_FUNCTION_TYPE_VAR_1): New.
7901 (DEF_FUNCTION_TYPE_VAR_2): New.
7902 (DEF_FUNCTION_TYPE_VAR_3): New.
7903 (DEF_FUNCTION_TYPE_VAR_4): New.
7904 (DEF_FUNCTION_TYPE_VAR_5): New.
7905 (DEF_FUNCTION_TYPE_VAR_6): New.
7906 (DEF_FUNCTION_TYPE_VAR_7): New.
7907 (DEF_FUNCTION_TYPE_VAR_11): New.
7908 (DEF_POINTER_TYPE): New.
7909 (BuiltinsContext::setup): Adjust.
7910 (BuiltinsContext::define_builtin_attributes): New.
7911 (DEF_ATTR_NULL_TREE): New.
7912 (DEF_ATTR_INT): New.
7913 (DEF_ATTR_STRING): New.
7914 (DEF_ATTR_IDENT): New.
7915 (DEF_ATTR_TREE_LIST): New.
7916 (handle_flags): Remove.
7917 (BuiltinsContext::define_builtins): New.
7918 (DEF_BUILTIN): New.
7919 (BuiltinsContext::define_builtin): Remove.
7920 (BuiltinsContext::register_rust_mappings): New. Add all missing
7921 builtins.
7922 (BuiltinsContext::lookup_gcc_builtin): Adjust.
7923 * backend/rust-builtins.h (DEF_PRIMITIVE_TYPE): New.
7924 (DEF_FUNCTION_TYPE_0): New.
7925 (DEF_FUNCTION_TYPE_1): New.
7926 (DEF_FUNCTION_TYPE_2): New.
7927 (DEF_FUNCTION_TYPE_3): New.
7928 (DEF_FUNCTION_TYPE_4): New.
7929 (DEF_FUNCTION_TYPE_5): New.
7930 (DEF_FUNCTION_TYPE_6): New.
7931 (DEF_FUNCTION_TYPE_7): New.
7932 (DEF_FUNCTION_TYPE_8): New.
7933 (DEF_FUNCTION_TYPE_9): New.
7934 (DEF_FUNCTION_TYPE_10): New.
7935 (DEF_FUNCTION_TYPE_11): New.
7936 (DEF_FUNCTION_TYPE_VAR_0): New.
7937 (DEF_FUNCTION_TYPE_VAR_1): New.
7938 (DEF_FUNCTION_TYPE_VAR_2): New.
7939 (DEF_FUNCTION_TYPE_VAR_3): New.
7940 (DEF_FUNCTION_TYPE_VAR_4): New.
7941 (DEF_FUNCTION_TYPE_VAR_5): New.
7942 (DEF_FUNCTION_TYPE_VAR_6): New.
7943 (DEF_FUNCTION_TYPE_VAR_7): New.
7944 (DEF_FUNCTION_TYPE_VAR_11): New.
7945 (DEF_POINTER_TYPE): New.
7946 (DEF_ATTR_NULL_TREE): New.
7947 (DEF_ATTR_INT): New.
7948 (DEF_ATTR_STRING): New.
7949 (DEF_ATTR_IDENT): New.
7950 (DEF_ATTR_TREE_LIST): New.
7951 * backend/rust-compile-intrinsic.cc (Intrinsics::compile): Add
7952 comment.
7953 (op_with_overflow_inner): Adjust.
7954 (copy_handler_inner): Adjust.
7955 (prefetch_data_handler): Adjust.
7956 (build_atomic_builtin_name): Adjust.
7957 (atomic_load_handler_inner): Adjust.
7958 (uninit_handler): Adjust.
7959 (move_val_init_handler): Adjust.
7960 (expect_handler_inner): Adjust.
7961 * rust-gcc.cc (fetch_overflow_builtins): Adjust.
7962 * rust-lang.cc (rust_localize_identifier): Adjust.
7963 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): New.
7964 * rust-attribs.cc: New file.
7965
7966 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
7967
7968 * expand/rust-cfg-strip.cc (CfgStrip::visit): Change calls from visitor
7969 to default visitor.
7970 (CfgStrip::go): Add call to visit crate.
7971 * expand/rust-cfg-strip.h (class CfgStrip): Update prototypes and
7972 remove empty ones.
7973 * ast/rust-ast-visitor.cc: add WhereClause condition check.
7974
7975 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
7976
7977 * expand/rust-expand-visitor.cc (ExpandVisitor::go): Add call to visit
7978 on the crate.
7979 (ExpandVisitor::visit): Remove some visit functions in favor of their
7980 default visitor counterpart.
7981 * expand/rust-expand-visitor.h (class ExpandVisitor): Inherit from
7982 default visitor and remove now useless function prototypes.
7983
7984 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
7985
7986 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
7987 duplicated functions.
7988 * resolve/rust-default-resolver.h (class DefaultResolver): Make the
7989 default resolver inherit from the default visitor.
7990
7991 2024-01-30 Owen Avery <[email protected]>
7992
7993 * checks/errors/rust-feature.cc
7994 (Feature::name_hash_map):
7995 Add entries for Name::LANG_ITEMS and Name::NO_CORE.
7996 * checks/errors/rust-feature.h
7997 (Feature::Name::LANG_ITEMS): New.
7998 (Feature::Name::NO_CORE): New.
7999
8000 2024-01-30 Kushal Pal <[email protected]>
8001
8002 * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
8003 Renamed `WIN64` to `WIN_64`
8004 * util/rust-abi.cc (get_abi_from_string): Likewise
8005 (get_string_from_abi): Likewise
8006 * util/rust-abi.h (enum ABI): Likewise
8007
8008 2024-01-30 Nobel Singh <[email protected]>
8009
8010 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8011 check for const funtion.
8012
8013 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8014
8015 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8016 a validation check and emit an error depending on the context.
8017
8018 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8019
8020 * ast/rust-ast-collector.cc (TokenCollector::visit): Adapt defintion
8021 getter.
8022 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
8023 * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
8024 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
8025 * hir/rust-ast-lower-implitem.h: Likewise.
8026 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
8027 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
8028 * resolve/rust-ast-resolve-stmt.h: Likewise.
8029 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
8030 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
8031 * parse/rust-parse-impl.h: Allow empty function body during parsing.
8032 * ast/rust-ast.cc (Function::Function): Constructor now take an
8033 optional for the body.
8034 (Function::operator=): Adapt to new optional member.
8035 (Function::as_string): Likewise.
8036 * ast/rust-item.h (class Function): Make body optional and do not
8037 rely on nullptr anymore.
8038
8039 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8040
8041 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_generic_args):
8042 Move function.
8043 (EarlyNameResolver::resolve_qualified_path_type): Likewise.
8044 (EarlyNameResolver::visit): Add a top level visit function for crate
8045 and remove duplicated code.
8046 * resolve/rust-early-name-resolver.h (class EarlyNameResolver): Update
8047 overriden function list.
8048
8049 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8050
8051 * util/rust-attributes.cc (AttributeChecker::visit): Add visit function
8052 for crates.
8053 * util/rust-attributes.h (class AttributeChecker): Update function
8054 prototypes.
8055
8056 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8057
8058 * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Add a visit
8059 function for the crate level.
8060 (FeatureGate::check): Add call to crate visit.
8061 * checks/errors/rust-feature-gate.h (class FeatureGate): Remove now
8062 useless visit functions (traversal only).
8063
8064 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8065
8066 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8067 const check.
8068 * checks/errors/rust-ast-validation.h: Add visit function prototype.
8069
8070 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8071
8072 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8073 async const check.
8074
8075 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8076
8077 * parse/rust-parse-impl.h (Parser::parse_vis_item): Allow parsing async
8078 items in const.
8079 (Parser::parse_async_item): Account for const offset during async
8080 lookahead.
8081
8082 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8083
8084 * ast/rust-ast-builder.cc (AstBuilder::fn_qualifiers): Change
8085 constructor to match the new arguments.
8086 * ast/rust-ast-collector.cc (TokenCollector::visit): Change behavior
8087 to handle both const and async specifiers at the same time.
8088 * ast/rust-ast.cc (FunctionQualifiers::as_string): Likewise.
8089 * ast/rust-item.h (class FunctionQualifiers): Remove AsyncConstStatus
8090 and replace it with both Async and Const status. Also change the safety
8091 arguments to use an enum instead of a boolean.
8092 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
8093 Update constructor call.
8094 * hir/tree/rust-hir-item.h: Add Const and Async status, remove
8095 AsyncConstStatus, update the constructor.
8096 * hir/tree/rust-hir.cc (FunctionQualifiers::as_string): Update with
8097 the new status.
8098 * parse/rust-parse-impl.h (Parser::parse_function_qualifiers): Update
8099 constructor call.
8100 * util/rust-common.h (enum Mutability): Make an enum class.
8101 (enum class): Add Async and Const enum class to avoid booleans.
8102 (enum Unsafety): Change to an enum class.
8103
8104 2024-01-30 Owen Avery <[email protected]>
8105
8106 * ast/rust-ast-full-decls.h
8107 (class InherentImplItem): Remove.
8108 * ast/rust-ast.h
8109 (class InherentImplItem): Remove.
8110 (class SingleASTNode):
8111 Store pointer to AssociatedItem instead of InherentImplItem.
8112 * ast/rust-ast.cc
8113 (SingleASTNode::SingleASTNode):
8114 Use clone_associated_item instead of clone_inherent_impl_item.
8115 (SingleASTNode::operator=): Likewise.
8116 * ast/rust-item.h
8117 (class InherentImpl):
8118 Use AssociatedItem rather than InherentImplItem.
8119 (class Function): Likewise.
8120 (class ConstantItem): Likewise.
8121 * ast/rust-macro.h
8122 (class MacroInvocation): Likewise.
8123 * expand/rust-expand-visitor.cc
8124 (ExpandVisitor::visit): Likewise.
8125 * parse/rust-parse-impl.h
8126 (Parser::parse_impl): Likewise.
8127 (Parser::parse_inherent_impl_item): Likewise.
8128 (Parser::parse_inherent_impl_function_or_method): Likewise.
8129 * parse/rust-parse.h
8130 (Parser::parse_inherent_impl_item): Likewise.
8131 (Parser::parse_inherent_impl_function_or_method): Likewise.
8132
8133 2024-01-30 Philip Herron <[email protected]>
8134
8135 * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block): removed
8136 * backend/rust-compile-base.h: update header
8137 * backend/rust-compile-block.cc (CompileBlock::visit): remove old logic
8138 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function): likewise
8139 * backend/rust-compile-stmt.cc (CompileStmt::visit): likewise
8140 * backend/rust-compile-var-decl.h: ensure we setup tuple bindings correctly
8141
8142 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8143
8144 * ast/rust-item.h: Add safety getter to modules.
8145 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Check
8146 a module's safety and emit an error when meeting an unsafe module.
8147 * checks/errors/rust-ast-validation.h: Add function prototype.
8148 * parse/rust-parse-impl.h (Parser::parse_module): Move the module locus
8149 to the first token instead of the mod keyword.
8150
8151 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8152
8153 * parse/rust-parse-impl.h (Parser::parse_vis_item): Dispatch to parse
8154 module when meeting an unsafe module.
8155 (Parser::parse_module): Set unsafe status when the parser encounter an
8156 unsafe keyword.
8157
8158 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8159
8160 * ast/rust-item.h: Add safety status to Modules in the AST.
8161 * parse/rust-parse-impl.h (Parser::parse_module): Adapt constructors.
8162
8163 2024-01-30 Owen Avery <[email protected]>
8164
8165 * hir/tree/rust-hir-pattern.h
8166 (class TupleItems): New.
8167 (class TupleStructItems): Inherit from TupleItems.
8168 (class TuplePatternItems): Likewise.
8169
8170 2024-01-30 Arthur Cohen <[email protected]>
8171
8172 * resolve/rust-toplevel-name-resolver-2.0.cc
8173 (TopLevel::insert_or_error_out): New functions.
8174 (TopLevel::handle_use_dec): New function.
8175 (flatten_rebind): Likewise.
8176 (flatten_list): Likewise.
8177 (flatten_glob): Likewise.
8178 (flatten): Likewise.
8179 (TopLevel::visit): Visit various `use` declaration nodes.
8180 * resolve/rust-toplevel-name-resolver-2.0.h: Declare functions and
8181 visitors.
8182
8183 2024-01-30 Arthur Cohen <[email protected]>
8184
8185 * resolve/rust-early-name-resolver-2.0.cc
8186 (Early::visit): Remove visitors.
8187 * resolve/rust-early-name-resolver-2.0.h: Likewise.
8188
8189 2024-01-30 Arthur Cohen <[email protected]>
8190
8191 * ast/rust-item.h (class UseTree): Add `node_id` member.
8192
8193 2024-01-30 Arthur Cohen <[email protected]>
8194
8195 * resolve/rust-toplevel-name-resolver-2.0.cc
8196 (TopLevel::insert_or_error_out): Add documentation comment.
8197 (TopLevel::go): Likewise.
8198
8199 2024-01-30 Arthur Cohen <[email protected]>
8200
8201 * resolve/rust-early-name-resolver-2.0.cc
8202 (Early::insert_once): New function.
8203 (Early::visit): Likewise.
8204 * resolve/rust-early-name-resolver-2.0.h: Likewise.
8205
8206 2024-01-30 Arthur Cohen <[email protected]>
8207
8208 * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Store mappings
8209 after having resolved them.
8210 * resolve/rust-late-name-resolver-2.0.h: Add `TypePath` visitor.
8211
8212 2024-01-30 Arthur Cohen <[email protected]>
8213
8214 * resolve/rust-late-name-resolver-2.0.cc
8215 (Late::setup_builtin_types): New function.
8216 (Late::go): Setup builtin types.
8217 * resolve/rust-late-name-resolver-2.0.h:
8218 * resolve/rust-name-resolution-context.cc
8219 (NameResolutionContext::map_usage): New function.
8220 * resolve/rust-name-resolution-context.h: Likewise.
8221
8222 2024-01-30 Arthur Cohen <[email protected]>
8223
8224 * resolve/rust-name-resolution-context.h: Store a reference to the
8225 mappings.
8226 * resolve/rust-name-resolution-context.cc
8227 (NameResolutionContext::NameResolutionContext): Likewise.
8228
8229 2024-01-30 Arthur Cohen <[email protected]>
8230
8231 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use
8232 the DefaultResolver in the toplevel visitor.
8233
8234 2024-01-30 Arthur Cohen <[email protected]>
8235
8236 * Make-lang.in: Compile late name resolver.
8237 * resolve/rust-late-name-resolver-2.0.cc: New file.
8238 * resolve/rust-late-name-resolver-2.0.h: New file.
8239
8240 2024-01-30 Arthur Cohen <[email protected]>
8241
8242 * resolve/rust-name-resolution-context.h: Add a Labels stack.
8243
8244 2024-01-30 M V V S Manoj Kumar <[email protected]>
8245
8246 * parse/rust-parse-impl.h (Parser::parse_item): Likewise.
8247 (Parser::parse_vis_item): Likewise.
8248 (Parser::parse_async_item): Likewise.
8249 * parse/rust-parse.h: Made declaration for parse_async_item.
8250
8251 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8252
8253 * lex/rust-lex.cc (Lexer::classify_keyword): Update keyword map name.
8254 * lex/rust-token.h (enum PrimitiveCoreType): Remove some deprecated
8255 comments.
8256 * util/rust-keyword-values.cc (get_keywords): Update the keyword map
8257 name.
8258 (RS_TOKEN): Define as empty
8259 (RS_TOKEN_KEYWORD_2015): Add the emission value.
8260 (RS_TOKEN_KEYWORD_2018): Likewise.
8261 * util/rust-keyword-values.h (RS_KEYWORD_LIST): Introduce the keyword
8262 list.
8263 (RS_TOKEN_KEYWORD_2018): Define multiple new keywords.
8264
8265 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8266
8267 * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value.
8268 * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Likewise.
8269 (Parser::parse_item): Likewise.
8270 (Parser::parse_vis_item): Likewise.
8271 (Parser::parse_macro_rules_def): Likewise.
8272 (Parser::parse_union): Likewise.
8273 (Parser::parse_trait_impl_item): Likewise.
8274 (Parser::parse_stmt): Likewise.
8275 (Parser::parse_stmt_or_expr): Likewise.
8276
8277 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8278
8279 * util/rust-keyword-values.h (class WeakKeywords): Add new class with
8280 weak keyword constexpr.
8281
8282 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8283
8284 * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value
8285 with keyword call.
8286 * ast/rust-ast.h: Likewise.
8287 * parse/rust-parse-impl.h (Parser::parse_path_ident_segment): Likewise.
8288 (Parser::parse_macro_match_fragment): Likewise.
8289 (Parser::parse_extern_crate): Likewise.
8290 (Parser::parse_use_tree): Likewise.
8291 (Parser::parse_const_item): Likewise.
8292 (Parser::parse_literal_expr): Likewise.
8293 (Parser::parse_maybe_named_param): Likewise.
8294 (Parser::parse_pattern_no_alt): Likewise.
8295 (Parser::left_denotation): Likewise.
8296 (Parser::parse_path_in_expression_pratt): Likewise.
8297
8298 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8299
8300 * lex/rust-token.h (enum PrimitiveCoreType): Add await keyword
8301 definition.
8302
8303 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8304
8305 * lex/rust-token.h (enum PrimitiveCoreType): Change macro for
8306 underscore in token list.
8307
8308 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8309
8310 * lex/rust-token.h (enum PrimitiveCoreType): Change enum macro calls.
8311 (RS_TOKEN_KEYWORD): Remove generic token keyword macro.
8312 (RS_TOKEN_KEYWORD_2015): Introduce keywords for edition 2015.
8313 (RS_TOKEN_KEYWORD_2018): Likewise with edition 2018.
8314 * lex/rust-token.cc (RS_TOKEN_KEYWORD): Remove old macro definition.
8315 (RS_TOKEN_KEYWORD_2015): Replace with 2015 definition...
8316 (RS_TOKEN_KEYWORD_2018): ... and 2018 definition.
8317 * util/rust-keyword-values.cc (RS_TOKEN_KEYWORD): Likewise.
8318 (RS_TOKEN_KEYWORD_2015): Likewise.
8319 (RS_TOKEN_KEYWORD_2018): Likewise.
8320 * util/rust-keyword-values.h (RS_TOKEN_KEYWORD): Likewise.
8321 (RS_TOKEN_KEYWORD_2015): Likewise.
8322 (RS_TOKEN_KEYWORD_2018): Likewise.
8323
8324 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8325
8326 * lex/rust-token.h (enum PrimitiveCoreType): Change keyword suffix from
8327 tok to kw.
8328 * ast/rust-ast-collector.cc (TokenCollector::visit): Update suffix to
8329 match the new declaration.
8330 * lex/rust-lex.cc (Lexer::parse_raw_identifier): Likewise.
8331 * parse/rust-parse-impl.h (can_tok_start_type): Likewise.
8332 (Parser::parse_item): Likewise.
8333 (Parser::parse_vis_item): Likewise.
8334 (Parser::parse_extern_crate): Likewise.
8335 (Parser::parse_function): Likewise.
8336 (Parser::parse_function_qualifiers): Likewise.
8337 (Parser::parse_struct): Likewise.
8338 (Parser::parse_enum): Likewise.
8339 (Parser::parse_static_item): Likewise.
8340 (Parser::parse_trait_item): Likewise.
8341 (Parser::parse_inherent_impl_item): Likewise.
8342 (Parser::parse_trait_impl_item): Likewise.
8343 (Parser::parse_extern_block): Likewise.
8344 (Parser::parse_external_item): Likewise.
8345 (Parser::parse_stmt): Likewise.
8346 (Parser::parse_return_expr): Likewise.
8347 (Parser::parse_match_expr): Likewise.
8348 (Parser::parse_type): Likewise.
8349 (Parser::parse_for_prefixed_type): Likewise.
8350 (Parser::parse_type_no_bounds): Likewise.
8351 (Parser::parse_stmt_or_expr): Likewise.
8352 * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewie.
8353 * util/rust-token-converter.cc (convert): Likewise.
8354
8355 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8356
8357 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8358 zero field check during ast validation pass.
8359 * checks/errors/rust-ast-validation.h: Add union visit function
8360 prototype.
8361
8362 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8363
8364 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8365 ast validation pass to reject variadic arguments on regular functions.
8366
8367 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8368
8369 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add auto
8370 trait associated item check in AST validation pass.
8371 * parse/rust-parse-impl.h: Remove old error emission done during
8372 parsing pass.
8373
8374 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8375
8376 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Reject
8377 auto traits with super traits.
8378
8379 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8380
8381 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8382 check for generics on auto traits.
8383 * checks/errors/rust-ast-validation.h: Add visit function prototype.
8384
8385 2024-01-30 Arthur Cohen <[email protected]>
8386
8387 * resolve/rust-forever-stack.hxx: Remove debug log.
8388
8389 2024-01-30 Arthur Cohen <[email protected]>
8390
8391 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Format.
8392
8393 2024-01-30 Arthur Cohen <[email protected]>
8394
8395 * resolve/rust-forever-stack.h: New method.
8396 * resolve/rust-forever-stack.hxx: Likewise.
8397
8398 2024-01-30 Arthur Cohen <[email protected]>
8399
8400 * resolve/rust-forever-stack.h: New method.
8401 * resolve/rust-forever-stack.hxx: Likewise.
8402
8403 2024-01-30 Arthur Cohen <[email protected]>
8404
8405 * resolve/rust-forever-stack.hxx: Do not copy segment when
8406 dereferencing iterator in `find_starting_point`.
8407
8408 2024-01-30 Arthur Cohen <[email protected]>
8409
8410 * resolve/rust-forever-stack.h: Fix `ForeverStack::resolve_path`
8411 signature.
8412 * resolve/rust-forever-stack.hxx: Likewise.
8413 * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Use new API.
8414 (Early::visit_attributes): Likewise.
8415
8416 2024-01-30 Arthur Cohen <[email protected]>
8417
8418 * resolve/rust-forever-stack.hxx: Add specific behavior for
8419 `ForeverStack::get` when dealing with labels.
8420
8421 2024-01-30 Arthur Cohen <[email protected]>
8422
8423 * resolve/rust-forever-stack.h: Improve resolve_path API.
8424 * resolve/rust-forever-stack.hxx: Likewise and fix implementation.
8425
8426 2024-01-30 Arthur Cohen <[email protected]>
8427
8428 * resolve/rust-rib.h: Add Namespace enum.
8429
8430 2024-01-30 Arthur Cohen <[email protected]>
8431
8432 * ast/rust-ast.h: Change Path API to be more consistent.
8433 * ast/rust-path.h: Likewise.
8434 * ast/rust-ast-collector.cc (TokenCollector::visit): Use new API.
8435 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
8436 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
8437 * resolve/rust-forever-stack.hxx: Likewise.
8438
8439 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8440
8441 * parse/rust-parse-impl.h (Parser::parse_function): Early return on
8442 unrecoverable errors.
8443 (Parser::parse_trait_item): Likewise.
8444 (Parser::parse_self_param): Update return type.
8445 * parse/rust-parse.h (enum ParseSelfError): Add enumeration to describe
8446 different self parameter parsing errors.
8447
8448 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8449
8450 * parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop
8451 exit condition.
8452
8453 2024-01-30 Pierre-Emmanuel Patry <[email protected]>
8454
8455 * ast/rust-item.h (struct Visibility): Move Visibility from here...
8456 * ast/rust-ast.h (struct Visibility): ...to here.
8457 * parse/rust-parse-impl.h (Parser::parse_trait_item): Parse visibility
8458 before giving it back to the item parsing function.
8459 (Parser::parse_trait_type): Add visibility modifier.
8460 * parse/rust-parse.h (RUST_PARSE_H): Change function prototype.
8461
8462 2024-01-18 Arthur Cohen <[email protected]>
8463
8464 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
8465 Cast size_t value to unsigned long.
8466 * expand/rust-proc-macro.cc (load_macros): Likewise.
8467 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
8468
8469 2024-01-16 Owen Avery <[email protected]>
8470
8471 * hir/tree/rust-hir-pattern.h
8472 (TupleStructItems::ItemType::RANGE): Rename to...
8473 (TupleStructItems::ItemType::RANGED): ...here.
8474 (TupleStructItems::ItemType::NO_RANGE): Rename to...
8475 (TupleStructItems::ItemType::MULTIPLE): ...here.
8476 (TuplePatternItems::TuplePatternItemType): Rename to...
8477 (TuplePatternItems::ItemType): ...here.
8478 : Handle renames.
8479 * backend/rust-compile-pattern.cc: Likewise.
8480 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
8481 * checks/errors/borrowck/rust-bir-builder-pattern.h: Likewise.
8482
8483 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8484
8485 * lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Remove
8486 additional zero after empty floating point.
8487 * parse/rust-parse-impl.h (Parser::left_denotation): Handle float with
8488 empty floating point.
8489
8490 2024-01-16 Raiki Tamura <[email protected]>
8491
8492 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
8493 Fix reference to node.
8494 * backend/rust-mangle.cc (struct V0Path): Modified to accept closures.
8495 (v0_crate_path): Modified to accept closures.
8496 (v0_closure): New function to mangle closures.
8497 (v0_path): Modified to accept closures
8498 * util/rust-mapping-common.h (UNKNOWN_NODEID): Change to UINT32_MAX.
8499 (UNKNOWN_HIRID): Change to UINT32_MAX.
8500
8501 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8502
8503 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Move from here...
8504 * ast/rust-ast-visitor.h: ... to here.
8505
8506 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8507
8508 * ast/rust-ast-collector.cc (TokenCollector::visit): Move to header
8509 file.
8510 (TokenCollector::visit_items_joined_by_separator): Likewise.
8511 (TokenCollector::visit_as_line): Likewise.
8512 (TokenCollector::visit_items_as_lines): Likewise.
8513 (TokenCollector::visit_items_as_block): Likewise.
8514 * ast/rust-ast-collector.h: Add implementation.
8515
8516 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8517
8518 * ast/rust-ast-collector.cc (TokenCollector::visit): Add visitor for
8519 VariadicParam and remove Self parameter visitor from Function visit.
8520 * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_self_param): Remove
8521 function.
8522 (CfgStrip::maybe_strip_trait_method_decl): Remove self parameter visit.
8523 (CfgStrip::maybe_strip_function_params): Handle new function
8524 parameters.
8525 (CfgStrip::visit): Handle VariadicParam, SelfParam and FunctionParam.
8526 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_self_param):
8527 Remove function.
8528 (ExpandVisitor::expand_trait_method_decl): Do not visit self parameter.
8529 (ExpandVisitor::visit): Add visit for VariadicParam, FunctionParam and
8530 SelfParam.
8531 (ExpandVisitor::expand_function_params): Visit parameters instead.
8532 * expand/rust-expand-visitor.h: Update function prototypes.
8533 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Update visit
8534 with new parameters.
8535 (ResolveTraitItems::visit): Likewise.
8536 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
8537 Update visit functions with the new visitor functions for VariadicParam
8538 SelfParam and FunctionParam.
8539 * resolve/rust-early-name-resolver.h: Update function prototypes.
8540 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Update visitor
8541 according to the new function parameter structures.
8542 * ast/rust-ast-visitor.h: Update prototypes and add visitor virtual
8543 functions for SelfParam, FunctionParam and VariadicParam.
8544 * ast/rust-ast.cc (Function::Function): Move constructor in
8545 implementation instead of header.
8546 (Function::operator=): Likewise.
8547 (Function::as_string): Update function with pointer dereference.
8548 (VariadicParam::as_string): Likewise.
8549 (TraitFunctionDecl::as_string): Likewise.
8550 (TraitMethodDecl::as_string): Likewise.
8551 (FunctionParam::accept_vis): Add function for visitor.
8552 (SelfParam::accept_vis): Likewise.
8553 (VariadicParam::accept_vis): Likewise.
8554 (TraitItemFunc::TraitItemFunc): Move constructor to implementation
8555 file.
8556 (TraitItemFunc::operator=): Likewise.
8557 (TraitItemMethod::TraitItemMethod): Likewise.
8558 (TraitItemMethod::operator=): Likewise.
8559 * ast/rust-item.h (class Function): Remove self optional member.
8560 (class TraitMethodDecl): Likewise.
8561 (class TraitFunctionDecl): Likewise.
8562 (class Param): Add abstract parameter class.
8563 (class SelfParam): Inherit from Param and remove parameter common
8564 members.
8565 (class FunctionParam): Likewise.
8566 (class VariadicParam): Likewise.
8567 (struct Visibility): Move structure declaration.
8568 (class VisItem): Likewise.
8569 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8570 a self parameter check during AST validation.
8571 * checks/errors/rust-ast-validation.h: Add function prototype.
8572 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Update function
8573 constructor.
8574 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Rework
8575 function for the new parameters.
8576 (ASTLoweringBase::visit): Add visit functions for VariadicParam,
8577 FunctionParam and SelfParam.
8578 * hir/rust-ast-lower-base.h: Update function prototypes.
8579 * parse/rust-parse-impl.h (Parser::parse_function): Update function
8580 according to new function representation.
8581 (Parser::parse_function_param): Return vector of abstract param instead
8582 of FunctionParam.
8583 (Parser::parse_method): Update according to new representation.
8584 (Parser::parse_trait_item): Likewise.
8585 (Parser::parse_self_param): Error out with
8586 self pointers and prevent the lexer from eating regular function
8587 parameters. Update return type.
8588 * parse/rust-parse.h: Update function return types.
8589 * ast/rust-ast-collector.h: Add VariadicParam visit prototype.
8590 * ast/rust-ast.h (struct Visibility): Move struct declaration.
8591 (class VisItem): Likewise.
8592 * ast/rust-expr.h: Update included files.
8593 * checks/errors/rust-feature-gate.h: Add visitor functions for
8594 SelfParam, FunctionParam and VariadicParam.
8595 * expand/rust-cfg-strip.h: Update function prototypes.
8596 * expand/rust-derive.h: Likewise.
8597 * hir/rust-ast-lower-implitem.h: Handle special arguments.
8598 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
8599 * metadata/rust-export-metadata.cc (ExportContext::emit_function):
8600 Likewise.
8601 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add visitor
8602 functions.
8603 * resolve/rust-ast-resolve-base.h: Update prototypes.
8604 * resolve/rust-ast-resolve-stmt.h: Handle new parameter kind.
8605 * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
8606 * resolve/rust-default-resolver.h: Update prototype.
8607 * util/rust-attributes.cc (AttributeChecker::visit): Add visitor
8608 functions for SelfParam and VariadicParam.
8609 * util/rust-attributes.h: Add visit prototypes.
8610
8611 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8612
8613 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
8614 check for additional named argument as well as variadic argument's
8615 position.
8616 * checks/errors/rust-ast-validation.h: Add visit function prototype for
8617 external functions.
8618
8619 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8620
8621 * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Push the new
8622 trait context when visiting a trait.
8623 * ast/rust-ast-visitor.h: Add visit function prototype and TRAIT
8624 context.
8625
8626 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8627
8628 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Change
8629 reported error location to the lifetime location.
8630
8631 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8632
8633 * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check if there is
8634 a label before visit.
8635 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Emit an
8636 error when a label has a forbidden name.
8637 * checks/errors/rust-ast-validation.h: Add function prototype.
8638
8639 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8640
8641 * ast/rust-expr.h (class BreakExpr): Change Lifetime to LoopLabel.
8642 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Lower lifetime
8643 inside the label instead.
8644 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve the
8645 inner lifetime.
8646
8647 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8648
8649 * lex/rust-lex.cc (Lexer::parse_raw_identifier): Use const value.
8650 * parse/rust-parse-impl.h (Parser::parse_simple_path_segment):
8651 Likewise.
8652
8653 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8654
8655 * lex/rust-lex.cc (RS_TOKEN): Remove local map.
8656 (RS_TOKEN_KEYWORD): Likewise.
8657 (Lexer::classify_keyword): Change call to utils.
8658 * util/rust-keyword-values.cc (get_keywords): Add init function.
8659 (RS_TOKEN_KEYWORD): Call to X macro.
8660 * util/rust-keyword-values.h: Change from set to a map.
8661
8662 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8663
8664 * checks/errors/rust-ast-validation.cc (RS_TOKEN): Remove locale set.
8665 (RS_TOKEN_KEYWORD): Likewise.
8666 (ASTValidation::visit): Change keyword set call to the one from utils.
8667
8668 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8669
8670 * Make-lang.in: Add rust-keyword-values.cc to the list.
8671 * util/rust-keyword-values.cc: New file.
8672 * util/rust-keyword-values.h: New file.
8673
8674 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8675
8676 * util/rust-attribute-values.h (RUST_ATTRIBUTES_VALUE_H): Remove old
8677 header guard.
8678 (RUST_ATTRIBUTE_VALUES_H): Add new one.
8679
8680 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8681
8682 * checks/errors/rust-ast-validation.cc (RS_TOKEN): Add keyword set.
8683 (RS_TOKEN_KEYWORD): Likewise.
8684 (ASTValidation::visit): Add validation on lifetime visit.
8685 * checks/errors/rust-ast-validation.h: Add function prototype.
8686
8687 2024-01-16 Owen Avery <[email protected]>
8688
8689 * ast/rust-item.h
8690 (class Method): Remove.
8691 (Function::self_param): New.
8692 (Function::has_self_param): New.
8693 (Function::Function): Initialize self_param.
8694 (Function::operator=): Likewise.
8695 (Function::get_self_param): New.
8696 * ast/rust-ast.cc
8697 (Method::as_string): Remove.
8698 (Method::accept_vis): Remove.
8699 * ast/rust-ast-collector.cc
8700 (TokenCollector::visit):
8701 Remove AST::Method visitor, handle self_param in AST::Function visitor.
8702 * ast/rust-ast-collector.h
8703 (TokenCollector::visit): Remove AST::Method visitor.
8704 * ast/rust-ast-full-decls.h (class Method): Remove.
8705 * ast/rust-ast-visitor.h
8706 (ASTVisitor::visit): Remove AST::Method visitor.
8707 (DefaultASTVisitor::visit): Likewise.
8708 * ast/rust-ast-visitor.cc
8709 (DefaultASTVisitor::visit):
8710 Remove AST::Method visitor, handle self_param in AST::Function visitor.
8711 * checks/errors/rust-feature-gate.cc
8712 (FeatureGate::visit): Remove AST::Method visitor.
8713 * checks/errors/rust-feature-gate.h
8714 (FeatureGate::visit): Likewise..
8715 * expand/rust-cfg-strip.cc
8716 (CfgStrip::visit):
8717 Remove AST::Method visitor, handle self_param in AST::Function visitor.
8718 * expand/rust-cfg-strip.h
8719 (CfgStrip::visit): Remove AST::Method visitor.
8720 * expand/rust-derive-clone.cc
8721 (DeriveClone::clone_fn): Return AST::Function instead of AST::Method.
8722 * expand/rust-derive.h (DeriveVisitor::visit): Remove AST::Method visitor.
8723 * expand/rust-expand-visitor.cc
8724 (ExpandVisitor::visit):
8725 Remove AST::Method visitor, handle self_param in AST::Function visitor.
8726 * expand/rust-expand-visitor.h:
8727 (ExpandVisitor::visit): Remove AST::Method visitor.
8728 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
8729 * hir/rust-ast-lower-base.h (ASTLoweringBase::visit): Likewise.
8730 * hir/rust-ast-lower-implitem.h
8731 (ASTLowerImplItem::visit):
8732 Remove AST::Method visitor, handle self_param in AST::Function visitor.
8733 * parse/rust-parse-impl.h: Include optional.h.
8734 (Parser::parse_function): Adjust AST::Function construction.
8735 (Parser::parse_inherent_impl_function_or_method):
8736 Construct AST::Function instead of AST::Method,
8737 adjust AST::Function construction.
8738 (Parser::parse_trait_impl_function_or_method): Likewise.
8739 (Parser::parse_method):
8740 Return std::unique_ptr<AST::Function> instead of AST::Method.
8741 * parse/rust-parse.h
8742 (Parser::parse_method): Likewise.
8743 * resolve/rust-ast-resolve-base.cc
8744 (ResolverBase::visit): Remove AST::Method visitor.
8745 * resolve/rust-ast-resolve-base.h
8746 (ResolverBase::visit): Likewise.
8747 * resolve/rust-ast-resolve-implitem.h
8748 (ResolveToplevelImplItem::visit): Likewise.
8749 * resolve/rust-ast-resolve-item.cc
8750 (ResolveItem::visit): Remove AST::Method visitor,
8751 handle self_param in AST::Function visitor.
8752 * resolve/rust-ast-resolve-item.h
8753 (ResolveItem::visit): Remove AST::Method visitor.
8754 * resolve/rust-default-resolver.cc
8755 (DefaultResolver::visit): Remove AST::Method visitor.
8756 * resolve/rust-default-resolver.h
8757 (DefaultResolver::visit): Likewise.
8758 * resolve/rust-early-name-resolver.cc
8759 (EarlyNameResolver::visit): Remove AST::Method visitor,
8760 handle self_param in AST::Function visitor.
8761 * resolve/rust-early-name-resolver.h
8762 (EarlyNameResolver::visit): Remove AST::Method visitor.
8763 * resolve/rust-toplevel-name-resolver-2.0.cc
8764 (TopLevel::visit): Likewise.
8765 * resolve/rust-toplevel-name-resolver-2.0.h
8766 (TopLevel::visit): Likewise.
8767 * util/rust-attributes.cc
8768 (AttributeChecker::visit): Likewise.
8769 * util/rust-attributes.h
8770 (AttributeChecker::visit): Likewise.
8771
8772 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8773
8774 * parse/rust-parse-impl.h (Parser::parse_named_function_param): Add
8775 new parsing ability.
8776
8777 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8778
8779 * ast/rust-ast.cc (ExternalFunctionItem::as_string): Adapt as_string
8780 function to the new ast representation.
8781 (NamedFunctionParam::as_string): Likewise.
8782 * ast/rust-item.h: Add a function to test whether a FunctionParam has
8783 a name pattern.
8784 * expand/rust-cfg-strip.cc (CfgStrip::visit): Adapt cfg strip visitor
8785 for the new variadic arguments.
8786 * hir/rust-ast-lower-extern.h: Adapt lowering to the new variadic
8787 function representation.
8788 * metadata/rust-export-metadata.cc (ExportContext::emit_function):
8789 Change call to constructor.
8790 * parse/rust-parse-impl.h (Parser::parse_named_function_param): Change
8791 NamedFunctionParam parsing to accomodate new variadic representation.
8792 (Parser::parse_external_item): Change external item parsing to use the
8793 new NamedFunctionParam variadics.
8794 * parse/rust-parse.h: Add new parsing function prototypes.
8795 * ast/rust-ast-collector.cc (TokenCollector::visit): Rework token
8796 collection to take into account variadic parameters.
8797 * ast/rust-ast-visitor.cc: Likewise.
8798 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change function
8799 bound to avoid getting the type of a variadic parameter.
8800 * resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
8801 Likewise.
8802 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
8803 Likewise.
8804
8805 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8806
8807 * ast/rust-item.h (class NamedFunctionParam): Add variadic boolean and
8808 another constructor.
8809 * hir/rust-ast-lower-extern.h: Avoid last parameter when variadic.
8810
8811 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8812
8813 * ast/rust-item.h: Add a getter to check if a given function is
8814 variadic.
8815
8816 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8817
8818 * parse/rust-parse-impl.h (Parser::parse_function_param): Parse
8819 variadic functions.
8820
8821 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8822
8823 * ast/rust-item.h (class FunctionParam): Add some informations to
8824 function parameters in order to be able to store variadic argument as
8825 a function parameter.
8826
8827 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8828
8829 * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Adapt
8830 the call to the new visit functions.
8831 (ASTValidation::check): Launch the parent class visitor root function.
8832 * checks/errors/rust-ast-validation.h (class ASTValidation): Inherit
8833 from the contextual visitor.
8834
8835 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8836
8837 * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Add multiple
8838 context saving calls.
8839 * ast/rust-ast-visitor.h (class DefaultASTVisitor): Make visit
8840 functions virtual.
8841 (class ContextualASTVisitor): Add a stack like container for the
8842 current context chain.
8843
8844 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8845
8846 * Make-lang.in: Add the new visitor object file.
8847 * ast/rust-ast-visitor.h (class DefaultASTVisitor): Create the default
8848 visitor class.
8849 * ast/rust-ast.h: Add a new reference getter for visitor pattern.
8850 * ast/rust-ast-visitor.cc: New file.
8851
8852 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8853
8854 * ast/rust-ast.h: Add some missing mutable reference getters.
8855 * ast/rust-expr.h: Likewise.
8856 * ast/rust-item.h: Likewise.
8857 * ast/rust-path.h: Likewise.
8858
8859 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8860
8861 * ast/rust-ast-collector.cc (TokenCollector::visit): Check for presence
8862 of a type and use the default value instead of the type.
8863
8864 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8865
8866 * checks/errors/rust-ast-validation.cc (ASTValidation::check): Launch
8867 check over the whole given crate.
8868 (ASTValidation::visit): Implement visitor for some members of the ast.
8869 * checks/errors/rust-ast-validation.h: Update some prototype according
8870 to implemented visitor functions. Also add a context tracker.
8871
8872 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8873
8874 * rust-session-manager.cc (Session::compile_crate): Add call to ast
8875 validation.
8876
8877 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8878
8879 * lang.opt: Add the new compile options and update the enum values.
8880 * rust-session-manager.h (struct CompileOptions): Add the new steps to
8881 the enumeration.
8882
8883 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8884
8885 * Make-lang.in: Add the new object file the list.
8886 * checks/errors/rust-ast-validation.cc: New file.
8887 * checks/errors/rust-ast-validation.h: New file.
8888
8889 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8890
8891 * expand/rust-cfg-strip.cc (CfgStrip::visit): Add expr value check.
8892 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
8893 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
8894 Likewise.
8895
8896 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8897
8898 * ast/rust-ast.h: Move implementation from here...
8899 * ast/rust-ast.cc (SingleASTNode::SingleASTNode): ...to here.
8900 (SingleASTNode::operator=): ...and here...
8901 (SingleASTNode::accept_vis): ...and here...
8902 (SingleASTNode::is_error): ...and here...
8903 (SingleASTNode::as_string): ...also here.
8904
8905 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8906
8907 * ast/rust-ast.h: Add override specifier.
8908 * ast/rust-item.h: Likewise.
8909
8910 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8911
8912 * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::split_current_token):
8913 Add implementation for multiple token split.
8914 * expand/rust-macro-invoc-lexer.h: Add function prototype.
8915 * expand/rust-proc-macro-invoc-lexer.cc (ProcMacroInvocLexer::split_current_token):
8916 Add implementation for 2+ token split for procedural macros.
8917 * expand/rust-proc-macro-invoc-lexer.h: Add function prototype.
8918 * lex/rust-lex.cc (Lexer::split_current_token): Add function to split a
8919 token in multiple other tokens.
8920 * lex/rust-lex.h: Add function prototype for split_current_token.
8921 * parse/rust-parse-impl.h (Parser::left_denotation): Handle float tuple
8922 index identified as a float literal.
8923
8924 2024-01-16 Jakub Dupak <[email protected]>
8925
8926 * hir/rust-hir-dump.cc (Dump::visit): Remove obsolete member.
8927 * hir/tree/rust-hir-expr.h (class BorrowExpr): Remove obsolete member.
8928 * hir/tree/rust-hir.cc (BorrowExpr::as_string): Remove obsolete member.
8929
8930 2024-01-16 Jakub Dupak <[email protected]>
8931
8932 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Fix typo.
8933
8934 2024-01-16 Owen Avery <[email protected]>
8935
8936 * backend/rust-compile-expr.cc
8937 (patterns_mergeable): Remove.
8938 (struct PatternMerge): Remove.
8939 (sort_tuple_patterns): Remove.
8940 (simplify_tuple_match): Remove.
8941 (CompileExpr::visit): Modify compilation of MatchExpr.
8942 * backend/rust-compile-pattern.cc
8943 (CompilePatternCaseLabelExpr::visit): Replace with...
8944 (CompilePatternCheckExpr::visit): ...this.
8945 * backend/rust-compile-pattern.h
8946 (class CompilePatternCaseLabelExpr): Replace with...
8947 (class CompilePatternCheckExpr): ...this.
8948 * backend/rust-compile-type.cc
8949 (TyTyResolveCompile::get_implicit_enumeral_node_type):
8950 Make enumeral type equivalent to isize.
8951
8952 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8953
8954 * backend/rust-compile-base.cc (get_attributes): Add documentation for
8955 indices 3 and 4.
8956 (get_trait_name): Add documentation for index 1.
8957
8958 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8959
8960 * Make-lang.in: Add gcc/rust/backend/rust-compile-proc-macro.cc to the
8961 list of file to compile.
8962 * backend/rust-compile.cc (attribute_array): Move to
8963 rust-compile-proc-macro.cc
8964 (derive_proc_macro): Likewise.
8965 (bang_proc_macro): Likewise.
8966 (attribute_proc_macro): Likewise.
8967 (proc_macro_payload): Likewise.
8968 (proc_macro): Likewise.
8969 (proc_macro_buffer): Likewise.
8970 (entrypoint): Likewise.
8971 (proc_macro_array): Likewise.
8972 (CompileCrate::add_proc_macro_symbols): Likewise.
8973 * backend/rust-compile-proc-macro.cc: New file.
8974
8975 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8976
8977 * backend/rust-compile.cc (proc_macro_buffer): Update type builder with
8978 array length information.
8979 (proc_macro_array): Update type initializer with array length
8980 information.
8981
8982 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
8983
8984 * backend/rust-compile.cc (build_attribute_array): Renamed from...
8985 (attribute_array): ...to attribute array.
8986 (build_derive_proc_macro): Likewise from...
8987 (derive_proc_macro): ... to derive_proc_macro.
8988 (build_bang_proc_macro): Likewise from...
8989 (bang_proc_macro): ...to bang_proc_macro.
8990 (build_attribute_proc_macro): Likewise from...
8991 (attribute_proc_macro): ... to attribute_proc_macro.
8992 (build_proc_macro_payload): Likewise from...
8993 (proc_macro_payload): to proc_macro_payload.
8994 (build_proc_macro): Likewise from...
8995 (proc_macro): ...to proc_macro.
8996 (build_proc_macro_buffer): Likewise from...
8997 (proc_macro_buffer): ... to proc_macro_buffer.
8998 (build_entrypoint): Likewise from...
8999 (entrypoint): ...to entrypoint.
9000 (init_derive_proc_macro): Renamed to it's shorter counterpart.
9001 (init_attribute_proc_macro): Likewise.
9002 (init_bang_proc_macro): Likewise.
9003 (init_proc_macro): Likewise.
9004 (initialize_proc_macro_array): Likewise.
9005 (proc_macro_array): Likewise.
9006 (CompileCrate::add_proc_macro_symbols): Update function calls.
9007
9008 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9009
9010 * backend/rust-compile-base.h: Make static function address_expression
9011 public.
9012 * backend/rust-compile.cc (CompileCrate::add_proc_macro_symbols): Add
9013 new global variable in export function.
9014 (build_bang_proc_macro): Add a function to build the bang proc macro
9015 structure type.
9016 (build_proc_macro): Add a function to build the proc macro structure
9017 type.
9018 (build_proc_macro_payload): Add a function to build the proc macro
9019 union used in proc macro structures.
9020 (init_derive_proc_macro): Add a function to initialize custom derive
9021 proc macros.
9022 (init_attribute_proc_macro): Add a function to initialize attribute
9023 proc macros.
9024 (init_bang_proc_macro): Add a function to initialize bang proc macros.
9025 (init_proc_macro): Add a function to initialize proc macro structures.
9026 (initialize_proc_macro_array): Add a function to initialize the proc
9027 macro buffer array.
9028 (CompileCrate::add_proc_macro_symbols): Add call to the new functions
9029 to correctly initialize proc macros as well as their entrypoint.
9030
9031 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9032
9033 * expand/rust-proc-macro.cc (CustomDeriveProcMacro::CustomDeriveProcMacro):
9034 Remove constant string declaration.
9035 (load_macros_array): Add call to the new generation function.
9036 (generate_proc_macro_decls_symbol): Add a new function to generate the
9037 entrypoint symbol name from the stable crate id.
9038 (PROC_MACRO_DECLS_FMT_ARGS):
9039 New macro to keep formats arguments in sync between each call.
9040 * expand/rust-proc-macro.h (generate_proc_macro_decls_symbol): Add
9041 function prototype.
9042 * rust-system.h: Include <iomanip>.
9043
9044 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9045
9046 * backend/rust-compile.cc (build_attribute_array): Add a function to
9047 build the attribute array type.
9048 (build_derive_proc_macro): Add a function to build the derive proc
9049 macro type.
9050 (build_bang_proc_macro): Add a function to build the bang proc macro
9051 type.
9052 (build_attribute_proc_macro): Add a function to build the attribute
9053 proc macro type.
9054 (build_proc_macro): Add a function to build the proc macro tagged union
9055 type.
9056 (build_proc_macro_buffer): Add a function to build the proc macro
9057 buffer type.
9058 (build_entrypoint): Add a function to build the proc macro entrypoint
9059 type.
9060 * backend/rust-compile.h: Add function prototype.
9061
9062 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9063
9064 * backend/rust-compile-context.h: Add getters.
9065
9066 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9067
9068 * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
9069 Make the function non static in order to be able to access the
9070 compile context. Also add the whole proc macro infomrmation
9071 collection.
9072 (get_attributes): Add a function to retrieve the different
9073 attributes from a derive procedural macro definition attribute.
9074 (get_trait_name): Add a function to retrieve the trait name from
9075 a derive procedural macro definition attribute.
9076 * backend/rust-compile-base.h: Add function prototypes.
9077
9078 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9079
9080 * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
9081 Reformat uncorrectly formatted comments.
9082
9083 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9084
9085 * backend/rust-compile-context.h (struct CustomDeriveInfo): Add
9086 new derive procedural macro metadata information holder for
9087 mappings.
9088
9089 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9090
9091 * ast/rust-ast.h: Add const getter.
9092
9093 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9094
9095 * backend/rust-compile-base.cc (handle_proc_macro_common): Add
9096 new attribute "gccrs_proc_macro" to all procedural macro
9097 functions.
9098 (get_abi): Add a function to retrieve the correct ABI depending
9099 on wether the function is a proc macro or not.
9100
9101 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9102
9103 * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
9104 Add proc macro handlers dispatch.
9105 (handle_proc_macro_common): Add a function for common behavior
9106 between all kinds of proc macros.
9107 * backend/rust-compile-base.h: Add function prototypes.
9108
9109 2024-01-16 Jakub Dupak <[email protected]>
9110
9111 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop): Move.
9112 (ExprStmtBuilder::get_label_ctx): Move.
9113 (ExprStmtBuilder::get_unnamed_loop_ctx): Moved.
9114 (ExprStmtBuilder::visit): BIR improvements.
9115 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Refactor.
9116 * checks/errors/borrowck/rust-bir-builder-internal.h (class LifetimeResolver):
9117 Refactor.
9118 (struct BuilderContext): Move.Refactor.
9119 (optional_from_ptr): Map on null ptr.
9120 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h (class LazyBooleanExprBuilder):
9121 Refactor.
9122 * checks/errors/borrowck/rust-bir-builder-pattern.h: Refactor.
9123 * checks/errors/borrowck/rust-bir-builder-struct.h (class StructBuilder): Refactor.
9124 * checks/errors/borrowck/rust-bir-builder.h: Refactor.
9125 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Refactor.
9126 (Dump::visit): Refactor.
9127 (Dump::visit_place): Refactor.
9128 (Dump::visit_move_place): Refactor.
9129 (Dump::visit_lifetime): Refactor.
9130 * checks/errors/borrowck/rust-bir-dump.h: Refactor.
9131 * checks/errors/borrowck/rust-bir-place.h: Refactor.
9132
9133 2024-01-16 Jakub Dupak <[email protected]>
9134
9135 * checks/errors/borrowck/dev-notes.md: New file.
9136
9137 2024-01-16 Jakub Dupak <[email protected]>
9138
9139 * checks/errors/borrowck/bir-design-notes.md: New file.
9140
9141 2024-01-16 Jakub Dupak <[email protected]>
9142
9143 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Use goto.
9144 * checks/errors/borrowck/rust-bir-builder-internal.h: Explicit goto.
9145 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Explicit goto.
9146
9147 2024-01-16 Jakub Dupak <[email protected]>
9148
9149 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Continue.
9150 (ExprStmtBuilder::setup_loop): Continue.
9151
9152 2024-01-16 Jakub Dupak <[email protected]>
9153
9154 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Detech infinite loops.
9155
9156 2024-01-16 Jakub Dupak <[email protected]>
9157
9158 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Push ctx.
9159 (ExprStmtBuilder::setup_loop): Common loop infractructure setup.
9160 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Loop ctx.
9161 * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext): Loop ctx.
9162
9163 2024-01-16 Jakub Dupak <[email protected]>
9164
9165 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Improve jumps dump.
9166 (Dump::visit): Improve jumps dump.
9167 * checks/errors/borrowck/rust-bir-dump.h (class Dump): Improve jumps dump.
9168
9169 2024-01-16 Jakub Dupak <[email protected]>
9170
9171 * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Simplify cfg logic.
9172 (Dump::go): Run simplify cfg.
9173 * checks/errors/borrowck/rust-bir-dump.h: Option to simplify cfg.
9174
9175 2024-01-16 Jakub Dupak <[email protected]>
9176
9177 * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Use new print.
9178 (print_comma_separated): Comma separation print.
9179 (Dump::visit): Use new print.
9180
9181 2024-01-16 Jakub Dupak <[email protected]>
9182
9183 * Make-lang.in: Build BIR dump.
9184 * checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Cross-platform mkdir.
9185 (dump_function_bir): Save dump to file.
9186 (BorrowChecker::go): Run dump during borrowck.
9187 * checks/errors/borrowck/rust-bir-dump.cc: New file.
9188 * checks/errors/borrowck/rust-bir-dump.h: New file.
9189
9190 2024-01-16 Jakub Dupak <[email protected]>
9191
9192 * Make-lang.in: Compile BIR expr visitor.
9193 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Use BIR builder.
9194 * rust-session-manager.cc (Session::compile_crate): Run borrow checker.
9195 * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc: New file.
9196 * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: New file.
9197 * checks/errors/borrowck/rust-bir-builder-internal.h: New file.
9198 * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: New file.
9199 * checks/errors/borrowck/rust-bir-builder-pattern.h: New file.
9200 * checks/errors/borrowck/rust-bir-builder-struct.h: New file.
9201 * checks/errors/borrowck/rust-bir-builder.h: New file.
9202
9203 2024-01-16 Jakub Dupak <[email protected]>
9204
9205 * checks/errors/borrowck/rust-borrow-checker.cc: Include to compile new code.
9206 * checks/errors/borrowck/rust-bir-place.h: New file.
9207 * checks/errors/borrowck/rust-bir-visitor.h: New file.
9208 * checks/errors/borrowck/rust-bir.h: New file.
9209
9210 2024-01-16 Jakub Dupak <[email protected]>
9211
9212 * lang.opt: CLI flag.
9213 * rust-session-manager.cc (Session::compile_crate): Guard execution.
9214
9215 2024-01-16 Jakub Dupak <[email protected]>
9216
9217 * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::BorrowChecker): Opt dump.
9218 (BorrowChecker::go): Opt dump.
9219 * checks/errors/borrowck/rust-borrow-checker.h (class BorrowChecker): Opt dump.
9220 * lang.opt: Add compile until borrowcheck.
9221 * rust-session-manager.cc (Session::enable_dump): Add BIR.
9222 (Session::compile_crate): Handle new options.
9223 * rust-session-manager.h (struct CompileOptions): Add BIR.
9224
9225 2024-01-16 Jakub Dupak <[email protected]>
9226
9227 * Make-lang.in: Build borrowck.
9228 * checks/errors/borrowck/rust-borrow-checker.cc: New file.
9229 * checks/errors/borrowck/rust-borrow-checker.h: New file.
9230 * checks/errors/borrowck/rust-function-collector.h: New file.
9231
9232 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9233
9234 * ast/rust-pattern.h: Add override modifier to overriding methods.
9235
9236 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9237
9238 * ast/rust-item.h: Add a new constructor for const with no value
9239 expression.
9240 * parse/rust-parse-impl.h (Parser::parse_const_item): Allow const with
9241 no expression value.
9242
9243 2024-01-16 Jakub Dupak <[email protected]>
9244
9245 * hir/tree/rust-hir-path.h: Avoid copy in getter.
9246
9247 2024-01-16 Jakub Dupak <[email protected]>
9248
9249 * backend/rust-compile-expr.cc (CompileExpr::visit): Rename method.
9250 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Rename method.
9251 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Rename method.
9252 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Rename method.
9253 * hir/rust-hir-dump.cc (Dump::visit): Rename method.
9254 * hir/tree/rust-hir-expr.h: Rename method.
9255 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Rename method.
9256 * typecheck/rust-tyty.h: Rename method.
9257
9258 2024-01-16 Jakub Dupak <[email protected]>
9259
9260 * backend/rust-compile-base.cc: Rename method.
9261 * backend/rust-compile-expr.cc (sort_tuple_patterns): Rename method.
9262 * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Rename method.
9263 (CompilePatternBindings::visit): Rename method.
9264 (CompilePatternLet::visit): Rename method.
9265 * backend/rust-compile-stmt.cc (CompileStmt::visit): Rename method.
9266 * backend/rust-compile-var-decl.h: Rename method.
9267 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate): Rename method.
9268 * hir/rust-hir-dump.cc (Dump::visit): Rename method.
9269 * hir/tree/rust-hir-path.h: Rename method.
9270 * hir/tree/rust-hir-pattern.h: Rename method.
9271 * hir/tree/rust-hir.h: Rename method.
9272 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::Resolve): Rename method.
9273 (TypeCheckPattern::visit): Rename method.
9274 (ClosureParamInfer::visit): Rename method.
9275 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Rename method.
9276 * util/rust-hir-map.cc (Mappings::insert_hir_pattern): Rename method.
9277
9278 2024-01-16 Jakub Dupak <[email protected]>
9279
9280 * hir/tree/rust-hir-expr.h: Add getter for name.
9281
9282 2024-01-16 Jakub Dupak <[email protected]>
9283
9284 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Implement for tuple pat.
9285 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Implement for tupple pat.
9286
9287 2024-01-16 Jakub Dupak <[email protected]>
9288
9289 * hir/tree/rust-hir-path.h: Avoid copy in getter.
9290 * hir/tree/rust-hir-pattern.h: Avoid copy in getter.
9291 * hir/tree/rust-hir.h: Avoid copy in getter.
9292
9293 2024-01-16 Owen Avery <[email protected]>
9294
9295 * resolve/rust-ast-resolve-implitem.h
9296 (ResolveToplevelImplItem::go): Take AssociatedItem as parameter.
9297 (ResolveTopLevelTraitItems::go): Likewise.
9298 * resolve/rust-ast-resolve-item.cc
9299 (ResolveTraitItems::go): Likewise.
9300 (ResolveItem::resolve_impl_item): Likewise.
9301 (ResolveImplItems::go): Likewise.
9302 * resolve/rust-ast-resolve-item.h
9303 (ResolveTraitItems::go): Likewise.
9304 (ResolveItem::resolve_impl_item): Likewise.
9305 (ResolveImplItems::go): Likewise.
9306
9307 2024-01-16 Owen Avery <[email protected]>
9308
9309 * hir/rust-ast-lower-implitem.h
9310 (ASTLoweringImplItem::translate): Take AssociatedItem as parameter.
9311 (ASTLoweringTraitItem::translate): Likewise.
9312
9313 2024-01-16 Jakub Dupak <[email protected]>
9314
9315 * backend/rust-compile-expr.cc (CompileExpr::visit): Bail on labelled block.
9316
9317 2024-01-16 Jakub Dupak <[email protected]>
9318
9319 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add loop ctx.
9320
9321 2024-01-16 Jakub Dupak <[email protected]>
9322
9323 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve using loop logic.
9324
9325 2024-01-16 Jakub Dupak <[email protected]>
9326
9327 * hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Call loop lowering and add it to constr.
9328 * hir/tree/rust-hir-expr.h (class LoopLabel): Move before BlockExpr and add to BlockExpr.
9329
9330 2024-01-16 Jakub Dupak <[email protected]>
9331
9332 * ast/rust-ast-builder.cc (AstBuilder::block): Add label arg to constructor call.
9333 * ast/rust-expr.h (class LoopLabel): Move before BlockExpr.
9334 (class BlockExpr): Add LoopLabel member.
9335 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Add label arg to constructor call.
9336 * parse/rust-parse-impl.h (Parser::parse_block_expr): Add label parameter.
9337 (Parser::parse_labelled_loop_expr): Add label arg to constructor call.
9338 * parse/rust-parse.h: Add label arg to constructor call.
9339
9340 2024-01-16 Owen Avery <[email protected]>
9341
9342 * ast/rust-ast.h
9343 (class AssociatedItem):
9344 New, based on TraitItem, InherentImplItem, and TraitImplItem classes.
9345 (class TraitItem): Inherit from AssociatedItem.
9346 (class InherentImplItem): Likewise.
9347 (class TraitImplItem): Likewise.
9348 * ast/rust-item.h
9349 (class Method): Update cloning functions.
9350 (class Function): Likewise.
9351 (class TypeAlias): Likewise.
9352 (class ConstantItem): Likewise.
9353 (class TraitItemFunc): Likewise.
9354 (class TraitItemMethod): Likewise.
9355 (class TraitItemConst): Likewise.
9356 (class TraitItemType): Likewise.
9357 * ast/rust-macro.h
9358 (class MacroInvocation): Likewise.
9359
9360 2024-01-16 Raiki Tamura <[email protected]>
9361
9362 * backend/rust-mangle.cc (v0_identifier): Fix broken encoding.
9363 (v0_scope_path): Modify paramter.
9364 (v0_path): Fix namespace for modules.
9365
9366 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9367
9368 * parse/rust-parse-impl.h (Parser::parse_closure_expr_pratt): Fix
9369 closure parsing function to handle consecutive parameter lists.
9370
9371 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9372
9373 * ast/rust-macro.h: Add PATH fragment to follow set restrictions.
9374
9375 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9376
9377 * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Add a function
9378 that checks tokens given by the lexer represents an accurate macro
9379 definition. This will reduce code duplication.
9380 (Parser::parse_item): Replace condition with call to new checking
9381 function.
9382 (Parser::parse_stmt): Likewise.
9383 * parse/rust-parse.h: Add function prototype for is_macro_rules_def.
9384
9385 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9386
9387 * parse/rust-parse-impl.h (Parser::parse_expr): Fix range from expr.
9388
9389 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9390
9391 * parse/rust-parse-impl.h (Parser::parse_item): Relax constraints
9392 around default identifier at item scope to accept "default" macros.
9393
9394 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9395
9396 * parse/rust-parse-impl.h (Parser::parse_path_expr_segment): Accept
9397 left shift tokens in order to let generic parsing function split the
9398 token.
9399
9400 2024-01-16 Owen Avery <[email protected]>
9401
9402 * ast/rust-ast.h
9403 (Pattern::get_pattern_node_id): Rename to...
9404 (Pattern::get_node_id): ...here.
9405 * ast/rust-macro.h
9406 (MacroInvocation::get_pattern_node_id): Rename to...
9407 (MacroInvocation::get_node_id): ...here.
9408 * ast/rust-path.h
9409 (PathInExpression::get_pattern_node_id): Remove.
9410 (QualifiedPathInExpression::get_pattern_node_id): Remove.
9411 * ast/rust-pattern.h
9412 (LiteralPattern::get_pattern_node_id): Remove.
9413 (IdentifierPattern::get_pattern_node_id): Remove.
9414 (WildcardPattern::get_pattern_node_id): Remove.
9415 (RestPattern::get_pattern_node_id): Rename to...
9416 (RestPattern::get_node_id): ...here.
9417 (RangePattern::get_pattern_node_id): Remove.
9418 (ReferencePattern::get_pattern_node_id): Remove.
9419 (StructPattern::get_pattern_node_id): Remove.
9420 (TupleStructPattern::get_pattern_node_id): Remove.
9421 (TuplePattern::get_pattern_node_id): Remove.
9422 (GroupedPattern::get_pattern_node_id): Remove.
9423 (SlicePattern::get_pattern_node_id): Remove.
9424 (AltPattern::get_pattern_node_id): Remove.
9425 * resolve/rust-early-name-resolver.cc
9426 (EarlyNameResolver::visit):
9427 Use get_node_id instead of get_pattern_node_id.
9428
9429 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9430
9431 * parse/rust-parse-impl.h (Parser::parse_expr): Add comma delimiter.
9432
9433 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9434
9435 * parse/rust-parse-impl.h (Parser::parse_visibility): Relax constraints
9436 over public visibility return condition in order to accept pub unit
9437 types.
9438
9439 2024-01-16 Jakub Dupak <[email protected]>
9440
9441 * typecheck/rust-tyty.cc (BaseType::is_unit): Refactor.
9442 (BaseType::satisfies_bound): Refactor.
9443 (BaseType::get_root): Refactor.
9444 (BaseType::destructure): Refactor.
9445 (BaseType::monomorphized_clone): Refactor.
9446 (BaseType::is_concrete): Refactor.
9447 (InferType::InferType): Refactor.
9448 (InferType::clone): Refactor.
9449 (InferType::apply_primitive_type_hint): Refactor.
9450 (StructFieldType::is_equal): Refactor.
9451 (ADTType::is_equal): Refactor.
9452 (handle_substitions): Refactor.
9453 (ADTType::handle_substitions): Refactor.
9454 (TupleType::TupleType): Refactor.
9455 (TupleType::is_equal): Refactor.
9456 (TupleType::handle_substitions): Refactor.
9457
9458 2024-01-16 Jakub Dupak <[email protected]>
9459
9460 * typecheck/rust-tyty.cc (InferType::InferType): Use static constant for kind information.
9461 (ErrorType::ErrorType): Use static constant for kind information.
9462 (TupleType::TupleType): Use static constant for kind information.
9463 (BoolType::BoolType): Use static constant for kind information.
9464 (IntType::IntType): Use static constant for kind information.
9465 (UintType::UintType): Use static constant for kind information.
9466 (FloatType::FloatType): Use static constant for kind information.
9467 (USizeType::USizeType): Use static constant for kind information.
9468 (ISizeType::ISizeType): Use static constant for kind information.
9469 (CharType::CharType): Use static constant for kind information.
9470 (ReferenceType::ReferenceType): Use static constant for kind information.
9471 (PointerType::PointerType): Use static constant for kind information.
9472 (ParamType::ParamType): Use static constant for kind information.
9473 (StrType::StrType): Use static constant for kind information.
9474 (NeverType::NeverType): Use static constant for kind information.
9475 (PlaceholderType::PlaceholderType): Use static constant for kind information.
9476 * typecheck/rust-tyty.h: Add static kind information to all TyTy classes.
9477 Create safe cast and check methods.
9478
9479 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9480
9481 * parse/rust-parse-impl.h (Parser::parse_type_param_bound): Add missing
9482 case for lifetime switch.
9483
9484 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9485
9486 * lex/rust-token.cc (Token::as_string): Update function to output scope
9487 resolution tokens correctly.
9488 * parse/rust-parse-impl.h (Parser::parse_generic_param): Change call to
9489 as_string.
9490
9491 2024-01-16 Raiki Tamura <[email protected]>
9492
9493 * backend/rust-compile-context.h: Modify declaration.
9494 * backend/rust-mangle.cc (struct V0Path): New struct.
9495 (v0_path): New function.
9496 (legacy_mangle_name): Take Context as argument.
9497 (v0_numeric_prefix): Fix type strings.
9498 (v0_complex_type_prefix): New function.
9499 (v0_add_integer_62): Deleted
9500 (v0_integer_62): New function.
9501 (v0_add_opt_integer_62): Deleted.
9502 (v0_opt_integer_62): New function.
9503 (v0_add_disambiguator): Deleted.
9504 (v0_disambiguator): New function.
9505 (v0_type_prefix): Support more types.
9506 (v0_generic_args): New function.
9507 (v0_add_identifier): Deleted.
9508 (v0_identifier): New function.
9509 (v0_type_path): New function.
9510 (v0_function_path): New function.
9511 (v0_scope_path): New function.
9512 (v0_crate_path): New function.
9513 (v0_inherent_or_trait_impl_path): New function.
9514 (v0_mangle_item): Use v0_path.
9515 (Mangler::mangle_item): Take Context as argument.
9516 * backend/rust-mangle.h (class Context): Add forward declaration.
9517 * hir/tree/rust-hir-item.h: Fix include.
9518
9519 2024-01-16 Owen Avery <[email protected]>
9520
9521 * hir/tree/rust-hir-pattern.h
9522 (TupleStructItems::clone_tuple_struct_items_impl): Rename to...
9523 (TupleStructItems::clone_tuple_items_impl): ...here.
9524 (TupleStructItemsNoRange::clone_tuple_struct_items_impl): Rename to...
9525 (TupleStructItemsNoRange::clone_tuple_items_impl): ...here.
9526 (TupleStructItemsRange::clone_tuple_struct_items_impl): Rename to...
9527 (TupleStructItemsRange::clone_tuple_items_impl): ...here.
9528 (TuplePatternItems::clone_tuple_pattern_items_impl): Rename to...
9529 (TuplePatternItems::clone_tuple_items_impl): ...here.
9530 (TuplePatternItemsMultiple::clone_tuple_pattern_items_impl): Rename to...
9531 (TuplePatternItemsMultiple::clone_tuple_items_impl): ...here.
9532 (TuplePatternItemsRanged::clone_tuple_pattern_items_impl): Rename to...
9533 (TuplePatternItemsRanged::clone_tuple_items_impl): ...here.
9534
9535 2024-01-16 Owen Avery <[email protected]>
9536
9537 * hir/tree/rust-hir-pattern.h
9538 (TuplePatternItems::get_pattern_type): Rename to...
9539 (TuplePatternItems::get_item_type): ...here.
9540 (TuplePatternItemsMultiple::get_pattern_type): Rename to...
9541 (TuplePatternItemsMultiple::get_item_type): ...here.
9542 (TuplePatternItemsRanged::get_pattern_type): Rename to...
9543 (TuplePatternItemsRanged::get_item_type): ...here.
9544 * backend/rust-compile-expr.cc: Adjust calls to renamed methods.
9545 * backend/rust-compile-pattern.cc: Likewise.
9546 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
9547
9548 2024-01-16 Marc Poulhiès <[email protected]>
9549
9550 * backend/rust-compile-expr.cc (CompileExpr::visit): Merge 2 if clauses.
9551 * backend/rust-compile-extern.h: Fix typo in comment.
9552
9553 2024-01-16 Jakub Dupak <[email protected]>
9554
9555 * parse/rust-parse-impl.h: Add missing token consumption
9556
9557 2024-01-16 Mohammed Rizan Farooqui <[email protected]>
9558
9559 * expand/rust-macro-builtins.cc (MacroBuiltin::include_str_handler): Comment removed
9560 (MacroBuiltin::env_handler): Comment removed
9561 (MacroBuiltin::cfg_handler): Comment removed
9562 (MacroBuiltin::line_handler): Comment removed
9563
9564 2024-01-16 Jakub Dupak <[email protected]>
9565
9566 * backend/rust-compile.cc (HIRCompileBase::coercion_site1): Fix wrong cast
9567
9568 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9569
9570 * rust-session-manager.cc (Session::expansion): Add early break on
9571 error.
9572
9573 2024-01-16 Raiki Tamura <[email protected]>
9574
9575 * util/rust-canonical-path.h: Add new segment kind for inherent impl.
9576 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Use it.
9577 * resolve/rust-ast-resolve-toplevel.h: Use it.
9578
9579 2024-01-16 Owen Avery <[email protected]>
9580
9581 * ast/rust-expr.h: Fix spelling of "doesn't".
9582 * backend/rust-compile-expr.cc: Fix spelling of "accessors".
9583 * backend/rust-compile-implitem.h: Fix spelling of "normal".
9584 * backend/rust-constexpr.cc: Fix spelling of "actual".
9585
9586 2024-01-16 Marc Poulhiès <[email protected]>
9587
9588 * hir/rust-hir-dump.cc (Dump::debug): New.
9589 (debug): New.
9590 * hir/rust-hir-dump.h (debug): New.
9591
9592 2024-01-16 Philip Herron <[email protected]>
9593
9594 * Make-lang.in: fixup formatting
9595 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): remove old check
9596 * rust-session-manager.cc (Session::compile_crate): call new lint
9597 * resolve/rust-ast-verify-assignee.h: Removed.
9598 * checks/errors/rust-readonly-check.cc: New file.
9599 * checks/errors/rust-readonly-check.h: New file.
9600
9601 2024-01-16 Muhammad Mahad <[email protected]>
9602
9603 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
9604 Added ErrorCode & more fixit hints.
9605
9606 2024-01-16 Philip Herron <[email protected]>
9607
9608 * backend/rust-compile-block.h: remove HIR::ForLoopExpr
9609 * backend/rust-compile-expr.h: likewise
9610 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): likewise
9611 * checks/errors/privacy/rust-privacy-reporter.h: likewise
9612 * checks/errors/rust-const-checker.cc (ConstChecker::visit): likewise
9613 * checks/errors/rust-const-checker.h: likewise
9614 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): likewise
9615 * checks/errors/rust-unsafe-checker.h: likewise
9616 * checks/lints/rust-lint-marklive.h: likewise
9617 * hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): likewise
9618 * hir/rust-hir-dump.cc (Dump::visit): likewise
9619 * hir/rust-hir-dump.h: likewise
9620 * hir/tree/rust-hir-expr.h (class ForLoopExpr): likewise
9621 * hir/tree/rust-hir-full-decls.h (class ForLoopExpr): likewise
9622 * hir/tree/rust-hir-visitor.h: likewise
9623 * hir/tree/rust-hir.cc (ForLoopExpr::as_string): likewise
9624 (ForLoopExpr::accept_vis): likewise
9625 * typecheck/rust-hir-type-check-expr.h: likewise
9626
9627 2024-01-16 Marc Poulhiès <[email protected]>
9628
9629 * backend/rust-compile-expr.cc (CompileExpr::visit): Fix typo in varIadic.
9630 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
9631 * rust-backend.h (function_type_varadic): Rename into ...
9632 (function_type_variadic): ... this.
9633 * rust-gcc.cc (function_type_varadic): Rename into ...
9634 (function_type_variadic): ... this.
9635 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
9636 * typecheck/rust-tyty.h (is_varadic): Renamed into ...
9637 (is_variadic): ... this.
9638
9639 2024-01-16 Marc Poulhiès <[email protected]>
9640
9641 * backend/rust-compile-base.cc (HIRCompileBase::compile_function):
9642 Fix typo in substitutions.
9643 (HIRCompileBase::resolve_method_address): Likewise.
9644 * backend/rust-compile-extern.h (CompileExternItem::visit):
9645 Likewise.
9646 * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
9647 Likewise.
9648 * backend/rust-compile-intrinsic.cc (maybe_override_ctx):
9649 Likewise.
9650 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
9651 * backend/rust-compile-resolve-path.cc
9652 (HIRCompileBase::query_compile): Likewise.
9653 * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion):
9654 Likewise.
9655 * typecheck/rust-hir-type-check-item.cc
9656 (TypeCheckItem::ResolveImplBlockSelfWithInference): Likewise.
9657 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit):
9658 Likewise.
9659 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
9660 Likewise.
9661 * typecheck/rust-tyty.cc (BaseType::has_subsititions_defined):
9662 Renamed into ...
9663 (BaseType::has_substitutions_defined): ... this.
9664 (ADTType::is_equal): Fix typo in substitutions.
9665 (handle_substitions): Likewise.
9666 (FnType::is_equal): Likewise.
9667 (FnType::handle_substitions): Likewise.
9668 * typecheck/rust-tyty.h (has_subsititions_defined): Renamed into
9669 ...
9670 (has_substitutions_defined): ... this.
9671
9672 2024-01-16 Owen Avery <[email protected]>
9673
9674 * backend/rust-compile-intrinsic.cc
9675 (get_identifier): Add declaration.
9676 (assume_handler): New.
9677 (generic_intrinsics): Add assume_handler entry.
9678
9679 2024-01-16 Owen Avery <[email protected]>
9680
9681 * rust-gcc.cc
9682 (Backend::wchar_type): Store static wchar tree.
9683
9684 2024-01-16 Owen Avery <[email protected]>
9685
9686 * rust-backend.h
9687 (complex_type): Remove.
9688 (complex_constant_expression): Remove.
9689 (real_part_expression): Remove.
9690 (imag_part_expression): Remove.
9691 (complex_expression): Remove.
9692 * rust-gcc.cc
9693 (complex_type): Remove.
9694 (complex_constant_expression): Remove.
9695 (real_part_expression): Remove.
9696 (imag_part_expression): Remove.
9697 (complex_expression): Remove.
9698
9699 2024-01-16 Owen Avery <[email protected]>
9700
9701 * rust-gcc.cc
9702 (namespace Backend):
9703 Use namespace definition instead of qualified names.
9704
9705 2024-01-16 liushuyu <[email protected]>
9706
9707 * backend/rust-compile-intrinsic.cc: add `copy`
9708 intrinsics and make `copy_nonoverlapping` handler more generic
9709
9710 2024-01-16 liushuyu <[email protected]>
9711
9712 * backend/rust-builtins.cc: add `expect` builtin definition.
9713 * backend/rust-compile-intrinsic.cc: add `likely` and `unlikely`
9714 intrinsics handler.
9715
9716 2024-01-16 Owen Avery <[email protected]>
9717
9718 * rust_error_codes.def: Moved to...
9719 * rust-error-codes.def: ...here...
9720 * rust-diagnostics.h: ...and update references.
9721
9722 2024-01-16 Guillaume Gomez <[email protected]>
9723
9724 * backend/rust-compile-intrinsic.cc: Simplify `make_unsigned_long_tree`
9725 * rust-backend.h: Remove `integer_constant_expression`
9726 * rust-gcc.cc: Remove `integer_constant_expression`
9727
9728 2024-01-16 Dave Evans <[email protected]>
9729
9730 * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit):
9731 Add AltPattern visitor function
9732 * backend/rust-compile-pattern.h:
9733 Update CompilePatternCaseLabelExpr::visit(AltPattern&).
9734 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
9735 Update AltPattern visitor
9736
9737 2024-01-16 Guillaume Gomez <[email protected]>
9738
9739 * backend/rust-compile-intrinsic.cc: Remove unused argument
9740
9741 2024-01-16 Muhammad Mahad <[email protected]>
9742
9743 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
9744 Added new error message, rich location and error code.
9745
9746 2024-01-16 Owen Avery <[email protected]>
9747
9748 * rust-backend.h
9749 (class Backend): Convert to ...
9750 (namespace Backend): ... namespace.
9751 * rust-gcc.cc
9752 (Backend::Backend): Rename to ...
9753 (Backend::init): ... here.
9754 (rust_get_backend): Remove.
9755 * rust-session-manager.cc
9756 (rust_get_backend): Remove.
9757 (Session::init): Use Backend::init instead of rust_get_backend.
9758 (Session::compile_crate):
9759 Initialize Context without pointer to Backend.
9760 * rust-session-manager.h
9761 (Session::backend): Remove.
9762 * backend/rust-compile-context.cc
9763 (Context::Context): Remove pointer to Backend.
9764 * backend/rust-compile-context.h
9765 (class Context): Remove pointer to Backend, update function calls.
9766 * backend/rust-compile-base.cc: Update function calls.
9767 * backend/rust-compile-block.cc: Likewise.
9768 * backend/rust-compile-expr.cc: Likewise.
9769 * backend/rust-compile-extern.h: Likewise.
9770 * backend/rust-compile-fnparam.cc: Likewise.
9771 * backend/rust-compile-intrinsic.cc: Likewise.
9772 * backend/rust-compile-item.cc: Likewise.
9773 * backend/rust-compile-pattern.cc: Likewise.
9774 * backend/rust-compile-resolve-path.cc: Likewise.
9775 * backend/rust-compile-type.cc: Likewise.
9776 * backend/rust-compile-var-decl.h: Likewise.
9777 * backend/rust-compile.cc: Likewise.
9778
9779 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9780
9781 * ast/rust-ast.cc (Attribute::check_cfg_predicate): Change raw
9782 string to constexpr call.
9783 (Attribute::separate_cfg_attrs): Likewise.
9784 * backend/rust-compile-base.cc (should_mangle_item): Likewise.
9785 (HIRCompileBase::setup_fndecl): Likewise.
9786 (HIRCompileBase::handle_cold_attribute_on_fndecl): Likewise.
9787 * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
9788 Likewise.
9789 * checks/errors/rust-unsafe-checker.cc (check_target_attr):
9790 Likewise.
9791 * expand/rust-cfg-strip.cc (fails_cfg): Likewise.
9792 (fails_cfg_with_expand): Likewise.
9793 (expand_cfg_attrs): Likewise.
9794 * expand/rust-macro-builtins.cc: Likewise.
9795 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Likewise.
9796 (ASTLoweringBase::lower_macro_definition): Likewise.
9797 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
9798 * parse/rust-parse-impl.h (Parser::parse_doc_comment): Likewise.
9799 * parse/rust-parse.cc (extract_module_path): Likewise.
9800 * resolve/rust-early-name-resolver.cc (is_macro_use_module):
9801 Likewise.
9802 (EarlyNameResolver::visit): Likewise.
9803 * resolve/rust-toplevel-name-resolver-2.0.cc (is_macro_export):
9804 Likwise.
9805 * rust-session-manager.cc (Session::injection): Likewise.
9806 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): Likewise.
9807 * util/rust-attributes.cc (is_proc_macro_type): Likewise.
9808 (AttributeChecker::check_attribute): Likewise.
9809 (AttributeChecker::visit): Likewise.
9810 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
9811 * util/rust-attribute-values.h: New file.
9812
9813 2024-01-16 Owen Avery <[email protected]>
9814
9815 * rust-backend.h
9816 (Backend::Backend): New.
9817 (Backend::~Backend): Remove.
9818 (class Gcc_backend): Remove.
9819 * rust-gcc.cc
9820 (Gcc_backend::Gcc_backend): Rename to ...
9821 (Backend::Backend): ... here.
9822 (rust_get_backend): Construct Backend instead of Gcc_backend.
9823
9824 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9825
9826 * expand/rust-proc-macro.cc (tokenstream_from_string): Change
9827 linemap null pointer to the current linemap.
9828
9829 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9830
9831 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
9832 Add proc macro definition insertion.
9833
9834 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9835
9836 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_def):
9837 Change the function body to fetch the node id from the macro
9838 parameter.
9839 (Mappings::insert_bang_proc_macro_def): Likewise.
9840 (Mappings::insert_attribute_proc_macro_def): Likewise.
9841 * util/rust-hir-map.h: Update the function's prototype by
9842 removing the node id from the list of arguments.
9843
9844 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9845
9846 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
9847 Add proc macro handle retrieval for attribute and derive proc macros.
9848
9849 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9850
9851 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macro_def):
9852 Update function to accomodate new signature.
9853 (Mappings::lookup_bang_proc_macro_def): Likewise.
9854 (Mappings::lookup_attribute_proc_macro_def): Likewise.
9855 * util/rust-hir-map.h: Update function signatures.
9856
9857 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9858
9859 * expand/rust-macro-expand.h (struct MacroExpander): Update
9860 lookup function prototypes.
9861 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macro_invocation):
9862 Update lookup function according to new signature.
9863 (Mappings::lookup_bang_proc_macro_invocation): Likewise.
9864 (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
9865 * util/rust-hir-map.h: Update function prototypes.
9866
9867 2024-01-16 Owen Avery <[email protected]>
9868
9869 * rust-backend.h
9870 (Backend::write_export_data): Remove.
9871 * rust-gcc.cc
9872 (Backend::write_export_data): Remove.
9873
9874 2024-01-16 Owen Avery <[email protected]>
9875
9876 * rust-backend.h
9877 (Backend::real_part_expression): Make non-virtual.
9878 (Backend::imag_part_expression): Likewise.
9879 (Backend::complex_expression): Likewise.
9880 (Backend::convert_expression): Likewise.
9881 (Backend::struct_field_expression): Likewise.
9882 (Backend::compound_expression): Likewise.
9883 (Backend::conditional_expression): Likewise.
9884 (Backend::negation_expression): Likewise.
9885 (Backend::arithmetic_or_logical_expression): Likewise.
9886 (Backend::arithmetic_or_logical_expression_checked): Likewise.
9887 (Backend::comparison_expression): Likewise.
9888 (Backend::lazy_boolean_expression): Likewise.
9889 (Backend::constructor_expression): Likewise.
9890 (Backend::array_constructor_expression): Likewise.
9891 (Backend::array_initializer): Likewise.
9892 (Backend::array_index_expression): Likewise.
9893 (Backend::call_expression): Likewise.
9894 (Gcc_backend::real_part_expression): Remove.
9895 (Gcc_backend::imag_part_expression): Remove.
9896 (Gcc_backend::complex_expression): Remove.
9897 (Gcc_backend::convert_expression): Remove.
9898 (Gcc_backend::struct_field_expression): Remove.
9899 (Gcc_backend::compound_expression): Remove.
9900 (Gcc_backend::conditional_expression): Remove.
9901 (Gcc_backend::negation_expression): Remove.
9902 (Gcc_backend::arithmetic_or_logical_expression): Remove.
9903 (Gcc_backend::arithmetic_or_logical_expression_checked): Remove.
9904 (Gcc_backend::comparison_expression): Remove.
9905 (Gcc_backend::lazy_boolean_expression): Remove.
9906 (Gcc_backend::constructor_expression): Remove.
9907 (Gcc_backend::array_constructor_expression): Remove.
9908 (Gcc_backend::array_initializer): Remove.
9909 (Gcc_backend::array_index_expression): Remove.
9910 (Gcc_backend::call_expression): Remove.
9911 * rust-gcc.cc
9912 (Gcc_backend::real_part_expression): Rename to ...
9913 (Backend::real_part_expression): ... here.
9914 (Gcc_backend::imag_part_expression): Rename to ...
9915 (Backend::imag_part_expression): ... here.
9916 (Gcc_backend::complex_expression): Rename to ...
9917 (Backend::complex_expression): ... here.
9918 (Gcc_backend::convert_expression): Rename to ...
9919 (Backend::convert_expression): ... here.
9920 (Gcc_backend::struct_field_expression): Rename to ...
9921 (Backend::struct_field_expression): ... here.
9922 (Gcc_backend::compound_expression): Rename to ...
9923 (Backend::compound_expression): ... here.
9924 (Gcc_backend::conditional_expression): Rename to ...
9925 (Backend::conditional_expression): ... here.
9926 (Gcc_backend::negation_expression): Rename to ...
9927 (Backend::negation_expression): ... here.
9928 (Gcc_backend::arithmetic_or_logical_expression): Rename to ...
9929 (Backend::arithmetic_or_logical_expression): ... here.
9930 (Gcc_backend::arithmetic_or_logical_expression_checked): Rename to ...
9931 (Backend::arithmetic_or_logical_expression_checked): ... here.
9932 (Gcc_backend::comparison_expression): Rename to ...
9933 (Backend::comparison_expression): ... here.
9934 (Gcc_backend::lazy_boolean_expression): Rename to ...
9935 (Backend::lazy_boolean_expression): ... here.
9936 (Gcc_backend::constructor_expression): Rename to ...
9937 (Backend::constructor_expression): ... here.
9938 (Gcc_backend::array_constructor_expression): Rename to ...
9939 (Backend::array_constructor_expression): ... here.
9940 (Gcc_backend::array_initializer): Rename to ...
9941 (Backend::array_initializer): ... here.
9942 (Gcc_backend::array_index_expression): Rename to ...
9943 (Backend::array_index_expression): ... here.
9944 (Gcc_backend::call_expression): Rename to ...
9945 (Backend::call_expression): ... here.
9946
9947 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9948
9949 * rust-session-manager.cc (Session::load_extern_crate): Change
9950 variable name, add temporaries and comments.
9951
9952 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9953
9954 * expand/rust-proc-macro.h: Change get_trait_name to get_name in
9955 order to be coherent with the others proc macro type name
9956 convention.
9957 * resolve/rust-toplevel-name-resolver-2.0.cc (insert_macros):
9958 Add a templated funtion that inserts a proc macro into the
9959 context and emit an error on failure.
9960 (TopLevel::visit): Change from manual insertion to a function
9961 call.
9962
9963 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9964
9965 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
9966 Change to assertion.
9967 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macros):
9968 Add empty line.
9969 (Mappings::lookup_bang_proc_macros): Likewise.
9970 (Mappings::lookup_attribute_proc_macros): Likewise.
9971
9972 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9973
9974 * metadata/rust-extern-crate.cc (ExternCrate::ExternCrate):
9975 Update definition to allow Extern crate with no content (pure
9976 proc macros).
9977 (ExternCrate::ok): Panic on no content.
9978 (ExternCrate::load): Likewise.
9979 * metadata/rust-extern-crate.h: Update prototypes.
9980 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
9981 Remove macro resolution.
9982 (TopLevel::visit): Likewise.
9983 * resolve/rust-toplevel-name-resolver-2.0.h: Add visit prototype
9984 for extern crate.
9985 * rust-session-manager.cc (Session::load_extern_crate): Adapt
9986 content depending on the loaded crate's content.
9987 * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macros):
9988 Change return type to optional because it is way more
9989 convenient.
9990 (Mappings::lookup_bang_proc_macros): Likewise.
9991 (Mappings::lookup_attribute_proc_macros): Likewise.
9992 * util/rust-hir-map.h: Update function prototypes.
9993
9994 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
9995
9996 * metadata/rust-imports.cc (Import::try_package_in_directory):
9997 Remove error when some macro are found even if no import data is
9998 available.
9999
10000 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10001
10002 * ast/rust-ast.h (class BangProcMacro): Move class from here to
10003 rust-proc-macro.h. Also remove related functions.
10004 (class AttributeProcMacro): Likewise.
10005 (class CustomDeriveProcMacro): Likewise.
10006 (struct Crate): Remove proc macro vector members.
10007 * expand/rust-macro-expand.h (struct MacroExpander): Change the
10008 type to the newly created classes.
10009 * expand/rust-proc-macro.cc (BangProcMacro::BangProcMacro): Add
10010 constructor implementation.
10011 (AttributeProcMacro::AttributeProcMacro): Likewise.
10012 (CustomDeriveProcMacro::CustomDeriveProcMacro): Likewise.
10013 * expand/rust-proc-macro.h (class BangProcMacro): Move class to
10014 here.
10015 (class AttributeProcMacro): Likewise.
10016 (class CustomDeriveProcMacro): Likewise.
10017 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
10018 Change top level visitor to check mappings instead
10019 * rust-session-manager.cc (Session::load_extern_crate):
10020 Add back macro collection to mappings.
10021 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macros):
10022 Update getter signature with new types.
10023 (Mappings::insert_bang_proc_macros): Likewise.
10024 (Mappings::insert_attribute_proc_macros): Likewise.
10025 (Mappings::lookup_derive_proc_macros): Likewise.
10026 (Mappings::lookup_bang_proc_macros): Likewise.
10027 (Mappings::lookup_attribute_proc_macros): Likewise.
10028 (Mappings::insert_derive_proc_macro_def): Likewise.
10029 (Mappings::insert_bang_proc_macro_def): Likewise.
10030 (Mappings::insert_attribute_proc_macro_def): Likewise.
10031 (Mappings::lookup_derive_proc_macro_def): Likewise.
10032 (Mappings::lookup_bang_proc_macro_def): Likewise.
10033 (Mappings::lookup_attribute_proc_macro_def): Likewise.
10034 (Mappings::insert_derive_proc_macro_invocation): Likewise.
10035 (Mappings::lookup_derive_proc_macro_invocation): Likewise.
10036 (Mappings::insert_bang_proc_macro_invocation): Likewise.
10037 (Mappings::lookup_bang_proc_macro_invocation): Likewise.
10038 (Mappings::insert_attribute_proc_macro_invocation): Likewise.
10039 (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
10040 * util/rust-hir-map.h: Update function prototypes as well as map
10041 types.
10042
10043 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10044
10045 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
10046 Visit crate's newly stored proc macros.
10047 * rust-session-manager.cc (Session::load_extern_crate):
10048 Store proc macros in the parsed crate instead of a local
10049 variable to achieve mappings.
10050
10051 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10052
10053 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
10054 Change argument to reference.
10055 * resolve/rust-early-name-resolver-2.0.h: Update function
10056 prototype.
10057
10058 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10059
10060 * ast/rust-ast.h: Add getters.
10061
10062 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10063
10064 * ast/rust-ast.h (struct Crate): Add proc macro members.
10065
10066 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10067
10068 * ast/rust-ast.h (class BangProcMacro): Add new proc macro
10069 abstraction.
10070 (class AttributeProcMacro): Likewise.
10071 (class CustomDeriveProcMacro): Likewise.
10072
10073 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10074
10075 * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
10076 Add function to handle attributes.
10077 (Early::visit): Override visitor functions.
10078 * resolve/rust-early-name-resolver-2.0.h: Add prototype.
10079
10080 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10081
10082 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Convert
10083 tokenstream to path list.
10084
10085 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10086
10087 * ast/rust-ast.cc (Attribute::is_derive): Remove tokenstream
10088 condition.
10089
10090 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10091
10092 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Change
10093 return type to a vector of references.
10094 * ast/rust-ast.h: Update constructor.
10095 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
10096 Update function call.
10097
10098 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10099
10100 * ast/rust-ast.cc (Attribute::get_traits_to_derive): Add
10101 function as member function.
10102 * ast/rust-ast.h: Add prototype.
10103 * expand/rust-expand-visitor.cc (get_traits_to_derive): Remove
10104 function.
10105 (ExpandVisitor::expand_inner_stmts): Update function call.
10106
10107 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10108
10109 * ast/rust-ast.cc (Attribute::is_derive): Add member function.
10110 * ast/rust-ast.h: Likewise.
10111 * expand/rust-expand-visitor.cc (is_derive): Remove old
10112 function.
10113 (ExpandVisitor::expand_inner_stmts): Update function call.
10114 (ExpandVisitor::visit_inner_using_attrs): Likewise.
10115
10116 2024-01-16 Philip Herron <[email protected]>
10117
10118 * backend/rust-compile-expr.cc (CompileExpr::visit): use a temp for the value
10119
10120 2024-01-16 Owen Avery <[email protected]>
10121
10122 * rust-backend.h
10123 (Backend::block): Make non-virtual.
10124 (Backend::block_add_statements): Likewise.
10125 (Gcc_backend::block): Remove.
10126 (Gcc_backend::block_add_statements): Remove.
10127 * rust-gcc.cc
10128 (Gcc_backend::block): Rename to ...
10129 (Backend::block): ... here.
10130 (Gcc_backend::block_add_statements): Rename to ...
10131 (Backend::block_add_statements): ... here.
10132
10133 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10134
10135 * expand/rust-macro-expand.h: Change include directive with the
10136 new name.
10137 * expand/rust-proc-macro.h (RUST_PROC_MACRO_H): Likewise.
10138 * util/rust-hir-map.h: Likewise.
10139 * util/rust-token-converter.h: Likewise.
10140 * util/rust-token-converter.cc: Remove useless include
10141 directive.
10142 * Make-lang.in: Rename library.
10143
10144 2024-01-16 Owen Avery <[email protected]>
10145
10146 * rust-backend.h
10147 (Backend::init_statement): Make non-virtual.
10148 (Backend::assignment_statement): Likewise.
10149 (Backend::return_statement): Likewise.
10150 (Backend::if_statement): Likewise.
10151 (Backend::loop_expression): Likewise.
10152 (Backend::exit_expression): Likewise.
10153 (Backend::compound_statement): Likewise.
10154 (Backend::statement_list): Likewise.
10155 (Backend::exception_handler_statement): Likewise.
10156 (Gcc_backend::init_statement): Remove.
10157 (Gcc_backend::assignment_statement): Remove.
10158 (Gcc_backend::return_statement): Remove.
10159 (Gcc_backend::if_statement): Remove.
10160 (Gcc_backend::compound_statement): Remove.
10161 (Gcc_backend::statement_list): Remove.
10162 (Gcc_backend::exception_handler_statement): Remove.
10163 (Gcc_backend::loop_expression): Remove.
10164 (Gcc_backend::exit_expression): Remove.
10165 * rust-gcc.cc
10166 (Gcc_backend::init_statement): Rename to ...
10167 (Backend::init_statement): ... here.
10168 (Gcc_backend::assignment_statement): Rename to ...
10169 (Backend::assignment_statement): ... here.
10170 (Gcc_backend::return_statement): Rename to ...
10171 (Backend::return_statement): ... here.
10172 (Gcc_backend::exception_handler_statement): Rename to ...
10173 (Backend::exception_handler_statement): ... here.
10174 (Gcc_backend::if_statement): Rename to ...
10175 (Backend::if_statement): ... here.
10176 (Gcc_backend::loop_expression): Rename to ...
10177 (Backend::loop_expression): ... here.
10178 (Gcc_backend::exit_expression): Rename to ...
10179 (Backend::exit_expression): ... here.
10180 (Gcc_backend::compound_statement): Rename to ...
10181 (Backend::compound_statement): ... here.
10182 (Gcc_backend::statement_list): Rename to ...
10183 (Backend::statement_list): ... here.
10184
10185 2024-01-16 Owen Avery <[email protected]>
10186
10187 * rust-backend.h
10188 (Backend::function): Make non-virtual.
10189 (Backend::function_defer_statement): Likewise.
10190 (Backend::function_set_parameters): Likewise.
10191 (Backend::write_global_definitions): Likewise.
10192 (Backend::write_export_data): Likewise.
10193 (Gcc_backend::function): Remove.
10194 (Gcc_backend::function_defer_statement): Remove.
10195 (Gcc_backend::function_set_parameters): Remove.
10196 (Gcc_backend::write_global_definitions): Remove.
10197 (Gcc_backend::write_export_data): Remove.
10198 * rust-gcc.cc
10199 (Gcc_backend::function): Rename to ...
10200 (Backend::function): ... here.
10201 (Gcc_backend::function_defer_statement):
10202 Fix a qualified lookup of Backend::label and rename to ...
10203 (Backend::function_defer_statement): ... here.
10204 (Gcc_backend::function_set_parameters) Rename to ...
10205 (Backend::function_set_parameters): ... here.
10206 (Gcc_backend::write_global_definitions): Rename to ...
10207 (Backend::write_global_definitions): ... here.
10208 (Gcc_backend::write_export_data): Rename to ...
10209 (Backend::write_export_data): ... here.
10210
10211 2024-01-16 Muhammad Mahad <[email protected]>
10212
10213 * typecheck/rust-hir-inherent-impl-overlap.h:
10214 Added rich location and errorcode.
10215 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
10216 likewise.
10217
10218 2024-01-16 Muhammad Mahad <[email protected]>
10219
10220 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
10221 Added error code.
10222
10223 2024-01-16 Owen Avery <[email protected]>
10224
10225 * rust-backend.h
10226 (Backend::zero_expression): Make non-virtual.
10227 (Backend::var_expression): Likewise.
10228 (Backend::integer_constant_expression): Likewise.
10229 (Backend::float_constant_expression): Likewise.
10230 (Backend::complex_constant_expression): Likewise.
10231 (Backend::string_constant_expression): Likewise.
10232 (Backend::char_constant_literal): Likewise.
10233 (Backend::wchar_constant_literal): Likewise.
10234 (Backend::boolean_constant_expression): Likewise.
10235 (Gcc_backend::zero_expression): Remove.
10236 (Gcc_backend::var_expression): Remove.
10237 (Gcc_backend::integer_constant_expression): Remove.
10238 (Gcc_backend::float_constant_expression): Remove.
10239 (Gcc_backend::complex_constant_expression): Remove.
10240 (Gcc_backend::string_constant_expression): Remove.
10241 (Gcc_backend::wchar_constant_expression): Remove.
10242 (Gcc_backend::char_constant_expression): Remove.
10243 (Gcc_backend::boolean_constant_expression): Remove.
10244 * rust-gcc.cc
10245 (Gcc_backend::zero_expression): Rename to ...
10246 (Backend::zero_expression): ... here.
10247 (Gcc_backend::var_expression): Rename to ...
10248 (Backend::var_expression): ... here.
10249 (Gcc_backend::integer_constant_expression): Rename to ...
10250 (Backend::integer_constant_expression): ... here.
10251 (Gcc_backend::float_constant_expression): Rename to ...
10252 (Backend::float_constant_expression): ... here.
10253 (Gcc_backend::complex_constant_expression): Rename to ...
10254 (Backend::complex_constant_expression): ... here.
10255 (Gcc_backend::string_constant_expression): Rename to ...
10256 (Backend::string_constant_expression): ... here.
10257 (Gcc_backend::wchar_constant_expression): Rename to ...
10258 (Backend::wchar_constant_expression): ... here.
10259 (Gcc_backend::char_constant_expression): Rename to ...
10260 (Backend::char_constant_expression): ... here.
10261 (Gcc_backend::boolean_constant_expression): Rename to ...
10262 (Backend::boolean_constant_expression): ... here.
10263
10264 2024-01-16 Owen Avery <[email protected]>
10265
10266 * rust-backend.h
10267 (Backend::global_variable): Make non-virtual.
10268 (Backend::global_variable_set_init): Likewise.
10269 (Backend::local_variable): Likewise.
10270 (Backend::parameter_variable): Likewise.
10271 (Backend::static_chain_variable): Likewise.
10272 (Backend::temporary_variable): Likewise.
10273 (Gcc_backend::global_variable): Remove.
10274 (Gcc_backend::global_variable_set_init): Remove.
10275 (Gcc_backend::local_variable): Remove.
10276 (Gcc_backend::parameter_variable): Remove.
10277 (Gcc_backend::static_chain_variable): Remove.
10278 (Gcc_backend::temporary_variable): Remove.
10279 (Gcc_backend::non_zero_size_type): Move to ...
10280 (Backend::non_zero_size_type): ... here.
10281 (Gcc_backend::convert_tree): Move to ...
10282 (Backend::convert_tree): ... here.
10283 * rust-gcc.cc
10284 (Gcc_backend::non_zero_size_type): Rename to ...
10285 (Backend::non_zero_size_type): ... here.
10286 (Gcc_backend::convert_tree): Rename to ...
10287 (Backend::convert_tree): ... here.
10288 (Gcc_backend::global_variable): Rename to ...
10289 (Backend::global_variable): ... here.
10290 (Gcc_backend::global_variable_set_init): Rename to ...
10291 (Backend::global_variable_set_init): ... here.
10292 (Gcc_backend::local_variable): Rename to ...
10293 (Backend::local_variable): ... here.
10294 (Gcc_backend::parameter_variable): Rename to ...
10295 (Backend::parameter_variable): ... here.
10296 (Gcc_backend::static_chain_variable): Rename to ...
10297 (Backend::static_chain_variable): ... here.
10298 (Gcc_backend::temporary_variable): Rename to ...
10299 (Backend::temporary_variable): ... here.
10300
10301 2024-01-16 Muhammad Mahad <[email protected]>
10302
10303 * checks/errors/privacy/rust-privacy-reporter.cc
10304 (PrivacyReporter::check_for_privacy_violation):
10305 Added errorcode & richlocation.
10306
10307 2024-01-16 Owen Avery <[email protected]>
10308
10309 * rust-backend.h
10310 (Backend::debug): Make non-virtual.
10311 (Backend::get_identifier_node): Likewise.
10312 (Gcc_backend::debug): Remove.
10313 (Gcc_backend::get_identifier_node): Remove.
10314 * rust-gcc.cc
10315 (Gcc_backend::debug): Rename to ...
10316 (Backend::debug): ... here.
10317 (Gcc_backend::get_identifier_node): Rename to ...
10318 (Backend::get_identifier_node): ... here.
10319
10320 2024-01-16 Owen Avery <[email protected]>
10321
10322 * typecheck/rust-hir-type-check-expr.cc
10323 (TypeCheckExpr::visit): Expect if conditions to have type bool.
10324
10325 2024-01-16 Owen Avery <[email protected]>
10326
10327 * rust-backend.h
10328 (Backend::label): Make non-virtual.
10329 (Backend::label_definition_statement): Likewise.
10330 (Backend::goto_statement): Likewise.
10331 (Backend::label_address): Likewise.
10332 (Gcc_backend::label): Remove.
10333 (Gcc_backend::label_definition_statement): Remove.
10334 (Gcc_backend::goto_statement): Remove.
10335 (Gcc_backend::label_address): Remove.
10336 * rust-gcc.cc
10337 (Gcc_backend::label): Rename to ...
10338 (Backend::label): ... here.
10339 (Gcc_backend::label_definition_statement): Rename to ...
10340 (Backend::label_definition_statement): ... here.
10341 (Gcc_backend::goto_statement): Rename to ...
10342 (Backend::goto_statement): ... here.
10343 (Gcc_backend::label_address): Rename to ...
10344 (Backend::label_address): ... here.
10345
10346 2024-01-16 Owen Avery <[email protected]>
10347
10348 * backend/rust-constexpr.cc
10349 (struct constexpr_fundef): Rename to ...
10350 (struct rust_constexpr_fundef): ... here.
10351 (struct constexpr_call): Rename to ...
10352 (struct rust_constexpr_call): ... here.
10353
10354 2024-01-16 Raiki Tamura <[email protected]>
10355
10356 * lex/rust-input-source.h: Move constants from here...
10357 * util/rust-codepoint.h (struct Codepoint): ... to here
10358 * util/rust-attributes.cc (check_no_mangle_function): New function.
10359 (AttributeChecker::visit): Use it.
10360 * util/rust-unicode.cc (is_ascii_only): New function.
10361 * util/rust-unicode.h (is_ascii_only): Likewise.
10362 * backend/rust-mangle.cc (legacy_mangle_name): Use it.
10363 * util/rust-punycode.cc (extract_basic_string): Likewise.
10364 * lex/rust-lex.cc (Lexer::parse_byte_char): Likewise.
10365
10366 2024-01-16 Muhammad Mahad <[email protected]>
10367
10368 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit):
10369 Added richlocation & error code.
10370
10371 2024-01-16 Owen Avery <[email protected]>
10372
10373 * typecheck/rust-hir-type-check-expr.cc
10374 (TypeCheckExpr::resolve_fn_trait_call): Add TODO comment.
10375 * typecheck/rust-tyty-bounds.cc
10376 (TypeBoundPredicate::TypeBoundPredicate):
10377 Add assertions, new error constructor.
10378 (TypeBoundPredicate::error): Use new error constructor.
10379 * typecheck/rust-tyty.h
10380 (struct TypeBoundPredicate::mark_is_error): New.
10381 (TypeBoundPredicate::TypeBoundPredicate):
10382 Add new error constructor.
10383
10384 2024-01-16 Owen Avery <[email protected]>
10385
10386 * rust-backend.h:
10387 (Backend::wchar_type): Make non-virtual.
10388 (Backend::get_pointer_size): Likewise.
10389 (Backend::raw_str_type): Likewise.
10390 (Backend::integer_type): Likewise.
10391 (Backend::float_type): Likewise.
10392 (Backend::complex_type): Likewise.
10393 (Backend::pointer_type): Likewise.
10394 (Backend::reference_type): Likewise.
10395 (Backend::immutable_type): Likewise.
10396 (Backend::function_type): Likewise.
10397 (Backend::function_type_varadic): Likewise.
10398 (Backend::function_ptr_type): Likewise.
10399 (Backend::struct_type): Likewise.
10400 (Backend::union_type): Likewise.
10401 (Backend::array_type): Likewise.
10402 (Backend::named_type): Likewise.
10403 (Backend::type_size): Likewise.
10404 (Backend::type_alignment): Likewise.
10405 (Backend::type_field_alignment): Likewise.
10406 (Backend::type_field_offset): Likewise.
10407 (Gcc_backend::wchar_type): Remove.
10408 (Gcc_backend::get_pointer_size): Remove.
10409 (Gcc_backend::raw_str_type): Remove.
10410 (Gcc_backend::integer_type): Remove.
10411 (Gcc_backend::float_type): Remove.
10412 (Gcc_backend::complex_type): Remove.
10413 (Gcc_backend::pointer_type): Remove.
10414 (Gcc_backend::reference_type): Remove.
10415 (Gcc_backend::immutable_type): Remove.
10416 (Gcc_backend::function_type): Remove.
10417 (Gcc_backend::function_type_varadic): Remove.
10418 (Gcc_backend::function_ptr_type): Remove.
10419 (Gcc_backend::struct_type): Remove.
10420 (Gcc_backend::union_type): Remove.
10421 (Gcc_backend::array_type): Remove.
10422 (Gcc_backend::named_type): Remove.
10423 (Gcc_backend::type_size): Remove.
10424 (Gcc_backend::type_alignment): Remove.
10425 (Gcc_backend::type_field_alignment): Remove.
10426 (Gcc_backend::type_field_offset): Remove.
10427 (Gcc_backend::fill_in_fields): Move to ...
10428 (Backend::fill_in_fields): ... here.
10429 (Gcc_backend::fill_in_array): Move to ...
10430 (Backend::fill_in_array): ... here.
10431 * rust-gcc.cc
10432 (Gcc_backend::wchar_type): Rename to ...
10433 (Backend::wchar_type): ... here.
10434 (Gcc_backend::get_pointer_size): Rename to ...
10435 (Backend::get_pointer_size): ... here.
10436 (Gcc_backend::raw_str_type): Rename to ...
10437 (Backend::raw_str_type): ... here.
10438 (Gcc_backend::integer_type): Rename to ...
10439 (Backend::integer_type): ... here.
10440 (Gcc_backend::float_type): Rename to ...
10441 (Backend::float_type): ... here.
10442 (Gcc_backend::complex_type): Rename to ...
10443 (Backend::complex_type): ... here.
10444 (Gcc_backend::pointer_type): Rename to ...
10445 (Backend::pointer_type): ... here.
10446 (Gcc_backend::reference_type): Rename to ...
10447 (Backend::reference_type): ... here.
10448 (Gcc_backend::immutable_type): Rename to ...
10449 (Backend::immutable_type): ... here.
10450 (Gcc_backend::function_type): Rename to ...
10451 (Backend::function_type): ... here.
10452 (Gcc_backend::function_type_varadic): Rename to ...
10453 (Backend::function_type_varadic): ... here.
10454 (Gcc_backend::function_ptr_type): Rename to ...
10455 (Backend::function_ptr_type): ... here.
10456 (Gcc_backend::struct_type): Rename to ...
10457 (Backend::struct_type): ... here.
10458 (Gcc_backend::union_type): Rename to ...
10459 (Backend::union_type): ... here.
10460 (Gcc_backend::fill_in_fields): Rename to ...
10461 (Backend::fill_in_fields): ... here.
10462 (Gcc_backend::array_type): Rename to ...
10463 (Backend::array_type): ... here.
10464 (Gcc_backend::fill_in_array): Rename to ...
10465 (Backend::fill_in_array): ... here.
10466 (Gcc_backend::named_type): Rename to ...
10467 (Backend::named_type): ... here.
10468 (Gcc_backend::type_size): Rename to ...
10469 (Backend::type_size): ... here.
10470 (Gcc_backend::type_alignment): Rename to ...
10471 (Backend::type_alignment): ... here.
10472 (Gcc_backend::type_field_alignment): Rename to ...
10473 (Backend::type_field_alignment): ... here.
10474 (Gcc_backend::type_field_offset): Rename to ...
10475 (Backend::type_field_offset): ... here.
10476
10477 2024-01-16 Philip Herron <[email protected]>
10478
10479 * backend/rust-compile-intrinsic.cc (move_val_init_handler): mark as side-effects
10480
10481 2024-01-16 Philip Herron <[email protected]>
10482
10483 * backend/rust-compile-intrinsic.cc (uninit_handler): Update fndecl attributes
10484
10485 2024-01-16 Philip Herron <[email protected]>
10486
10487 * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): fix use before init
10488
10489 2024-01-16 Philip Herron <[email protected]>
10490
10491 * backend/rust-compile-intrinsic.cc (enter_intrinsic_block): take the locals vector
10492 (uninit_handler): make a temp variable and use the address of it
10493
10494 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10495
10496 * resolve/rust-early-name-resolver-2.0.cc (Early::visit):
10497 Collect error instead of lambda.
10498 * resolve/rust-early-name-resolver-2.0.h (std::function<void):
10499 Remove type alias.
10500 * rust-diagnostics.h: Change collection type.
10501 * rust-session-manager.cc (Session::expansion): Change
10502 collection container.
10503
10504 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10505
10506 * resolve/rust-early-name-resolver-2.0.cc (Early::visit):
10507 Collect error instead of emitting it. Also add invocation
10508 registration.
10509 * resolve/rust-early-name-resolver-2.0.h (std::function<void):
10510 Add type definition for collection.
10511 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
10512 Register macro rule definition in mappings.
10513 * rust-session-manager.cc (Session::expansion): Add macro
10514 resolve error collection.
10515
10516 2024-01-16 Owen Avery <[email protected]>
10517
10518 * config-lang.in:
10519 Add "backend/rust-tree.h" and "backend/rust-tree.h" to gtfiles.
10520 * backend/rust-tree.cc: Include new header generated by gengtype.
10521 * backend/rust-tree.h
10522 (struct language_function): Add TODO.
10523 * rust-lang.cc:
10524 Include "rust-tree.h".
10525 (struct lang_type): Remove duplicate definition.
10526 (struct lang_decl): Likewise.
10527 (struct lang_identifier): Likewise.
10528 (struct language_function): Likewise.
10529
10530 2024-01-16 Muhammad Mahad <[email protected]>
10531
10532 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
10533 Added error code and rich location.
10534
10535 2024-01-16 Owen Avery <[email protected]>
10536
10537 * backend/rust-tree.h
10538 (struct rust_cp_class_binding): Fork from gcc/cp/name_lookup.h.
10539 (struct rust_cp_binding_level): Likewise.
10540 (struct named_label_entry): Remove declaration...
10541 (struct rust_named_label_entry): ... and fork definition from gcc/cp/decl.cc.
10542
10543 2024-01-16 Muhammad Mahad <[email protected]>
10544
10545 * rust-diagnostics.cc (rust_be_error_at): Added overload function.
10546 (rust_error_at): non-const `rich_location *` function.
10547 * rust-diagnostics.h (rust_error_at): Implementation of overloaded
10548 function.
10549 (rust_be_error_at): likewise.
10550 * rust_error_codes.def: Added GNU license.
10551
10552 2024-01-16 Muhammad Mahad <[email protected]>
10553
10554 * typecheck/rust-tyty.cc (BaseType::satisfies_bound):
10555 Added errorcode and user-friendly error message.
10556
10557 2024-01-16 Owen Avery <[email protected]>
10558
10559 * backend/rust-tree.cc
10560 (resort_data): Fork from c++ frontend.
10561 (resort_member_name_cmp): Likewise.
10562 (resort_type_member_vec): Likewise.
10563 * backend/rust-tree.h
10564 (resort_type_member_vec): Likewise.
10565
10566 2024-01-16 Owen Avery <[email protected]>
10567
10568 * backend/rust-tree.cc
10569 (struct conv_type_hasher): Rename to ...
10570 (struct rust_conv_type_hasher): ... here.
10571 (struct cplus_array_hasher): Rename to ...
10572 (struct rust_cplus_array_hasher): ... here.
10573 (struct source_location_table_entry_hash): Rename to ...
10574 (struct rust_source_location_table_entry_hash): ... here.
10575 * backend/rust-tree.h
10576 (struct named_decl_hash): Rename to ...
10577 (struct rust_named_decl_hash): ... here.
10578 (struct cxx_saved_binding): Rename to ...
10579 (struct rust_cxx_saved_binding): ... here.
10580 (struct named_label_hash): Rename to ...
10581 (struct rust_named_label_hash): ... here.
10582 (struct tree_pair_s): Rename to ...
10583 (struct rust_tree_pair_s): ... here.
10584 (struct tree_pair_p): Rename to ...
10585 (struct rust_tree_pair_p): ... here.
10586
10587 2024-01-16 Owen Avery <[email protected]>
10588
10589 * backend/rust-tree.cc
10590 (Rust::gt_pch_nx): Move external function declaration ...
10591 (gt_pch_nx): ... out of Rust namespace.
10592 * backend/rust-tree.h
10593 (OVL_FIRST): Qualify function name.
10594
10595 2024-01-16 Philip Herron <[email protected]>
10596
10597 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): do a final lookup
10598
10599 2024-01-16 Muhammad Mahad <[email protected]>
10600
10601 * parse/rust-parse-impl.h (Parser::parse_generic_params):
10602 Added more user friendly message.
10603
10604 2024-01-16 Owen Avery <[email protected]>
10605
10606 * expand/rust-macro-builtins.cc
10607 (MacroBuiltin::include_str_handler): Use vector::data.
10608
10609 2024-01-16 Muhammad Mahad <[email protected]>
10610
10611 * typecheck/rust-hir-type-check-type.cc:
10612 Added last variant name, errorcode & rich location. for enum candidates.
10613
10614 2024-01-16 Owen Avery <[email protected]>
10615
10616 * backend/rust-tree.h
10617 (struct stmt_tree_s): Remove.
10618 (typedef stmt_tree): Remove.
10619 (c_language_function::x_stmt_tree): Remove.
10620 (saved_scope::x_stmt_tree): Remove.
10621 (lang_decl_fn::pending_inline_p): Remove.
10622 (lang_decl_fn::spare): Adjust size.
10623 (lang_decl_fn::pending_inline_info): Remove.
10624
10625 2024-01-16 Owen Avery <[email protected]>
10626
10627 * backend/rust-constexpr.cc:
10628 Include gt-rust-rust-constexpr.h.
10629 (struct constexpr_call_hasher): Rename to ...
10630 (struct rust_constexpr_call_hasher): ... here.
10631 (struct constexpr_fundef_hasher): Rename to ...
10632 (struct rust_constexpr_fundef_hasher): ... here.
10633 * config-lang.in: Add rust-constexpr.cc to gtfiles.
10634
10635 2024-01-16 Raiki Tamura <[email protected]>
10636
10637 * backend/rust-mangle.cc (v0_add_identifier): Added punycode encoding
10638 (v0_mangle_item): Likewise.
10639 * lex/rust-lex.cc (assert_source_content): Change type
10640 (test_buffer_input_source): Change type
10641 (test_file_input_source): Change type
10642 * resolve/rust-ast-resolve-toplevel.h: fix typo
10643 * rust-session-manager.cc (Session::load_extern_crate): fix typo
10644 * util/rust-canonical-path.h: fix typo
10645 * util/rust-hir-map.cc (NodeMapping::get_error): fix typo
10646 (Mappings::Mappings): fix typo
10647 * util/rust-mapping-common.h (UNKNOWN_CREATENUM): fix typo
10648 (UNKNOWN_CRATENUM): Change 0 to UINT32_MAX
10649
10650 2024-01-16 Muhammad Mahad <[email protected]>
10651
10652 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
10653 Updated errorcode & more userfriendly message.
10654
10655 2024-01-16 Muhammad Mahad <[email protected]>
10656
10657 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit):
10658 Added more helpful error message.
10659
10660 2024-01-16 Muhammad Mahad <[email protected]>
10661
10662 * typecheck/rust-hir-path-probe.h:
10663 Fixes issue & added rich location message.
10664 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
10665 Added rich location and error code.
10666
10667 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10668
10669 * lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Only
10670 accept digits after a dot instead of accepting any float
10671 member.
10672
10673 2024-01-16 Muhammad Mahad <[email protected]>
10674
10675 * ast/rust-pattern.h: No need of assertion, we are handling it.
10676 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
10677 Added check which emits error instead of using assertion.
10678 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
10679 Added rich location and error code.
10680
10681 2024-01-16 Muhammad Mahad <[email protected]>
10682
10683 * backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
10684 Added rich_location & error code.
10685
10686 2024-01-16 Muhammad Mahad <[email protected]>
10687
10688 * parse/rust-parse-impl.h (Parser::parse_trait):
10689 added errorcode & updated error message.
10690
10691 2024-01-16 Muhammad Mahad <[email protected]>
10692
10693 * parse/rust-parse-impl.h (Parser::parse_outer_attribute):
10694 Added errorcode & updated error function.
10695
10696 2024-01-16 Muhammad Mahad <[email protected]>
10697
10698 * rust-diagnostics.cc (va_constructor):
10699 Added constructor for all possible cases.
10700 (Error::Error): Updated error struct
10701 for all possible cases.
10702 * rust-diagnostics.h (struct Error):
10703 Updated error struct to support error
10704 code & rich location support.
10705
10706 2024-01-16 Muhammad Mahad <[email protected]>
10707
10708 * backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
10709 Added rich_location & error code.
10710
10711 2024-01-16 Arthur Cohen <[email protected]>
10712
10713 * rust-diagnostics.cc: Switch from new[] to xcalloc
10714
10715 2024-01-16 Raiki Tamura <[email protected]>
10716
10717 * util/make-rust-unicode.py: Add type annotation
10718
10719 2024-01-16 Philip Herron <[email protected]>
10720
10721 * backend/rust-compile-intrinsic.cc (check_for_cached_intrinsic):
10722 simplify this cached intrinsic check
10723 * backend/rust-mangle.cc (legacy_mangle_item): use new interface
10724 * typecheck/rust-tyty.h: new managle helper
10725
10726 2024-01-16 Philip Herron <[email protected]>
10727
10728 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
10729 use the single candidate
10730
10731 2024-01-16 Marc Poulhiès <[email protected]>
10732
10733 * hir/rust-hir-dump.cc (Dump::visit): Remove useless if/else
10734 already handled by visit_field.
10735
10736 2024-01-16 Owen Avery <[email protected]>
10737
10738 * util/rust-punycode.cc: Add CHECKING_P guard.
10739
10740 2024-01-16 Raiki Tamura <[email protected]>
10741
10742 * backend/rust-mangle.cc (legacy_mangle_name): Use Unicode escape
10743
10744 2024-01-16 Philip Herron <[email protected]>
10745
10746 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): remove hack
10747
10748 2024-01-16 Owen Avery <[email protected]>
10749
10750 * expand/rust-proc-macro-invoc-lexer.cc
10751 (ProcMacroInvocLexer::skip_token): Remove.
10752 * expand/rust-proc-macro-invoc-lexer.h:
10753 Include "rust-macro-invoc-lexer.h".
10754 (class ProcMacroInvocLexer):
10755 Extend MacroInvocLexerBase.
10756
10757 2024-01-16 Raiki Tamura <[email protected]>
10758
10759 * lex/rust-codepoint.h: Moved to...
10760 * util/rust-codepoint.h: ...here.
10761 * lex/rust-input-source.h: Add missing license
10762 * util/rust-unicode.cc: Add missing license
10763 * util/rust-punycode.cc (extract_basic_string): Remove constant
10764
10765 2024-01-16 Arthur Cohen <[email protected]>
10766
10767 * expand/rust-macro-expand.h: Keep optional references for last_def
10768 and last_invoc.
10769 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Store
10770 optional references.
10771 * rust-session-manager.cc (Session::expansion): Use tl::optional's APIs
10772 for better checking.
10773
10774 2024-01-16 Marc Poulhiès <[email protected]>
10775
10776 * hir/rust-hir-dump.h (do_ifexpr): New.
10777 * hir/rust-hir-dump.cc (Dump::do_ifexpr): New.
10778 (Dump::visit): Use do_ifexpr and visit_field
10779
10780 2024-01-16 Muhammad Mahad <[email protected]>
10781
10782 * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
10783 Refactored ErrorCodes & error messages.
10784
10785 2024-01-16 Muhammad Mahad <[email protected]>
10786
10787 * backend/rust-compile-base.cc:
10788 Added ErrorCode.
10789
10790 2024-01-16 Muhammad Mahad <[email protected]>
10791
10792 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
10793 called error function.
10794 (ASTLoweringBase::lower_extern_block): likewise.
10795
10796 2024-01-16 Owen Avery <[email protected]>
10797
10798 * ast/rust-ast-collector.cc: Adjust formatting.
10799 * checks/errors/rust-feature-gate.cc: Add trailing newline.
10800 * rust-diagnostics.h: Remove old comment.
10801
10802 2024-01-16 Owen Avery <[email protected]>
10803
10804 * rust-gcc.cc
10805 (Gcc_backend::struct_type): Remove references to "this".
10806 (Gcc_backend::union_type): Likewise.
10807 (Gcc_backend::array_type): Likewise.
10808 (Gcc_backend::wchar_constant_expression): Likewise.
10809 (Gcc_backend::convert_expression): Likewise.
10810 (Gcc_backend::constructor_expression): Likewise.
10811 (Gcc_backend::array_initializer): Likewise.
10812 (Gcc_backend::assignment_statement): Likewise.
10813 (Gcc_backend::global_variable): Likewise.
10814 (Gcc_backend::temporary_variable): Likewise.
10815 (Gcc_backend::function_defer_statement): Likewise.
10816
10817 2024-01-16 Raiki Tamura <[email protected]>
10818
10819 * Make-lang.in: Add rust-punycode.o.
10820 * rust-lang.cc (run_rust_tests): Add selftest.
10821 * util/rust-punycode.cc: New file.
10822 * util/rust-punycode.h: New file.
10823
10824 2024-01-16 Muhammad Mahad <[email protected]>
10825
10826 * backend/rust-compile.cc (HIRCompileBase::verify_array_capacities):
10827 Added ErrorCode.
10828
10829 2024-01-16 Muhammad Mahad <[email protected]>
10830
10831 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve):
10832 added errorcode.
10833
10834 2024-01-16 Owen Avery <[email protected]>
10835
10836 * rust-backend.h
10837 (Backend::error_variable): Remove.
10838 (Gcc_backend::error_variable): Move to ...
10839 * rust-gcc.cc
10840 (Bvariable::error_variable): ... here ...
10841 * rust-gcc.h
10842 (Bvariable::error_variable): ... and declare here.
10843 (Gcc_backend::global_variable): Update error_variable call.
10844 (Gcc_backend::local_variable): Likewise.
10845 (Gcc_backend::parameter_variable): Likewise.
10846 (Gcc_backend::static_chain_variable): Likewise.
10847 (Gcc_backend::temporary_variable): Likewise.
10848 * backend/rust-compile-extern.h
10849 (CompileExternItem::visit): Likewise.
10850 * backend/rust-compile-fnparam.cc
10851 (CompileFnParam::CompileFnParam): Likewise.
10852
10853 2024-01-16 Owen Avery <[email protected]>
10854
10855 * backend/rust-compile-type.cc
10856 (TyTyResolveCompile::visit): Inline Backend::bool_type call.
10857 * rust-backend.h
10858 (Backend::bool_type): Remove.
10859 (Backend::char_type): Remove.
10860 (Gcc_backend::bool_type): Remove.
10861 (Gcc_backend::char_type): Remove.
10862 * rust-gcc.cc
10863 (Gcc_backend::char_constant_expression): Inline Backend::char_type call.
10864
10865 2024-01-16 Raiki Tamura <[email protected]>
10866
10867 * lex/rust-lex.cc (assert_source_content): Fix namespace specifier
10868 (test_buffer_input_source): Likewise.
10869 (test_file_input_source): Likewise.
10870 * lex/rust-lex.h: Move InputSource ...
10871 * lex/rust-input-source.h: ... to here. (New file)
10872 * lex/rust-token.cc (nfc_normalize_token_string): New function
10873 * lex/rust-token.h (nfc_normalize_token_string): New function
10874 * rust-lang.cc (run_rust_tests): Modify order of selftests.
10875 * rust-session-manager.cc (validate_crate_name): Modify interface of Utf8String.
10876 * util/rust-unicode.cc (lookup_cc): Modify codepoint_t typedef.
10877 (lookup_recomp): Likewise.
10878 (recursive_decomp_cano): Likewise.
10879 (decomp_cano): Likewise.
10880 (sort_cano): Likewise.
10881 (compose_hangul): Likewise.
10882 (assert_normalize): Likewise.
10883 (Utf8String::nfc_normalize): New function.
10884 * util/rust-unicode.h: Modify interface of Utf8String.
10885
10886 2024-01-16 Muhammad Mahad <[email protected]>
10887
10888 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
10889 Added ErrorCode.
10890
10891 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
10892
10893 * util/rust-common.h (enum_to_str): Remove extra semicolon after
10894 the function.
10895
10896 2024-01-16 Muhammad Mahad <[email protected]>
10897
10898 * checks/errors/rust-const-checker.cc (ConstChecker::visit):
10899 Use of mutable reference in constant functions.
10900 * checks/errors/rust-feature-gate.cc (FeatureGate::gate):
10901 ErrorCode for intrinsics are subject to change.
10902
10903 2024-01-16 Muhammad Mahad <[email protected]>
10904
10905 * checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
10906 Added errorcode.
10907
10908 2024-01-16 Muhammad Mahad <[email protected]>
10909
10910 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
10911 Added errorcode.
10912
10913 2024-01-16 Arthur Cohen <[email protected]>
10914
10915 * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Declare
10916 macros in the current rib if they are macros 2.0.
10917
10918 2024-01-16 Arthur Cohen <[email protected]>
10919
10920 * ast/rust-macro.h: Add new method to `MacroRulesDefinition` to allow
10921 getting the `MacroKind` contained.
10922
10923 2024-01-16 Arthur Cohen <[email protected]>
10924
10925 * rust-session-manager.cc
10926 (Session::expansion): Use new `Early` name resolution 2.0 pass
10927
10928 2024-01-16 Arthur Cohen <[email protected]>
10929
10930 * Make-lang.in: Add new object file.
10931 * resolve/rust-early-name-resolver-2.0.cc: New file.
10932 * resolve/rust-early-name-resolver-2.0.h: New file.
10933
10934 2024-01-16 Arthur Cohen <[email protected]>
10935
10936 * resolve/rust-default-resolver.cc
10937 (DefaultResolver::visit): Visit CallExpr and MethodCallExpr properly.
10938 * resolve/rust-default-resolver.h: Switch "node" to plural in documentation.
10939
10940 2024-01-16 Arthur Cohen <[email protected]>
10941
10942 * resolve/rust-toplevel-name-resolver-2.0.cc
10943 (TopLevel::insert_or_error_out): Fix format string.
10944 (is_macro_export): New method.
10945 (TopLevel::visit): Handle macro definitions.
10946
10947 2024-01-16 Arthur Cohen <[email protected]>
10948
10949 * resolve/rust-name-resolution-context.cc
10950 (Resolver::insert): Do not call into `rust_unreachable` when resolving
10951 macros anymore.
10952
10953 2024-01-16 Arthur Cohen <[email protected]>
10954
10955 * resolve/rust-forever-stack.h
10956 (insert_at_root): New method.
10957 (resolve_path): New method.
10958 (reverse_iter): Iterate on `Node`s instead of `Rib`s
10959 * resolve/rust-forever-stack.hxx: Add path resolution.
10960
10961 2024-01-16 Arthur Cohen <[email protected]>
10962
10963 * resolve/rust-rib.h: Add shadowing parameter. Make kind field public.
10964 * resolve/rust-rib.cc (Rib::insert): Likewise.
10965
10966 2024-01-16 Muhammad Mahad <[email protected]>
10967
10968 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
10969 refactored message and called error function.
10970
10971 2024-01-16 Muhammad Mahad <[email protected]>
10972
10973 * checks/errors/rust-feature-gate.cc (FeatureGate::check):
10974 errorcode support for unknown feature.
10975
10976 2024-01-16 Muhammad Mahad <[email protected]>
10977
10978 * typecheck/rust-unify.cc (UnifyRules::emit_type_mismatch):
10979 refactored & called error function.
10980
10981 2024-01-16 Marc Poulhiès <[email protected]>
10982
10983 * expand/rust-macro-builtins.cc
10984 (load_file_bytes): Return a tl::optional.
10985 (MacroBuiltin::include_byte_handler): Adjust and check file was
10986 correctly opened.
10987 (MacroBuiltin::include_str_handler): Likewise.
10988
10989 2024-01-16 Arthur Cohen <[email protected]>
10990
10991 * resolve/rust-toplevel-name-resolver-2.0.h
10992 (class TopLevel): Inherit from DefaultResolver
10993 * resolve/rust-toplevel-name-resolver-2.0.cc
10994 (TopLevel::TopLevel): Remove unecessary methods
10995
10996 2024-01-16 Arthur Cohen <[email protected]>
10997
10998 * Make-lang.in: Add new object file.
10999 * resolve/rust-default-resolver.cc: New file.
11000 * resolve/rust-default-resolver.h: New file.
11001
11002 2024-01-16 Raiki Tamura <[email protected]>
11003
11004 * util/rust-unicode.cc (decomp_cano): Decompose Hangul.
11005 (sort_cano): Fix bounds check.
11006 (recomp): use `compose_hangul`.
11007 (compose_hangul): Compose Hangul.
11008 (rust_utf8_normalize_test): Add tests.
11009
11010 2024-01-16 Arthur Cohen <[email protected]>
11011
11012 * resolve/rust-forever-stack.hxx: assert() -> rust_assert()
11013
11014 2024-01-16 Arthur Cohen <[email protected]>
11015
11016 * Make-lang.in: Add new object file.
11017 * resolve/rust-toplevel-name-resolver-2.0.cc: New file.
11018 * resolve/rust-toplevel-name-resolver-2.0.h: New file.
11019
11020 2024-01-16 Arthur Cohen <[email protected]>
11021
11022 * Make-lang.in: Add new object file.
11023 * resolve/rust-name-resolution-context.cc: New file.
11024 * resolve/rust-name-resolution-context.h: New file.
11025
11026 2024-01-16 Muhammad Mahad <[email protected]>
11027
11028 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
11029 called error function.
11030
11031 2024-01-16 Owen Avery <[email protected]>
11032
11033 * expand/rust-macro-invoc-lexer.cc
11034 (MacroInvocLexer::skip_token): Remove.
11035 * expand/rust-macro-invoc-lexer.h
11036 (class MacroInvocLexer): Extend MacroInvocLexerBase.
11037
11038 2024-01-16 Marc Poulhiès <[email protected]>
11039
11040 * ast/rust-ast-fragment.cc (Fragment::create_empty): New.
11041 * ast/rust-ast-fragment.h (MacroTranscriberFunc): New.
11042 * ast/rust-macro.h (MacroRulesDefinition): Use MacroTranscriberFunc.
11043 * expand/rust-macro-builtins.cc
11044 (MacroBuiltin::builtin_transcribers): likewise.
11045 (MacroBuiltin::assert_handler): Return optional.
11046 (MacroBuiltin::file_handler): Likewise.
11047 (MacroBuiltin::column_handler): Likewise.
11048 (MacroBuiltin::include_bytes_handler): Likewise.
11049 (MacroBuiltin::include_str_handler): Likewise.
11050 (MacroBuiltin::compile_error_handler): Likewise.
11051 (MacroBuiltin::concat_handler): Likewise.
11052 (MacroBuiltin::env_handler): Likewise.
11053 (MacroBuiltin::cfg_handler): Likewise.
11054 (MacroBuiltin::include_handler): Likewise.
11055 (MacroBuiltin::line_handler): Likewise.
11056 (MacroBuiltin::stringify_handler): Likewise.
11057 (MacroBuiltin::sorry): Likewise.
11058 * expand/rust-macro-builtins.h (builtin_transcribers): Use
11059 MacroTranscriberFunc.
11060 (assert_handler): Return optional.
11061 (file_handler): Likewise.
11062 (column_handler): Likewise.
11063 (include_bytes_handler): Likewise.
11064 (include_str_handler): Likewise.
11065 (compile_error_handler): Likewise.
11066 (concat_handler): Likewise.
11067 (env_handler): Likewise.
11068 (cfg_handler): Likewise.
11069 (include_handler): Likewise.
11070 (line_handler): Likewise.
11071 (stringify_handler): Likewise.
11072 (sorry): Likewise.
11073 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc):
11074 Adjust to transcribers returning optional.
11075
11076 2024-01-16 Philip Herron <[email protected]>
11077
11078 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
11079 always resolve the type even when its an a mandatory trait item
11080 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
11081 Add check for enum candidates otherwise you get undefined behaviour
11082
11083 2024-01-16 Raiki Tamura <[email protected]>
11084
11085 * lex/rust-codepoint.h: Add comment
11086 * lex/rust-lex.h: New method to get decoded characters
11087 * rust-session-manager.cc (validate_crate_name): Modify unicode check
11088 (rust_crate_name_validation_test): Add testcases
11089 * util/rust-unicode.h (RUST_UNICODE_H): New class Utf8String.
11090 (class Utf8String): New class.
11091 * util/rust-unicode.cc (binary_search_sorted_array): Add comment.
11092 (recursive_decomp_cano): Add comment.
11093 (recomp): Remove dead code.
11094 (dump_string): Removed.
11095
11096 2024-01-16 Owen Avery <[email protected]>
11097
11098 * util/rust-unicode.cc: Add CHECKING_P guard.
11099
11100 2024-01-16 Philip Herron <[email protected]>
11101
11102 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
11103 We need to check if a function context exists
11104
11105 2024-01-16 Philip Herron <[email protected]>
11106
11107 * expand/rust-proc-macro.cc (literal_from_string): update Lexer constructor
11108 (tokenstream_from_string): likewise
11109 * lex/rust-lex.cc (Lexer::Lexer): likewise
11110 * lex/rust-lex.h: pass through Linemap
11111 * parse/rust-cfg-parser.cc (parse_cfg_option): likewise
11112 * rust-session-manager.cc (Session::load_extern_crate): likewise
11113 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
11114 dont apply Sized on self
11115 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate): new
11116 * typecheck/rust-hir-type-check-base.h: add prototype
11117 * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::Resolve): apply Sized
11118 (TypeResolveGenericParam::visit): likewise
11119 * typecheck/rust-hir-type-check-type.h: update prototypes
11120 * typecheck/rust-typecheck-context.cc: remove bad assertions
11121 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): cleanup
11122 (TypeCheckBase::get_predicate_from_bound): apply sized rules properly
11123 * util/rust-hir-map.cc (Mappings::lookup_trait_item_lang_item): helpers
11124 (Mappings::get_lang_item): likewise
11125 * util/rust-hir-map.h: likewise
11126 * util/rust-token-converter.cc (from_ident): update lexer ctor
11127 (from_punct): likewise
11128
11129 2024-01-16 Philip Herron <[email protected]>
11130
11131 * typecheck/rust-hir-path-probe.cc: track regular polarity
11132 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): likewise
11133 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
11134 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): likewise
11135 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
11136 (TypeBoundPredicate::TypeBoundPredicate): update ctor
11137 (TypeBoundPredicate::operator=): update copy assignment ctor
11138 (TypeBoundPredicate::error): update error node
11139 * typecheck/rust-tyty.h: add polarity field to predicate
11140
11141 2024-01-16 Philip Herron <[email protected]>
11142
11143 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): use new BoundPolarity enum
11144 * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): likewise
11145 * hir/rust-hir-dump.cc (BoundPolarityString): new helper
11146 (Dump::visit): update hir dump
11147 * hir/tree/rust-hir-item.h (class ImplBlock): likewise
11148 * hir/tree/rust-hir-type.h (class TraitBound): likewise
11149 * hir/tree/rust-hir.cc (TraitBound::as_string): fix as string
11150 * util/rust-common.h (enum Polarity): add new anti bound
11151 (enum BoundPolarity): likewise
11152 * util/rust-hir-map.cc (Mappings::Mappings): update naming
11153
11154 2024-01-16 Owen Avery <[email protected]>
11155
11156 * rust-backend.h: Include "rust-gcc.h".
11157 (class Gcc_backend): Move to ...
11158 * rust-gcc.cc (class Gcc_backend): ... here.
11159
11160 2024-01-16 Philip Herron <[email protected]>
11161
11162 * typecheck/rust-hir-type-check-item.cc: add is_error check
11163
11164 2024-01-16 Raiki Tamura <[email protected]>
11165
11166 * Make-lang.in: Add rust-unicode.o
11167 * rust-lang.cc (run_rust_tests): Add test.
11168 * rust-system.h: Include <array>
11169 * util/make-rust-unicode.py: Generater of rust-unicode-data.h.
11170 * util/rust-unicode-data.h: Auto-generated file.
11171 * util/rust-unicode.cc: New file.
11172 * util/rust-unicode.h: New file.
11173
11174 2024-01-16 Arthur Cohen <[email protected]>
11175
11176 * rust-diagnostics.cc: Rework `make_description` and `make_url` functions.
11177 * rust-diagnostics.h: Specify ErrorCode's underlying type,
11178 remove error_codes_strings table.
11179 * rust_error_codes.def: New file.
11180
11181 2024-01-16 Owen Avery <[email protected]>
11182
11183 * rust-location.h (typedef Location): Remove.
11184 * expand/rust-proc-macro.cc
11185 (register_callback): Replace Location constructor with UNDEF_LOCATION.
11186 * ast/rust-ast-collector.h: Replace Location with location_t.
11187 * checks/errors/privacy/rust-privacy-reporter.cc: Likewise.
11188 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
11189 * checks/errors/privacy/rust-pub-restricted-visitor.cc: Likewise.
11190 * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
11191 * checks/errors/rust-feature-gate.cc: Likewise.
11192 * checks/errors/rust-feature-gate.h: Likewise.
11193 * metadata/rust-imports.h: Likewise.
11194 * resolve/rust-ast-resolve-path.h: Likewise.
11195 * resolve/rust-name-resolver.h: Likewise.
11196 * rust-backend.h: Likewise.
11197 * rust-diagnostics.h: Likewise.
11198 * rust-gcc.cc: Likewise.
11199 * rust-linemap.h: Likewise.
11200 * util/rust-attributes.cc: Likewise.
11201 * util/rust-hir-map.cc: Likewise.
11202 * util/rust-hir-map.h: Likewise.
11203 * util/rust-token-converter.cc: Likewise.
11204
11205 2024-01-16 Owen Avery <[email protected]>
11206
11207 * typecheck/rust-autoderef.cc: Replace Location with location_t.
11208 * typecheck/rust-coercion.cc: Likewise.
11209 * typecheck/rust-coercion.h: Likewise.
11210 * typecheck/rust-hir-path-probe.h: Likewise.
11211 * typecheck/rust-hir-trait-reference.cc: Likewise.
11212 * typecheck/rust-hir-trait-resolve.cc: Likewise.
11213 * typecheck/rust-hir-type-check-base.cc: Likewise.
11214 * typecheck/rust-hir-type-check-expr.cc: Likewise.
11215 * typecheck/rust-hir-type-check-expr.h: Likewise.
11216 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
11217 * typecheck/rust-hir-type-check-item.cc: Likewise.
11218 * typecheck/rust-hir-type-check-path.cc: Likewise.
11219 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
11220 * typecheck/rust-hir-type-check-stmt.cc: Likewise.
11221 * typecheck/rust-hir-type-check-struct.cc: Likewise.
11222 * typecheck/rust-hir-type-check-type.cc: Likewise.
11223 * typecheck/rust-hir-type-check-type.h: Likewise.
11224 * typecheck/rust-type-util.cc: Likewise.
11225 * typecheck/rust-type-util.h: Likewise.
11226 * typecheck/rust-tyty-bounds.cc: Likewise.
11227 * typecheck/rust-tyty-call.cc: Likewise.
11228 * typecheck/rust-tyty-call.h: Likewise.
11229 * typecheck/rust-tyty-cmp.h: Likewise.
11230 * typecheck/rust-tyty-subst.cc: Likewise.
11231 * typecheck/rust-tyty-subst.h: Likewise.
11232 * typecheck/rust-tyty.cc: Likewise.
11233
11234 2024-01-16 Muhammad Mahad <[email protected]>
11235
11236 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
11237 refactored error message & called error function.
11238
11239 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11240
11241 * expand/rust-proc-macro.cc (literal_from_string): Add callback
11242 function.
11243 (load_macros_array): Likewise.
11244
11245 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11246
11247 * util/rust-token-converter.cc (handle_suffix): Rework function
11248 to make it work with the new literal conversion function.
11249 (convert_literal): Add a new function to convert to a proc macro
11250 literal from a literal tokenptr. The function will abort if the
11251 pointer does not point to a literal.
11252 (convert): Add call to convert literal for every literal case.
11253 * util/rust-token-converter.h (convert_literal): Add public
11254 prototype.
11255
11256 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11257
11258 * expand/rust-proc-macro.cc: Remove static modifier and move to
11259 an anonymous namespace.
11260
11261 2024-01-16 Muhammad Mahad <[email protected]>
11262
11263 * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
11264 Formatted according to enum class.
11265 * checks/errors/rust-feature-gate.cc (FeatureGate::gate): likewise.
11266 * checks/errors/rust-unsafe-checker.cc (check_unsafe_call): likewise.
11267 * hir/rust-ast-lower-base.cc (struct_field_name_exists): likewise.
11268 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): likewise.
11269 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
11270 likewise.
11271 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): likewise.
11272 (PatternDeclaration::add_new_binding): likewise.
11273 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): likewise.
11274 * resolve/rust-ast-verify-assignee.h: likewise.
11275 * rust-diagnostics.cc: updated make_desc & url function for enum class.
11276 * rust-diagnostics.h (struct ErrorCode): removed struct to switch to enum.
11277 (enum class): Switched from errorcode struct to enum class.
11278 (XSTR): Macro for converting enum to string.
11279 (STR): macro Used by XSTR for converting to string.
11280 (ERROR_CODE): macro used by map for check.
11281 (TABLE_TO_MAP): macro used by map for check
11282 * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
11283 Formatted according to enum class.
11284 * typecheck/rust-hir-path-probe.h: likewise.
11285 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise.
11286 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
11287 likewise.
11288 (TypeCheckImplItemWithTrait::visit): likewise.
11289 * typecheck/rust-hir-type-check-item.cc: likewise.
11290 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): likewise.
11291 (emit_invalid_field_error): likewise.
11292 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): likewise.
11293 * typecheck/rust-tyty-call.cc (emit_unexpected_argument_error): likewise.
11294 (TypeCheckCallExpr::visit): likewise.
11295 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
11296 likewise.
11297 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): likewise.
11298
11299 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11300
11301 * util/rust-attributes.cc (check_proc_macro_non_root): Add
11302 function to emit this specific error.
11303 (AttributeChecker::visit): Modify visitor to propagate to some
11304 containers that were not handled correctly.
11305
11306 2024-01-16 Owen Avery <[email protected]>
11307
11308 * backend/rust-compile-base.h: Replace Location with location_t.
11309 * metadata/rust-imports.h: Likewise.
11310 * resolve/rust-name-resolver.cc: Likewise.
11311 * resolve/rust-name-resolver.h: Likewise.
11312 * rust-backend.h: Likewise.
11313 * rust-gcc.cc: Likewise.
11314 * rust-gcc.h: Likewise.
11315
11316 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11317
11318 * expand/rust-proc-macro.cc (available): Remove function.
11319 (load_macros_array): There was no need for an indirection here.
11320
11321 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11322
11323 * expand/rust-proc-macro.cc (available): Add symbol
11324 registration.
11325 (load_macros_array): Likewise.
11326
11327 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11328
11329 * expand/rust-proc-macro.cc (load_macros_array): Symbol rename.
11330
11331 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11332
11333 * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
11334 Refactor the function to be safer and more efficient.
11335
11336 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11337
11338 * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
11339 Add a new function to find a potential proc macro type
11340 attribute on a given item.
11341 (proc_macro_privacy_check): Move all proc macro privacy check in
11342 their own function to avoid cluttering the usual privacy check.
11343 (PrivacyReporter::go): Add call to newly created proc macro
11344 privacy check function.
11345
11346 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11347
11348 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::go):
11349 Add visibility verification.
11350
11351 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11352
11353 * util/rust-attributes.cc (is_proc_macro_type): Add function to
11354 identify matching proc macro attribute type.
11355 (check_proc_macro_non_function): Add function to check and emit
11356 error.
11357 (AttributeChecker::visit): Add cal to new check function.
11358
11359 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11360
11361 * ast/rust-ast.h: Remove NodeId from identifiers.
11362
11363 2024-01-16 Muhammad Mahad <[email protected]>
11364
11365 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
11366 Added check for error code support.
11367
11368 2024-01-16 Muhammad Mahad <[email protected]>
11369
11370 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
11371 called error function.
11372
11373 2024-01-16 Owen Avery <[email protected]>
11374
11375 * backend/rust-compile-base.cc: Replace Location with location_t.
11376 * backend/rust-compile-base.h: Likewise.
11377 * backend/rust-compile-expr.cc: Likewise.
11378 * lex/rust-token.h: Likewise.
11379 * metadata/rust-import-archive.cc: Likewise.
11380 * metadata/rust-imports.cc: Likewise.
11381 * metadata/rust-imports.h: Likewise.
11382 * rust-backend.h: Likewise.
11383 * rust-diagnostics.cc: Likewise.
11384 * rust-diagnostics.h: Likewise.
11385 * rust-gcc.cc: Likewise.
11386 * rust-linemap.cc: Likewise.
11387 * util/rust-token-converter.cc: Likewise.
11388
11389 2024-01-16 Owen Avery <[email protected]>
11390
11391 * ast/rust-ast-builder.h: Replace Location with location_t.
11392 * ast/rust-ast.h: Likewise.
11393 * ast/rust-expr.h: Likewise.
11394 * ast/rust-item.h: Likewise.
11395 * ast/rust-macro.h: Likewise.
11396 * ast/rust-path.h: Likewise.
11397 * hir/tree/rust-hir-expr.h: Likewise.
11398 * hir/tree/rust-hir-item.h: Likewise.
11399 * hir/tree/rust-hir-path.h: Likewise.
11400 * hir/tree/rust-hir.h: Likewise.
11401 * lex/rust-lex.cc: Likewise.
11402 * lex/rust-lex.h: Likewise.
11403
11404 2024-01-16 Owen Avery <[email protected]>
11405
11406 * expand/rust-derive-clone.cc: Replace Location with location_t.
11407 * expand/rust-derive-clone.h: Likewise.
11408 * expand/rust-derive-copy.cc: Likewise.
11409 * expand/rust-derive-copy.h: Likewise.
11410 * expand/rust-derive.cc: Likewise.
11411 * expand/rust-derive.h: Likewise.
11412 * expand/rust-macro-builtins.cc: Likewise.
11413 * expand/rust-macro-builtins.h: Likewise.
11414 * expand/rust-macro-expand.cc: Likewise.
11415 * parse/rust-parse-impl.h: Likewise.
11416 * parse/rust-parse.cc: Likewise.
11417 * parse/rust-parse.h: Likewise.
11418
11419 2024-01-16 Owen Avery <[email protected]>
11420
11421 * parse/rust-parse-impl.h
11422 (Parser::parse_macro_match): Use token_id_is_keyword.
11423
11424 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11425
11426 * ast/rust-ast.h (class Identifier): Remove interface
11427 inheritance.
11428 (class SimplePath): Likewise.
11429 * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
11430 return type.
11431 (derive_item): Update according to get_traits_to_derive return
11432 type.
11433 (expand_item_attribute): Likewise.
11434 (ExpandVisitor::expand_inner_stmts): Likewise.
11435 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
11436 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_invocation):
11437 Change input type to SimplePath.
11438 (Mappings::lookup_derive_proc_macro_invocation): Likewise.
11439 (Mappings::insert_attribute_proc_macro_invocation): Likewise.
11440 (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
11441 * util/rust-hir-map.h: Likewise with function prototypes.
11442 * util/rust-proc-macro-invocation.h: Removed.
11443
11444 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11445
11446 * ast/rust-ast.h: Add new constructor for SimplePath from an
11447 identifier.
11448 * expand/rust-expand-visitor.cc (get_traits_to_derive): Add
11449 conversion.
11450
11451 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11452
11453 * expand/rust-macro-expand.cc (MacroExpander::import_proc_macros):
11454 Remove function.
11455 * expand/rust-macro-expand.h (struct MacroExpander): Remove
11456 import_proc_macro function.
11457 * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_def):
11458 Add a function to insert a derive proc macro definition.
11459 (Mappings::insert_bang_proc_macro): Remove function.
11460 (Mappings::insert_bang_proc_macro_def): Add function to insert a
11461 bang proc macro definition.
11462 (Mappings::insert_attribute_proc_macro_def): Likewise with
11463 attribute proc macros.
11464 (Mappings::lookup_derive_proc_macro_def): Add a function to
11465 lookup a defined derive proc macro definition.
11466 (Mappings::lookup_bang_proc_macro): Remove function.
11467 (Mappings::lookup_bang_proc_macro_def): Add a function to lookup
11468 a bang proc macro definition.
11469 (Mappings::lookup_attribute_proc_macro_def): Add a function to
11470 lookup an attribute prod macro definition.
11471 (Mappings::insert_derive_proc_macro_invocation): Add a function
11472 to insert a derive proc macro invocation.
11473 (Mappings::lookup_derive_proc_macro_invocation): Add a function
11474 to lookup a derive proc macro invocation.
11475 (Mappings::insert_bang_proc_macro_invocation): Add a function to
11476 insert a bang proc macro invocation.
11477 (Mappings::lookup_bang_proc_macro_invocation): Add a function to
11478 lookup a bang proc macro invocation.
11479 (Mappings::insert_attribute_proc_macro_invocation): Add a
11480 function to insert an attribute proc macro invocation.
11481 (Mappings::lookup_attribute_proc_macro_invocation): Add a
11482 function to lookup an attribute proc macro invocation.
11483 * util/rust-hir-map.h: Add different proc macro mappings
11484 and change function prototypes.
11485 * expand/rust-expand-visitor.cc (get_traits_to_derive): Return a
11486 vector of SimplePath instead.
11487 (derive_item): Accept SimplePath instead of a string.
11488 * ast/rust-ast.h: Add common ProcMacroInvocable interface to
11489 Identifiers and SimplePath nodes.
11490 * ast/rust-ast.cc: Add const modifier.
11491 * ast/rust-macro.h: Change path and identifier getters.
11492 * ast/rust-path.h: Change return type to reference.
11493 * util/rust-proc-macro-invocation.h: New file.
11494
11495 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11496
11497 * util/rust-attributes.h (RUST_ATTRIBUTES_H): Add missing header
11498 guard.
11499
11500 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11501
11502 * ast/rust-ast.h (class MetaItem): Add MetaItem dispatch values.
11503 * ast/rust-expr.h: Add LitExpr and PathLit dispatch.
11504 * ast/rust-macro.h: Add remaining dispatch getters.
11505
11506 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11507
11508 * metadata/rust-extern-crate.h: Add proc macro getter.
11509 * rust-session-manager.cc (Session::load_extern_crate): Collect
11510 mappings and create mappings.
11511 * util/rust-hir-map.cc: Add insertion and lookup functions for
11512 every mapping.
11513 * util/rust-hir-map.h: Add function prototypes.
11514
11515 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11516
11517 * metadata/rust-imports.cc (Import::try_package_in_directory):
11518 Add call to load macros before loading metadatas.
11519 * expand/rust-proc-macro.cc: Return empty vector instead of
11520 panicking on error.
11521
11522 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11523
11524 * metadata/rust-import-archive.cc (Stream_concatenate::do_peek):
11525 Remove deletion.
11526 (Stream_concatenate::do_advance): Likewise.
11527 (Import::find_archive_export_data): Replace with a smart
11528 pointer.
11529 * metadata/rust-imports.cc (add_search_path): Change return type
11530 to smart pointer.
11531 (Import::open_package): Likewise.
11532 (Import::try_package_in_directory): Likewise.
11533 (Import::find_export_data): Likewise.
11534 (Import::find_object_export_data): Likewise.
11535 (Import::Import): Change constructor to accept unique_ptr.
11536 * metadata/rust-imports.h: Change constructor prototype.
11537 * rust-session-manager.cc (Session::load_extern_crate): Change
11538 pointer to smart pointer.
11539
11540 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11541
11542 * metadata/rust-extern-crate.cc (ExternCrate::ExternCrate):
11543 Change constructor to accept procedural macro vector.
11544 * metadata/rust-extern-crate.h: Add vector of procecural macro
11545 in extern crate.
11546 * rust-session-manager.cc (Session::load_extern_crate): Add
11547 argument to new constructor call.
11548
11549 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11550
11551 * metadata/rust-imports.cc (add_search_path): Change prototype,
11552 now return a pair of Stream and procedural macro vector.
11553 (Import::open_package): Likewise.
11554 (Import::try_package_in_directory): Likewise.
11555 * metadata/rust-imports.h: Likewise.
11556 * rust-session-manager.cc (Session::load_extern_crate):
11557 Likewise.
11558
11559 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11560
11561 * metadata/rust-imports.h: Make the function to load a given
11562 file public.
11563 * rust-session-manager.cc (Session::load_extern_crate): Change
11564 path resolution depending on extern crate declaration in cli
11565 arguments.
11566
11567 2024-01-16 Owen Avery <[email protected]>
11568
11569 * ast/rust-ast-collector.h
11570 (TokenCollector::visit):
11571 Replace default argument with UNDEF_LOCATION.
11572
11573 2024-01-16 Owen Avery <[email protected]>
11574
11575 * backend/rust-compile-base.cc: Replace Location with location_t.
11576 * backend/rust-compile-base.h: Likewise.
11577 * backend/rust-compile-block.cc: Likewise.
11578 * backend/rust-compile-expr.cc: Likewise.
11579 * backend/rust-compile-expr.h: Likewise.
11580 * backend/rust-compile-extern.h: Likewise.
11581 * backend/rust-compile-implitem.h: Likewise.
11582 * backend/rust-compile-intrinsic.cc: Likewise.
11583 * backend/rust-compile-item.h: Likewise.
11584 * backend/rust-compile-pattern.h: Likewise.
11585 * backend/rust-compile-resolve-path.cc: Likewise.
11586 * backend/rust-compile-stmt.cc: Likewise.
11587 * backend/rust-compile-type.cc: Likewise.
11588 * backend/rust-compile.cc: Likewise.
11589 * backend/rust-constexpr.cc: Likewise.
11590
11591 2024-01-16 Muhammad Mahad <[email protected]>
11592
11593 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
11594 refactored and call error function.
11595
11596 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11597
11598 * util/rust-attributes.cc (AttributeChecker::visit): Add help
11599 message.
11600
11601 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11602
11603 * util/rust-attributes.cc (AttributeChecker::visit): Add
11604 attribute input check.
11605
11606 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11607
11608 * util/rust-attributes.cc (AttributeChecker::visit): Add
11609 attribute check on functions.
11610
11611 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11612
11613 * util/rust-token-converter.cc (from_ident): Adapt code to new
11614 constructor.
11615
11616 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11617
11618 * expand/rust-proc-macro.cc (tokenstream_from_string): Add a
11619 function that creates a tokenstream from a given string.
11620 (load_macros_array): Add call to registration function.
11621
11622 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
11623
11624 * lang.opt: Add option
11625 * rust-session-manager.cc: Add option registration in session
11626 target options.
11627 * rust-session-manager.h (struct CompileOptions): Add new getter
11628 for proc macros instead of a boolean.
11629
11630 2024-01-16 Arthur Cohen <[email protected]>
11631
11632 * resolve/rust-forever-stack.h: New file.
11633 * resolve/rust-forever-stack.hxx: New file.
11634
11635 2024-01-16 Marc Poulhiès <[email protected]>
11636
11637 * hir/rust-hir-dump.cc (convert_param_kind_to_str): New.
11638 (convert_new_bind_type_to_str): New.
11639 (convert_mut_to_str): New.
11640 (Dump::go): New.
11641 (Dump::put): New.
11642 (Dump::begin): New.
11643 (Dump::end): New.
11644 (Dump::begin_field): New.
11645 (Dump::end_field): New.
11646 (Dump::put_field): New.
11647 (Dump::visit_field): New.
11648 (Dump::visit): Refactor.
11649 (Dump::visit_collection): New.
11650 (Dump::do_traititem): New.
11651 (Dump::do_vis_item): New.
11652 (Dump::do_functionparam): New.
11653 (Dump::do_pathpattern): New.
11654 (Dump::do_structexprstruct): New.
11655 (Dump::do_expr): New.
11656 (Dump::do_pathexpr): New.
11657 (Dump::do_typepathsegment): New.
11658 (Dump::do_typepathfunction): New.
11659 (Dump::do_qualifiedpathtype): New.
11660 (Dump::do_operatorexpr): New.
11661 (Dump::do_mappings): New.
11662 (Dump::do_inner_attrs): New.
11663 (Dump::do_outer_attrs): New.
11664 (Dump::do_baseloopexpr): New.
11665 (Dump::do_ifletexpr): New.
11666 (Dump::do_struct): New.
11667 (Dump::do_enumitem): New.
11668 (Dump::do_traitfunctiondecl): New.
11669 (Dump::do_externalitem): New.
11670 (Dump::do_namefunctionparam): New.
11671 (Dump::do_stmt): New.
11672 (Dump::do_type): New.
11673 (Dump::do_item): New.
11674 (Dump::do_tuplefield): New.
11675 (Dump::do_structfield): New.
11676 (Dump::do_genericargs): New.
11677 (Dump::do_maybenamedparam): New.
11678 * hir/rust-hir-dump.h: Refactor.
11679 * hir/tree/rust-hir-item.h (enum_to_str): New.
11680 * hir/tree/rust-hir-type.h (enum_to_str): New.
11681 * hir/tree/rust-hir.cc (enum_to_str): New.
11682 * util/rust-common.h (enum_to_str): New.
11683
11684 2024-01-16 Arthur Cohen <[email protected]>
11685 Matthew Jasper <[email protected]>
11686
11687 * Make-lang.in: Add `rust-rib.cc` object.
11688 * resolve/rust-rib.cc: New file.
11689 * resolve/rust-rib.h: New file.
11690
11691 2024-01-16 Owen Avery <[email protected]>
11692
11693 * ast/rust-ast.h: Replace Location with location_t.
11694 * ast/rust-expr.h: Likewise.
11695 * ast/rust-item.h: Likewise.
11696 * ast/rust-macro.h: Likewise.
11697 * ast/rust-path.h: Likewise.
11698 * ast/rust-pattern.h: Likewise.
11699 * ast/rust-stmt.h: Likewise.
11700 * ast/rust-type.h: Likewise.
11701 * hir/rust-ast-lower-base.h: Likewise.
11702 * hir/tree/rust-hir-expr.h: Likewise.
11703 * hir/tree/rust-hir-item.h: Likewise.
11704 * hir/tree/rust-hir-path.h: Likewise.
11705 * hir/tree/rust-hir-pattern.h: Likewise.
11706 * hir/tree/rust-hir-stmt.h: Likewise.
11707 * hir/tree/rust-hir-type.h: Likewise.
11708 * hir/tree/rust-hir.h: Likewise.
11709 * lex/rust-token.h: Likewise.
11710 * resolve/rust-ast-resolve-pattern.h: Likewise.
11711 * typecheck/rust-hir-trait-reference.h: Likewise.
11712 * typecheck/rust-tyty-bounds.h: Likewise.
11713 * typecheck/rust-tyty-call.h: Likewise.
11714 * typecheck/rust-tyty-subst.h: Likewise.
11715 * typecheck/rust-tyty-util.h: Likewise.
11716 * typecheck/rust-tyty.h: Likewise.
11717
11718 2024-01-16 Owen Avery <[email protected]>
11719
11720 * ast/rust-ast-collector.cc: Replace Location with location_t.
11721 * ast/rust-ast.cc: Likewise.
11722 * ast/rust-ast.h: Likewise.
11723 * ast/rust-expr.h: Likewise.
11724 * ast/rust-item.h: Likewise.
11725 * ast/rust-macro.h: Likewise.
11726 * ast/rust-path.cc: Likewise.
11727 * ast/rust-path.h: Likewise.
11728 * ast/rust-pattern.h: Likewise.
11729 * ast/rust-stmt.h: Likewise.
11730 * ast/rust-type.h: Likewise.
11731 * backend/rust-compile-base.cc: Likewise.
11732 * backend/rust-compile-base.h: Likewise.
11733 * backend/rust-compile-block.cc: Likewise.
11734 * backend/rust-compile-expr.cc: Likewise.
11735 * backend/rust-compile-expr.h: Likewise.
11736 * backend/rust-compile-fnparam.cc: Likewise.
11737 * backend/rust-compile-fnparam.h: Likewise.
11738 * backend/rust-compile-intrinsic.cc: Likewise.
11739 * backend/rust-compile-pattern.cc: Likewise.
11740 * backend/rust-compile-resolve-path.h: Likewise.
11741 * backend/rust-compile.cc: Likewise.
11742 * checks/errors/rust-const-checker.cc: Likewise.
11743 * checks/errors/rust-const-checker.h: Likewise.
11744 * checks/errors/rust-unsafe-checker.cc: Likewise.
11745 * checks/errors/rust-unsafe-checker.h: Likewise.
11746 * expand/rust-macro-builtins.cc: Likewise.
11747 * expand/rust-macro-expand.h: Likewise.
11748 * hir/rust-ast-lower-base.h: Likewise.
11749 * hir/rust-ast-lower-implitem.h: Likewise.
11750 * hir/rust-ast-lower-item.cc: Likewise.
11751 * hir/tree/rust-hir-expr.h: Likewise.
11752 * hir/tree/rust-hir-item.h: Likewise.
11753 * hir/tree/rust-hir-path.h: Likewise.
11754 * hir/tree/rust-hir-pattern.h: Likewise.
11755 * hir/tree/rust-hir-stmt.h: Likewise.
11756 * hir/tree/rust-hir-type.h: Likewise.
11757 * hir/tree/rust-hir.cc: Likewise.
11758 * hir/tree/rust-hir.h: Likewise.
11759 * lex/rust-token.h: Likewise.
11760 * metadata/rust-extern-crate.cc: Likewise.
11761 * metadata/rust-extern-crate.h: Likewise.
11762 * parse/rust-parse-impl.h: Likewise.
11763 * parse/rust-parse.h: Likewise.
11764 * resolve/rust-ast-resolve-expr.cc: Likewise.
11765 * resolve/rust-ast-resolve-implitem.h: Likewise.
11766 * resolve/rust-ast-resolve-pattern.h: Likewise.
11767 * resolve/rust-ast-resolve-stmt.h: Likewise.
11768 * resolve/rust-ast-resolve-toplevel.h: Likewise.
11769 * resolve/rust-ast-resolve-type.h: Likewise.
11770 * resolve/rust-name-resolver.cc: Likewise.
11771 * resolve/rust-name-resolver.h: Likewise.
11772 * rust-diagnostics.cc: Likewise.
11773 * rust-diagnostics.h: Likewise.
11774 * rust-gcc.cc: Likewise.
11775 * rust-session-manager.cc: Likewise.
11776 * rust-session-manager.h: Likewise.
11777 * typecheck/rust-casts.cc: Likewise.
11778 * typecheck/rust-casts.h: Likewise.
11779 * typecheck/rust-coercion.cc: Likewise.
11780 * typecheck/rust-coercion.h: Likewise.
11781 * typecheck/rust-hir-path-probe.cc: Likewise.
11782 * typecheck/rust-hir-path-probe.h: Likewise.
11783 * typecheck/rust-hir-trait-reference.cc: Likewise.
11784 * typecheck/rust-hir-trait-reference.h: Likewise.
11785 * typecheck/rust-hir-trait-resolve.cc: Likewise.
11786 * typecheck/rust-hir-type-check-base.cc: Likewise.
11787 * typecheck/rust-hir-type-check-base.h: Likewise.
11788 * typecheck/rust-hir-type-check-item.cc: Likewise.
11789 * typecheck/rust-hir-type-check-item.h: Likewise.
11790 * typecheck/rust-hir-type-check-path.cc: Likewise.
11791 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
11792 * typecheck/rust-hir-type-check-pattern.h: Likewise.
11793 * typecheck/rust-hir-type-check-type.cc: Likewise.
11794 * typecheck/rust-hir-type-check-type.h: Likewise.
11795 * typecheck/rust-hir-type-check.cc: Likewise.
11796 * typecheck/rust-hir-type-check.h: Likewise.
11797 * typecheck/rust-substitution-mapper.cc: Likewise.
11798 * typecheck/rust-substitution-mapper.h: Likewise.
11799 * typecheck/rust-type-util.cc: Likewise.
11800 * typecheck/rust-typecheck-context.cc: Likewise.
11801 * typecheck/rust-tyty-bounds.cc: Likewise.
11802 * typecheck/rust-tyty-call.h: Likewise.
11803 * typecheck/rust-tyty-subst.cc: Likewise.
11804 * typecheck/rust-tyty-subst.h: Likewise.
11805 * typecheck/rust-tyty-util.cc: Likewise.
11806 * typecheck/rust-tyty-util.h: Likewise.
11807 * typecheck/rust-tyty.cc: Likewise.
11808 * typecheck/rust-tyty.h: Likewise.
11809 * typecheck/rust-unify.cc: Likewise.
11810 * typecheck/rust-unify.h: Likewise.
11811 * util/rust-hir-map.cc: Likewise.
11812 * util/rust-hir-map.h: Likewise.
11813 * util/rust-identifier.h: Likewise.
11814
11815 2024-01-16 Owen Avery <[email protected]>
11816
11817 * rust-gcc.cc
11818 (Gcc_backend::debug): Move out of class declaration.
11819 (Gcc_backend::get_identifier_node): Likewise.
11820 (Gcc_backend::wchar_type): Likewise.
11821
11822 2024-01-16 Muhammad Mahad <[email protected]>
11823
11824 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
11825 called error function.
11826
11827 2024-01-16 Owen Avery <[email protected]>
11828
11829 * rust-linemap.h (Linemap::predeclared_location): Remove.
11830 * backend/rust-compile-type.cc:
11831 Replace Linemap::predeclared_location with BUILTINS_LOCATION.
11832 * resolve/rust-name-resolver.cc: Likewise.
11833 * typecheck/rust-hir-type-check-type.cc: Likewise.
11834 * typecheck/rust-tyty.cc: Likewise.
11835
11836 2024-01-16 Owen Avery <[email protected]>
11837
11838 * rust-gcc.h: Add include guard.
11839
11840 2024-01-16 Arthur Cohen <[email protected]>
11841
11842 * rust-system.h (rust_unreachable): Change definition to fancy_abort
11843 * ast/rust-ast-collector.cc (TokenCollector::visit): Use rust_unreachable
11844 instead of gcc_unreachable.
11845 (get_delimiters): Likewise.
11846 * ast/rust-ast-dump.h: Likewise.
11847 * ast/rust-ast-formatting.cc (get_string_in_delims): Likewise.
11848 (get_mode_dump_desc): Likewise.
11849 * ast/rust-ast.cc (Visibility::as_string): Likewise.
11850 (UseTreeGlob::as_string): Likewise.
11851 * ast/rust-ast.h: Likewise.
11852 * ast/rust-macro.h: Likewise.
11853 * ast/rust-path.h: Likewise.
11854 * backend/rust-compile-expr.cc (sort_tuple_patterns): Likewise.
11855 (CompileExpr::visit): Likewise.
11856 (CompileExpr::generate_closure_fntype): Likewise.
11857 * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): Likewise.
11858 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): Likewise.
11859 (CompilePatternLet::visit): Likewise.
11860 * backend/rust-constexpr.cc (base_field_constructor_elt): Likewise.
11861 (eval_array_reference): Likewise.
11862 (label_matches): Likewise.
11863 (eval_store_expression): Likewise.
11864 (eval_call_expression): Likewise.
11865 (build_data_member_initialization): Likewise.
11866 (array_index_cmp): Likewise.
11867 (get_array_or_vector_nelts): Likewise.
11868 (eval_bit_field_ref): Likewise.
11869 (eval_loop_expr): Likewise.
11870 (potential_constant_expression_1): Likewise.
11871 * backend/rust-mangle.cc (v0_simple_type_prefix): Likewise.
11872 (v0_type_prefix): Likewise.
11873 (v0_mangle_item): Likewise.
11874 (Mangler::mangle_item): Likewise.
11875 * backend/rust-tree.cc (convert_to_void): Likewise.
11876 (type_memfn_quals): Likewise.
11877 (rs_tree_equal): Likewise.
11878 (fold_offsetof): Likewise.
11879 (fold_builtin_source_location): Likewise.
11880 (lvalue_error): Likewise.
11881 * backend/rust-tree.h (struct named_decl_hash): Likewise.
11882 (struct named_label_hash): Likewise.
11883 * checks/errors/privacy/rust-visibility-resolver.cc
11884 (VisibilityResolver::resolve_visibility): Likewise.
11885 (VisibilityResolver::visit): Likewise.
11886 * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Likewise.
11887 * checks/errors/rust-feature.cc (Feature::create): Likewise.
11888 * expand/rust-expand-visitor.cc (get_traits_to_derive): Likewise.
11889 (derive_item): Likewise.
11890 (expand_item_attribute): Likewise.
11891 (expand_stmt_attribute): Likewise.
11892 * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Likewise.
11893 (MacroExpander::match_repetition): Likewise.
11894 (transcribe_context): Likewise.
11895 (MacroExpander::import_proc_macros): Likewise.
11896 (MacroExpander::parse_proc_macro_output): Likewise.
11897 * expand/rust-macro-expand.h: Likewise.
11898 * expand/rust-macro-invoc-lexer.h: Likewise.
11899 * expand/rust-macro-substitute-ctx.cc (SubstituteCtx::substitute_token): Likewise.
11900 * expand/rust-proc-macro-invoc-lexer.h: Likewise.
11901 * expand/rust-proc-macro.cc (load_macros): Likewise.
11902 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_generic_args): Likewise.
11903 (ASTLoweringBase::lower_literal): Likewise.
11904 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
11905 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Likewise.
11906 * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Likewise.
11907 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
11908 * hir/tree/rust-hir.cc (get_string_in_delims): Likewise.
11909 (Visibility::as_string): Likewise.
11910 (UseTreeGlob::as_string): Likewise.
11911 (CompoundAssignmentExpr::as_string): Likewise.
11912 (ArithmeticOrLogicalExpr::as_string): Likewise.
11913 * lex/rust-lex.cc (Lexer::parse_byte_string): Likewise.
11914 (Lexer::parse_string): Likewise.
11915 * lex/rust-token.cc (RS_TOKEN): Likewise.
11916 * parse/rust-parse-impl.h (Parser::parse_simple_path_segment): Likewise.
11917 (Parser::parse_path_ident_segment): Likewise.
11918 (Parser::parse_attr_input): Likewise.
11919 (Parser::parse_inherent_impl_item): Likewise.
11920 (Parser::parse_trait_impl_item): Likewise.
11921 (Parser::parse_type_path_segment): Likewise.
11922 (Parser::parse_reference_type): Likewise.
11923 (get_lbp_for_comparison_expr): Likewise.
11924 * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewise.
11925 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
11926 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
11927 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
11928 (ResolveTypeToCanonicalPath::visit): Likewise.
11929 (ResolveGenericArgs::resolve_disambiguated_generic): Likewise.
11930 * rust-gcc.cc (operator_to_tree_code): Likewise.
11931 (fetch_overflow_builtins): Likewise.
11932 (Gcc_backend::non_zero_size_type): Likewise.
11933 (Gcc_backend::convert_tree): Likewise.
11934 * rust-lang.cc (grs_langhook_type_for_mode): Likewise.
11935 (grs_langhook_global_bindings_p): Likewise.
11936 (grs_langhook_pushdecl): Likewise.
11937 (grs_langhook_getdecls): Likewise.
11938 (convert): Likewise.
11939 * typecheck/rust-autoderef.h: Likewise.
11940 * typecheck/rust-hir-path-probe.cc: Likewise.
11941 * typecheck/rust-hir-trait-reference.cc (TraitItemReference::get_tyty): Likewise.
11942 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): Likewise.
11943 * typecheck/rust-hir-type-check-expr.cc: Likewise.
11944 * typecheck/rust-hir-type-check-expr.h: Likewise.
11945 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): Likewise.
11946 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
11947 * typecheck/rust-hir-type-check-stmt.h: Likewise.
11948 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
11949 * typecheck/rust-substitution-mapper.h: Likewise.
11950 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::get_context_type): Likewise.
11951 * typecheck/rust-tyty-call.h: Likewise.
11952 * typecheck/rust-tyty.cc (TypeKindFormat::to_string): Likewise.
11953 (BaseType::monomorphized_clone): Likewise.
11954 (VariantDef::variant_type_string): Likewise.
11955 (ClosureType::handle_substitions): Likewise.
11956 (IntType::as_string): Likewise.
11957 (UintType::as_string): Likewise.
11958 (FloatType::as_string): Likewise.
11959 * typecheck/rust-unify.cc (UnifyRules::expect_projection): Likewise.
11960 * util/rust-token-converter.cc (convert): Likewise.
11961 (from_literal): Likewise.
11962 (from_group): Likewise.
11963 (from_tokentree): Likewise.
11964
11965 2024-01-16 Muhammad Mahad <[email protected]>
11966
11967 * checks/errors/rust-feature-gate.cc (FeatureGate::gate):
11968 called error function.
11969
11970 2024-01-16 Muhammad Mahad <[email protected]>
11971
11972 * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
11973 called error function.
11974
11975 2024-01-16 Muhammad Mahad <[email protected]>
11976
11977 * checks/errors/rust-unsafe-checker.cc (check_unsafe_call):
11978 called error function.
11979
11980 2024-01-16 Owen Avery <[email protected]>
11981
11982 * rust-location.h
11983 (typedef RichLocation): Remove.
11984 * expand/rust-macro-expand.cc: Replace RichLocation with rich_location.
11985 * hir/rust-ast-lower-base.cc: Likewise.
11986 * resolve/rust-ast-resolve-implitem.h: Likewise.
11987 * resolve/rust-ast-resolve-stmt.h: Likewise.
11988 * resolve/rust-ast-resolve-toplevel.h: Likewise.
11989 * rust-diagnostics.cc: Likewise.
11990 * rust-diagnostics.h: Likewise.
11991 * rust-session-manager.cc: Likewise.
11992 * typecheck/rust-casts.cc: Likewise.
11993 * typecheck/rust-coercion.cc: Likewise.
11994 * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
11995 * typecheck/rust-hir-path-probe.h: Likewise.
11996 * typecheck/rust-hir-trait-reference.cc: Likewise.
11997 * typecheck/rust-hir-type-check-expr.cc: Likewise.
11998 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
11999 * typecheck/rust-hir-type-check-item.cc: Likewise.
12000 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
12001 * typecheck/rust-tyty-cmp.h: Likewise.
12002 * typecheck/rust-tyty-subst.cc: Likewise.
12003 * typecheck/rust-tyty.cc: Likewise.
12004 * typecheck/rust-unify.cc: Likewise.
12005
12006 2024-01-16 Owen Avery <[email protected]>
12007
12008 * lex/rust-lex.cc
12009 (Lexer::start_line): Use linemap_line_start.
12010 * rust-linemap.cc
12011 (Linemap::start_line): Remove.
12012 * rust-linemap.h
12013 (Linemap::start_line): Remove.
12014
12015 2024-01-16 Owen Avery <[email protected]>
12016
12017 * rust-linemap.cc
12018 (RichLocation::RichLocation): Remove.
12019 (RichLocation::~RichLocation): Remove.
12020 (RichLocation::add_range): Remove.
12021 (RichLocation::add_fixit_insert_before): Remove.
12022 (RichLocation::add_fixit_insert_after): Remove.
12023 * rust-location.h
12024 (class RichLocation): Remove.
12025 * rust-diagnostics.cc
12026 (rust_be_error_at): Remove RichLocation::get invocation.
12027 * expand/rust-macro-expand.cc: Fix RichLocation constructor.
12028 * hir/rust-ast-lower-base.cc: Likewise.
12029 * resolve/rust-ast-resolve-implitem.h: Likewise.
12030 * resolve/rust-ast-resolve-stmt.h: Likewise.
12031 * resolve/rust-ast-resolve-toplevel.h: Likewise.
12032 * rust-session-manager.cc: Likewise.
12033 * typecheck/rust-casts.cc: Likewise.
12034 * typecheck/rust-coercion.cc: Likewise.
12035 * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
12036 * typecheck/rust-hir-path-probe.h: Likewise.
12037 * typecheck/rust-hir-trait-reference.cc: Likewise.
12038 * typecheck/rust-hir-type-check-expr.cc: Likewise.
12039 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
12040 * typecheck/rust-hir-type-check-item.cc: Likewise.
12041 * typecheck/rust-hir-type-check-pattern.cc: Likewise.
12042 * typecheck/rust-tyty-cmp.h: Likewise.
12043 * typecheck/rust-tyty-subst.cc: Likewise.
12044 * typecheck/rust-tyty.cc: Likewise.
12045 * typecheck/rust-unify.cc: Likewise.
12046
12047 2024-01-16 Owen Avery <[email protected]>
12048
12049 * lex/rust-lex.cc
12050 (Lexer::get_current_location): Use linemap_position_for_column.
12051 * rust-session-manager.cc
12052 (Session::handle_crate_name): Likewise.
12053 * rust-linemap.cc
12054 (Linemap::get_location): Remove.
12055 * rust-linemap.h
12056 (Linemap::get_location): Likewise.
12057
12058 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12059
12060 * lex/rust-token.cc (escape_special_chars): Add a function that
12061 escape a given string.
12062 (Token::as_string): Add call to escape function for string/char
12063 representations.
12064
12065 2024-01-16 Marc Poulhiès <[email protected]>
12066
12067 * hir/tree/rust-hir-type.h (MaybeNamedParam::get_type): Remove
12068 rust_assert.
12069 (BareFunctionType::get_return_type): Likewise.
12070
12071 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12072
12073 * backend/rust-compile-intrinsic.cc (offset_handler): Remove
12074 braces.
12075 (sizeof_handler): Likewise.
12076 (transmute_handler): Likewise.
12077 (rotate_handler): Likewise.
12078 (wrapping_op_handler_inner): Likewise.
12079 (op_with_overflow_inner): Likewise.
12080 (atomic_load_handler_inner): Likewise.
12081 (unchecked_op_inner): Likewise.
12082 (uninit_handler): Likewise.
12083
12084 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12085
12086 * ast/rust-ast.h: Add virtual destructor.
12087 * expand/rust-macro-expand.h: Likewise.
12088
12089 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12090
12091 * hir/tree/rust-hir-full-decls.h (struct Crate): Change to
12092 class.
12093 (class Crate): Likewise.
12094 (struct StructField): Likewise.
12095 (class StructField): Likewise.
12096 (struct TupleField): Likewise.
12097 (class TupleField): Likewise.
12098 (struct TraitFunctionDecl): Likewise.
12099 (class TraitFunctionDecl): Likewise.
12100 * rust-session-manager.h (struct Crate): Likewise.
12101 (class Crate): Likewise.
12102
12103 2024-01-16 Owen Avery <[email protected]>
12104
12105 * ast/rust-expr.h
12106 (MetaItemPathLit::get_locus): Remove copy construction.
12107 * backend/rust-constexpr.cc
12108 (eval_constant_expression): Likewise.
12109 (is_valid_constexpr_fn): Likewise.
12110 * util/rust-token-converter.cc
12111 (convert): Likewise.
12112
12113 2024-01-16 Owen Avery <[email protected]>
12114
12115 * lex/rust-lex.cc
12116 (Lexer::dump_and_skip): Use location_to_string.
12117 * rust-linemap.cc
12118 (Linemap::to_string): Move to...
12119 (Linemap::location_to_string): ... here.
12120 * rust-linemap.h
12121 (Linemap::to_string): Remove.
12122 (Linemap::location_to_string): Remove definition.
12123
12124 2024-01-16 Marc Poulhiès <[email protected]>
12125
12126 * hir/tree/rust-hir-expr.h (TypeCastExpr::get_casted_expr): Remove
12127 assert in accessor.
12128 (TypeCastExpr::get_type_to_convert_to): Likewise.
12129 (CompoundAssignmentExpr::get_left_expr): Likewise.
12130 (CompoundAssignmentExpr::get_right_expr): Likewise.
12131 (GroupedExpr::get_expr_in_parens): Likewise.
12132 (TupleIndexExpr::get_tuple_expr): Likewise.
12133 (FieldAccessExpr::get_receiver_expr): Likewise.
12134 (ClosureParam::get_pattern): Likewise.
12135 (ClosureParam::get_type): Likewise.
12136 (ExprType::get_return_type): Likewise.
12137 (IfLetExpr::get_scrutinee_expr): Likewise.
12138 (MatchArm::get_guard_expr): Likewise.
12139 (MatchExpr::get_scrutinee_expr): Likewise.
12140 * hir/tree/rust-hir-item.h (TypeParam::get_type): Likewise.
12141 (SelfParam::get_type): Likewise.
12142 (Function::get_return_type): Likewise.
12143 (TypeAlias::get_type_aliased): Likewise.
12144 (StructField::get_field_type): Likewise.
12145 (TraitFunctionDecl::get_block_expr): Likewise.
12146 (ImplBlock::get_trait_ref): Likewise.
12147 * hir/tree/rust-hir-path.h (ConstGenericArg::get_expression): New.
12148 (TypePathFunction::get_return_type): Remove assert in accessor.
12149 (QualifiedPathType::get_trait): Likewise.
12150 * hir/tree/rust-hir-pattern.h (PatternType::get_lower_bound): Likewise.
12151 (PatternType::get_upper_bound): Likewise.
12152 (ReferencePattern::get_referenced_pattern): Likewise.
12153 * hir/tree/rust-hir.h (ConstGenericParam::get_default_expression): Likewise.
12154
12155 2024-01-16 Muhammad Mahad <[email protected]>
12156
12157 * hir/rust-ast-lower-base.cc (struct_field_name_exists):
12158 called error function.
12159
12160 2024-01-16 Owen Avery <[email protected]>
12161
12162 * rust-diagnostics.cc
12163 (rust_be_error_at): Add function accepting location_t and ErrorCode.
12164 (rust_error_at): Likewise.
12165 * rust-diagnostics.h
12166 (rust_error_at): Likewise.
12167 (rust_be_error_at): Likewise.
12168
12169 2024-01-16 Owen Avery <[email protected]>
12170
12171 * rust-linemap.cc
12172 (class Gcc_linemap): Remove.
12173 (Gcc_linemap::start_file): Move to...
12174 (Linemap::start_file): ... here.
12175 (Gcc_linemap::to_string): Move to...
12176 (Linemap::to_string): ... here.
12177 (Gcc_linemap::stop): Move to...
12178 (Linemap::stop): ... here.
12179 (Gcc_linemap::start_line): Move to...
12180 (Linemap::start_line): ... here.
12181 (Gcc_linemap::get_location): Move to...
12182 (Linemap::get_location): ... here.
12183 (rust_get_linemap): Use Linemap.
12184 * rust-linemap.h
12185 (Linemap::in_file_): New field from Gcc_linemap.
12186 (Linemap::Linemap): Initialize in_file_.
12187 (Linemap::~Linemap): Make non-virtual.
12188 (Linemap::start_file): Likewise.
12189 (Linemap::start_line): Likewise.
12190 (Linemap::get_location): Likewise.
12191 (Linemap::stop): Likewise.
12192 (Linemap::to_string): Likewise.
12193
12194 2024-01-16 Arthur Cohen <[email protected]>
12195
12196 * Make-lang.in: Remove rust-optional-test.cc's object file
12197 * ast/rust-macro.h: Remove use of Rust::Optional
12198 * backend/rust-compile-base.cc
12199 (HIRCompileBase::resolve_method_address): Likewise.
12200 * checks/errors/privacy/rust-privacy-reporter.cc
12201 (PrivacyReporter::check_for_privacy_violation): Likewise.
12202 (PrivacyReporter::visit): Likewise.
12203 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
12204 * checks/errors/rust-feature-gate.cc (FeatureGate::check): Likewise.
12205 * checks/errors/rust-feature.cc (Feature::create): Likewise.
12206 (Feature::as_name): Likewise.
12207 * checks/errors/rust-feature.h: Likewise.
12208 * expand/rust-macro-builtins.cc: Likewise.
12209 * lex/rust-lex.cc (Lexer::Lexer): Likewise.
12210 (Lexer::skip_token): Likewise.
12211 (Lexer::dump_and_skip): Likewise.
12212 * lex/rust-lex.h: Likewise.
12213 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
12214 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
12215 * rust-lang.cc (run_rust_tests): Likewise.
12216 * rust-session-manager.cc (Session::compile_crate): Likewise.
12217 (TargetOptions::dump_target_options): Likewise.
12218 * rust-session-manager.h (struct TargetOptions): Likewise.
12219 * util/rust-hir-map.cc (Mappings::lookup_module_children): Likewise.
12220 (Mappings::lookup_module_chidren_items): Likewise.
12221 (Mappings::lookup_module_child): Likewise.
12222 (Mappings::lookup_parent_module): Likewise.
12223 * util/rust-hir-map.h (RUST_HIR_MAP_H): Likewise.
12224 * util/rust-optional-test.cc: Removed.
12225 * util/rust-optional.h: Removed.
12226
12227 2024-01-16 Owen Avery <[email protected]>
12228
12229 * rust-linemap.h (Linemap::unknown_location): Remove.
12230 * ast/rust-ast.cc:
12231 Replace Linemap::unknown_location with UNKNOWN_LOCATION.
12232 * ast/rust-path.cc: Likewise.
12233 * hir/tree/rust-hir.cc: Likewise.
12234 * metadata/rust-imports.cc: Likewise.
12235 * parse/rust-parse-impl.h: Likewise.
12236 * parse/rust-parse.h: Likewise.
12237 * rust-backend.h: Likewise.
12238 * rust-diagnostics.cc: Likewise.
12239 * rust-session-manager.cc: Likewise.
12240 * typecheck/rust-tyty.cc: Likewise.
12241
12242 2024-01-16 Muhammad Mahad <[email protected]>
12243
12244 * resolve/rust-ast-verify-assignee.h: called error function.
12245
12246 2024-01-16 Muhammad Mahad <[email protected]>
12247
12248 * typecheck/rust-tyty-call.cc (emit_unexpected_argument_error):
12249 Refactored invalid number of argument into one function.
12250 (TypeCheckCallExpr::visit): called refactored function.
12251 (TypeCheckMethodCallExpr::check): likewise.
12252
12253 2024-01-16 Arthur Cohen <[email protected]>
12254
12255 * util/expected.h: Adapt class to GCC requirements.
12256
12257 2024-01-16 Arthur Cohen <[email protected]>
12258
12259 * util/expected.h: New file.
12260
12261 2024-01-16 Arthur Cohen <[email protected]>
12262
12263 * util/optional.h: Adapt for GCC.
12264
12265 2024-01-16 Arthur Cohen <[email protected]>
12266
12267 * util/optional.h: New file.
12268
12269 2024-01-16 Owen Avery <[email protected]>
12270
12271 * rust-location.h (UNDEF_LOCATION): New.
12272 * ast/rust-ast-collector.cc: Replace Location () with UNDEF_LOCATION.
12273 * ast/rust-ast-fragment.cc: Likewise.
12274 * ast/rust-ast.h: Likewise.
12275 * ast/rust-expr.h: Likewise.
12276 * ast/rust-item.h: Likewise.
12277 * ast/rust-macro.h: Likewise.
12278 * ast/rust-path.h: Likewise.
12279 * ast/rust-type.h: Likewise.
12280 * backend/rust-compile-expr.cc: Likewise.
12281 * backend/rust-compile-extern.h: Likewise.
12282 * backend/rust-compile-implitem.h: Likewise.
12283 * backend/rust-compile-intrinsic.cc: Likewise.
12284 * backend/rust-compile-item.h: Likewise.
12285 * backend/rust-compile.cc: Likewise.
12286 * backend/rust-constexpr.cc: Likewise.
12287 * expand/rust-expand-visitor.cc: Likewise.
12288 * expand/rust-macro-expand.cc: Likewise.
12289 * expand/rust-macro-expand.h: Likewise.
12290 * expand/rust-macro-invoc-lexer.cc: Likewise.
12291 * expand/rust-proc-macro-invoc-lexer.cc: Likewise.
12292 * expand/rust-proc-macro.cc: Likewise.
12293 * hir/tree/rust-hir-expr.h: Likewise.
12294 * hir/tree/rust-hir-item.h: Likewise.
12295 * hir/tree/rust-hir-path.h: Likewise.
12296 * hir/tree/rust-hir-type.h: Likewise.
12297 * hir/tree/rust-hir.h: Likewise.
12298 * lex/rust-lex.cc: Likewise.
12299 * metadata/rust-export-metadata.cc: Likewise.
12300 * parse/rust-parse-impl.h: Likewise.
12301 * resolve/rust-ast-resolve-item.cc: Likewise.
12302 * resolve/rust-ast-resolve.cc: Likewise.
12303 * rust-diagnostics.h: Likewise.
12304 * rust-session-manager.cc: Likewise.
12305 * typecheck/rust-autoderef.cc: Likewise.
12306 * typecheck/rust-coercion.cc: Likewise.
12307 * typecheck/rust-hir-dot-operator.cc: Likewise.
12308 * typecheck/rust-hir-path-probe.cc: Likewise.
12309 * typecheck/rust-hir-trait-reference.cc: Likewise.
12310 * typecheck/rust-hir-trait-reference.h: Likewise.
12311 * typecheck/rust-hir-type-check-expr.cc: Likewise.
12312 * typecheck/rust-hir-type-check-implitem.cc: Likewise.
12313 * typecheck/rust-hir-type-check-type.cc: Likewise.
12314 * typecheck/rust-hir-type-check.cc: Likewise.
12315 * typecheck/rust-tyty-bounds.cc: Likewise.
12316 * typecheck/rust-tyty-subst.cc: Likewise.
12317 * typecheck/rust-tyty.cc: Likewise.
12318 * util/rust-hir-map.cc: Likewise.
12319
12320 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12321
12322 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix abit
12323 output format.
12324
12325 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12326
12327 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix
12328 external item trailing semicolon and outer attributes.
12329
12330 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12331
12332 * ast/rust-ast-collector.cc (TokenCollector::visit): Output
12333 outer attributes on external functions.
12334
12335 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12336
12337 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix method
12338 qualifier output.
12339
12340 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12341
12342 * ast/rust-ast-collector.cc (TokenCollector::visit): Add where
12343 clause.
12344
12345 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12346
12347 * ast/rust-ast-collector.cc (TokenCollector::visit): Add outer
12348 attributes to collector output.
12349
12350 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12351
12352 * ast/rust-ast-collector.cc (TokenCollector::visit): Add
12353 variadics in collector output.
12354
12355 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12356
12357 * ast/rust-ast-collector.cc (TokenCollector::visit): Add
12358 generics.
12359
12360 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12361
12362 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix generic
12363 output.
12364
12365 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12366
12367 * ast/rust-ast-collector.cc (TokenCollector::visit): Reformat
12368 trait impl block.
12369
12370 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12371
12372 * ast/rust-ast-collector.cc (TokenCollector::visit): Output
12373 generic in inherent impl.
12374
12375 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12376
12377 * ast/rust-ast-dump.cc (Dump::require_spacing): Change dollar
12378 spacing rule.
12379
12380 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12381
12382 * ast/rust-ast-collector.cc (TokenCollector::visit): Change
12383 formatting.
12384
12385 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12386
12387 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix trait
12388 impl block output.
12389
12390 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12391
12392 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix binding
12393 args.
12394
12395 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12396
12397 * ast/rust-ast-collector.cc (TokenCollector::visit): Output
12398 function qualifiers after visibility.
12399
12400 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12401
12402 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix self
12403 param output.
12404
12405 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12406
12407 * ast/rust-ast-dump.cc (Dump::require_spacing): Add a rule to
12408 remove spaces around dots and after references.
12409
12410 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12411
12412 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix several
12413 token collection rules.
12414 * ast/rust-ast-dump.cc (Dump::require_spacing): Add spacing rule
12415 for comma.
12416
12417 2024-01-16 Owen Avery <[email protected]>
12418
12419 * expand/rust-macro-invoc-lexer.h
12420 (class MacroInvocLexerBase): New.
12421
12422 2024-01-16 Owen Avery <[email protected]>
12423
12424 * expand/rust-macro-builtins.cc
12425 (source_relative_path): Use LOCATION_FILE.
12426 (MacroBuiltin::file_handler): Likewise.
12427 (MacroBuiltin::column_handler): Use LOCATION_COLUMN.
12428 (MacroBuiltin::line_handler): Use LOCATION_LINE.
12429 * rust-linemap.cc
12430 (Gcc_linemap::location_file): Remove.
12431 (Gcc_linemap::location_line): Remove.
12432 (Gcc_linemap::location_column): Remove.
12433 * rust-linemap.h
12434 (Linemap::location_file): Remove.
12435 (Linemap::location_line): Remove.
12436 (Linemap::location_column): Remove.
12437 (Linemap::location_to_file): Remove.
12438 (Linemap::location_to_line): Remove.
12439 (Linemap::location_to_column): Remove.
12440
12441 2024-01-16 Muhammad Mahad <[email protected]>
12442
12443 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
12444 called error function and changed error message
12445 similiar to rustc.
12446
12447 2024-01-16 Owen Avery <[email protected]>
12448
12449 * rust-linemap.cc
12450 (Gcc_linemap::get_unknown_location): Remove.
12451 (Gcc_linemap::get_predeclared_location): Remove.
12452 (Gcc_linemap::is_predeclared): Remove.
12453 (Gcc_linemap::is_unknown): Remove.
12454 * rust-linemap.h
12455 (Linemap::get_predeclared_location): Remove.
12456 (Linemap::get_unknown_location): Remove.
12457 (Linemap::is_predeclared): Remove.
12458 (Linemap::is_unknown): Remove.
12459 (Linemap::predeclared_location): Use BUILTINS_LOCATION.
12460 (Linemap::unknown_location): Use UNKNOWN_LOCATION.
12461 (Linemap::is_predeclared_location): Remove.
12462 (Linemap::is_unknown_location): Remove.
12463
12464 2024-01-16 Muhammad Mahad <[email protected]>
12465
12466 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
12467 called error function
12468
12469 2024-01-16 Muhammad Mahad <[email protected]>
12470
12471 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve):
12472 called error function.
12473
12474 2024-01-16 Raiki Tamura <[email protected]>
12475
12476 * lex/rust-lex.cc (Lexer::input_source_is_valid_utf8): New method of `Lexer`.
12477 * lex/rust-lex.h: Likewise.
12478 * rust-session-manager.cc (Session::compile_crate): Add error.
12479
12480 2024-01-16 Owen Avery <[email protected]>
12481
12482 * expand/rust-macro-expand.cc
12483 (transcribe_expression): Skip trailing semicolon.
12484
12485 2024-01-16 Muhammad Mahad <[email protected]>
12486
12487 * typecheck/rust-hir-type-check-item.cc: called error function.
12488
12489 2024-01-16 Raiki Tamura <[email protected]>
12490
12491 * ast/rust-ast.h: Modify constructors of `Rust::Identifier`
12492 * ast/rust-pattern.h: Likewise.
12493 * hir/tree/rust-hir-item.h: Likewise.
12494 * parse/rust-parse-impl.h (Parser::parse_macro_rules_def): Likewise.
12495 (Parser::parse_decl_macro_def): Likewise.
12496 (Parser::parse_macro_match_fragment): Likewise.
12497 (Parser::parse_module): Likewise.
12498 (Parser::parse_use_tree): Likewise.
12499 (Parser::parse_function): Likewise.
12500 (Parser::parse_type_param): Likewise.
12501 (Parser::parse_type_alias): Likewise.
12502 (Parser::parse_struct): Likewise.
12503 (Parser::parse_struct_field): Likewise.
12504 (Parser::parse_enum): Likewise.
12505 (Parser::parse_enum_item): Likewise.
12506 (Parser::parse_union): Likewise.
12507 (Parser::parse_static_item): Likewise.
12508 (Parser::parse_trait): Likewise.
12509 (Parser::parse_trait_item): Likewise.
12510 (Parser::parse_trait_type): Likewise.
12511 (Parser::parse_trait_const): Likewise.
12512 (Parser::parse_external_item): Likewise.
12513 (Parser::parse_generic_args_binding): Likewise.
12514 (Parser::parse_method): Likewise.
12515 (Parser::parse_maybe_named_param): Likewise.
12516 (Parser::parse_identifier_pattern): Likewise.
12517 (Parser::parse_struct_expr_field): Likewise.
12518 (ResolveItem::visit): Likewise.
12519 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit):Add comments
12520 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
12521 * checks/lints/rust-lint-scan-deadcode.h: Fix error location
12522
12523 2024-01-16 Owen Avery <[email protected]>
12524
12525 * backend/rust-compile-base.cc
12526 (HIRCompileBase::address_expression): Remove gcc_location method call.
12527 (HIRCompileBase::indirect_expression): Likewise.
12528 (HIRCompileBase::compile_constant_item): Likewise.
12529 (HIRCompileBase::named_constant_expression): Likewise.
12530 * backend/rust-compile-expr.cc
12531 (CompileExpr::visit): Remove gcc_location method call, use UNKNOWN_LOCATION to initialize.
12532 (CompileExpr::get_fn_addr_from_dyn): Remove gcc_location method call.
12533 (CompileExpr::type_cast_expression): Likewise.
12534 * backend/rust-compile-intrinsic.cc
12535 (transmute_handler): Replace "Location ().gcc_location ()" with UNKNOWN_LOCATION.
12536 (copy_nonoverlapping_handler): Likewise.
12537 (prefetch_data_handler): Likewise.
12538 (atomic_store_handler_inner): Likewise.
12539 (atomic_load_handler_inner): Likewise.
12540 * resolve/rust-ast-resolve-expr.cc
12541 (ResolveExpr::visit): Remove gcc_location method call.
12542 * rust-diagnostics.cc
12543 (rust_be_error_at): Likewise.
12544 (rust_be_warning_at): Likewise.
12545 (rust_be_fatal_error): Likewise.
12546 (rust_be_inform): Likewise.
12547 * rust-diagnostics.h
12548 (rust_sorry_at): Likewise.
12549 * rust-gcc.cc
12550 (Bvariable::get_tree): Likewise.
12551 (Gcc_backend::fill_in_fields): Likewise.
12552 (Gcc_backend::named_type): Likewise.
12553 (Gcc_backend::real_part_expression): Likewise.
12554 (Gcc_backend::imag_part_expression): Likewise.
12555 (Gcc_backend::complex_expression): Likewise.
12556 (Gcc_backend::convert_expression): Likewise.
12557 (Gcc_backend::struct_field_expression): Likewise.
12558 (Gcc_backend::compound_expression): Likewise.
12559 (Gcc_backend::conditional_expression): Likewise.
12560 (Gcc_backend::negation_expression): Likewise.
12561 (Gcc_backend::arithmetic_or_logical_expression): Likewise.
12562 (Gcc_backend::arithmetic_or_logical_expression_checked): Likewise.
12563 (Gcc_backend::comparison_expression): Likewise.
12564 (Gcc_backend::lazy_boolean_expression): Likewise.
12565 (Gcc_backend::constructor_expression): Likewise.
12566 (Gcc_backend::array_constructor_expression): Likewise.
12567 (Gcc_backend::array_initializer): Likewise.
12568 (Gcc_backend::array_index_expression): Likewise.
12569 (Gcc_backend::call_expression): Likewise.
12570 (Gcc_backend::assignment_statement): Likewise.
12571 (Gcc_backend::return_statement): Likewise.
12572 (Gcc_backend::exception_handler_statement): Likewise.
12573 (Gcc_backend::if_statement): Likewise.
12574 (Gcc_backend::loop_expression): Likewise.
12575 (Gcc_backend::exit_expression): Likewise.
12576 (Gcc_backend::block): Likewise.
12577 (Gcc_backend::convert_tree): Likewise.
12578 (Gcc_backend::global_variable): Likewise.
12579 (Gcc_backend::local_variable): Likewise.
12580 (Gcc_backend::parameter_variable): Likewise.
12581 (Gcc_backend::static_chain_variable): Likewise.
12582 (Gcc_backend::temporary_variable): Likewise.
12583 (Gcc_backend::label): Likewise.
12584 (Gcc_backend::goto_statement): Likewise.
12585 (Gcc_backend::label_address): Likewise.
12586 (Gcc_backend::function): Likewise.
12587 * rust-linemap.cc
12588 (Gcc_linemap::to_string): Likewise.
12589 (Gcc_linemap::location_file): Likewise.
12590 (Gcc_linemap::location_line): Likewise.
12591 (Gcc_linemap::location_column): Likewise.
12592 (Gcc_linemap::is_predeclared): Likewise.
12593 (Gcc_linemap::is_unknown): Likewise.
12594 (RichLocation::RichLocation): Likewise.
12595 (RichLocation::add_range): Likewise.
12596 (RichLocation::add_fixit_insert_before): Likewise.
12597 (RichLocation::add_fixit_insert_after): Likewise.
12598 * rust-location.h
12599 (class Location): Replace with typedef.
12600 (operator<): Remove.
12601 (operator==): Remove.
12602 (operator+): Remove.
12603 (operator-): Remove.
12604 * typecheck/rust-hir-trait-resolve.cc
12605 (AssociatedImplTrait::setup_associated_types): Initialize Location with UNKNOWN_LOCATION.
12606 * typecheck/rust-hir-type-check-stmt.cc
12607 (TypeCheckStmt::visit): Likewise.
12608 * util/rust-token-converter.cc
12609 (convert): Remove gcc_location method call.
12610
12611 2024-01-16 Marc Poulhiès <[email protected]>
12612
12613 * hir/tree/rust-hir-expr.h (BorrowExpr::is_double_borrow): New.
12614 (ArrayElemsCopied::get_elem_to_copy)
12615 (ArrayElemsCopied::get_num_copies_expr): Return unique_ptr.
12616 (CallExpr::get_fnexpr): Likewise.
12617 (ReturnExpr::get_expr): Likewise.
12618 (StructExprStructFields::get_struct_base): New.
12619 (MethodCallExpr::has_params): New.
12620 (ClosureExpr::has_params): New.
12621 (BlockExpr::get_inner_attrs): New.
12622 (WhileLoopExpr::get_patterns): New.
12623 (ForLoopExpr::get_pattern): New.
12624 (IfLetExpr::get_if_block): Return ref to unique_ptr.
12625 (IfLetExprConseqElse::get_else_block): Likewise.
12626 (MatchExpr::get_inner_attrs): New.
12627 * hir/tree/rust-hir-item.h (Module::get_module_name): New.
12628 (ExternCrate::get_referenced_crate)
12629 (ExternCrate::get_as_clause_name): New.
12630 (UseTreeGlob::get_glob_type, UseTreeGlob::get_path): New.
12631 (UseTreeList::get_path_type, UseTreeList::get_path)
12632 (UseTreeList::get_trees): New.
12633 (TraitItemKind::get_expr): Remove assert. unique_ptr can
12634 be "empty". Must be checked in caller.
12635 * hir/tree/rust-hir-pattern.h (IdentifierPattern::get_is_ref)
12636 (IdentifierPattern::get_to_bind): New.
12637 (RangePatternBoundType::get_has_minus): New.
12638 (RangePattern::get_has_ellipsis_syntax): New.
12639 (StructPatternField::get_outer_attrs): New.
12640 (StructPatternFieldTuplePat::get_index)
12641 (StructPatternFieldTuplePat::get_tuple_pattern): New.
12642 (StructPatternFieldIdent::get_has_ref): New.
12643 * hir/tree/rust-hir-stmt.h (LetStmt::get_outer_attrs): New.
12644 (LetStmt::get_type)
12645 (LetStmt::get_init_expr, LetStmt::get_pattern): Return unique_ptr.
12646 (ExprStmt::get_expr): Likewise.
12647 * hir/tree/rust-hir-type.h (TraitBound::get_for_lifetimes): New.
12648 (TraitBound::get_in_params): New.
12649 (TraitBound::get_opening_question_mark): New.
12650 (ImplTraitType::get_type_param_bounds): New.
12651 (TraitObjectType::get_has_dyn): New.
12652 (TraitBound::get_type_in_parens): New.
12653 (ImplTraitTypeOneBound::get_trait_bound): New.
12654 (BareFunctionType::get_for_lifetimes)
12655 (BareFunctionType::get_is_variadic)
12656 (BareFunctionType::get_function_qualifiers): New.
12657 * hir/tree/rust-hir.h (class Expr): Virtual inherit from FullVisitable.
12658 (class Pattern): Likewise.
12659 (ConstGenericParam::get_name): New.
12660 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adjust call.
12661 (TypeCheckExpr::resolve_fn_trait_call): Likewise.
12662 * backend/rust-compile-expr.cc (CompileExpr::visit): Adjust call.
12663 (CompileExpr::array_copied_expr): Likewise.
12664 (CompileExpr::generate_possible_fn_trait_call): Likewise.
12665 * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
12666 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
12667 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
12668 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
12669 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
12670 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
12671
12672 2024-01-16 Muhammad Mahad <[email protected]>
12673
12674 * typecheck/rust-hir-path-probe.h: called error function
12675
12676 2024-01-16 Muhammad Mahad <[email protected]>
12677
12678 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
12679 called error function
12680
12681 2024-01-16 Marc Poulhiès <[email protected]>
12682
12683 * hir/tree/rust-hir-expr.h (class ArrayElems): Inherit from FullVisitable.
12684 (class StructExprField): Likewise.
12685 * hir/tree/rust-hir-item.h (class WhereClauseItem): Likewise.
12686 (class UseTree): Likewise.
12687 (UseTreeRebind::get_path, UseTreeRebind::get_identifier)
12688 (UseTreeRebind::get_bind_type): New.
12689 (UseDeclaration::get_use_tree): New.
12690 (struct TraitFunctionDecl): Change struct to ...
12691 (class TraitFunctionDecl): ... class.
12692 (TraitFunctionDecl::get_where_clause): New.
12693 (StructField::get_outer_attrs): New.
12694 (struct TupleField): Change struct to ...
12695 (class TupleField): ... class.
12696 (TupleField::get_visibility, TupleField::get_outer_attrs): New.
12697 * hir/tree/rust-hir-pattern.h (class TupleStructItems): Inherit
12698 from FullVisitable.
12699
12700 2024-01-16 Raiki Tamura <[email protected]>
12701
12702 * lex/rust-lex.cc (Lexer::build_token): Replace function call.
12703 (Lexer::parse_string): Likewise.
12704 (Lexer::parse_identifier_or_keyword): Likewise.
12705 (Lexer::parse_raw_string): Likewise.
12706 (Lexer::parse_char_or_lifetime): Likewise.
12707 (Lexer::get_input_codepoint_length): Deleted.
12708 (Lexer::peek_codepoint_input): Deleted.
12709 (Lexer::skip_codepoint_input): Deleted.
12710 * lex/rust-lex.h: Remove some methods and fields
12711
12712 2024-01-16 Philip Herron <[email protected]>
12713
12714 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): track output
12715 * util/rust-hir-map.cc (Mappings::lookup_trait_item_lang_item): new helper
12716 * util/rust-hir-map.h: add prototype for helper
12717
12718 2024-01-16 Philip Herron <[email protected]>
12719
12720 * backend/rust-compile-expr.cc (CompileExpr::generate_possible_fn_trait_call): use fnexpr
12721 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_fn_trait_call): likewise
12722
12723 2024-01-16 Muhammad Mahad <[email protected]>
12724
12725 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
12726
12727 2024-01-16 Marc Poulhiès <[email protected]>
12728
12729 * hir/tree/rust-hir.h (struct Crate): Rename struct into ...
12730 (class Crate): ... class, and add get_items.
12731 * backend/rust-compile.cc (CompileCrate::go): Adapt to visibility change of items.
12732 * checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve): Likewise.
12733 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::go): Likewise.
12734 * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::go): Likewise.
12735 * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::go): Likewise.
12736 * checks/errors/rust-const-checker.cc (ConstChecker::go): Likewise.
12737 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::go): Likewise.
12738 * checks/lints/rust-lint-marklive.cc (FindEntryPoint::find): Likewise.
12739 * checks/lints/rust-lint-scan-deadcode.h (ScanDeadCode::Scan): Likewise.
12740 * metadata/rust-export-metadata.cc (PublicInterface::gather_export_data): Likewise.
12741 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
12742 * hir/rust-hir-dump.cc (CompileCrate::go): Likewise.
12743
12744 2024-01-16 Marc Poulhiès <[email protected]>
12745
12746 * hir/tree/rust-hir-expr.h (AwaitExpr::get_awaited_expr): New.
12747 (AsyncBlockExpr::get_has_move, AsyncBlockExpr::get_block_expr): New.
12748 * hir/tree/rust-hir-item.h (Enum::get_where_clause): New.
12749 (Trait::get_where_clause, Trait::is_unsafe): New.
12750 (ExternalItem::get_visibility): New.
12751
12752 2024-01-16 Marc Poulhiès <[email protected]>
12753
12754 * hir/tree/rust-hir.h (class FullVisitable): New.
12755 (class Stmt): Adjust with new class.
12756 (class Expr): Likewise.
12757 (class Pattern): Likewise.
12758 (class Type): Likewise.
12759 (class TypeParamBound): Likewise.
12760 (class GenericParam): Likewise.
12761 (class TraitItem): Likewise.
12762 (class ImplItem): Likewise.
12763
12764 2024-01-16 Marc Poulhiès <[email protected]>
12765
12766 * hir/tree/rust-hir.h (class WithInnerAttrs): New.
12767 (class Item): Adjust to new WithInnerAttrs class.
12768 (struct Crate): Likewise.
12769 * hir/rust-hir-dump.cc (Dump::go): Likewise.
12770 (Dump::visit): Likewise.
12771 * hir/tree/rust-hir-expr.h (class GroupedExpr): Likewise.
12772 (class ArrayExpr): Likewise.
12773 (class TupleExpr): Likewise.
12774 (class StructExprStruct): Likewise.
12775 (class BlockExpr): Likewise.
12776 (class MatchExpr): Likewise.
12777 * hir/tree/rust-hir-item.h (TypeParam::get_outer_attribute): New.
12778 (class Module): Adjust to new WithInnerAttrs class.
12779 (struct StructField): change struct to...
12780 (class StructField): ... a class.
12781 (class ImplBlock): Adjust to new WithInnerAttrs class.
12782 (class ExternBlock): Likewise.
12783
12784 2024-01-16 Marc Poulhiès <[email protected]>
12785
12786 * hir/tree/rust-hir-type.h (ArrayType::get_element_type): Returns
12787 unique_ptr.
12788 * hir/tree/rust-hir-expr.h (ArithmeticOrLogicalExpr::get_lhs)
12789 (ArithmeticOrLogicalExpr::get_rhs): Likewise.
12790 (ComparisonExpr::get_lhs, ComparisonExpr::get_rhs): Likewise.
12791 (LazyBooleanExpr::get_lhs, LazyBooleanExpr::get_rhs): Likewise.
12792 (AssignmentExpr::get_lhs, AssignmentExpr::get_rhs): Likewise.
12793 (ArrayExpr::get_internal_elements): Likewise.
12794 (ArrayIndexExpr::get_index_expr, ArrayIndexExpr::get_array_expr):
12795 Likewise.
12796 (StructExprFieldWithVal::get_value): Likewise.
12797 (IfExpr::get_if_condition, IfExpr::get_if_block): Likewise.
12798 (ExprWithBlock::get_else_block): Likewise.
12799 * hir/tree/rust-hir-item.h (FunctionParam::get_param_name)
12800 (FunctionParam::get_type): Likewise.
12801 (ConstantItem::get_type, ConstantItem::get_expr): Likewise.
12802 (StaticItem::get_expr, StaticItem::get_type): Likewise.
12803 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
12804 Adjust for previous change.
12805 * backend/rust-compile-block.cc (CompileConditionalBlocks::visit):
12806 Likewise.
12807 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
12808 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
12809 * backend/rust-compile-struct-field-expr.cc
12810 (CompileStructExprField::visit): Likewise.
12811 * checks/errors/privacy/rust-privacy-reporter.cc
12812 (PrivacyReporter::visit): Likewise.
12813 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
12814 Likewise.
12815 * typecheck/rust-hir-type-check-implitem.cc
12816 (TypeCheckImplItem::visit): Likewise.
12817 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
12818 Likewise.
12819 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit):
12820 Likewise.
12821 * typecheck/rust-hir-type-check-struct.cc
12822 (TypeCheckStructExpr::visit): Likewise.
12823 * typecheck/rust-hir-type-check.cc
12824 (TraitItemReference::get_type_from_fn): Likewise.
12825
12826 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12827
12828 * ast/rust-pattern.h: Change constructor to accept new parameter
12829 instead of defaulting on string type.
12830 * parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern):
12831 Propagate type hint.
12832 (Parser::parse_pattern_no_alt): Likewise.
12833
12834 2024-01-16 Raiki Tamura <[email protected]>
12835
12836 * lex/rust-lex.cc (Lexer::parse_byte_char):add check for range of codepoint
12837
12838 2024-01-16 Muhammad Mahad <[email protected]>
12839
12840 * typecheck/rust-hir-type-check-pattern.cc (emit_invalid_field_error): Refactored Field
12841 Error Function
12842 (TypeCheckPattern::visit): called emit_invalid_field_error function
12843
12844 2024-01-16 Owen Avery <[email protected]>
12845
12846 * expand/rust-macro-expand.cc
12847 (MacroExpander::match_matcher): Remove append_fragment inside repetitions.
12848 (MacroExpander::match_n_matches): Use sub_stack push/pop to handle repetitions.
12849 (MatchedFragmentContainer::add_fragment): Add MatchedFragmentContainer accepting version.
12850 * expand/rust-macro-expand.h
12851 (MatchedFragmentContainer::add_fragment): Likewise.
12852 (MatchedFragmentContainerRepetition::add_fragment): Likewise.
12853 (SubstititionScope::append_fragment): Likewise.
12854
12855 2024-01-16 Philip Herron <[email protected]>
12856
12857 * typecheck/rust-casts.cc (TypeCastRules::check): apply new argument
12858 * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): track if this is a cast site
12859 (TypeCoercionRules::TryCoerce): update ctor
12860 (TypeCoercionRules::TypeCoercionRules): cleanup error handling
12861 (TypeCoercionRules::do_coercion): likewise
12862 (TypeCoercionRules::coerce_unsafe_ptr): only infer in try mode
12863 (TypeCoercionRules::coerce_borrowed_pointer): cleanup
12864 * typecheck/rust-coercion.h: update header
12865
12866 2024-01-16 Philip Herron <[email protected]>
12867
12868 * typecheck/rust-hir-trait-reference.h: update prototype
12869 * typecheck/rust-hir-trait-resolve.cc: add generic args as an out param
12870 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): use the generics
12871
12872 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12873
12874 * ast/rust-ast-collector.cc (TokenCollector::visit): Add comment
12875 after tail expressions.
12876 * ast/rust-ast-dump.cc (Dump::require_spacing): Check for
12877 missing previous token.
12878 * ast/rust-ast-dump.h: Output formatting characters.
12879
12880 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12881
12882 * ast/rust-ast-collector.cc (TokenCollector::collect): Collect
12883 CollectItems once done.
12884 (TokenCollector::newline): Add newline formatting
12885 implementation.
12886 (TokenCollector::indentation): Add indentation implementation.
12887 (TokenCollector::increment_indentation): Add indentation
12888 increment.
12889 (TokenCollector::comment): Add new comment formatting option.
12890 * ast/rust-ast-collector.h: Update prototypes.
12891
12892 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12893
12894 * ast/rust-ast-collector.cc (TokenCollector::collect_tokens):
12895 Filter tokens.
12896 (TokenCollector::visit_items_joined_by_separator): Change store
12897 call.
12898 (TokenCollector::visit_as_line): Likewise.
12899 (TokenCollector::visit_items_as_block): Likewise.
12900 (TokenCollector::trailing_comma): Likewise.
12901 (TokenCollector::visit): Likewise.
12902 (TokenCollector::visit_closure_common): Likewise.
12903 (TokenCollector::visit_function_common): Likewise.
12904 * ast/rust-ast-collector.h (class CollectItem): Add class to
12905 differentiate between formatting and raw data (tokens).
12906
12907 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12908
12909 * ast/rust-ast-collector.cc (TokenCollector::TokenCollector):
12910 Remove constructor, changing it to an implicit default
12911 constructor.
12912 * ast/rust-ast-collector.h: Change from container reference to
12913 direct container.
12914 * ast/rust-ast-dump.h: Change call to constructor.
12915 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
12916
12917 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12918
12919 * ast/rust-ast-dump.cc (Dump::require_spacing): Add a function
12920 to determine wether a space shall output.
12921 * ast/rust-ast-dump.h: Add function prototype as well as
12922 condition.
12923
12924 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12925
12926 * ast/rust-ast-collector.cc (TokenCollector::visit): Add a visit
12927 function for visitable abstract class so we can call a dump on
12928 any visitable item.
12929 * ast/rust-ast-collector.h: Add new visit function prototype.
12930 * ast/rust-ast-dump.cc (Dump::go): Add call to process function.
12931 (Dump::visit): Remove functions.
12932 (Dump::visit_items_joined_by_separator): Likewise.
12933 (Dump::visit_as_line): Likewise.
12934 (Dump::visit_items_as_lines): Likewise.
12935 (Dump::visit_items_as_block): Likewise.
12936 (Dump::visit_function_common): Likewise.
12937 (get_delimiters): Likewise.
12938 (Dump::debug): Update with call to tokencollector.
12939 * ast/rust-ast-dump.h (RUST_AST_DUMP_H): Move include
12940 directives.
12941 (class Dump): Remove multiple prototypes and add generic process
12942 function.
12943
12944 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12945
12946 * ast/rust-ast-collector.cc (TokenCollector::visit): Add
12947 semicolon in extern blocks.
12948
12949 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12950
12951 * rust-session-manager.cc (Session::enable_dump): Remove
12952 tokenstream dump.
12953 (Session::compile_crate): Likewise.
12954 (Session::dump_tokenstream): Likewise.
12955 * rust-session-manager.h (struct CompileOptions): Likewise.
12956
12957 2024-01-16 Raiki Tamura <[email protected]>
12958
12959 * lex/rust-lex.cc (Lexer::build_token):add check for all kinds of whitespaces
12960
12961 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12962
12963 * ast/rust-ast.h: Add default constructors.
12964
12965 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
12966
12967 * ast/rust-ast-collector.cc (TokenCollector::visit): Change with
12968 call to getter.
12969 * ast/rust-ast.cc (Module::as_string): Likewise.
12970 (StaticItem::as_string): Likewise.
12971 (TupleStruct::as_string): Likewise.
12972 (Method::as_string): Likewise.
12973 (StructStruct::as_string): Likewise.
12974 (UseTreeRebind::as_string): Likewise.
12975 (Enum::as_string): Likewise.
12976 (Trait::as_string): Likewise.
12977 (Union::as_string): Likewise.
12978 (Function::as_string): Likewise.
12979 (TypeAlias::as_string): Likewise.
12980 (MacroRulesDefinition::as_string): Likewise.
12981 (FieldAccessExpr::as_string): Likewise.
12982 (MacroMatchFragment::as_string): Likewise.
12983 (TypeParam::as_string): Likewise.
12984 (StructExprFieldIdentifierValue::as_string): Likewise.
12985 (EnumItem::as_string): Likewise.
12986 (StructField::as_string): Likewise.
12987 (ExternalTypeItem::as_string): Likewise.
12988 (ExternalStaticItem::as_string): Likewise.
12989 (ExternalFunctionItem::as_string): Likewise.
12990 (TraitFunctionDecl::as_string): Likewise.
12991 (TraitMethodDecl::as_string): Likewise.
12992 (TraitItemConst::as_string): Likewise.
12993 (TraitItemType::as_string): Likewise.
12994 (MaybeNamedParam::as_string): Likewise.
12995 (MetaListPaths::as_string): Likewise.
12996 (MetaListNameValueStr::as_string): Likewise.
12997 (Module::process_file_path): Likewise.
12998 (MetaListNameValueStr::check_cfg_predicate): Likewise.
12999 (MetaListPaths::check_cfg_predicate): Likewise.
13000 (MetaWord::check_cfg_predicate): Likewise.
13001 (MetaNameValueStr::check_cfg_predicate): Likewise.
13002 (MetaNameValueStr::to_attribute): Likewise.
13003 (MetaWord::to_attribute): Likewise.
13004 (MetaListPaths::to_attribute): Likewise.
13005 (MetaListNameValueStr::to_attribute): Likewise.
13006 (operator<<): Change Identifier class <<
13007 operator overload for standard output stream.
13008 * ast/rust-ast.h (class Identifier): Change typedef to proper
13009 class definition.
13010 (operator<<): Add prototype for operator overload.
13011 (class Token): Change getter identifier.
13012 (class MetaListNameValueStr): Likewise.
13013 (class PathExpr): Likewise.
13014 * ast/rust-expr.h: Likewise.
13015 * ast/rust-item.h: Likewise.
13016 * ast/rust-macro.h: Likewise.
13017 * ast/rust-path.cc (GenericArg::disambiguate_to_type): Likewise.
13018 (GenericArgsBinding::as_string): Likewise.
13019 (ConstGenericParam::as_string): Likewise.
13020 * ast/rust-path.h: Likewise.
13021 * ast/rust-pattern.cc (IdentifierPattern::as_string): Likewise.
13022 (StructPatternFieldIdentPat::as_string): Likewise.
13023 (StructPatternFieldIdent::as_string): Likewise.
13024 * ast/rust-type.h: Likewise.
13025 * backend/rust-compile-base.cc: Likewise.
13026 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
13027 * backend/rust-compile-extern.h: Likewise.
13028 * backend/rust-compile-fnparam.cc (CompileFnParam::visit):
13029 Likewise.
13030 * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
13031 Likewise.
13032 * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
13033 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): Likewise.
13034 * backend/rust-compile-struct-field-expr.cc (CompileStructExprField::visit):
13035 Likewise.
13036 * backend/rust-compile-var-decl.h: Likewise.
13037 * backend/rust-compile.cc: Likewise.
13038 * checks/errors/rust-unsafe-checker.cc (check_extern_call):
13039 Likewise.
13040 * checks/lints/rust-lint-marklive.cc (MarkLive::visit):
13041 Likewise.
13042 * checks/lints/rust-lint-scan-deadcode.h: Likewise.
13043 * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Likewise.
13044 (DeriveClone::visit_tuple): Likewise.
13045 (DeriveClone::visit_struct): Likewise.
13046 (DeriveClone::visit_union): Likewise.
13047 * expand/rust-derive-copy.cc (DeriveCopy::visit_struct):
13048 Likewise.
13049 (DeriveCopy::visit_tuple): Likewise.
13050 (DeriveCopy::visit_enum): Likewise.
13051 (DeriveCopy::visit_union): Likewise.
13052 * expand/rust-macro-expand.cc (MacroExpander::match_matcher):
13053 Likewise.
13054 (MacroExpander::match_n_matches): Likewise.
13055 (MacroExpander::match_repetition): Likewise.
13056 (MacroExpander::match_repetition_skipped_metavars): Likewise.
13057 * hir/rust-ast-lower-base.cc (struct_field_name_exists):
13058 Likewise.
13059 * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
13060 * hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit):
13061 Likewise.
13062 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
13063 * hir/tree/rust-hir-expr.h: Likewise.
13064 * hir/tree/rust-hir-item.h: Likewise.
13065 * hir/tree/rust-hir-path.h: Likewise.
13066 * hir/tree/rust-hir-type.h: Likewise.
13067 * hir/tree/rust-hir.cc (Module::as_string): Likewise.
13068 (StaticItem::as_string): Likewise.
13069 (TupleStruct::as_string): Likewise.
13070 (ConstantItem::as_string): Likewise.
13071 (StructStruct::as_string): Likewise.
13072 (UseTreeRebind::as_string): Likewise.
13073 (Enum::as_string): Likewise.
13074 (Trait::as_string): Likewise.
13075 (Union::as_string): Likewise.
13076 (Function::as_string): Likewise.
13077 (TypeAlias::as_string): Likewise.
13078 (FieldAccessExpr::as_string): Likewise.
13079 (TypeParam::as_string): Likewise.
13080 (GenericArgsBinding::as_string): Likewise.
13081 (StructPatternFieldIdent::as_string): Likewise.
13082 (StructPatternFieldIdentPat::as_string): Likewise.
13083 (IdentifierPattern::as_string): Likewise.
13084 (StructExprFieldIdentifierValue::as_string): Likewise.
13085 (EnumItem::as_string): Likewise.
13086 (StructField::as_string): Likewise.
13087 (ExternalStaticItem::as_string): Likewise.
13088 (ExternalFunctionItem::as_string): Likewise.
13089 (NamedFunctionParam::as_string): Likewise.
13090 (TraitFunctionDecl::as_string): Likewise.
13091 (TraitItemConst::as_string): Likewise.
13092 (TraitItemType::as_string): Likewise.
13093 (MaybeNamedParam::as_string): Likewise.
13094 * hir/tree/rust-hir.h: Likewise.
13095 * parse/rust-parse-impl.h (Parser::parse_macro_match_fragment):
13096 Likewise.
13097 (Parser::parse_module): Likewise.
13098 (Parser::parse_use_tree): Likewise.
13099 (Parser::parse_maybe_named_param): Likewise.
13100 * resolve/rust-ast-resolve-implitem.h: Likewise.
13101 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
13102 Likewise.
13103 (ResolveItem::visit): Likewise.
13104 (flatten_rebind): Likewise.
13105 (ResolveExternItem::visit): Likewise.
13106 (rust_flatten_rebind): Likewise.
13107 (rust_flatten_rebind_nested): Likewise.
13108 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
13109 Likewise.
13110 (PatternDeclaration::visit): Likewise.
13111 (PatternDeclaration::add_new_binding): Likewise.
13112 * resolve/rust-ast-resolve-stmt.h: Likewise.
13113 * resolve/rust-ast-resolve-toplevel.h: Likewise.
13114 * resolve/rust-ast-resolve-type.h: Likewise.
13115 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
13116 * typecheck/rust-autoderef.cc: Likewise.
13117 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
13118 Likewise.
13119 * typecheck/rust-hir-path-probe.cc (PathProbeType::visit):
13120 Likewise.
13121 * typecheck/rust-hir-trait-reference.cc (TraitReference::get_name): Likewise.
13122 * typecheck/rust-hir-trait-resolve.cc (ResolveTraitItemToRef::visit): Likewise.
13123 (TraitResolver::resolve_trait): Likewise.
13124 (TraitItemReference::resolve_item): Likewise.
13125 (AssociatedImplTrait::setup_raw_associated_types): Likewise.
13126 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
13127 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
13128 Likewise.
13129 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise.
13130 (TypeCheckImplItem::visit): Likewise.
13131 (TypeCheckImplItemWithTrait::visit): Likewise.
13132 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
13133 Likewise.
13134 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
13135 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
13136 * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise.
13137 * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
13138 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): Likewise.
13139 * util/rust-attributes.cc (check_doc_attribute): Likewise.
13140 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
13141
13142 2024-01-16 Raiki Tamura <[email protected]>
13143
13144 * lex/rust-lex.cc (is_float_digit):Change types of param to `uint32_t`
13145 (is_x_digit):Likewise
13146 (is_octal_digit):Likewise
13147 (is_bin_digit):Likewise
13148 (check_valid_float_dot_end):Likewise
13149 (is_whitespace):Likewise
13150 (is_non_decimal_int_literal_separator):Likewise
13151 (is_identifier_start):Likewise
13152 (is_identifier_continue):Likewise
13153 (Lexer::skip_broken_string_input):Likewise
13154 (Lexer::build_token):Remove handling BOM
13155 (Lexer::parse_in_type_suffix):Modify use of `current_char`
13156 (Lexer::parse_in_decimal):Likewise
13157 (Lexer::parse_escape):Likewise
13158 (Lexer::parse_utf8_escape):Likewise
13159 (Lexer::parse_partial_string_continue):Likewise
13160 (Lexer::parse_partial_hex_escape):Likewise
13161 (Lexer::parse_partial_unicode_escape):Likewise
13162 (Lexer::parse_byte_char):Likewise
13163 (Lexer::parse_byte_string):Likewise
13164 (Lexer::parse_raw_byte_string):Likewise
13165 (Lexer::parse_raw_identifier):Likewise
13166 (Lexer::parse_non_decimal_int_literal):Likewise
13167 (Lexer::parse_decimal_int_or_float):Likewise
13168 (Lexer::peek_input):Change return type to `Codepoint`
13169 (Lexer::get_input_codepoint_length):Change to return 1
13170 (Lexer::peek_codepoint_input):Change to be wrapper of `peek_input`
13171 (Lexer::skip_codepoint_input):Change to be wrapper of `skip_input`
13172 (Lexer::test_get_input_codepoint_n_length):Deleted
13173 (Lexer::split_current_token):Deleted
13174 (Lexer::test_peek_codepoint_input):Deleted
13175 (Lexer::start_line):Move backwards
13176 (assert_source_content):New helper function for selftest
13177 (test_buffer_input_source):New helper function for selftest
13178 (test_file_input_source):Likewise
13179 (rust_input_source_test):New test
13180 * lex/rust-lex.h (rust_input_source_test):New test
13181 * rust-lang.cc (run_rust_tests):Add selftest
13182
13183 2024-01-16 Owen Avery <[email protected]>
13184
13185 * expand/rust-macro-expand.cc
13186 (MacroExpander::match_repetition_skipped_metavars): New.
13187 (MacroExpander::match_repetition): Use new method.
13188 * expand/rust-macro-expand.h
13189 (MacroExpander::match_repetition_skipped_metavars): New.
13190
13191 2024-01-16 Muhammad Mahad <[email protected]>
13192
13193 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
13194
13195 2024-01-16 Muhammad Mahad <[email protected]>
13196
13197 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
13198
13199 2024-01-16 Owen Avery <[email protected]>
13200
13201 * expand/rust-macro-expand.cc
13202 (MacroExpander::match_token): Match token instead of token id.
13203 * parse/rust-parse-impl.h
13204 (Parser::skip_token): Add token-skipping variant.
13205 (Parser::expect_token): Likewise.
13206 * parse/rust-parse.h
13207 (Parser::skip_token): Likewise.
13208 (Parser::expect_token): Likewise.
13209
13210 2024-01-16 Arthur Cohen <[email protected]>
13211
13212 * lang.opt: Add -frust-name-resolution-2.0 option
13213
13214 2024-01-16 Philip Herron <[email protected]>
13215
13216 * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): add check for pointers
13217
13218 2024-01-16 Philip Herron <[email protected]>
13219
13220 * typecheck/rust-autoderef.cc: use new selection filter
13221 * typecheck/rust-hir-dot-operator.cc (MethodResolver::Select): new slection Filter
13222 * typecheck/rust-hir-dot-operator.h: New select prototype
13223 * typecheck/rust-hir-type-check-expr.cc: call select
13224 * typecheck/rust-type-util.cc (try_coercion): new helper
13225 * typecheck/rust-type-util.h (try_coercion): helper prototype
13226
13227 2024-01-16 Muhammad Mahad <[email protected]>
13228
13229 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): passed "E0277"
13230 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): passed "E0277"
13231
13232 2024-01-16 Matthew Jasper <[email protected]>
13233
13234 * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
13235 Expand expressions in more contexts.
13236 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
13237 Visit enum variants.
13238
13239 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13240
13241 * ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Refactor
13242 code and warn about dangling reference.
13243 * expand/rust-expand-visitor.cc (expand_stmt_attribute):
13244 Document function and change argument names to make those
13245 clearer.
13246
13247 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13248
13249 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
13250 Remove second argument.
13251 (ExpandVisitor::visit): Remove argument from function call.
13252 * expand/rust-expand-visitor.h: Update function prototype.
13253
13254 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13255
13256 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change
13257 call to expand_inner_stmts.
13258 (expand_tail_expr): Change argument name and try to expand the
13259 last statement as a tail expression once all statements have
13260 been expanded.
13261 * expand/rust-expand-visitor.h: Change prototype to accept
13262 parent class.
13263 * ast/rust-expr.h: Add try_convert_last_stmt function prototype.
13264
13265 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13266
13267 * ast/rust-expr.h: Add a function to take tail expr as well
13268 as a function to set a tail expression.
13269 * expand/rust-expand-visitor.cc (expand_tail_expr): Add tail
13270 expression expansion function.
13271 (ExpandVisitor::visit): Add call to tail expr expansion in for
13272 BlockExpr.
13273
13274 2024-01-16 Arthur Cohen <[email protected]>
13275 Pierre-Emmanuel Patry <[email protected]>
13276
13277 * expand/rust-expand-visitor.cc : Change type from pointer to
13278 reference and expand statements from statements.
13279 * ast/rust-macro.h: Return macro kind.
13280 * ast/rust-ast.h: Add Statement kind.
13281 * ast/rust-item.h: Change module.
13282 * ast/rust-stmt.h: Return kind.
13283
13284 2024-01-16 Owen Avery <[email protected]>
13285
13286 * expand/rust-macro-expand.cc
13287 (MacroExpander::expand_decl_macro):
13288 Use pointers/smart pointers to refer to MatchedFragmentContainer instances.
13289 (MacroExpander::transcribe_rule): Likewise.
13290 (MatchedFragmentContainer::get_single_fragment): New implementation.
13291 (MatchedFragmentContainer::get_fragments): Likewise.
13292 (MatchedFragmentContainer::add_fragment): Likewise.
13293 (MatchedFragmentContainer::zero): Likewise.
13294 (MatchedFragmentContainer::metavar): Likewise.
13295 * expand/rust-macro-expand.h
13296 (class MatchedFragmentContainer): Make abstract.
13297 (class MatchedFragmentContainerMetaVar): New.
13298 (class MatchedFragmentContainerRepetition): New.
13299 (class SubstitutionScope):
13300 Use pointers/smart pointers to refer to MatchedFragmentContainer instances.
13301 (MacroExpander::transcribe_rule): Likewise.
13302 * expand/rust-macro-substitute-ctx.cc
13303 (SubstituteCtx::substitute_metavar): Likewise.
13304 (SubstituteCtx::check_repetition_amount): Likewise.
13305 (SubstituteCtx::substitute_repetition): Likewise.
13306 * expand/rust-macro-substitute-ctx.h
13307 (class SubstituteCtx): Likewise.
13308
13309 2024-01-16 Muhammad Mahad <[email protected]>
13310
13311 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): called rust_error_at
13312 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): called rust_error_at
13313
13314 2024-01-16 Philip Herron <[email protected]>
13315
13316 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
13317 arguments mappings as an out parameter and apply them to the bounds
13318 * typecheck/rust-hir-type-check-item.h: update the prototype
13319 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
13320 apply the arguments to the segment type
13321
13322 2024-01-16 Philip Herron <[email protected]>
13323
13324 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
13325 simplify lookup of the respective predicate
13326 * typecheck/rust-tyty-subst.cc (SubstitutionArg::SubstitutionArg): track original parameter
13327 (SubstitutionArg::operator=): update copy ctor
13328 (SubstitutionArg::get_param_ty): use original param
13329 (SubstitutionArg::as_string): update as_string
13330 * typecheck/rust-tyty-subst.h: add new private field
13331
13332 2024-01-16 Philip Herron <[email protected]>
13333
13334 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
13335 New helper utility to infer non concrete types and handle the case where its not a
13336 binding generic type (which inherits SubstitutionRef)
13337 * typecheck/rust-hir-type-check-item.h: new helper prototype
13338 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): use this helper
13339
13340 2024-01-16 Philip Herron <[email protected]>
13341
13342 * typecheck/rust-hir-trait-resolve.cc: use lookup_predicate (DefID)
13343 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): fix formatting
13344
13345 2024-01-16 Matthew Jasper <[email protected]>
13346
13347 * ast/rust-ast.h (MacroInvocation::add_semicolon): New method.
13348 (Expr::to_stmt): Remove method.
13349 * ast/rust-macro.h (MacroInvocation::add_semicolon): Add override.
13350 (MacroInvocation::to_stmt): Remove override.
13351 * ast/rust-stmt.h: Remove use of Expr::to_stmt.
13352 (ExprStmt::add_semicolon): Add override.
13353 * expand/rust-macro-expand.h (struct MacroExpander):
13354 Add EXPR/STMT and remove BLOCK from ContextType.
13355 * expand/rust-expand-visitor.cc (ExpandVisitor::maybe_expand_expr): Use EXPR context.
13356 (ExpandVisitor::expand_inner_stmts): Use STMT context.
13357 (ExpandVisitor::visitor): Remove use of BLOCK context.
13358 * expand/rust-macro-expand.cc (parse_many): Pass enum by value.
13359 (transcribe_on_delimiter): Remove function.
13360 (transcribe_context): Use EXPR/STMT contexts.
13361 (MacroExpander::parse_proc_macro_output): Use EXPR/STMT contexts.
13362 (transcribe_many_stmts): Parse statements with semicolons.
13363 * parse/rust-parse-impl.h (Parser::parse_stmt):
13364 Delegate macro parsing to parse_expr_stmt, check for ! after macro_rules.
13365 (Parser::parse_let_stmt): Work around lack of NT tokens.
13366 (Parser::parse_expr_stmt): Handle statements at end of macro expansions.
13367 (Parser::parse_expr_stmt): Parse macro statements/expression statements
13368 starting with a macro.
13369 (Parser::parse_match_expr): Don't modify flag unnecessarily.
13370 (Parser::parse_stmt_or_expr):
13371 Parse macro statements/expression statements starting with a macro.
13372 (Parser::parse_path_based_stmt_or_expr): Remove method.
13373 (Parser::parse_macro_invocation_maybe_semi): Remove method.
13374 (Parser::parse_expr): Move code into left_denotations.
13375 (Parser::left_denotations): New method.
13376 (Parser::null_denotation): Split out methods for cases with and without paths.
13377 (Parser::null_denotation_path): New method.
13378 (Parser::null_denotation_not_path): New method.
13379 (Parser::parse_macro_invocation_partial): Don't check for semicolon here.
13380 * parse/rust-parse.h: Update declarations.
13381 (struct ParseRestrictions): Additional flag.
13382
13383 2024-01-16 Matthew Jasper <[email protected]>
13384
13385 * ast/rust-ast.cc (BlockExpr::strip_tail_expr):
13386 Don't normalize tail expression in this method.
13387 (BlockExpr::normalize_tail_expr): New method that only does the normalization.
13388 * ast/rust-expr.h: Declare new method.
13389 * hir/rust-ast-lower-block.h: Normalize tail expressions on blocks before lowering.
13390
13391 2024-01-16 Matthew Jasper <[email protected]>
13392
13393 * ast/rust-ast-dump.cc (Dump::visit): Print macro invocations.
13394
13395 2024-01-16 Raiki Tamura <[email protected]>
13396
13397 * lex/rust-lex.cc (is_whitespace):add all lacked codepoints valid as whitespaces
13398 (is_identifier_start):new function to check XID_Start and underscore
13399 (is_identifier_continue):new function to check XID_Continue
13400 (Lexer::build_token):tokenize Unicode identifiers
13401 (Lexer::parse_partial_string_continue):add comments
13402 (Lexer::parse_partial_unicode_escape):add comments
13403 (Lexer::parse_raw_identifier):change to use `is_identifier_scontinue`
13404 (Lexer::parse_identifier_or_keyword):change to use `is_identifier_continue`
13405 (Lexer::parse_char_or_lifetime):change to use `is_identifier_start/continue`
13406 (Lexer::skip_codepoint_input):do not attempt to skip input when bumping EOF
13407 * lex/rust-lex.h:add `current_char32` field
13408
13409 2024-01-16 Owen Avery <[email protected]>
13410
13411 * lex/rust-lex.cc
13412 (Lexer::classify_keyword): Check if iterator is valid before dereferencing.
13413
13414 2024-01-16 Owen Avery <[email protected]>
13415
13416 * expand/rust-macro-expand.cc
13417 (MacroExpander::match_repetition): Remove redundant rust_error_at call.
13418
13419 2024-01-16 Philip Herron <[email protected]>
13420
13421 * typecheck/rust-unify.cc (UnifyRules::go): dont check bounds on placeholders
13422
13423 2024-01-16 tieway59 <[email protected]>
13424
13425 * typecheck/rust-tycheck-dump.h: Delete this file
13426 * rust-session-manager.cc: Remove `Session::dump_type_resolution`
13427 and `TYPE_RESOLUTION_DUMP`
13428 * rust-session-manager.h: Likewise
13429
13430 2024-01-16 Philip Herron <[email protected]>
13431
13432 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
13433 match the fntype to the candidate
13434
13435 2024-01-16 Arthur Cohen <[email protected]>
13436
13437 * expand/rust-derive.h: Store AstBuilder and location.
13438 * expand/rust-derive.cc (DeriveVisitor::DeriveVisitor): Update constructor.
13439 * expand/rust-derive-clone.h: Remove members now stored in `DeriveVisitor`.
13440 * expand/rust-derive-copy.h: Likewise.
13441 * expand/rust-derive-clone.cc (DeriveClone::DeriveClone): Update constructor.
13442 * expand/rust-derive-copy.cc (DeriveCopy::DeriveCopy): Likewise.
13443
13444 2024-01-16 Philip Herron <[email protected]>
13445
13446 * backend/rust-compile-item.cc (CompileItem::visit): ensure assoicated types are setup
13447 * typecheck/rust-hir-trait-reference.h: new interface for concrete impl block
13448 * typecheck/rust-hir-trait-resolve.cc (AssociatedImplTrait::setup_raw_associated_types):
13449 ensure we setup assoicated types for this impl block
13450
13451 2024-01-16 Dave Evans <[email protected]>
13452
13453 * backend/rust-compile-expr.cc (check_match_scrutinee): Add REF type to rust_assert.
13454 (CompileExpr::visit): Add REF type for scrutinee_kind in MatchExpr visitor.
13455
13456 2024-01-16 TieWay59 <[email protected]>
13457
13458 * typecheck/rust-hir-type-check-expr.cc: Remove obsolete error diagnostic
13459
13460 2024-01-16 Philip Herron <[email protected]>
13461
13462 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
13463 use new interface
13464 * typecheck/rust-type-util.cc (types_compatable): implementation of new interface
13465 * typecheck/rust-type-util.h (types_compatable): prototype
13466 * typecheck/rust-unify.cc (UnifyRules::expect_placeholder):
13467 It is allow for unification against placeholders
13468
13469 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13470
13471 * expand/rust-expand-visitor.cc (derive_item): Add const
13472 attribute to the trait name argument.
13473 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
13474
13475 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13476
13477 * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
13478 assertion to allow empty derive directives.
13479
13480 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13481
13482 * expand/rust-expand-visitor.cc (expand_attribute): Add function
13483 to expand a given attribute on a given item.
13484 * expand/rust-macro-expand.h (struct MacroExpander): Change
13485 return type to ast fragment.
13486
13487 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13488
13489 * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
13490 the function to get traits in a given attribute instead of an
13491 attribute vector.
13492 (ExpandVisitor::expand_struct_fields): Remove call in visitor.
13493 (ExpandVisitor::expand_function_params): Likewise.
13494 (ExpandVisitor::expand_closure_params): Likewise.
13495 (ExpandVisitor::visit): Likewise.
13496 (ExpandVisitor::expand_outer_attribute): Remove function.
13497 (ExpandVisitor::visit_outer_attrs): Remove function.
13498 * expand/rust-expand-visitor.h: Remove function prototypes.
13499 (ExpandVisitor::visit_outer_attrs): Remove function.
13500
13501 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13502
13503 * expand/rust-expand-visitor.h: Remove fragment collection fro
13504 procedural macros.
13505 * expand/rust-macro-expand.h (struct MacroExpander): Remove
13506 procedural macro fragment from expander.
13507
13508 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13509
13510 * ast/rust-ast-fragment.cc (Fragment::Fragment): Remove
13511 overwrite member in constructor.
13512 (Fragment::operator=): Removal of overwrite member in copy.
13513 (Fragment::should_overwrite): Remove overwrite getter.
13514 * ast/rust-ast-fragment.h: Remove overwrite boolean member.
13515 * expand/rust-expand-visitor.cc (derive_item): Add a function to
13516 derive items using the expander for now.
13517 (builtin_derive_item): Rename from derive_item to
13518 builtin_derive_item.
13519 (ExpandVisitor::visit): Remove visit to derive attributes.
13520 (ExpandVisitor::expand_derive): Remove derive attribute visitor.
13521 (ExpandVisitor::visit_attrs_with_derive): Likewise.
13522 * expand/rust-expand-visitor.h: Update insertion of other kind
13523 of proc macros. We no longer have an overwrite attribute in the
13524 fragment.
13525 * expand/rust-macro-expand.cc (MacroExpander::parse_procmacro_output):
13526 Return the fragment instead of inserting it.
13527 * expand/rust-macro-expand.h (struct MacroExpander): Return
13528 fragment.
13529
13530 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13531
13532 * ast/rust-ast-collector.h: Update enum name to match
13533 definition.
13534 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_derive):
13535 Add call to expander.
13536 (ExpandVisitor::expand_outer_attribute):
13537 Change call to macro expander.
13538 (ExpandVisitor::expand_inner_attribute): Likewise.
13539 * expand/rust-expand-visitor.h: Remove const attribute to match
13540 visitor declaration. Attach result to the AST. Add condition for
13541 item erasure.
13542 * expand/rust-proc-macro.h: Add token collector and expansion
13543 call. Add lexers and parsers for each proc macro type and uses
13544 them to parse macro output.
13545 * expand/rust-macro-expand.h (struct MacroExpander): Add
13546 functions.
13547 * expand/rust-proc-macro.cc (ProcMacroExpander::import_proc_macros):
13548 Moved from here...
13549 * expand/rust-macro-expand.cc (MacroExpander::import_proc_macros):
13550 ... to here. Unify procedural macro parsing under one function.
13551 Add a flag to determine whether it originate from a derive
13552 macro.
13553 (MacroExpander::parse_procmacro_output):
13554 Parse macro output to statements. Store an error on parsing
13555 failure.
13556 * Make-lang.in: Add const_TokenPtr specific lexer.
13557 * expand/rust-proc-macro-invoc-lexer.cc: New file.
13558 * expand/rust-proc-macro-invoc-lexer.h: New file.
13559 * rust-session-manager.cc (Session::expansion): Remove
13560 ProcMacroExpander declaration.
13561 * ast/rust-ast-fragment.cc (Fragment::Fragment): Add overwrite
13562 flag.
13563 (Fragment::should_overwrite): Add a getter to determine whether
13564 the fragment shall overwrite it's parent or be appended after.
13565 * ast/rust-ast-fragment.h: Add flag to declaration.
13566
13567 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13568
13569 * util/rust-hir-map.cc (Mappings::insert_bang_proc_macro):
13570 Add a function to insert a new bang proc macro.
13571 (Mappings::lookup_bang_proc_macro): Add a function to lookup a
13572 bang procedural macro.
13573 (Mappings::insert_derive_proc_macro): Add a function to insert a
13574 derive procedural macro.
13575 (Mappings::lookup_derive_proc_macro): Add a function to lookup a
13576 derive procedural macro.
13577 (Mappings::insert_attribute_proc_macro): Add a function to
13578 insert an attribute procedural macro.
13579 (Mappings::lookup_attribute_proc_macro): Add a function to
13580 lookup an attribute procedural macro.
13581 * util/rust-hir-map.h: Add function prototypes.
13582 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_outer_attribute):
13583 Implement expansion of outer attributes.
13584 (ExpandVisitor::expand_inner_attribute):
13585 Add call for inner attribute expansion.
13586 * expand/rust-expand-visitor.h:
13587 Add new procedural macro expander attribute.
13588 * expand/rust-proc-macro.cc (load_macros_array): Add a function
13589 to load the proc macro array from a given shared object.
13590 (load_macros): Add a function to retrieve procedural macro
13591 vector from a given shared object.
13592 (ProcMacroExpander::import_proc_macros): Add a function to load
13593 procedural macros from a given extern crate name.
13594 * expand/rust-proc-macro.h (RUST_PROC_MACRO_H): Add new
13595 proc-macro file.
13596 (class ProcMacroExpander): Add new ProcMacroExpander class.
13597 * rust-session-manager.cc (Session::expansion): Create new macro
13598 expander and feed it to the expand visitor.
13599 * util/rust-attributes.cc: Add macro_export builtin attribute.
13600
13601 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13602
13603 * ast/rust-ast-collector.cc (TokenCollector::visit): Fix
13604 attribute collection.
13605
13606 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13607
13608 * ast/rust-ast-collector.h: Make trivial visitors public.
13609
13610 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13611
13612 * Make-lang.in: Add rust-proc-macro object to list.
13613 * expand/rust-proc-macro.cc: New file.
13614 * expand/rust-proc-macro.h: New file.
13615
13616 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13617
13618 * util/rust-attributes.cc: Add attribute to the table.
13619
13620 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13621
13622 * ast/rust-ast-collector.cc (TokenCollector::visit): Move
13623 implementation from here...
13624 * ast/rust-ast-collector.h: ... to here.
13625
13626 2024-01-16 Owen Avery <[email protected]>
13627
13628 * Make-lang.in: Add "rust-dir-owner.o".
13629 * ast/rust-ast.cc: Include "rust-dir-owner.h".
13630 (Module::process_file_path):
13631 Handle non-mod-rs external file modules properly.
13632 * parse/rust-parse-impl.h: Include "rust-dir-owner.h".
13633 (Parser::parse_module):
13634 Handle non-mod-rs external file modules properly.
13635 * util/rust-dir-owner.cc: New file.
13636 * util/rust-dir-owner.h: New file.
13637
13638 2024-01-16 Owen Avery <[email protected]>
13639
13640 * expand/rust-macro-builtins.cc: Fix comments.
13641 (MacroBuiltin::proc_macro_builtin): Add error message.
13642 * expand/rust-macro-builtins.h: Fix comments.
13643
13644 2024-01-16 Philip Herron <[email protected]>
13645
13646 * typecheck/rust-hir-trait-resolve.cc: when the bound is concrete keep the mapping
13647 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): add missing call
13648 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): make this the same as paths
13649
13650 2024-01-16 Owen Avery <[email protected]>
13651
13652 * util/rust-optional.h
13653 (class Optional): Add volatile field to union.
13654
13655 2024-01-16 Owen Avery <[email protected]>
13656
13657 * expand/rust-macro-substitute-ctx.cc
13658 (SubstituteCtx::substitute_metavar): Substitute crate metavar.
13659
13660 2024-01-16 Owen Avery <[email protected]>
13661
13662 * parse/rust-parse-impl.h
13663 (Parser::null_denotation): Allow struct expression referencing.
13664
13665 2024-01-16 Charalampos Mitrodimas <[email protected]>
13666
13667 * ast/rust-ast-dump.cc (Dump::visit):
13668 print literals based on their type.
13669
13670 2024-01-16 Arthur Cohen <[email protected]>
13671
13672 * expand/rust-macro-builtins.cc (MacroBuiltin::dummy): New function.
13673 * expand/rust-macro-builtins.h: Declare it.
13674
13675 2024-01-16 Arthur Cohen <[email protected]>
13676
13677 * ast/rust-ast-builder.cc (AstBuilder::struct_expr_struct): New function.
13678 (AstBuilder::let): Likewise.
13679 (AstBuilder::struct_expr): Likewise.
13680 (AstBuilder::struct_expr_field): Likewise.
13681 (AstBuilder::field_access): Likewise.
13682 (AstBuilder::wildcard): Likewise.
13683 * ast/rust-ast-builder.h: Likewise.
13684 * expand/rust-derive-clone.cc (DeriveClone::visit_union): Implement
13685 properly.
13686
13687 2024-01-16 Arthur Cohen <[email protected]>
13688
13689 * Make-lang.in: Add new files.
13690 * expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveCopy.
13691 * expand/rust-derive-copy.cc: New file.
13692 * expand/rust-derive-copy.h: New file.
13693
13694 2024-01-16 Arthur Cohen <[email protected]>
13695
13696 * expand/rust-derive-clone.cc (DeriveClone::visit_struct): Implement proper
13697 cloning for structs with fields.
13698 * ast/rust-ast-builder.cc (AstBuilder::struct_expr): New function.
13699 (AstBuilder::struct_expr_field): Likewise.
13700 (AstBuilder::field_access): Likewise.
13701 (AstBuilder::let): Likewise.
13702 * ast/rust-ast-builder.h: Declare new functions.
13703
13704 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13705
13706 * util/rust-token-converter.cc (convert): Use a variable instead
13707 of multiple nested calls.
13708
13709 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13710
13711 * lex/rust-lex.h: Make build_token method public.
13712 * lex/rust-token.h: Add a setter for a token location.
13713 * util/rust-token-converter.cc (convert): Add the function to
13714 convert from a Span to a Location.
13715 (from_ident): Convert Ident span to a Location.
13716 (from_literal): Convert Literal span to a Location.
13717 (from_punct): Convert Punct span to a Location.
13718 (from_group): Convert Group span to a Location.
13719
13720 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13721
13722 * util/rust-token-converter.cc (convert): Add implementation.
13723
13724 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13725
13726 * util/rust-token-converter.cc (convert): Update call to
13727 constructors with location information.
13728 (handle_suffix): Convert token locus to a Span and use it in the
13729 literal.
13730
13731 2024-01-16 Owen Avery <[email protected]>
13732
13733 * expand/rust-macro-expand.cc
13734 (MacroExpander::try_match_rule): Don't match delimiters for root matcher.
13735 (MacroExpander::match_matcher): Add option to match delimiters.
13736 * expand/rust-macro-expand.h
13737 (MacroExpander::match_matcher): Likewise.
13738 * parse/rust-parse-impl.h
13739 (Parser::skip_token): Add zero argument method.
13740 * parse/rust-parse.h:
13741 (Parser::skip_token): Likewise.
13742
13743 2024-01-16 Philip Herron <[email protected]>
13744
13745 * Make-lang.in: remove files
13746 * backend/rust-compile-block.h: fix headers
13747 * backend/rust-compile-expr.h: likewise
13748 * backend/rust-compile-fnparam.h: likewise
13749 * backend/rust-compile-item.h: likewise
13750 * backend/rust-compile-pattern.h: likewise
13751 * backend/rust-compile-resolve-path.h: likewise
13752 * backend/rust-compile-stmt.h: likewise
13753 * typecheck/rust-autoderef.cc: likewise
13754 * typecheck/rust-hir-path-probe.cc: likewise
13755 * typecheck/rust-hir-path-probe.h: likewise
13756 * typecheck/rust-hir-trait-reference.h: likewise
13757 * typecheck/rust-hir-trait-resolve.cc: use a for loop instead
13758 * typecheck/rust-hir-trait-resolve.h: fix headers
13759 * typecheck/rust-hir-type-check-expr.h: likewise
13760 * typecheck/rust-hir-type-check-implitem.h: likewise
13761 * typecheck/rust-hir-type-check-item.h: likewise
13762 * typecheck/rust-hir-type-check-path.cc: likewise
13763 * typecheck/rust-hir-type-check-pattern.h: likewise
13764 * typecheck/rust-hir-type-check-stmt.h: likewise
13765 * typecheck/rust-hir-type-check-type.h: likewise
13766 * typecheck/rust-hir-type-check-util.cc: Removed.
13767 * typecheck/rust-hir-type-check-util.h: Removed.
13768
13769 2024-01-16 Arthur Cohen <[email protected]>
13770
13771 * Make-lang.in: Add new object files to Makefile.
13772 * expand/rust-expand-visitor.cc (is_derive): Move function.
13773 (is_builtin): Likewise.
13774 (get_traits_to_derive): New function.
13775 (derive_item): Likewise.
13776 (ExpandVisitor::visit): Visit item/statements containers.
13777 (ExpandVisitor::visit_outer_attrs): Take a reference on the attribute
13778 instead of a copy.
13779 (ExpandVisitor::is_derive): Deleted function.
13780 (ExpandVisitor::is_builtin): Likewise.
13781 * expand/rust-expand-visitor.h (RUST_EXPAND_VISITOR_H): Add missing #ifdef
13782 guards.
13783 (is_derive): Declare function.
13784 (is_builtin): Likewise.
13785 * expand/rust-macro-builtins.cc (builtin_macro_from_string): Use new
13786 MacroBuiltin::builtins map.
13787 (make_macro_path_str): Likewise.
13788 * expand/rust-macro-builtins.h (enum class): Add builtin derive macros.
13789 * expand/rust-derive-clone.cc: New file.
13790 * expand/rust-derive-clone.h: New file.
13791 * expand/rust-derive.cc: New file.
13792 * expand/rust-derive.h: New file.
13793 * util/rust-hir-map.cc (Mappings::insert_macro_def): Fix logic for
13794 setting builtin macro transcribers.
13795
13796 2024-01-16 Arthur Cohen <[email protected]>
13797
13798 * ast/rust-ast-builder.cc: New file.
13799 * ast/rust-ast-builder.h: New file.
13800
13801 2024-01-16 Arthur Cohen <[email protected]>
13802
13803 * expand/rust-macro-invoc-lexer.cc: Add missing copyright header.
13804 * expand/rust-macro-substitute-ctx.cc: Likewise.
13805
13806 2024-01-16 Owen Avery <[email protected]>
13807
13808 * rust-session-manager.h:
13809 Include "rust-optional.h".
13810 (struct TargetOptions):
13811 Store values in config key/value pairs as Optional<std::string> rather than std::string.
13812 * rust-session-manager.cc
13813 (TargetOptions::dump_target_options):
13814 Handle Optional<std::string> values.
13815
13816 2024-01-16 Philip Herron <[email protected]>
13817
13818 * typecheck/rust-casts.cc (TypeCastRules::check): do coercion
13819 (TypeCastRules::emit_cast_error): clang-format
13820
13821 2024-01-16 Philip Herron <[email protected]>
13822
13823 * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): add name resolution
13824 * resolve/rust-ast-resolve-stmt.h: likewise
13825 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): insert resolved node
13826
13827 2024-01-16 Philip Herron <[email protected]>
13828
13829 * resolve/rust-ast-resolve-pattern.cc: remove unused
13830
13831 2024-01-16 Philip Herron <[email protected]>
13832
13833 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): fix missing pop
13834
13835 2024-01-16 Philip Herron <[email protected]>
13836
13837 * backend/rust-compile-expr.cc (CompileExpr::visit): remove unused
13838
13839 2024-01-16 Philip Herron <[email protected]>
13840
13841 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::translate): hir lowering
13842 (ASTLoweringStmt::visit): likewise
13843 * hir/rust-ast-lower-stmt.h: likewise
13844
13845 2024-01-16 Owen Avery <[email protected]>
13846
13847 * expand/rust-macro-substitute-ctx.cc
13848 (SubstituteCtx::substitute_metavar): Allow substitution failure.
13849 (SubstituteCtx::substitute_token):
13850 Handle substitution failure, include dollar sign in count of tokens to substitute.
13851 (SubstituteCtx::substitute_tokens):
13852 Include dollar sign in count of tokens to substitute.
13853 * expand/rust-macro-substitute-ctx.h
13854 (SubstituteCtx::substitute_metavar):
13855 Adjust signature and document new substitution failure handling.
13856
13857 2024-01-16 Owen Avery <[email protected]>
13858
13859 * expand/rust-macro-substitute-ctx.cc
13860 (SubstituteCtx::check_repetition_amount):
13861 Ignore single fragments while checking repetition amount.
13862
13863 2024-01-16 Philip Herron <[email protected]>
13864
13865 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): stop if error
13866 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): fix sized options
13867 * typecheck/rust-tyty.cc (BaseType::satisfies_bound): its ok if its an ?T
13868 (BaseType::bounds_compatible): likewise
13869 * typecheck/rust-tyty.h: update prototype
13870 * typecheck/rust-unify.cc (UnifyRules::go): check both sides bounds
13871
13872 2024-01-16 Philip Herron <[email protected]>
13873
13874 * backend/rust-compile-expr.cc (HIRCompileBase::resolve_deref_adjustment):
13875 reuse op overload code
13876 * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): update
13877 (Adjuster::try_raw_deref_type): likewise
13878 * typecheck/rust-autoderef.h: likewise
13879 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
13880 improve debug loging
13881
13882 2024-01-16 Philip Herron <[email protected]>
13883
13884 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): refactor
13885 * backend/rust-compile-base.h: likewise
13886 * backend/rust-compile-expr.cc (CompileExpr::visit): likewise
13887 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): likewise
13888
13889 2024-01-16 David Malcolm <[email protected]>
13890
13891 * typecheck/rust-hir-trait-reference.cc (TraitItemReference::is_optional): Remove
13892 stray semicolon.
13893
13894 2024-01-16 Arthur Cohen <[email protected]>
13895
13896 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::go): Cleanup
13897 order of calls when accumulating #[macro_use] macros.
13898 (EarlyNameResolver::visit): Likewise.
13899
13900 2024-01-16 Matthew Jasper <[email protected]>
13901
13902 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::accumulate_escaped_macros):
13903 Remove unnecessary visit.
13904
13905 2024-01-16 Matthew Jasper <[email protected]>
13906
13907 * ast/rust-ast.cc (Attribute::check_cfg_predicate):
13908 Only check first item as a predicate.
13909
13910 2024-01-16 Owen Avery <[email protected]>
13911
13912 * util/rust-optional.h
13913 (operator==): New for Optional<T> == Optional<U>.
13914
13915 2024-01-16 Owen Avery <[email protected]>
13916
13917 * parse/rust-parse-impl.h
13918 (Parser::parse_attr_input): Parse AttrInputMacro.
13919
13920 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13921
13922 * ast/rust-ast-collector.cc (TokenCollector::visit): Propagate
13923 coretype hint.
13924
13925 2024-01-16 Owen Avery <[email protected]>
13926
13927 * util/rust-optional.h
13928 (class Optional<T>): Improve inner state.
13929
13930 2024-01-16 Owen Avery <[email protected]>
13931
13932 * expand/rust-macro-substitute-ctx.cc
13933 (SubstituteCtx::check_repetition_amount): Handle keywords.
13934 (SubstituteCtx::substitute_token): Likewise.
13935 * lex/rust-token.cc
13936 (Token::get_str): Likewise.
13937 * parse/rust-parse-impl.h
13938 (Parser::parse_macro_match_fragment): Likewise.
13939
13940 2024-01-16 Arthur Cohen <[email protected]>
13941
13942 * ast/rust-ast.h: Add `outer_attrs` to Item.
13943 * ast/rust-expr.h: Make use of new inheritance methods.
13944 * ast/rust-item.h: Likewise.
13945 * ast/rust-macro.h: Likewise.
13946
13947 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13948
13949 * util/rust-token-converter.cc (dispatch_float_literals): Remove
13950 function.
13951 (handle_suffix): Rename old dispatch and add one LitKind
13952 argument.
13953 (dispatch_integer_literals): Remove function.
13954 (convert): Change call from dispatch to suffix handler.
13955
13956 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
13957
13958 * lex/rust-token.h: Implement hash for token id enumeration.
13959 * util/rust-token-converter.cc (dispatch_float_literals): Update
13960 to new internals.
13961 (dispatch_integer_literals): Likewise.
13962 (convert): Likewise.
13963 (string_literal): Remove function.
13964 (byte_string_literal): Likewise.
13965 (unsigned_literal): Likewise.
13966 (signed_literal): Likewise.
13967 (from_literal): Update with new internals.
13968
13969 2024-01-16 Owen Avery <[email protected]>
13970
13971 * ast/rust-ast-dump.cc
13972 (Dump::visit): Add AttrInputMacro visitor.
13973 * ast/rust-ast-dump.h:
13974 (Dump::visit): Likewise.
13975 * ast/rust-ast-full-decls.h
13976 (class AttrInputMacro): New.
13977 * ast/rust-ast-collector.cc
13978 (TokenCollector::visit):
13979 Add and call out to AttrInputMacro visitor.
13980 * ast/rust-ast-collector.h:
13981 (TokenCollector::visit): Add AttrInputMacro visitor.
13982 * ast/rust-ast-visitor.h:
13983 (ASTVisitor::visit): Likewise.
13984 * ast/rust-ast.cc
13985 (AttrInputMacro::accept_vis): New.
13986 (AttrInputMacro::as_string): New.
13987 (AttrInputMacro::AttrInputMacro): New.
13988 (AttrInputMacro::operator=): New.
13989 * ast/rust-ast.h:
13990 (AttrInput::AttrInputType::MACRO): New.
13991 * ast/rust-expr.h
13992 (class AttrInputMacro): New.
13993 * checks/errors/rust-feature-gate.h:
13994 (FeatureGate::visit): Add AttrInputMacro visitor.
13995 * expand/rust-cfg-strip.cc
13996 (CfgStrip::visit): Likewise.
13997 * expand/rust-cfg-strip.h:
13998 (CfgStrip::visit): Likewise.
13999 * expand/rust-expand-visitor.cc
14000 (ExpandVisitor::visit): Likewise.
14001 * expand/rust-expand-visitor.h:
14002 (ExpandVisitor::visit): Likewise.
14003 * hir/rust-ast-lower-base.cc
14004 (ASTLoweringBase::visit): Likewise.
14005 * hir/rust-ast-lower-base.h:
14006 (ASTLoweringBase::visit): Likewise.
14007 * resolve/rust-ast-resolve-base.cc
14008 (ResolverBase::visit): Likewise.
14009 * resolve/rust-ast-resolve-base.h:
14010 (ResolverBase::visit): Likewise.
14011 * resolve/rust-early-name-resolver.cc
14012 (EarlyNameResolver::visit): Likewise.
14013 * resolve/rust-early-name-resolver.h:
14014 (EarlyNameResolver::visit): Likewise.
14015 * util/rust-attributes.cc
14016 (AttributeChecker::visit): Likewise.
14017 (check_doc_attribute): Handle AttrInputType::MACRO.
14018 * util/rust-attributes.h:
14019 (AttributeChecker::visit): Add AttrInputMacro visitor.
14020
14021 2024-01-16 Owen Avery <[email protected]>
14022
14023 * ast/rust-macro.h
14024 (MacroInvocation::clone_macro_invocation_impl): Make public.
14025
14026 2024-01-16 Owen Avery <[email protected]>
14027
14028 * util/rust-optional.h
14029 (struct std::hash<Optional<T>>): New.
14030
14031 2024-01-16 Owen Avery <[email protected]>
14032
14033 * util/rust-optional.h
14034 (class Optional<T&>): Use pointers internally.
14035
14036 2024-01-16 Arthur Cohen <[email protected]>
14037
14038 * ast/rust-ast-dump.cc (Dump::visit): Implement dump for
14039 `TupleIndexExpr`.
14040
14041 2024-01-16 Owen Avery <[email protected]>
14042
14043 * lex/rust-token.cc
14044 (token_id_keyword_string): Return std::string reference.
14045 * lex/rust-token.h
14046 (token_id_keyword_string): Return std::string reference.
14047
14048 2024-01-16 Matthew Jasper <[email protected]>
14049
14050 * ast/rust-ast.h (Expr::as_expr_without_block): Remove.
14051 (Expr::set_outer_attrs): Make public in base class.
14052 * expand/rust-macro-expand.cc:
14053 Add fixme comment for pre-existing bug.
14054 * hir/tree/rust-hir.h: Remove Expr::as_expr_without_block.
14055 * parse/rust-parse-impl.h (Parser::parse_lifetime): Use lifetime_from_token.
14056 (Parser::lifetime_from_token): New method.
14057 (Parser::null_denotation): Handle labelled loop expressions and for loop expressions.
14058 (Parser::parse_loop_label): Make initial token a parameter.
14059 (Parser::parse_labelled_loop_expr): Likewise.
14060 (Parser::parse_for_loop_expr): Allow FOR token to already be skipped.
14061 (Parser::parse_expr): Handle expr_can_be_stmt.
14062 (Parser::parse_expr_with_block): Remove.
14063 (Parser::parse_expr_stmt_with_block): Remove.
14064 (Parser::parse_expr_stmt_without_block): Remove.
14065 (Parser::parse_expr_without_block): Remove.
14066 (Parser::parse_stmt_or_expr_with_block): Remove.
14067 (Parser::parse_expr_stmt): Use parse_expr directly.
14068 (Parser::parse_match_expr): Likewise.
14069 (Parser::parse_stmt): Use parse_expr_stmt in more cases.
14070 (Parser::parse_stmt_or_expr):
14071 Rename from parse_stmt_or_expr_without_block, use parse_expr directly.
14072 (Parser::parse_block_expr): Update error message.
14073 * parse/rust-parse.h: Update declarations.
14074
14075 2024-01-16 Matthew Jasper <[email protected]>
14076
14077 * ast/rust-ast-full-decls.h (class ExprStmtWithoutBlock): Remove.
14078 (class ExprStmtWithBlock): Remove.
14079 * ast/rust-stmt.h (class ExprStmtWithoutBlock): Remove.
14080 (class ExprStmtWithBlock): Remove.
14081 (class ExprStmt):
14082 Make non-abstract, add common functionality from removed base classes.
14083 * ast/rust-ast.h: Move to_stmt to base class.
14084 * ast/rust-ast.cc (ExprStmtWithBlock::as_string): Remove.
14085 * ast/rust-macro.h: Use new signature for to_stmt.
14086 (ExprStmt::as_string): New method.
14087 (ExprStmtWithoutBlock::as_string): Remove.
14088 (BlockExpr::strip_tail_expr): Update for removed classes.
14089 (ExprStmtWithoutBlock::accept_vis): Remove.
14090 (ExprStmtWithBlock::accept_vis): Remove.
14091 (ExprStmt::accept_vis): New method.
14092 * ast/rust-ast-dump.cc (Dump::visit): Update for removed classes.
14093 * ast/rust-ast-dump.h: Likewise.
14094 * ast/rust-ast-collector.h: Likewise.
14095 * ast/rust-ast-collector.cc (TokenStream::visit): Likewise.
14096 * ast/rust-ast-visitor.h: Likewise.
14097 * checks/errors/rust-feature-gate.h: Likewise.
14098 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
14099 * expand/rust-expand-visitor.h: Likewise.
14100 * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
14101 * expand/rust-cfg-strip.h: Likewise.
14102 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
14103 * hir/rust-ast-lower-base.h: Likewise.
14104 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
14105 * hir/rust-ast-lower-stmt.h: Likewise.
14106 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
14107 * util/rust-attributes.h: Likewise.
14108 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
14109 * resolve/rust-ast-resolve-base.h: Likewise.
14110 * resolve/rust-ast-resolve-stmt.h: Likewise.
14111 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
14112 Likewise.
14113 * resolve/rust-early-name-resolver.h: Likewise.
14114 * parse/rust-parse-impl.h (Parser::parse_match_expr): Likewise.
14115 (Parser::parse_stmt_or_expr_without_block): Likewise.
14116 * parse/rust-parse.h: Likewise.
14117
14118 2024-01-16 Owen Avery <[email protected]>
14119
14120 * lex/rust-token.cc
14121 (token_id_is_keyword): New.
14122 (token_id_keyword_string): New.
14123 * lex/rust-token.h
14124 (token_id_is_keyword): New.
14125 (token_id_keyword_string): New.
14126 * expand/rust-macro-expand.cc
14127 (MacroExpander::match_fragment): Match keywords for ident fragment.
14128 * parse/rust-parse-impl.h
14129 (Parser::parse_identifier_or_keyword_token): Add.
14130 * parse/rust-parse.h
14131 (Parser::parse_identifier_or_keyword_token): Add.
14132
14133 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14134
14135 * util/rust-token-converter.cc (dispatch_float_literals): Invert
14136 suffix condition.
14137 (dispatch_integer_literals): Likewise.
14138
14139 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14140
14141 * util/rust-token-converter.cc (convert): Fix style.
14142 (from_ident): Likewise.
14143
14144 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14145
14146 * util/rust-token-converter.cc (dispatch_float_literals): Make
14147 input immutable.
14148 (dispatch_integer_literals): Likewise.
14149 (convert): Likewise.
14150 * util/rust-token-converter.h (convert): Likewise.
14151
14152 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14153
14154 * util/rust-token-converter.cc (from_tokenstream): Add
14155 conversion of Ident structures.
14156 (from_ident): Likewise.
14157
14158 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14159
14160 * util/rust-token-converter.cc (from_literal): Add function
14161 implementation.
14162 (string_literal): String literal specific handler.
14163 (byte_string_literal): Byte string specific handler.
14164 (unsigned_literal): Unsigned literal specific handler.
14165 (signed_literal): Signed literal specific handler.
14166
14167 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14168
14169 * util/rust-token-converter.cc (from_punct): Add conversion
14170 implementation.
14171
14172 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14173
14174 * util/rust-token-converter.cc (dispatch_float_literals): Accept
14175 const_TokenPtr instead of TokenPtr.
14176 (dispatch_integer_literals): Likewise.
14177 (convert): Accept vector of const_TokenPtr instead of a vector
14178 of TokenPtr.
14179 * util/rust-token-converter.h (convert): Likewise.
14180
14181 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14182
14183 * util/rust-token-converter.cc (from_tokenstream): Add vector
14184 for joined punct accumulation.
14185 (from_ident): Accept const pointer vector.
14186 (from_literal): Likewise.
14187 (from_punct): Likewise.
14188 (from_group): Likewise.
14189 (from_tokentree): Likewise.
14190 (convert): Likewise.
14191 * util/rust-token-converter.h (convert): Likewise.
14192
14193 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14194
14195 * util/rust-token-converter.cc (from_tokenstream): Add call to
14196 from_tokentree.
14197 (from_tokentree): Add implementation, from the from_tokenstream
14198 function.
14199
14200 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14201
14202 * util/rust-token-converter.cc (from_punct): Add group
14203 conversion.
14204 (from_group): Likewise.
14205
14206 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14207
14208 * util/rust-token-converter.cc (to_tokenstream): Change function
14209 name from to_tokenstream to convert.
14210 (convert): Likewise.
14211 (from_tokenstream): Add tokenstream handler.
14212 (from_ident): Add empty function.
14213 (from_literal): Likewise.
14214 (from_punct): Likewise.
14215 (from_group): Likewise.
14216 * util/rust-token-converter.h (to_tokenstream): Change function
14217 name from to_tokenstream to convert.
14218 (convert): Likewise.
14219
14220 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14221
14222 * util/rust-token-converter.cc (dispatch_float_literals): Remove
14223 suffixed temporary variable.
14224 (dispatch_integer_literals): Likewise.
14225
14226 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14227
14228 * Make-lang.in: Add new rust-token-converter file.
14229 * ast/rust-ast-collector.cc (pop_group): Function moved from
14230 TokenCollector.
14231 (dispatch_float_literals): Likewise.
14232 (dispatch_integer_literals): Likewise.
14233 (TokenCollector::collect): Removed function.
14234 * ast/rust-ast-collector.h: Removed function prototype.
14235 * util/rust-token-converter.cc: New file.
14236 * util/rust-token-converter.h: New file.
14237
14238 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14239
14240 * ast/rust-ast-collector.h (RUST_AST_TOKENSTREAM_H): Rename
14241 headerguard from RUST_AST_TOKENSTREAM_H ...
14242 (RUST_AST_COLLECTOR_H): ... to RUST_AST_COLLECTOR_H.
14243
14244 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14245
14246 * Make-lang.in: Change file name.
14247 * ast/rust-ast-tokenstream.cc: Moved to...
14248 * ast/rust-ast-collector.cc: ...here.
14249 * ast/rust-ast-tokenstream.h: Moved to...
14250 * ast/rust-ast-collector.h: ...here.
14251 * rust-session-manager.cc: Change header name.
14252
14253 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14254
14255 * ast/rust-ast-tokenstream.cc (TokenStream::TokenStream): Rename
14256 TokenStream to TokenCollector.
14257 (TokenCollector::TokenCollector): Likewise.
14258 (TokenStream::collect_tokens): Likewise.
14259 (TokenCollector::collect_tokens): Likewise.
14260 (TokenStream::collect): Likewise.
14261 (TokenCollector::collect): Likewise.
14262 (TokenStream::visit): Likewise.
14263 (TokenCollector::visit): Likewise.
14264 (TokenStream::visit_items_joined_by_separator): Likewise.
14265 (TokenCollector::visit_items_joined_by_separator): Likewise.
14266 (TokenStream::visit_as_line): Likewise.
14267 (TokenCollector::visit_as_line): Likewise.
14268 (TokenStream::visit_items_as_lines): Likewise.
14269 (TokenCollector::visit_items_as_lines): Likewise.
14270 (TokenStream::visit_items_as_block): Likewise.
14271 (TokenCollector::visit_items_as_block): Likewise.
14272 (TokenStream::trailing_comma): Likewise.
14273 (TokenCollector::trailing_comma): Likewise.
14274 (TokenStream::newline): Likewise.
14275 (TokenCollector::newline): Likewise.
14276 (TokenStream::indentation): Likewise.
14277 (TokenCollector::indentation): Likewise.
14278 (TokenStream::increment_indentation): Likewise.
14279 (TokenCollector::increment_indentation): Likewise.
14280 (TokenStream::decrement_indentation): Likewise.
14281 (TokenCollector::decrement_indentation): Likewise.
14282 (TokenStream::visit_closure_common): Likewise.
14283 (TokenCollector::visit_closure_common): Likewise.
14284 (TokenStream::visit_loop_common): Likewise.
14285 (TokenCollector::visit_loop_common): Likewise.
14286 (TokenStream::visit_function_common): Likewise.
14287 (TokenCollector::visit_function_common): Likewise.
14288 * ast/rust-ast-tokenstream.h (class TokenStream): Likewise.
14289 (class TokenCollector): Likewise.
14290 * rust-session-manager.cc (Session::dump_tokenstream): Rename
14291 token vector for clearer intent.
14292
14293 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14294
14295 * ast/rust-ast-tokenstream.cc (dispatch_float_literals): Add
14296 dispatch function for floating point literals.
14297 (TokenStream::collect): Add call to dispatcher.
14298
14299 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14300
14301 * ast/rust-ast-tokenstream.cc (dispatch_integer_literals):
14302 Add a static function to dispatch depending on the core type.
14303 (TokenStream::collect): Add call to dispatch function.
14304
14305 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14306
14307 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add
14308 conversion for byte string and string.
14309
14310 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14311
14312 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add Ident
14313 conversion.
14314
14315 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14316
14317 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add joint
14318 punct token conversion.
14319
14320 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14321
14322 * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add
14323 conversion for single punctuation tokens.
14324
14325 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14326
14327 * ast/rust-ast-tokenstream.cc (pop_group): Add a function to
14328 easily collect a group from a given stack at the end of it.
14329 (TokenStream::collect): Collect tokens as a rust compatible
14330 Tokenstream type.
14331 * ast/rust-ast-tokenstream.h (RUST_AST_TOKENSTREAM_H): Move
14332 includes to stay constrained by guards.
14333
14334 2024-01-16 M V V S Manoj Kumar <[email protected]>
14335
14336 * ast/rust-ast-full-decls.h (enum class): Added declaration.
14337 (struct AnonConst): Added declaration.
14338 (struct InlineAsmRegOrRegClass): Added declaration.
14339 (struct InlineAsmOperand): Added declaration.
14340 (struct InlineAsmPlaceHolder): Added declaration.
14341 (struct InlineAsmTemplatePiece): Added declaration.
14342 (struct TupleClobber): Added declaration.
14343 (struct TupleTemplateStr): Added declaration.
14344 * ast/rust-expr.h (class InlineAsm): Defined all it's data members outside.
14345 (enum class InlineAsmOptions): Converted this to a enum class so we could use it in the HIR.
14346 (struct AnonConst): Defined it independent of the AST::InlineAsm node.
14347 (struct InlineAsmRegOrRegClass): Defined it independent of the AST::InlineAsm node.
14348 (struct InlineAsmOperand): Defined it independent of the AST::InlineAsm node.
14349 (struct InlineAsmPlaceHolder): Defined it independent of the AST::InlineAsm node.
14350 (struct InlineAsmTemplatePiece): Defined it independent of the AST::InlineAsm node.
14351 (struct TupleClobber): Defined it independent of the AST::InlineAsm node.
14352 (struct TupleTemplateStr): Defined it independent of the AST::InlineAsm node.
14353 * hir/tree/rust-hir-expr.h (class InlineAsmReg): Added defination.
14354 (class InlineAsmRegClass): Added defination.
14355 (struct InlineAsmRegOrRegClass): Added defination.
14356 (class InlineAsm): Added defination.
14357 * hir/tree/rust-hir-full-decls.h (class InlineAsmReg): Added declaration.
14358 (class InlineAsmRegClass): Added declaration.
14359 (struct InlineAsmRegOrRegClass): Added declaration.
14360 (class InlineAsm): Added declaration.
14361
14362 2024-01-16 Philip Herron <[email protected]>
14363
14364 * backend/rust-compile-base.cc: track return type in fncontext
14365 * backend/rust-compile-context.h (struct fncontext): likewise
14366 * backend/rust-compile-expr.cc (CompileExpr::visit): apply coercion site
14367 (CompileExpr::generate_closure_function): update push_context
14368 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
14369
14370 2024-01-16 Philip Herron <[email protected]>
14371
14372 * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body):
14373 add missing coercion_site codegen
14374
14375 2024-01-16 Philip Herron <[email protected]>
14376
14377 * backend/rust-compile-expr.cc (CompileExpr::visit): refactr
14378 (CompileExpr::get_fn_addr_from_dyn): likewise
14379 (CompileExpr::get_receiver_from_dyn): likewise
14380 (CompileExpr::type_cast_expression): likewise
14381 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): likewise
14382 (TyTyResolveCompile::create_dyn_obj_record): likewise
14383 (TyTyResolveCompile::create_slice_type_record): likewise
14384 (TyTyResolveCompile::create_str_type_record): likewise
14385 * backend/rust-compile-type.h: likewise
14386 * backend/rust-compile.cc (HIRCompileBase::coercion_site1): likewise
14387 (HIRCompileBase::coerce_to_dyn_object): refactor
14388 * backend/rust-tree.h (SLICE_FLAG): removed
14389 (SLICE_TYPE_P): removed
14390 (RS_DST_FLAG): new flag
14391 (RS_DST_FLAG_P): new predicate
14392 * typecheck/rust-tyty.cc (ReferenceType::is_dyn_object): new helper
14393 (ReferenceType::is_dyn_obj_type): likewise
14394 (PointerType::is_dyn_object): likewise
14395 (PointerType::is_dyn_obj_type): likewise
14396 * typecheck/rust-tyty.h (class DynamicObjectType): moved up
14397
14398 2024-01-16 Philip Herron <[email protected]>
14399
14400 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): add filter
14401
14402 2024-01-16 Philip Herron <[email protected]>
14403
14404 * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body): use unit_expression
14405 (HIRCompileBase::unit_expression): new helper
14406 * backend/rust-compile-base.h: update prototype
14407 * backend/rust-compile-block.cc (CompileBlock::visit): use unit_expression
14408 * backend/rust-compile-expr.cc (CompileExpr::visit): likewise
14409 (CompileExpr::generate_closure_function): likewise
14410 * backend/rust-compile-implitem.cc (CompileTraitItem::visit): cleanup
14411 * backend/rust-compile-item.cc (CompileItem::visit): likewise
14412 * backend/rust-compile-pattern.cc (CompilePatternLet::visit): likewise
14413 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): likewise
14414 * backend/rust-compile-type.cc (TyTyResolveCompile::get_unit_type): new helper
14415 (TyTyResolveCompile::visit): use new unit_type helper
14416 * backend/rust-compile-type.h: likewise
14417 * rust-backend.h: simplify the return_expression
14418 * rust-gcc.cc (Gcc_backend::function_type): likewise
14419 (Gcc_backend::return_statement): likewise
14420 * backend/rust-constexpr.cc (eval_constant_expression): remove bad assertion
14421
14422 2024-01-16 Philip Herron <[email protected]>
14423
14424 * checks/lints/rust-lint-unused-var.cc (UnusedVariables::Lint): use the decl not the expr
14425
14426 2024-01-16 Owen Avery <[email protected]>
14427
14428 * parse/rust-parse-impl.h
14429 (Parser::parse_trait_impl_function_or_method):
14430 Parse function/method qualifiers after "default".
14431
14432 2024-01-16 Philip Herron <[email protected]>
14433
14434 * backend/rust-compile-base.cc: add missing compile_locals call
14435
14436 2024-01-16 Arthur Cohen <[email protected]>
14437
14438 * ast/rust-ast.h (class AttrInputMetaItemContainer): Run clang-format.
14439 (class DelimTokenTree): Likewise.
14440
14441 2024-01-16 Arthur Cohen <[email protected]>
14442
14443 * resolve/rust-early-name-resolver.cc (is_macro_use_module): New function.
14444 (EarlyNameResolver::accumulate_escaped_macros): New function.
14445 (EarlyNameResolver::go): Use `accumulate_escaped_macros`.
14446 (EarlyNameResolver::visit): Likewise.
14447 * resolve/rust-early-name-resolver.h: Declare `accumulate_escaped_macros`.
14448
14449 2024-01-16 Arthur Cohen <[email protected]>
14450
14451 * ast/rust-ast.h: Add take_items() and set_items() method to Crate.
14452 * ast/rust-item.h: Add take_items() and set_items() method to Module.
14453
14454 2024-01-16 Arthur Cohen <[email protected]>
14455
14456 * ast/rust-ast.h (enum Kind): Add MODULE variant.
14457 * ast/rust-item.h: Return Kind::MODULE in AST::Module::get_kind().
14458
14459 2024-01-16 Arthur Cohen <[email protected]>
14460
14461 * ast/rust-macro.cc (builtin_macro_from_string): Move function.
14462 * ast/rust-macro.h (enum class): Move enum.
14463 (builtin_macro_from_string): Move function.
14464 * expand/rust-macro-builtins.cc (builtin_macro_from_string): New function.
14465 (make_macro_path_str): Use new bi-map.
14466 (parse_single_string_literal): Use new `BuiltinMacro` enum.
14467 (MacroBuiltin::include_bytes_handler): Likewise.
14468 (MacroBuiltin::include_str_handler): Likewise.
14469 (MacroBuiltin::compile_error_handler): Likewise.
14470 (MacroBuiltin::concat_handler): Likewise.
14471 (MacroBuiltin::env_handler): Likewise.
14472 (MacroBuiltin::include_handler): Likewise.
14473 (MacroBuiltin::sorry): New function.
14474 * expand/rust-macro-builtins.h (enum class): Move enum here.
14475 (builtin_macro_from_string): New function declaration.
14476 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Use
14477 new function.
14478 * util/rust-hir-map.cc (Mappings::insert_macro_def): Remove old
14479 builtin macro map.
14480
14481 2024-01-16 Arthur Cohen <[email protected]>
14482
14483 * expand/rust-macro-builtins.cc: Include bidirectional map.
14484 * util/bi-map.h: New file.
14485
14486 2024-01-16 Owen Avery <[email protected]>
14487
14488 * ast/rust-ast.cc
14489 (BlockExpr::strip_tail_expr):
14490 Try to take new tail expression from statements list.
14491 * ast/rust-expr.h
14492 (BlockExpr::strip_tail_expr):
14493 Replace definition with only declaration.
14494
14495 2024-01-16 Owen Avery <[email protected]>
14496
14497 * ast/rust-ast.h
14498 (Stmt::is_expr): New.
14499 * ast/rust-stmt.h
14500 (ExprStmt::is_expr): New.
14501
14502 2024-01-16 Owen Avery <[email protected]>
14503
14504 * expand/rust-macro-substitute-ctx.cc
14505 (SubstituteCtx::substitute_repetition): Fix out-of-bounds.
14506
14507 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14508
14509 * Make-lang.in: Link against the static libproc_macro.
14510
14511 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14512
14513 * lang.opt: Add frust-extern option.
14514 * rust-session-manager.cc (Session::handle_extern_option): Add
14515 frust-extern option handler.
14516 * rust-session-manager.h (struct Session): Add an unordered map
14517 to store library name and locations.
14518
14519 2024-01-16 Owen Avery <[email protected]>
14520
14521 * parse/rust-parse-impl.h
14522 (Parser::parse_generic_params):
14523 Handle parameter parsing error.
14524
14525 2024-01-16 Philip Herron <[email protected]>
14526
14527 * typecheck/rust-hir-type-check-expr.cc: update for op overload
14528
14529 2024-01-16 Philip Herron <[email protected]>
14530
14531 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): use the predicate
14532 (TypeCheckExpr::resolve_segments): cleanup
14533
14534 2024-01-16 Philip Herron <[email protected]>
14535
14536 * typecheck/rust-hir-trait-reference.cc (AssociatedImplTrait::AssociatedImplTrait):
14537 bind the predicate
14538 (AssociatedImplTrait::get_trait): remove
14539 (AssociatedImplTrait::get_predicate): new getter
14540 * typecheck/rust-hir-trait-reference.h: bind predicate
14541 * typecheck/rust-hir-type-check-item.cc: update ctor
14542 * typecheck/rust-type-util.cc (lookup_associated_impl_block): new function
14543 * typecheck/rust-type-util.h (class BaseType): remove unused forward decl
14544 (lookup_associated_impl_block): new helper
14545 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::is_equal): new
14546 * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl): use new helper
14547 (SubstitutionRef::monomorphize): update usage/error handling
14548 * typecheck/rust-tyty-subst.h: remove old prototype
14549 * typecheck/rust-tyty.h: add is_equal decl
14550
14551 2024-01-16 Owen Avery <[email protected]>
14552
14553 * typecheck/rust-hir-type-check-pattern.cc
14554 (TypeCheckPattern::visit): Type check StructPatternFieldIdentPat.
14555
14556 2024-01-16 Owen Avery <[email protected]>
14557
14558 * hir/rust-ast-lower-pattern.cc
14559 (ASTLoweringPattern::visit): Lower StructPatternFieldIdentPat.
14560
14561 2024-01-16 Philip Herron <[email protected]>
14562
14563 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_fn_trait_call):
14564 return the assoicated predicate
14565 * typecheck/rust-hir-type-check-expr.h: update prototype
14566
14567 2024-01-16 Philip Herron <[email protected]>
14568
14569 * hir/rust-ast-lower-implitem.h: add missing where clause lowering
14570
14571 2024-01-16 Philip Herron <[email protected]>
14572
14573 * hir/tree/rust-hir-item.h: add get_locus() const
14574
14575 2024-01-16 Owen Avery <[email protected]>
14576
14577 * hir/tree/rust-hir-pattern.h
14578 (StructPatternFieldIdentPat::get_identifier): New.
14579 (StructPatternFieldIdentPat::get_pattern): New.
14580
14581 2024-01-16 Marc Poulhiès <[email protected]>
14582
14583 * ast/rust-ast-dump.cc (Dump::visit): print parentheses around
14584 unique expression operand.
14585
14586 2024-01-16 Owen Avery <[email protected]>
14587
14588 * rust-session-manager.cc
14589 (Session::enable_dump): Fix error messages.
14590
14591 2024-01-16 Philip Herron <[email protected]>
14592
14593 * typecheck/rust-unify.cc (UnifyRules::emit_abi_mismatch): new error method
14594 (UnifyRules::expect_fndef): add ABI check
14595 * typecheck/rust-unify.h: prototype for new error method
14596
14597 2024-01-16 Philip Herron <[email protected]>
14598
14599 * util/rust-abi.cc (get_abi_from_string): add ABI mapping
14600
14601 2024-01-16 Philip Herron <[email protected]>
14602
14603 * hir/tree/rust-hir-pattern.h: add missing get_mutability
14604 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
14605 use new ClosureParamInfer on untyped parameters
14606 * typecheck/rust-hir-type-check-pattern.cc (ClosureParamInfer::Resolve): interface
14607 (ClosureParamInfer::ClosureParamInfer): constructor
14608 (ClosureParamInfer::visit): visitors for each pattern
14609 * typecheck/rust-hir-type-check-pattern.h (class ClosureParamInfer): new visitor
14610
14611 2024-01-16 Philip Herron <[email protected]>
14612
14613 * typecheck/rust-hir-type-check-pattern.h: cleanup
14614
14615 2024-01-16 Philip Herron <[email protected]>
14616
14617 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
14618 return so we dont hit undefined behaviour
14619
14620 2024-01-16 Philip Herron <[email protected]>
14621
14622 * backend/rust-compile-implitem.h: remove includes
14623
14624 2024-01-16 Philip Herron <[email protected]>
14625
14626 * backend/rust-compile-item.cc (CompileItem::visit): remove bad checks
14627
14628 2024-01-16 Philip Herron <[email protected]>
14629
14630 * lang.opt: add lang option flag
14631 * rust-lang.cc (grs_langhook_init_options_struct): enable by default
14632
14633 2024-01-16 Philip Herron <[email protected]>
14634
14635 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::operator=):
14636 we are done if other is in an error state
14637
14638 2024-01-16 Philip Herron <[email protected]>
14639
14640 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): verify it is a method
14641
14642 2024-01-16 Philip Herron <[email protected]>
14643
14644 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): use new interface
14645 * typecheck/rust-hir-type-check-base.h: update prototype to include Self
14646 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): lifewise
14647 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
14648 likewise
14649 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): likewise
14650 (TypeCheckExpr::resolve_segments): likewise
14651 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
14652 (TypeResolveGenericParam::visit): likewise
14653 (ResolveWhereClauseItem::visit): likewise
14654 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
14655 (TypeBoundPredicate::apply_generic_arguments): likewise
14656 (TypeBoundsMappings::lookup_predicate): likewise
14657 * typecheck/rust-tyty-bounds.h: likewise
14658 * typecheck/rust-tyty.h:likewise
14659
14660 2024-01-16 Philip Herron <[email protected]>
14661
14662 * typecheck/rust-hir-type-check.h: New error state and missing copy implementations
14663 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::TypeCheckContextItem):
14664 missing copy ctor
14665 (TypeCheckContextItem::operator=): missing copy implementation
14666 (TypeCheckContextItem::get_error): new static function
14667 (TypeCheckContextItem::is_error): new method
14668 (TypeCheckContextItem::get_context_type): handle error state
14669 (TypeCheckContextItem::get_defid): handle error state
14670
14671 2024-01-16 Philip Herron <[email protected]>
14672
14673 * typecheck/rust-hir-type-check.h: new helper
14674 * typecheck/rust-typecheck-context.cc (TypeCheckContext::have_function_context):
14675 implementation
14676
14677 2024-01-16 Philip Herron <[email protected]>
14678
14679 * typecheck/rust-hir-type-check.h: Add prototype
14680 * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::get_defid): implementation
14681
14682 2024-01-16 Philip Herron <[email protected]>
14683
14684 * typecheck/rust-hir-type-check-expr.cc: refactor
14685
14686 2024-01-16 Philip Herron <[email protected]>
14687
14688 * typecheck/rust-autoderef.cc: don't take a reference
14689 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
14690 * typecheck/rust-hir-type-check.h: remove reference
14691 * typecheck/rust-typecheck-context.cc (TypeCheckContext::pop_return_type): likewise
14692
14693 2024-01-16 Owen Avery <[email protected]>
14694
14695 * resolve/rust-ast-resolve-pattern.cc
14696 (PatternDeclaration::visit): Handle StructPatternFieldIdentPat.
14697
14698 2024-01-16 TieWay59 <[email protected]>
14699
14700 PR translation/108890
14701 * lang.opt: Fix translation mistakes 2023 in
14702 GCC/Rust [PR108890]
14703 (line 67): change the inconsistent tab to spaces
14704 (line 75): wrap bare placeholder `integer`
14705 (line 79): remove redundant text of `Choose which`
14706 (line 96): remove redundant text of `Choose which`
14707 (line 112): remove redundant `Flag to`
14708 (line 124): correct the exclusive term `When to stop`
14709 (line 124): correct typo of `copimlation`
14710
14711 2024-01-16 M V V S Manoj Kumar <[email protected]>
14712
14713 * parse/rust-parse-impl.h (Parser::debug_dump_ast_output): Removed this funtion.
14714 * rust-session-manager.cc (Session::enable_dump): Removed else if (arg == "parse").
14715 (Session::compile_crate): Removed calls of dump_ast and dump_ast_expanded.
14716 (Session::dump_ast): Removed this function.
14717 (Session::dump_ast_expanded): Removed this function.
14718 * rust-session-manager.h (struct CompileOptions): Removed the PARSER_AST_DUMP option.
14719
14720 2024-01-16 Arthur Cohen <[email protected]>
14721
14722 * parse/rust-parse-impl.h (Parser::parse_reference_pattern): Do not
14723 call into `parse_pattern` anymore.
14724
14725 2024-01-16 Owen Avery <[email protected]>
14726
14727 * hir/rust-ast-lower-pattern.cc
14728 (ASTLoweringPattern::translate): Add is_let_top_level parameter.
14729 (ASTLoweringPattern::visit): Handle is_let_top_level.
14730 * hir/rust-ast-lower-pattern.h
14731 (class ASTLoweringPattern): Add is_let_top_level.
14732 * hir/rust-ast-lower-stmt.cc
14733 (ASTLoweringStmt::visit): Set is_let_top_level.
14734
14735 2024-01-16 Zheyuan Chen <[email protected]>
14736
14737 * ast/rust-ast-dump.cc: fix bad formatting for associated type.
14738
14739 2024-01-16 Sergey Bugaev <[email protected]>
14740
14741 * hir/rust-ast-lower-expr.h, hir/rust-ast-lower-expr.cc:
14742 Lower AST::ErrorPropagationExpr to HIR::ErrorPropagationExpr
14743
14744 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14745
14746 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix scope
14747 resolution token output.
14748
14749 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14750
14751 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Keep
14752 associated type.
14753
14754 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14755
14756 * ast/rust-ast-tokenstream.cc (TokenStream::visit_function_common):
14757 Fix function body output.
14758
14759 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14760
14761 * parse/rust-parse-impl.h (Parser::parse_outer_attribute): Fix
14762 attribute status.
14763
14764 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14765
14766 * lex/rust-token.cc (Token::as_string): Fix lifetime string
14767 representation.
14768
14769 2024-01-16 Sergey Bugaev <[email protected]>
14770
14771 * resolve/rust-ast-resolve-expr.cc: Add "break rust" Easter egg
14772
14773 2024-01-16 Sergey Bugaev <[email protected]>
14774
14775 * resolve/rust-ast-resolve-expr.h,
14776 resolve/rust-ast-resolve-expr.cc: Add ResolveExpr::funny_error
14777
14778 2024-01-16 Sergey Bugaev <[email protected]>
14779
14780 * ast/rust-ast.h: Add AST::Kind::IDENTIFIER
14781
14782 2024-01-16 Sergey Bugaev <[email protected]>
14783
14784 * ast/rust-ast.h (Kind): Convert into a C++ enum class
14785 * expand/rust-macro-builtins.cc: Adapt to the change
14786
14787 2024-01-16 Owen Avery <[email protected]>
14788
14789 * typecheck/rust-hir-type-check-expr.cc
14790 (TypeCheckExpr::visit): Add implementation for IfLetExprConseqElse.
14791 * typecheck/rust-hir-type-check-expr.h:
14792 (TypeCheckExpr::visit): Remove stub implementation for IfLetExprConseqElse.
14793 * hir/rust-ast-lower-expr.cc
14794 (ASTLoweringExpr::visit): Lower IfLetExpr{,ConseqElse}.
14795 * hir/rust-ast-lower-expr.h:
14796 (ASTLoweringExpr::visit): Likewise.
14797 * hir/rust-ast-lower-block.h
14798 (ASTLoweringIfLetBlock::visit): Lower IfLetExprConseqElse.
14799 (ASTLoweringExprWithBlock::visit): Likewise.
14800 * hir/rust-ast-lower.cc
14801 (ASTLoweringIfLetBlock::visit): Lower IfLetExprConseqElse.
14802 * hir/tree/rust-hir-expr.h
14803 (IfLetExprConseqElse::IfLetExprConseqElse): Make constructor more general.
14804 (IfLetExprConseqElse::vis_else_block): Add.
14805 (IfLetExprConseqElse::get_else_block): Add.
14806 * resolve/rust-ast-resolve-expr.cc
14807 (ResolveExpr::visit): Add IfLetExprConseqElse visitor.
14808 * resolve/rust-ast-resolve-expr.h
14809 (ResolveExpr::visit): Add IfLetExprConseqElse visitor.
14810
14811 2024-01-16 Sebastian Kirmayer <[email protected]>
14812
14813 * parse/rust-parse-impl.h
14814 (Parser<ManagedTokenSource>::parse_macro_match_repetition):
14815 reject separator in `?` repetition
14816
14817 2024-01-16 Owen Avery <[email protected]>
14818
14819 * ast/rust-expr.h
14820 (class IfLetExprConseqElse): Make else_block ExprWithBlock.
14821 (class IfLetExprConseqIf): Remove.
14822 (class IfLetExprConseqIfLet): Remove.
14823 * ast/rust-ast-full-decls.h
14824 (class IfLetExprConseqIf): Remove.
14825 (class IfLetExprConseqIfLet): Remove.
14826 * ast/rust-ast.cc
14827 (IfLetExprConseqElse::as_string): Adjust output.
14828 (IfLetExprConseqIf::as_string): Remove.
14829 (IfLetExprConseqIfLet::as_string): Remove.
14830 (IfLetExprConseqIf::accept_vis): Remove.
14831 (IfLetExprConseqIfLet::accept_vis): Remove.
14832 * ast/rust-ast-visitor.h
14833 (ASTVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
14834 * ast/rust-ast-dump.cc
14835 (Dump::visit): Likewise.
14836 * ast/rust-ast-dump.h:
14837 (Dump::visit): Likewise.
14838 * ast/rust-ast-tokenstream.cc
14839 (TokenStream::visit): Likewise.
14840 * ast/rust-ast-tokenstream.h
14841 (TokenStream::visit): Likewise.
14842 * util/rust-attributes.cc
14843 (AttributeChecker::visit): Likewise.
14844 * util/rust-attributes.h:
14845 (AttributeChecker::visit): Likewise.
14846 * resolve/rust-early-name-resolver.cc
14847 (EarlyNameResolver::visit): Likewise.
14848 * resolve/rust-early-name-resolver.h
14849 (EarlyNameResolver::visit): Likewise.
14850 * resolve/rust-ast-resolve-base.h
14851 (ResolverBase::visit): Likewise.
14852 * resolve/rust-ast-resolve-base.cc
14853 (ResolverBase::visit): Likewise.
14854 * checks/errors/rust-feature-gate.h
14855 (FeatureGate::visit): Likewise.
14856 * expand/rust-cfg-strip.cc
14857 (CfgStrip::visit): Likewise.
14858 * expand/rust-cfg-strip.h:
14859 (CfgStrip::visit): Likewise.
14860 * expand/rust-expand-visitor.cc
14861 (ExpandVisitor::visit): Likewise.
14862 * expand/rust-expand-visitor.h
14863 (ExpandVisitor::visit): Likewise.
14864 * hir/rust-ast-lower-base.cc
14865 (ASTLoweringBase::visit): Likewise.
14866 * hir/rust-ast-lower-base.h:
14867 (ASTLoweringBase::visit): Likewise.
14868 * parse/rust-parse-impl.h
14869 (Parser::parse_if_let_expr): Replace IfLetExprConseqIf{,Let} with IfLetExprConseqElse.
14870
14871 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
14872
14873 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add struct
14874 name and curly braces to output tokenstream.
14875
14876 2024-01-16 Owen Avery <[email protected]>
14877
14878 * parse/rust-parse-impl.h
14879 (Parser::parse_macro_match): Handle underscore.
14880
14881 2024-01-16 Owen Avery <[email protected]>
14882
14883 * hir/tree/rust-hir-full-decls.h
14884 (class ExprStmtWithoutBlock): Remove.
14885 (class ExprStmtWithBlock): Remove.
14886 * hir/tree/rust-hir-stmt.h
14887 (class ExprStmt):
14888 Add remaining ExprStmtWith{,out}Block functionality.
14889 (class ExprStmtWithoutBlock): Remove.
14890 (class ExprStmtWithBlock): Remove.
14891 * hir/rust-ast-lower-stmt.cc
14892 (ASTLoweringStmt::visit):
14893 Lower to HIR::ExprStmt instead of deriving class.
14894
14895 2024-01-16 Owen Avery <[email protected]>
14896
14897 * backend/rust-compile-stmt.cc
14898 (CompileStmt::visit): Unify ExprStmtWith{,out}Block visitors.
14899 * backend/rust-compile-stmt.h
14900 (CompileStmt::visit): Likewise.
14901 * backend/rust-compile-item.h
14902 (CompileItem::visit): Likewise.
14903 * hir/rust-hir-dump.cc
14904 (Dump::visit): Likewise.
14905 * hir/rust-hir-dump.h
14906 (Dump::visit): Likewise.
14907 * hir/tree/rust-hir-stmt.h
14908 (ExprStmt::accept_vis): Add.
14909 (ExprStmtWithoutBlock::accept_vis): Remove.
14910 (ExprStmtWithBlock::accept_vis): Remove.
14911 * hir/tree/rust-hir.cc
14912 (ExprStmt::accept_vis): Add.
14913 (ExprStmtWithoutBlock::accept_vis): Remove.
14914 (ExprStmtWithBlock::accept_vis): Remove.
14915 * hir/tree/rust-hir-visitor.h
14916 (HIRFullVisitor::visit): Likewise.
14917 (HIRFullVisitorBase::visit): Likewise.
14918 (HIRStmtVisitor::visit): Likewise.
14919 * checks/errors/rust-const-checker.cc
14920 (ConstChecker::visit): Likewise.
14921 * checks/errors/rust-const-checker.h
14922 (ConstChecker::visit): Likewise.
14923 * checks/errors/rust-unsafe-checker.cc
14924 (UnsafeChecker::visit): Likewise.
14925 * checks/errors/rust-unsafe-checker.h
14926 (UnsafeChecker::visit): Likewise.
14927 * checks/errors/privacy/rust-privacy-reporter.cc
14928 (PrivacyReporter::visit): Likewise.
14929 * checks/errors/privacy/rust-privacy-reporter.h
14930 (PrivacyReporter::visit): Likewise.
14931 * checks/lints/rust-lint-marklive.h
14932 (MarkLive::visit): Likewise.
14933 * typecheck/rust-hir-type-check-stmt.cc
14934 (TypeCheckStmt::visit): Likewise.
14935 * typecheck/rust-hir-type-check-stmt.h
14936 (TypeCheckStmt::visit): Likewise.
14937 * typecheck/rust-tycheck-dump.h
14938 (TypeResolverDump::visit): Likewise.
14939
14940 2024-01-16 Owen Avery <[email protected]>
14941
14942 * hir/tree/rust-hir-stmt.h
14943 (ExprStmt::expr): Add field.
14944 (ExprStmt::get_expr): Add method.
14945 (ExprStmt::ExprStmt): Add copy/move constructors, modify existing constructor.
14946 (ExprStmt::operator=): Add assignment operator.
14947 (ExprStmtWithoutBlock::expr): Remove field.
14948 (ExprStmtWithoutBlock::get_expr): Remove method.
14949 (ExprStmtWithoutBlock::ExprStmt):
14950 Remove copy/move constructors, modify existing constructor.
14951 (ExprStmtWithoutBlock::operator=): Remove assignment operator.
14952 (ExprStmtWithBlock::expr): Remove field.
14953 (ExprStmtWithBlock::get_expr): Remove method.
14954 (ExprStmtWithBlock::ExprStmt): Remove copy/move constructors, modify existing constructor.
14955 (ExprStmtWithBlock::operator=): Remove assignment operator.
14956 (ExprStmt::as_string): Add method.
14957 (ExprStmtWithBlock::as_string): Remove method.
14958 (ExprStmtWithoutBlock::as_string): Remove method.
14959 * hir/tree/rust-hir.cc
14960 (ExprStmt::as_string): Add method.
14961 (ExprStmtWithBlock::as_string): Remove method.
14962 (ExprStmtWithoutBlock::as_string): Remove method.
14963
14964 2024-01-16 Owen Avery <[email protected]>
14965
14966 * ast/rust-expr.h
14967 (class IfExprConseqElse): Make else_block ExprWithBlock.
14968 (class IfExprConseqIf): Remove.
14969 (class IfExprConseqIfLet): Remove.
14970 * ast/rust-ast-full-decls.h
14971 (class IfExprConseqIf): Remove.
14972 (class IfExprConseqIfLet): Remove.
14973 * ast/rust-ast.cc
14974 (IfExprConseqElse::as_string): Adjust output.
14975 (IfExprConseqIf::as_string): Remove.
14976 (IfExprConseqIfLet::as_string): Remove.
14977 (IfExprConseqIf::accept_vis): Remove.
14978 (IfExprConseqIfLet::accept_vis): Remove.
14979 * ast/rust-ast-visitor.h
14980 (ASTVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
14981 * ast/rust-ast-tokenstream.cc
14982 (TokenStream::visit): Likewise.
14983 * ast/rust-ast-tokenstream.h
14984 (TokenStream::visit): Likewise.
14985 * ast/rust-ast-dump.cc
14986 (Dump::visit): Likewise.
14987 * ast/rust-ast-dump.h
14988 (Dump::visit): Likewise.
14989 * checks/errors/rust-feature-gate.h
14990 (FeatureGate::visit): Likewise.
14991 * util/rust-attributes.cc
14992 (AttributeChecker::visit): Likewise.
14993 * util/rust-attributes.h
14994 (AttributeChecker::visit): Likewise.
14995 * resolve/rust-early-name-resolver.cc
14996 (EarlyNameResolver::visit): Likewise.
14997 * resolve/rust-early-name-resolver.h
14998 (EarlyNameResolver::visit): Likewise.
14999 * resolve/rust-ast-resolve-base.h
15000 (ResolverBase::visit): Likewise.
15001 * resolve/rust-ast-resolve-base.cc
15002 (ResolverBase::visit): Likewise.
15003 * resolve/rust-ast-resolve-expr.h
15004 (ResolveExpr::visit): Remove IfExprConseqIf visitor.
15005 * resolve/rust-ast-resolve-expr.cc
15006 (ResolveExpr::visit): Likewise.
15007 * expand/rust-cfg-strip.cc
15008 (CfgStrip::visit): Remove IfExprConseqIf{,Let} visitors.
15009 * expand/rust-cfg-strip.h
15010 (CfgStrip::visit): Likewise.
15011 * expand/rust-expand-visitor.cc
15012 (ExpandVisitor::visit): Likewise.
15013 * expand/rust-expand-visitor.h
15014 (ExpandVisitor::visit): Likewise.
15015 * hir/rust-ast-lower-base.cc
15016 (ASTLoweringBase::visit): Likewise.
15017 * hir/rust-ast-lower-base.h
15018 (ASTLoweringBase::visit): Likewise.
15019 * hir/rust-ast-lower-block.h
15020 (ASTLoweringIfBlock::visit): Remove IfExprConseqIf visitor.
15021 (ASTLoweringExprWithBlock::visit): Likewise.
15022 * hir/rust-ast-lower.cc
15023 (ASTLoweringIfBlock::visit):
15024 Remove IfExprConseqIf visitor, adjust IfExprConseqElse lowering.
15025 * hir/rust-ast-lower-expr.h
15026 (ASTLoweringExpr::visit): Remove IfExprConseqIf visitor.
15027 * hir/rust-ast-lower-expr.cc
15028 (ASTLoweringExpr::visit): Likewise.
15029 * parse/rust-parse-impl.h
15030 (Parser::parse_if_expr): Replace IfExprConseqIf{,Let} with IfExprConseqElse.
15031
15032 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15033
15034 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix inner
15035 attribute tokenstream output.
15036
15037 2024-01-16 Marc Poulhiès <[email protected]>
15038
15039 * ast/rust-ast-dump.cc (Dump::debug): New.
15040 * ast/rust-ast-dump.h (Dump::debug): Untemplate it.
15041 (debug): New.
15042 * ast/rust-ast.h (class Visitable): New.
15043 (class TokenTree): Inherit from Visitable.
15044 (class MacroMatch): Likewise.
15045 (class AttrInput): Likewise.
15046 (class MetaItemInner): Likewise.
15047 (class Pattern): Likewise.
15048 (classTypeParamBound): Likewise.
15049 (class GenericParam): Likewise.
15050 (class TraitItem): Likewise.
15051 (classInherentImplItem): Likewise.
15052 (class TraitImplItem): Likewise.
15053 (class ExternalItem): Likewise.
15054 (class SingleASTNode): Likewise.
15055
15056 2024-01-16 Thomas Schwinge <[email protected]>
15057
15058 * rust-lang.cc (grs_langhook_type_for_mode): Placate clang-format.
15059
15060 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15061
15062 * ast/rust-ast.h: Add boolean for differenciation.
15063 * parse/rust-parse-impl.h (Parser::parse_doc_comment): Change
15064 function interface to make code cleaner. It should return a body
15065 instead of the whole attribute.
15066 (Parser::parse_inner_attribute): Specify the inner status of the
15067 node.
15068 (Parser::parse_attribute_body): Change function interface to
15069 make the code cleaner much like parse_doc_comment.
15070 (Parser::parse_outer_attribute): Specify outer status of the
15071 node.
15072 * parse/rust-parse.h: Update functions prototypes.
15073
15074 2024-01-16 Philip Herron <[email protected]>
15075
15076 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
15077 reuse resolve_method_address to monomorphize the call if required
15078 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
15079 allow matching against unimplemented trait item bounds
15080
15081 2024-01-16 Philip Herron <[email protected]>
15082
15083 * typecheck/rust-hir-path-probe.cc: dont subst with a dynamic object
15084
15085 2024-01-16 Philip Herron <[email protected]>
15086
15087 * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): moved here
15088 * backend/rust-compile-base.h: refactored prototype
15089 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): refactor
15090 * backend/rust-compile-expr.h: likewise
15091
15092 2024-01-16 Philip Herron <[email protected]>
15093
15094 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): remove unused
15095
15096 2024-01-16 Philip Herron <[email protected]>
15097
15098 * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): call destructure
15099
15100 2024-01-16 Philip Herron <[email protected]>
15101
15102 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
15103 call path probe impl trait
15104
15105 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15106
15107 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
15108 to attribute expansion function.
15109
15110 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15111
15112 * expand/rust-expand-visitor.cc (ExpandVisitor::visit_outer_attrs):
15113 Change condition order.
15114 (ExpandVisitor::visit_inner_using_attrs): Likewise.
15115 (ExpandVisitor::visit_attrs_with_derive): Likewise.
15116 (ExpandVisitor::is_builtin): Add builtin identification
15117 function.
15118 * expand/rust-expand-visitor.h: Add function prototype.
15119 * util/rust-attributes.cc: Add missing rustc_builtin_macro
15120 attribute.
15121
15122 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15123
15124 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_struct_fields):
15125 Add call to expand structu fields.
15126 (ExpandVisitor::expand_function_params): Add call to expand
15127 function parameters.
15128 (ExpandVisitor::expand_closure_params): Add call to expand
15129 closure parameters.
15130 (ExpandVisitor::visit): Add calls for item outer attribute
15131 expansions.
15132
15133 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15134
15135 * expand/rust-expand-visitor.cc (ExpandVisitor::expand_outer_attribute):
15136 Stub for a single attribute expansion.
15137 (ExpandVisitor::visit_outer_attrs): Visit the attributes to
15138 expand on a given item.
15139 * expand/rust-expand-visitor.h: Add function prototypes.
15140
15141 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15142
15143 * ast/rust-ast.h: Add getter to Expr class.
15144 * ast/rust-expr.h: Add override attribute to existing getters.
15145 Also implement it for RangeExpr, attempting to retrieve outer
15146 attributes on those types will crash the compiler.
15147 * ast/rust-macro.h: Add override attribute to existing getters.
15148 * ast/rust-path.h: Likewise.
15149
15150 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15151
15152 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
15153 to inner attribute stub.
15154 (ExpandVisitor::expand_inner_attribute): Expand one single
15155 attribute.
15156 (ExpandVisitor::visit_inner_using_attrs): Expand a given item
15157 using a vector of attributes.
15158 (ExpandVisitor::visit_inner_attrs): Visit inner attributes of a
15159 given item.
15160 * expand/rust-expand-visitor.h: Add function prototypes.
15161
15162 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15163
15164 * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
15165 to derive expander.
15166 (ExpandVisitor::expand_derive): Expand a single derive.
15167 (ExpandVisitor::visit_attrs_with_derive): Visit an item with
15168 derive attributes.
15169 (ExpandVisitor::is_derive): Identify a derive attribute.
15170 * expand/rust-expand-visitor.h: Add function prototypes.
15171
15172 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15173
15174 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix ICE.
15175
15176 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15177
15178 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
15179 default separator.
15180
15181 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15182
15183 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Visit inner
15184 attributes.
15185
15186 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15187
15188 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Change token
15189 type.
15190
15191 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15192
15193 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix existing
15194 and implement remaining attribute visitors.
15195
15196 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15197
15198 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor
15199 to the union's outer attributes.
15200
15201 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15202
15203 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add call to
15204 inner attribute visitor.
15205
15206 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15207
15208 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix ICE.
15209
15210 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15211
15212 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Make comma
15213 mandatory.
15214
15215 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15216
15217 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
15218 additional semicolon output.
15219 * ast/rust-ast-tokenstream.h: Change block visitor prototype
15220 with a default value for trailing tokens.
15221
15222 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15223
15224 * Make-lang.in: Add two new files to the list of sources.
15225 * ast/rust-ast-full.h: Add new ast formatting header.
15226 * ast/rust-ast.cc (enum indent_mode): Move formatting function
15227 to it's own file.
15228 (indent_spaces): Likewise.
15229 (get_string_in_delims): Likewise.
15230 (enum AttrMode): Likewise.
15231 (get_mode_dump_desc): Likewise.
15232 (append_attributes): Likewise.
15233 (unquote_string): Likewise.
15234 (GroupedExpr::as_string): Move pattern implementation to it's
15235 own file.
15236 (RangePattern::as_string): Likewise.
15237 (RangePatternBoundLiteral::as_string): Likewise.
15238 (SlicePattern::as_string): Likewise.
15239 (AltPattern::as_string): Likewise.
15240 (TuplePatternItemsMultiple::as_string): Likewise.
15241 (TuplePatternItemsRanged::as_string): Likewise.
15242 (TuplePattern::as_string): Likewise.
15243 (StructPatternField::as_string): Likewise.
15244 (StructPatternFieldIdent::as_string): Likewise.
15245 (StructPatternFieldTuplePat::as_string): Likewise.
15246 (StructPatternFieldIdentPat::as_string): Likewise.
15247 (StructPatternElements::as_string): Likewise.
15248 (StructPattern::as_string): Likewise.
15249 (LiteralPattern::as_string): Likewise.
15250 (ReferencePattern::as_string): Likewise.
15251 (IdentifierPattern::as_string): Likewise.
15252 (TupleStructItemsNoRange::as_string): Likewise.
15253 (TupleStructItemsRange::as_string): Likewise.
15254 (TupleStructPattern::as_string): Likewise.
15255 (GroupedExpr::accept_vis): Likewise.
15256 (LiteralPattern::accept_vis): Likewise.
15257 (IdentifierPattern::accept_vis): Likewise.
15258 (WildcardPattern::accept_vis): Likewise.
15259 (RestPattern::accept_vis): Likewise.
15260 (RangePatternBoundLiteral::accept_vis): Likewise.
15261 (RangePatternBoundPath::accept_vis): Likewise.
15262 (RangePatternBoundQualPath::accept_vis): Likewise.
15263 (RangePattern::accept_vis): Likewise.
15264 (ReferencePattern::accept_vis): Likewise.
15265 (StructPatternFieldTuplePat::accept_vis): Likewise.
15266 (StructPatternFieldIdentPat::accept_vis): Likewise.
15267 (StructPatternFieldIdent::accept_vis): Likewise.
15268 (StructPattern::accept_vis): Likewise.
15269 (TupleStructItemsNoRange::accept_vis): Likewise.
15270 (TupleStructItemsRange::accept_vis): Likewise.
15271 (TupleStructPattern::accept_vis): Likewise.
15272 (TuplePatternItemsMultiple::accept_vis): Likewise.
15273 (TuplePatternItemsRanged::accept_vis): Likewise.
15274 (TuplePattern::accept_vis): Likewise.
15275 (GroupedPattern::accept_vis): Likewise.
15276 (SlicePattern::accept_vis): Likewise.
15277 (AltPattern::accept_vis): Likewise.
15278 * ast/rust-ast-formatting.cc: New file.
15279 * ast/rust-ast-formatting.h: New file.
15280 * ast/rust-pattern.cc: New file.
15281
15282 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15283
15284 * Make-lang.in: Add new file for rust-path implementation.
15285 * ast/rust-ast.cc (PathInExpression::as_string): Move function
15286 to the new file.
15287 (PathPattern::as_string): Likewise.
15288 (QualifiedPathInExpression::as_string): Likewise.
15289 (ConstGenericParam::as_string): Likewise.
15290 (QualifiedPathInType::as_string): Likewise.
15291 (TypePath::as_string): Likewise.
15292 (PathPattern::convert_to_simple_path): Likewise.
15293 (TypePath::as_simple_path): Likewise.
15294 (PathExprSegment::as_string): Likewise.
15295 (GenericArgs::as_string): Likewise.
15296 (GenericArgsBinding::as_string): Likewise.
15297 (TypePath::to_trait_bound): Likewise.
15298 (TypePathSegmentGeneric::as_string): Likewise.
15299 (TypePathFunction::as_string): Likewise.
15300 (TypePathSegmentFunction::as_string): Likewise.
15301 (ConstGenericParam::accept_vis): Likewise.
15302 (PathInExpression::accept_vis): Likewise.
15303 (TypePathSegment::accept_vis): Likewise.
15304 (TypePathSegmentGeneric::accept_vis): Likewise.
15305 (TypePathSegmentFunction::accept_vis): Likewise.
15306 (TypePath::accept_vis): Likewise.
15307 (QualifiedPathInExpression::accept_vis): Likewise.
15308 (QualifiedPathInType::accept_vis): Likewise.
15309 (GenericArg::disambiguate_to_const): Likewise.
15310 (GenericArg::disambiguate_to_type): Likewise.
15311 * ast/rust-path.cc: New file.
15312
15313 2024-01-16 Philip Herron <[email protected]>
15314
15315 * backend/rust-compile-item.cc (CompileItem::visit): unwrap the constant expression
15316
15317 2024-01-16 Owen Avery <[email protected]>
15318
15319 * util/rust-lang-item.h
15320 (RustLangItem::ItemType::FN): Add.
15321 (RustLangItem::ItemType::FN_MUT): Add.
15322 (RustLangItem::Parse): Handle FN and FN_MUT.
15323 (RustLangItem::ToString): Handle FN and FN_MUT.
15324
15325 2024-01-16 Emanuele Micheletti <[email protected]>
15326
15327 * typecheck/rust-casts.cc (TypeCastRules::cast_rules):
15328 case INTEGRAL handles TypeKind::CHAR
15329
15330 2024-01-16 Philip Herron <[email protected]>
15331
15332 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
15333 add check for reference marker and type's in self params
15334 (ResolveItem::visit): likewise
15335 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
15336 remove bad generics check
15337 (TypeCheckExpr::resolve_segments): likewise
15338 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): likewise
15339
15340 2024-01-16 Philip Herron <[email protected]>
15341
15342 * resolve/rust-ast-resolve-item.cc
15343 (ResolveTraitItems::visit): add name resolution self param
15344 (ResolveItem::visit): likewise
15345
15346 2024-01-16 Philip Herron <[email protected]>
15347
15348 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate): this is an empty
15349 (TypeBoundPredicate::operator=): likewise
15350 * typecheck/rust-tyty-subst.cc (SubstitutionArgumentMappings::empty): new interface
15351 (SubstitutionArgumentMappings::is_error): this marks it as an error
15352 * typecheck/rust-tyty-subst.h: update prototypes
15353
15354 2024-01-16 Philip Herron <[email protected]>
15355
15356 * checks/errors/privacy/rust-privacy-reporter.cc
15357 (PrivacyReporter::check_base_type_privacy): allow error types to be permissive
15358
15359 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15360
15361 * ast/rust-ast-tokenstream.cc (TokenStream::visit_items_as_lines):
15362 Handle trailing chars.
15363 (TokenStream::visit_items_as_block): Likewise.
15364 (TokenStream::visit): Fix visitor.
15365
15366 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15367
15368 * lex/rust-token.cc (Token::as_string): Add type hint output.
15369
15370 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15371
15372 * rust-session-manager.cc (Session::enable_dump): Enable new
15373 dump.
15374 (Session::compile_crate): CLI argument parsing.
15375 (Session::dump_tokenstream): Dump the tokenstream as a string in
15376 the specified file.
15377 * rust-session-manager.h (struct CompileOptions): Add
15378 tokenstream dump option.
15379
15380 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15381
15382 * lex/rust-token.cc (Token::as_string): Add as_string
15383 implementation.
15384 * lex/rust-token.h: Add as_string prototype.
15385
15386 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15387
15388 * ast/rust-ast-tokenstream.cc (TokenStream::TokenStream): Add
15389 constructor.
15390
15391 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15392
15393 * ast/rust-ast-tokenstream.cc (TokenStream::collect_tokens): Add
15394 getter.
15395 (TokenStream::go): Rename function.
15396 (TokenStream::visit): Likewise.
15397 * ast/rust-ast-tokenstream.h: Add collect prototype.
15398
15399 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15400
15401 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Change
15402 getter name.
15403 * ast/rust-ast.cc (SimplePath::as_string): Change attribute
15404 name.
15405 * ast/rust-ast.h (class SimplePath): Refactor attribute name and
15406 change getter name.
15407
15408 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15409
15410 * ast/rust-ast-tokenstream.cc (TokenStream::visit_as_line): Add
15411 formatting calls.
15412 (TokenStream::visit_items_as_block): Likewise.
15413 (TokenStream::newline): Add stub.
15414 (TokenStream::indentation): Add stub.
15415 (TokenStream::increment_indentation): Add stub.
15416 (TokenStream::decrement_indentation): Add stub.
15417 (TokenStream::visit): Add formatting calls.
15418 (TokenStream::visit_function_common): Likewise.
15419 * ast/rust-ast-tokenstream.h: Add stub prototypes.
15420
15421 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15422
15423 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
15424
15425 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15426
15427 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor
15428 implementation.
15429 * ast/rust-ast-tokenstream.h: Add additional function prototype.
15430 * ast/rust-item.h: Add some getters.
15431 * ast/rust-macro.h: Likewise.
15432
15433 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15434
15435 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
15436 * ast/rust-item.h: Add missing getters.
15437
15438 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15439
15440 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
15441
15442 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15443
15444 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add
15445 visitors.
15446 (TokenStream::visit_closure_common): Merge common code for
15447 closure visitors.
15448 * ast/rust-ast-tokenstream.h: Add function prototype.
15449 * ast/rust-expr.h: Add missing move attribute getter.
15450
15451 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15452
15453 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add
15454 visitors.
15455 (TokenStream::visit_loop_common): Merge common loop code.
15456 * ast/rust-ast-tokenstream.h: Add function prototypes.
15457
15458 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15459
15460 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
15461 visitor.
15462 * ast/rust-ast-tokenstream.h: Add function prototype for missing
15463 component.
15464
15465 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15466
15467 * ast/rust-ast-tokenstream.cc (TokenStream::trailing_comma):
15468 Output a trailing comma to the token stream according to the
15469 configuration.
15470 * ast/rust-ast-tokenstream.h: Add function prototype.
15471
15472 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15473
15474 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
15475 visitors.
15476
15477 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15478
15479 * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
15480 visitors.
15481 * ast/rust-ast-tokenstream.h: Add function prototypes.
15482 * ast/rust-ast.h: Add missing getters.
15483 * ast/rust-expr.h: Likewise.
15484
15485 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
15486
15487 * Make-lang.in: Add rust-as-tokenstream to compile list.
15488 * ast/rust-item.h: Add missing getter for location.
15489 * ast/rust-ast-tokenstream.cc: Add ast visitor implementation.
15490 * ast/rust-ast-tokenstream.h: New file.
15491 * ast/rust-pattern.h: Add getter.
15492
15493 2024-01-16 Philip Herron <[email protected]>
15494
15495 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
15496 Add implicit unit type as the return type when not specified
15497
15498 2024-01-16 Philip Herron <[email protected]>
15499
15500 * util/rust-attributes.cc: Add stable to the table of known attributes
15501
15502 2024-01-16 Philip Herron <[email protected]>
15503
15504 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): return early on bad type
15505 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::TypeCheckPattern):
15506 remove assertion in favor of check
15507 (TypeCheckPattern::visit): likewise
15508
15509 2024-01-16 Philip Herron <[email protected]>
15510
15511 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
15512 when its not a block we dont have any ribs to generate locals from
15513
15514 2024-01-16 Owen Avery <[email protected]>
15515
15516 * parse/rust-parse-impl.h
15517 (Parser<ManagedTokenSource>::parse_expr_without_block):
15518 Remove direct array expression handling.
15519
15520 2024-01-16 Arthur Cohen <[email protected]>
15521
15522 * ast/rust-item.h: Fix `Visibility::has_path()` implementation.
15523 * checks/errors/privacy/rust-visibility-resolver.cc
15524 (VisibilityResolver::resolve_module_path): Check if we are dealing with pub(crate) properly.
15525
15526 2024-01-16 Arthur Cohen <[email protected]>
15527
15528 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Set
15529 resolved_node_id when visiting root segment of SimplePath.
15530
15531 2024-01-16 Arthur Cohen <[email protected]>
15532
15533 * ast/rust-ast.h: Call SimplePath constructor differently in
15534 SimplePath::from_str
15535
15536 2024-01-16 Arthur Cohen <[email protected]>
15537
15538 * hir/rust-ast-lower-type.h: Move all remaining definitions to source file.
15539 * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): Moved to source file.
15540 (ASTLoweringType::visit): Likewise.
15541 (ASTLowerGenericParam::translate): Likewise.
15542 (ASTLowerGenericParam::visit): Likewise.
15543 (ASTLoweringTypeBounds::translate): Likewise.
15544 (ASTLoweringTypeBounds::visit): Likewise.
15545 (ASTLowerWhereClauseItem::translate): Likewise.
15546 (ASTLowerWhereClauseItem::visit): Likewise.
15547
15548 2024-01-16 Owen Avery <[email protected]>
15549
15550 * ast/rust-pattern.h: Remove commented out code.
15551
15552 2024-01-16 emanuele-em <[email protected]>
15553
15554 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): BOOL removed from switch cases
15555
15556 2024-01-16 Arthur Cohen <[email protected]>
15557
15558 * Make-lang.in: Rename rust-asttribute-visitor.o -> rust-cfg-strip.o
15559 * expand/rust-attribute-visitor.cc: Moved to...
15560 * expand/rust-cfg-strip.cc: ...here.
15561 * expand/rust-attribute-visitor.h: Moved to...
15562 * expand/rust-cfg-strip.h: ...here.
15563 * expand/rust-macro-expand.cc: Fix include of rust-attribute-visitor.h
15564 * expand/rust-macro-builtins.cc: Likewise.
15565 * rust-session-manager.cc (Session::expansion): Call CfgStrip instead of
15566 AttrVisitor.
15567
15568 2024-01-16 Arthur Cohen <[email protected]>
15569
15570 * Make-lang.in: Add new object file.
15571 * expand/rust-attribute-visitor.cc (AttrVisitor::go): Visit all items of a
15572 crate.
15573 (AttrVisitor::expand_struct_fields): Do not perform macro expansion anymore.
15574 (AttrVisitor::expand_function_params): Likewise.
15575 (AttrVisitor::expand_generic_args): Likewise.
15576 (AttrVisitor::expand_qualified_path_type): Likewise.
15577 (AttrVisitor::expand_self_param): Likewise.
15578 (AttrVisitor::expand_trait_function_decl): Likewise.
15579 (AttrVisitor::expand_trait_method_decl): Likewise.
15580 (AttrVisitor::visit): Likewise.
15581 (AttrVisitor::maybe_expand_expr): Remove function.
15582 (AttrVisitor::maybe_expand_type): Likewise.
15583 * expand/rust-attribute-visitor.h: Do not keep MacroExpander inside AttrVisitor
15584 anymore.
15585 * expand/rust-macro-expand.h (struct MacroExpander): Turn ContextType into an
15586 enum class for more type safety.
15587 * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Use new ContextType
15588 API.
15589 * rust-session-manager.cc (Session::expansion): Call into ExpandVisitor.
15590 * expand/rust-expand-visitor.cc: New file.
15591 * expand/rust-expand-visitor.h: New file.
15592
15593 2024-01-16 Arthur Cohen <[email protected]>
15594
15595 * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Do not cfg-attr
15596 strip in MacroExpander
15597 (MacroExpander::fails_cfg): Function moved...
15598 (MacroExpander::fails_cfg_with_expand): Function moved...
15599 (MacroExpander::expand_cfg_attrs): Function moved...
15600 * expand/rust-attribute-visitor.cc (fails_cfg): ...here.
15601 (fails_cfg_with_expand): ...here.
15602 (expand_cfg_attrs): ...here.
15603 (AttrVisitor::expand_struct_fields): Use new functions.
15604 (AttrVisitor::expand_tuple_fields): Likewise.
15605 (AttrVisitor::expand_function_params): Likewise.
15606 (AttrVisitor::visit): Likewise.
15607 (AttrVisitor::go): New function.
15608 * expand/rust-attribute-visitor.h: Declare AttrVisitor::go.
15609 * expand/rust-macro-expand.h (struct MacroExpander): Remove cfg-attr related
15610 functions.
15611
15612 2024-01-16 Arthur Cohen <[email protected]>
15613
15614 * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_macro_definition):
15615 New function.
15616 * hir/rust-ast-lower-base.h: Declare `lower_macro_definition`.
15617 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Lower public
15618 macro definitions.
15619 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
15620 * hir/rust-ast-lower-stmt.h: Add visitor for `AST::MacroRulesDefinition`.
15621 * hir/rust-ast-lower.cc (ASTLowering::go): Formatting.
15622 (ASTLoweringBlock::visit): Visit `AST::MacroRulesDefinition`
15623 (ASTLoweringIfLetBlock::visit): Formatting.
15624 (ASTLoweringExprWithBlock::visit): Formatting.
15625
15626 2024-01-16 Arthur Cohen <[email protected]>
15627
15628 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Add new visitor
15629 for AST::MacroRulesDefinition.
15630 * hir/rust-ast-lower-item.h: Declare above mentioned visitor.
15631 * metadata/rust-export-metadata.cc (ExportContext::emit_macro): New function.
15632 * metadata/rust-export-metadata.h: Declare it.
15633 (PublicInterface::gather_export_data): Go through each exported macro.
15634 * util/rust-hir-map.cc (Mappings::insert_exported_macro): New function.
15635 (Mappings::get_exported_macros): New function.
15636 * util/rust-hir-map.h: Add new mappings for exported macros.
15637
15638 2024-01-16 Arthur Cohen <[email protected]>
15639
15640 * backend/rust-compile-item.h: Revert 1c946687239b86a92839d57dfbc928ad7ce35eae.
15641 * backend/rust-compile-stmt.h: Likewise.
15642 * checks/errors/privacy/rust-privacy-reporter.cc
15643 (PrivacyReporter::visit): Likewise.
15644 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
15645 * checks/errors/privacy/rust-pub-restricted-visitor.cc
15646 (PubRestrictedVisitor::visit): Likewise.
15647 * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
15648 * checks/errors/privacy/rust-reachability.cc
15649 (ReachabilityVisitor::visit): Likewise.
15650 * checks/errors/privacy/rust-reachability.h: Likewise.
15651 * checks/errors/privacy/rust-visibility-resolver.cc
15652 (VisibilityResolver::visit): Likewise.
15653 * checks/errors/privacy/rust-visibility-resolver.h: Likewise.
15654 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
15655 * checks/errors/rust-const-checker.h: Likewise.
15656 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
15657 * checks/errors/rust-unsafe-checker.h: Likewise.
15658 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
15659 * hir/rust-ast-lower-item.h: Likewise.
15660 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
15661 * hir/rust-hir-dump.h: Likewise.
15662 * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Likewise.
15663 * hir/tree/rust-hir-item.h (class ExportedMacro): Likewise.
15664 * hir/tree/rust-hir-visitor.h: Likewise.
15665 * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): Likewise.
15666 (ExportedMacro::get_locus): Likewise.
15667 (ExportedMacro::get_item_kind): Likewise.
15668 (ExportedMacro::clone_item_impl): Likewise.
15669 * hir/tree/rust-hir.h: Likewise.
15670 * metadata/rust-export-metadata.cc: Likewise.
15671 * typecheck/rust-hir-type-check-item.h: Likewise.
15672 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
15673 * typecheck/rust-hir-type-check-stmt.h: Likewise.
15674 * typecheck/rust-tycheck-dump.h: Likewise.
15675 * util/rust-attributes.cc: Likewise.
15676
15677 2024-01-16 Philip Herron <[email protected]>
15678
15679 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): return a TraitObject
15680
15681 2024-01-16 Philip Herron <[email protected]>
15682
15683 * typecheck/rust-hir-trait-resolve.cc: don't inject extra inference variables
15684
15685 2024-01-16 Arthur Cohen <[email protected]>
15686
15687 * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous semicolon when
15688 dumping macro rules.
15689
15690 2024-01-16 Arthur Cohen <[email protected]>
15691
15692 * metadata/rust-imports.cc (add_search_path): Change `Go` -> `Rust`.
15693 (Import::try_package_in_directory): Likewise.
15694 (Import::find_export_data): Likewise.
15695
15696 2024-01-16 Owen Avery <[email protected]>
15697
15698 * hir/rust-ast-lower-pattern.cc
15699 (ASTLoweringPattern::visit): Lower AltPattern.
15700 * hir/rust-ast-lower-pattern.h:
15701 (ASTLoweringPattern::visit): Add AltPattern visitor.
15702
15703 2024-01-16 Xiao Ma <[email protected]>
15704 Thomas Schwinge <[email protected]>
15705
15706 * checks/errors/rust-feature-gate.cc: Adjust 'ld'->'u'.
15707 * checks/errors/rust-feature.h: Adjust
15708 the type of `m_issue`: 'uint64_t' -> 'unsigned'.
15709
15710 2024-01-16 Philip Herron <[email protected]>
15711
15712 * ast/rust-ast.h: add const get_final_segment helper
15713 * hir/rust-ast-lower-enumitem.h: dont add an item mapping for enumitems
15714 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): add enum to enum-items mappings
15715 * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): likewise
15716 * hir/tree/rust-hir-item.h: add non const helper to get variants
15717 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): resolve the use declaration
15718 * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): handle self
15719 * resolve/rust-ast-resolve-toplevel.h: add enum item mappings to module mappings
15720 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): ensure variant
15721 (TypeCheckExpr::resolve_segments): likewise
15722 * typecheck/rust-type-util.cc (query_type): lookup enum's
15723 * util/rust-hir-map.cc (Mappings::insert_hir_enumitem): enum item mappings
15724 (Mappings::lookup_hir_enumitem): likewise
15725 * util/rust-hir-map.h: likewise
15726
15727 2024-01-16 Philip Herron <[email protected]>
15728
15729 * resolve/rust-ast-resolve-path.cc (ResolvePath::ResolvePath): return NodeId
15730 (ResolvePath::go): update signiture
15731 (ResolvePath::resolve_path): return resolved_node_id
15732 * resolve/rust-ast-resolve-path.h: update prototypes
15733
15734 2024-01-16 Mahmoud Mohamed <[email protected]>
15735
15736 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit):
15737 Add lowering for SlicePattern.
15738 * hir/rust-ast-lower-pattern.h: Likewise.
15739 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit):
15740 Add name resolution visit for SlicePattern.
15741 * resolve/rust-ast-resolve-pattern.h: Likewise.
15742
15743 2024-01-16 Philip Herron <[email protected]>
15744
15745 * hir/rust-ast-lower-implitem.h (RUST_AST_LOWER_IMPLITEM_H): cleanup header usage
15746 * hir/rust-ast-lower-item.cc: likewise
15747 * hir/rust-ast-lower-item.h (RUST_AST_LOWER_ITEM): likewise
15748 * hir/rust-ast-lower-stmt.cc: likewise
15749 * hir/rust-ast-lower-stmt.h (RUST_AST_LOWER_STMT): likewise
15750 * hir/rust-ast-lower-type.h: likewise
15751 * hir/rust-ast-lower.cc: likewise
15752 * hir/rust-ast-lower.h: likewise
15753 * resolve/rust-ast-resolve-expr.h: likewise
15754 * resolve/rust-ast-resolve-item.cc: likewise
15755 * resolve/rust-ast-resolve-item.h: likewise
15756 * resolve/rust-ast-resolve-stmt.cc: likewise
15757 * resolve/rust-ast-resolve-stmt.h: likewise
15758 * resolve/rust-ast-resolve-struct-expr-field.h: likewise
15759 * resolve/rust-ast-resolve-toplevel.h: likewise
15760 * resolve/rust-ast-resolve-type.h: likewise
15761 * resolve/rust-ast-resolve.h: likewise
15762
15763 2024-01-16 Mahmoud Mohamed <[email protected]>
15764
15765 * resolve/rust-ast-resolve-pattern.h (class ResolvePattern): Removed.
15766
15767 2024-01-16 Philip Herron <[email protected]>
15768
15769 * backend/rust-compile-intrinsic.cc (move_val_init_handler): new intrinsice
15770 (uninit_handler): use a builtin memcpy
15771
15772 2024-01-16 Philip Herron <[email protected]>
15773
15774 * typecheck/rust-coercion.cc (TypeCoercionRules::select): use the result
15775
15776 2024-01-16 Philip Herron <[email protected]>
15777
15778 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): fix ctor
15779 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): likewise
15780 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
15781 * typecheck/rust-typecheck-context.cc (TypeCheckContext::push_new_loop_context): likewise
15782 * typecheck/rust-tyty-util.cc (TyVar::get_implicit_infer_var): likewise
15783 * typecheck/rust-tyty.cc (InferType::InferType): new ctor with type hint
15784 (InferType::clone): fix ctor
15785 (InferType::apply_primitive_type_hint): new function to apply possible hint
15786 * typecheck/rust-tyty.h: update prototypes
15787 * typecheck/rust-unify.cc (UnifyRules::expect_inference_variable): apply type hints
15788 (UnifyRules::expect_bool): likewise
15789 (UnifyRules::expect_char): likewise
15790 (UnifyRules::expect_int): likewise
15791 (UnifyRules::expect_uint): likewise
15792 (UnifyRules::expect_float): likewise
15793 (UnifyRules::expect_isize): likewise
15794 (UnifyRules::expect_usize): likewise
15795
15796 2024-01-16 Jiakun Fan <[email protected]>
15797
15798 * hir/rust-hir-dump.cc (Dump::go): fix format
15799 (Dump::visit): impl `visit (AST::Attribute &)`, dump inner attrs and
15800 `visit (Lifetime &)`
15801 * hir/rust-hir-dump.h:add `visit (AST::Attribute &)`
15802
15803 2024-01-16 Mahmoud Mohamed <[email protected]>
15804
15805 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
15806 Print out consistency errors.
15807 (PatternDeclaration::visit): Implement visit for AltPattern.
15808 (PatternDeclaration::add_new_binding): New helper function for
15809 adding a binding to identifier.
15810 * resolve/rust-ast-resolve-pattern.h (struct BindingInfo):
15811 New struct to facilitate checking for inconsistencies between bindings.
15812
15813 2024-01-16 Owen Avery <[email protected]>
15814
15815 * backend/rust-compile-block.h
15816 (CompileConditionalBlocks::visit): Remove IfLetExprConseqIf{,Let} visitors.
15817 (CompileExprWithBlock::visit): Remove IfLetExprConseqIf{,Let} visitors.
15818 * backend/rust-compile-expr.h
15819 (CompileExpr::visit): Remove IfLetExprConseqIf{,Let} visitors.
15820 * checks/errors/rust-unsafe-checker.cc
15821 (UnsafeChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
15822 * checks/errors/rust-unsafe-checker.h
15823 (UnsafeChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
15824 * checks/errors/rust-const-checker.cc
15825 (ConstChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
15826 * checks/errors/rust-const-checker.h
15827 (ConstChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
15828 * checks/errors/privacy/rust-privacy-reporter.cc
15829 (PrivacyReporter::visit): Remove IfLetExprConseqIf{,Let} visitors.
15830 * checks/errors/privacy/rust-privacy-reporter.h
15831 (PrivacyReporter::visit): Remove IfLetExprConseqIf{,Let} visitors.
15832 * hir/tree/rust-hir-expr.h
15833 (class IfLetExprConseqElse): Make else_block ExprWithBlock.
15834 (class IfLetExprConseqIf): Remove.
15835 (class IfLetExprConseqIfLet): Remove.
15836 * hir/tree/rust-hir-full-decls.h
15837 (class IfLetExprConseqIf): Remove.
15838 (class IfLetExprConseqIfLet): Remove.
15839 * hir/tree/rust-hir.cc
15840 (IfLetExprConseqElse::as_string): Adjust output.
15841 (IfLetExprConseqIf::as_string): Remove.
15842 (IfLetExprConseqIfLet::as_string): Remove.
15843 (IfLetExprConseqIf::accept_vis): Remove.
15844 (IfLetExprConseqIfLet::accept_vis): Remove.
15845 * hir/tree/rust-hir-visitor.h
15846 (HIRFullVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
15847 (HIRFullVisitorBase::visit): Remove IfLetExprConseqIf{,Let} visitors.
15848 (HIRExpressionVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
15849 * hir/rust-hir-dump.cc
15850 (Dump::visit): Remove IfLetExprConseqIf{,Let} visitors.
15851 * hir/rust-hir-dump.h
15852 (Dump::visit): Remove IfLetExprConseqIf{,Let} visitors.
15853 * typecheck/rust-hir-type-check-expr.h
15854 (TypeCheckExpr::visit): Remove IfLetExprConseqIf{,Let} visitors.
15855
15856 2024-01-16 Owen Avery <[email protected]>
15857
15858 * typecheck/rust-hir-type-check-expr.cc
15859 (TypeCheckExpr::visit): Remove IfExprConseqIf visitor.
15860 * typecheck/rust-hir-type-check-expr.h
15861 (TypeCheckExpr::visit): Remove IfExprConseqIf{,Let} visitor.
15862 * backend/rust-compile-block.cc
15863 (CompileConditionalBlocks::visit): Remove IfExprConseqIf visitor.
15864 * backend/rust-compile-block.h
15865 (CompileConditionalBlocks::visit): Remove IfExprConseqIf{,Let} visitors.
15866 (CompileExprWithBlock::visit):
15867 Remove IfExprConseqIf{,Let} visitors, implement BlockExpr visitor.
15868 * backend/rust-compile-expr.cc
15869 (CompileExpr::visit): Remove IfExprConseqIf visitor.
15870 * backend/rust-compile-expr.h
15871 (CompileExpr::visit): Remove IfExprConseqIf{,Let} visitors.
15872 * checks/lints/rust-lint-marklive.h
15873 (MarkLive::visit): Remove IfExprConseqIf visitor.
15874 * checks/errors/rust-const-checker.cc
15875 (ConstChecker::visit): Remove IfExprConseqIf{,Let} visitors.
15876 * checks/errors/rust-const-checker.h
15877 (ConstChecker::visit): Remove IfExprConseqIf{,Let} visitors.
15878 * checks/errors/rust-unsafe-checker.cc
15879 (UnsafeChecker::visit): Remove IfExprConseqIf{,Let} visitors.
15880 * checks/errors/rust-unsafe-checker.h
15881 (UnsafeChecker::visit): Remove IfExprConseqIf{,Let} visitors.
15882 * checks/errors/privacy/rust-privacy-reporter.cc
15883 (PrivacyReporter::visit): Remove IfExprConseqIf{,Let} visitors.
15884 * checks/errors/privacy/rust-privacy-reporter.h
15885 (PrivacyReporter::visit): Remove IfExprConseqIf{,Let} visitors.
15886 * hir/tree/rust-hir-expr.h
15887 (class IfExprConseqElse): Make else_block ExprWithBlock.
15888 (class IfExprConseqIf): Remove.
15889 (class IfExprConseqIfLet): Remove.
15890 * hir/tree/rust-hir-full-decls.h
15891 (class IfExprConseqIf): Remove.
15892 (class IfExprConseqIfLet): Remove.
15893 * hir/tree/rust-hir.cc
15894 (IfExprConseqElse::as_string): Adjust output.
15895 (IfExprConseqIf::as_string): Remove.
15896 (IfExprConseqIfLet::as_string): Remove.
15897 (IfExprConseqIf::accept_vis): Remove.
15898 (IfExprConseqIfLet::accept_vis): Remove.
15899 * hir/tree/rust-hir-visitor.h
15900 (HIRFullVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
15901 (HIRFullVisitorBase::visit): Remove IfExprConseqIf{,Let} visitors.
15902 (HIRExpressionVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
15903 * hir/rust-hir-dump.cc
15904 (Dump::visit): Remove IfExprConseqIf{,Let} visitors.
15905 * hir/rust-hir-dump.h
15906 (Dump::visit): Remove IfExprConseqIf{,Let} visitors.
15907 * hir/rust-ast-lower.cc
15908 (ASTLoweringIfBlock::visit): Replace HIR::IfExprConseqIf with HIR::IfExprConseqElse.
15909
15910 2024-01-16 Mahmoud Mohamed <[email protected]>
15911
15912 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
15913 Push a Product context instead of an Or context.
15914
15915 2024-01-16 Philip Herron <[email protected]>
15916
15917 * typecheck/rust-hir-inherent-impl-overlap.h (class ImplItemToName): remove
15918
15919 2024-01-16 Philip Herron <[email protected]>
15920
15921 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): remove unused code
15922
15923 2024-01-16 Philip Herron <[email protected]>
15924
15925 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): remove infer call
15926 (TypeCheckExpr::resolve_root_path): only infer when we need to
15927
15928 2024-01-16 Philip Herron <[email protected]>
15929
15930 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): add debug
15931
15932 2024-01-16 Philip Herron <[email protected]>
15933
15934 * backend/rust-compile.cc: use unify_and instead
15935 * typecheck/rust-tyty-subst.cc (SubstitutionRef::solve_missing_mappings_from_this): remove
15936 * typecheck/rust-tyty-subst.h: update header
15937
15938 2024-01-16 Philip Herron <[email protected]>
15939
15940 * typecheck/rust-coercion.cc (TypeCoercionRules::select): use new unify_and interface
15941 * typecheck/rust-hir-dot-operator.cc (MethodResolver::try_hook): grab bounds behind refs
15942
15943 2024-01-16 Philip Herron <[email protected]>
15944
15945 * backend/rust-compile-base.cc: fix headers
15946 * backend/rust-compile-base.h: likewise
15947 * backend/rust-compile-expr.cc: likewise
15948 * backend/rust-compile-extern.h: likewise
15949 * backend/rust-compile-pattern.cc: likewise
15950 * backend/rust-compile.cc: likewise
15951 * typecheck/rust-autoderef.cc: likewise
15952 * typecheck/rust-hir-dot-operator.cc: likewise
15953 * typecheck/rust-hir-inherent-impl-overlap.h: likewise
15954 * typecheck/rust-hir-path-probe.cc: likewise
15955 * typecheck/rust-hir-trait-resolve.cc: likewise
15956 * typecheck/rust-hir-type-check-base.cc: likewise
15957 * typecheck/rust-hir-type-check-base.h (RUST_HIR_TYPE_CHECK_BASE): likewise
15958 * typecheck/rust-hir-type-check-enumitem.cc: likewise
15959 * typecheck/rust-hir-type-check-expr.cc: likewise
15960 * typecheck/rust-hir-type-check-implitem.cc: likewise
15961 * typecheck/rust-hir-type-check-item.cc: likewise
15962 * typecheck/rust-hir-type-check-path.cc: likewise
15963 * typecheck/rust-hir-type-check-pattern.cc: likewise
15964 * typecheck/rust-hir-type-check-stmt.cc: likewise
15965 * typecheck/rust-hir-type-check-struct.cc: likewise
15966 * typecheck/rust-hir-type-check-type.cc: likewise
15967 * typecheck/rust-hir-type-check-type.h: likewise
15968 * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): likewise
15969 * typecheck/rust-tyty-bounds.cc: likewise
15970 * typecheck/rust-tyty-call.cc: likewise
15971 * typecheck/rust-tyty-subst.cc: likewise
15972 * typecheck/rust-tyty.cc: likewise
15973
15974 2024-01-16 Philip Herron <[email protected]>
15975
15976 * typecheck/rust-tyty.cc (BaseType::has_subsititions_defined): new implementation
15977 (BaseType::needs_generic_substitutions): likewise
15978 (ProjectionType::needs_generic_substitutions): remove
15979 (ProjectionType::has_subsititions_defined): remove
15980 * typecheck/rust-tyty.h: update header
15981
15982 2024-01-16 Philip Herron <[email protected]>
15983
15984 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): update to use new interface
15985 (TypeCheckExpr::resolve_root_path): likewise
15986 (TypeCheckExpr::resolve_segments): likewise
15987 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
15988 (TypeCheckType::resolve_root_path): likewise
15989 * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): likewise
15990 * typecheck/rust-tyty.cc (BaseType::supports_substitutions): likewise
15991 (BaseType::can_substitute): remove
15992 (BaseType::contains_type_parameters): remove
15993 (handle_substitions): cleanup
15994 (TupleType::handle_substitions): update
15995 (FnType::handle_substitions): update
15996 (ProjectionType::supports_substitutions): update
15997 * typecheck/rust-tyty.h: update header
15998
15999 2024-01-16 Philip Herron <[email protected]>
16000
16001 * typecheck/rust-tyty.h: cleanup ordering of header
16002
16003 2024-01-16 Philip Herron <[email protected]>
16004
16005 * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): new impl
16006 (InferType::monomorphized_clone): remove
16007 (ErrorType::monomorphized_clone): likewise
16008 (ADTType::monomorphized_clone): likewise
16009 (TupleType::monomorphized_clone): likewise
16010 (FnType::monomorphized_clone): likewise
16011 (FnPtr::monomorphized_clone): likewise
16012 (ClosureType::monomorphized_clone): likewise
16013 (ArrayType::clone): likewise
16014 (ArrayType::get_var_element_type): likewise
16015 (ArrayType::monomorphized_clone): likewise
16016 (SliceType::clone): likewise
16017 (SliceType::get_var_element_type): likewise
16018 (SliceType::monomorphized_clone): likewise
16019 (BoolType::monomorphized_clone): likewise
16020 (IntType::monomorphized_clone): likewise
16021 (UintType::monomorphized_clone): likewise
16022 (FloatType::monomorphized_clone): likewise
16023 (USizeType::monomorphized_clone): likewise
16024 (ISizeType::monomorphized_clone): likewise
16025 (CharType::monomorphized_clone): likewise
16026 (ReferenceType::clone): likewise
16027 (ReferenceType::get_var_element_type): likewise
16028 (ReferenceType::monomorphized_clone): likewise
16029 (PointerType::clone): likewise
16030 (PointerType::get_var_element_type): likewise
16031 (PointerType::monomorphized_clone): likewise
16032 (ParamType::monomorphized_clone): likewise
16033 (StrType::monomorphized_clone): likewise
16034 (NeverType::monomorphized_clone): likewise
16035 (PlaceholderType::monomorphized_clone): likewise
16036 (ProjectionType::monomorphized_clone): likewise
16037 (DynamicObjectType::monomorphized_clone): likewise
16038 * typecheck/rust-tyty.h: update header
16039
16040 2024-01-16 Philip Herron <[email protected]>
16041
16042 * typecheck/rust-tyty.cc (BaseType::is_unit): new implementation
16043 (ErrorType::is_unit): remove
16044 (TupleType::is_unit): likewise
16045 (NeverType::is_unit): likewise
16046 (PlaceholderType::is_unit): likewise
16047 (ProjectionType::is_unit): likewise
16048 * typecheck/rust-tyty.h: update header
16049
16050 2024-01-16 Philip Herron <[email protected]>
16051
16052 * typecheck/rust-tyty.cc (BaseType::is_concrete): new implementation
16053 (InferType::is_concrete): remove
16054 (ErrorType::is_concrete): likewise
16055 (StructFieldType::is_concrete): likewise
16056 (ADTType::is_concrete): likewise
16057 (TupleType::is_concrete): likewise
16058 (BoolType::is_concrete): likewise
16059 (IntType::is_concrete): likewise
16060 (UintType::is_concrete): likewise
16061 (FloatType::is_concrete): likewise
16062 (USizeType::is_concrete): likewise
16063 (ISizeType::is_concrete): likewise
16064 (CharType::is_concrete): likewise
16065 (ReferenceType::is_concrete): likewise
16066 (PointerType::is_concrete): likewise
16067 (ParamType::is_concrete): likewise
16068 (StrType::is_concrete): likewise
16069 (NeverType::is_concrete): likewise
16070 (PlaceholderType::is_concrete): likewise
16071 (ProjectionType::is_concrete): likewise
16072 (DynamicObjectType::is_concrete): likewise
16073 * typecheck/rust-tyty.h: update header
16074
16075 2024-01-16 Philip Herron <[email protected]>
16076
16077 * backend/rust-compile-type.cc (TyTyResolveCompile::TyTyResolveCompile): call destructure
16078 (TyTyResolveCompile::compile): use error_mark_node
16079 (TyTyResolveCompile::visit): use error_mark_node
16080 * backend/rust-compile-type.h: remove recursive ops
16081
16082 2024-01-16 Tage Johansson <[email protected]>
16083
16084 * parse/rust-parse.cc: fix follow-sets
16085
16086 2024-01-16 Mahmoud Mohamed <[email protected]>
16087
16088 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit) :declare and
16089 pass bindings to PatternDeclaration::go.
16090 (ResolveExpr::resolve_closure_param): Likewise.
16091 * resolve/rust-ast-resolve-expr.h: Likewise.
16092 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
16093 (ResolveItem::visit): Likewise.
16094 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): Likewise.
16095 (PatternDeclaration::visit): check for previous identifier bindings
16096 before inserting the new one.
16097 * resolve/rust-ast-resolve-pattern.h (enum PatternBoundCtx): New enum.
16098 * resolve/rust-ast-resolve-stmt.h: pass bindings to PatterDeclaration::go.
16099
16100 2024-01-16 Mahmoud Mohamed <[email protected]>
16101
16102 * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
16103 handle closure parameters pattern bindings using CompilePatternBindings visitor
16104
16105 2024-01-16 Arthur Cohen <[email protected]>
16106
16107 * README.md (process): Rename `rust1` to `crab1` in examples.
16108 * Make-lang.in: Rename `rust1` to `crab1`.
16109 * config-lang.in: Likewise.
16110 * lang-specs.h: Likewise.
16111 * rustspec.cc (lang_specific_driver): Likewise.
16112
16113 2024-01-16 Owen Avery <[email protected]>
16114
16115 * hir/tree/rust-hir-pattern.h
16116 (SlicePattern::get_items): Add.
16117
16118 2024-01-16 Owen Avery <[email protected]>
16119
16120 * hir/tree/rust-hir-full-decls.h
16121 (struct GenericArgsBinding): Convert to class.
16122 (class GenericArgsBinding): Convert from struct.
16123 (struct TypePathFunction): See above.
16124 (class TypePathFunction): See above.
16125 (struct QualifiedPathType): See above.
16126 (class QualifiedPathType): See above.
16127 * ast/rust-ast-full-decls.h
16128 (struct WhereClause): See above.
16129 (class WhereClause): See above.
16130 (struct SelfParam): See above.
16131 (class SelfParam): See above.
16132 (struct FunctionQualifiers): See above.
16133 (class FunctionQualifiers): See above.
16134 (struct FunctionParam): See above.
16135 (class FunctionParam): See above.
16136 (struct StructField): See above.
16137 (class StructField): See above.
16138 (struct TupleField): See above.
16139 (class TupleField): See above.
16140 (struct TraitFunctionDecl): See above.
16141 (class TraitFunctionDecl): See above.
16142 (struct TraitMethodDecl): See above.
16143 (class TraitMethodDecl): See above.
16144 (struct NamedFunctionParam): See above.
16145 (class NamedFunctionParam): See above.
16146 * hir/tree/rust-hir-path.h
16147 (struct GenericArgsBinding): See above.
16148 (class GenericArgsBinding): See above.
16149 (struct TypePathFunction): See above.
16150 (class TypePathFunction): See above.
16151 (struct QualifiedPathType): See above.
16152 (class QualifiedPathType): See above.
16153 * ast/rust-item.h
16154 (struct WhereClause): See above.
16155 (class WhereClause): See above.
16156 (struct SelfParam): See above.
16157 (class SelfParam): See above.
16158 (struct FunctionQualifiers): See above.
16159 (class FunctionQualifiers): See above.
16160 (struct FunctionParam): See above.
16161 (class FunctionParam): See above.
16162 (struct StructField): See above.
16163 (class StructField): See above.
16164 (struct TupleField): See above.
16165 (class TupleField): See above.
16166 (struct TraitFunctionDecl): See above.
16167 (class TraitFunctionDecl): See above.
16168 (struct TraitMethodDecl): See above.
16169 (class TraitMethodDecl): See above.
16170 (struct NamedFunctionParam): See above.
16171 (class NamedFunctionParam): See above.
16172
16173 2024-01-16 Owen Avery <[email protected]>
16174
16175 * hir/tree/rust-hir-pattern.h
16176 (class AltPattern): Remove duplicate access specifier.
16177 (AltPattern::get_alts): Add.
16178 * hir/tree/rust-hir.cc
16179 (AltPattern::as_string): Add.
16180 (AltPattern::accept_vis): Add.
16181
16182 2024-01-16 Arthur Cohen <[email protected]>
16183
16184 * hir/tree/rust-hir-item.h (class ExportedMacro): Add new ExportedMacro class.
16185 * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): New function.
16186 (ExportedMacro::get_locus): Likewise.
16187 (ExportedMacro::get_item_kind): Likewise.
16188 (ExportedMacro::clone_item_impl): Likewise.
16189 * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Forward declare class.
16190 * backend/rust-compile-item.h: Add visitor for ExportedMacro.
16191 * backend/rust-compile-stmt.h: Likewise.
16192 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
16193 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
16194 * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::visit):
16195 Likewise.
16196 * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
16197 * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
16198 * checks/errors/privacy/rust-reachability.h: Likewise.
16199 * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
16200 * checks/errors/privacy/rust-visibility-resolver.h: Likewise.
16201 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
16202 * checks/errors/rust-const-checker.h: Likewise.
16203 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
16204 * checks/errors/rust-unsafe-checker.h: Likewise.
16205 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
16206 * hir/rust-ast-lower-item.h: Likewise.
16207 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
16208 * hir/rust-hir-dump.h: Likewise.
16209 * hir/tree/rust-hir-visitor.h: Likewise.
16210 * metadata/rust-export-metadata.cc: Likewise.
16211 * typecheck/rust-hir-type-check-item.h: Likewise.
16212 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
16213 * typecheck/rust-hir-type-check-stmt.h: Likewise.
16214 * typecheck/rust-tycheck-dump.h: Likewise.
16215 * hir/tree/rust-hir.h: Add new ItemKind::MacroExport variant.
16216 * util/rust-attributes.cc: Add #[macro_export] attribute.
16217
16218 2024-01-16 Mahmoud Mohamed <[email protected]>
16219
16220 * backend/rust-compile-fnparam.cc (CompileFnParam::visit):
16221 Added visit implementation for ReferencePattern.
16222 (CompileFnParam::create_tmp_param_var):
16223 Refactored duplicated code into a helper function.
16224 * backend/rust-compile-fnparam.h: Added visit implementation for
16225 ReferencePattern.
16226 * backend/rust-compile-pattern.cc (CompilePatternBindings::visit):
16227 Added visit implementation for ReferencePattern and
16228 IdentifierPattern.
16229 * backend/rust-compile-pattern.h: Added visit implementation for
16230 ReferencePattern and IdentifierPattern.
16231
16232 2024-01-16 Arthur Cohen <[email protected]>
16233
16234 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Move
16235 unloaded module item loading to...
16236 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): ...here.
16237
16238 2024-01-16 Jakub Dupak <[email protected]>
16239
16240 * hir/rust-hir-dump.cc (Dump::visit): Simplify indentation dump to single line.
16241
16242 2024-01-16 Jakub Dupak <[email protected]>
16243
16244 * ast/rust-ast-dump.cc (Indent::Indent): Move to separate file.
16245 (operator<<): Move to separate file.
16246 (Indent::increment): Move to separate file.
16247 (Indent::decrement): Move to separate file.
16248 * ast/rust-ast-dump.h (class Indent): Move to separate file.
16249 * hir/rust-hir-dump.cc (Dump::Dump): Use new indentation object.
16250 (Dump::go): Use new indentation object.
16251 (Dump::visit): Use new indention object.
16252 * hir/rust-hir-dump.h: Use new indentation object.
16253 * util/rust-dump.h: New file. Moved Indentation from rust-ast-dump.cc
16254
16255 2024-01-16 Mahmoud Mohamed <[email protected]>
16256
16257 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
16258 Add the missing infered type assignment
16259
16260 2024-01-16 Marc Poulhiès <[email protected]>
16261
16262 PR rust/108111
16263 * ast/rust-ast-full-decls.h (StructPatternElements): Declare as a
16264 class.
16265 * ast/rust-item.h (EnumItem): Mark several method as being
16266 overrides.
16267 * ast/rust-pattern.h (StructPattern::get_locus): Add override.
16268 * lex/rust-lex.h (BufferInputSource): Use reference_wrapper
16269 instead of bare reference.
16270 (TokenSource::get): Add method to implement the reference_wrapper
16271 interface.
16272 * typecheck/rust-tyty.h (TypeBoundPredicate): Add empty dtor.
16273 * util/rust-buffered-queue.h (peek): Source token stream is now
16274 using a reference_wrapper, use .get()
16275
16276 2024-01-16 vincent <[email protected]>
16277
16278 * typecheck/rust-hir-type-check-pattern.cc
16279 (TypeCheckPattern::visit): rewrite part code to helper function
16280 (TypeCheckPattern::typecheck_range_pattern_bound): helper function
16281 * typecheck/rust-hir-type-check-pattern.h
16282 (TypeCheckPattern::typecheck_range_pattern_bound):
16283 change the parameter of the function
16284
16285 2024-01-16 goar5670 <[email protected]>
16286
16287 * hir/tree/rust-hir-pattern.h (HIR::ReferencePattern):
16288 added get_referenced_pattern function.
16289 * resolve/rust-ast-resolve-pattern.h
16290 (Resolve::PatternDeclaration): add visit function for
16291 AST::ReferencePattern
16292 * typecheck/rust-hir-type-check-pattern.cc
16293 (Resolver::TypeCheckPattern): add visit function for
16294 HIR::ReferencePattern
16295
16296 2024-01-16 Owen Avery <[email protected]>
16297
16298 * util/rust-lang-item.h
16299 (RustLangItem::ItemType): New enumerators.
16300 (RustLangItem::Parse): Parse new enumerators.
16301 (RustLangItem::ToString): Handle new enumerators.
16302
16303 2024-01-16 Owen Avery <[email protected]>
16304
16305 * backend/rust-compile-fnparam.h:
16306 (CompileFnParam::visit): Add AltPattern visitor.
16307 * backend/rust-compile-pattern.h:
16308 (CompilePatternCaseLabelExpr::visit): Add AltPattern visitor.
16309 (CompilePatternBindings::visit): Add AltPattern visitor.
16310 (CompilePatternLet::visit): Add AltPattern visitor.
16311 * backend/rust-compile-resolve-path.h:
16312 (ResolvePathRef::visit): Add AltPattern visitor.
16313 * backend/rust-compile-var-decl.h:
16314 (CompileVarDecl::visit): Add AltPattern visitor.
16315 * checks/errors/rust-const-checker.cc
16316 (ConstChecker::visit): Add AltPattern visitor.
16317 * checks/errors/rust-const-checker.h:
16318 (ConstChecker::visit): Add AltPattern visitor.
16319 * checks/errors/rust-unsafe-checker.cc
16320 (UnsafeChecker::visit): Add AltPattern visitor.
16321 * checks/errors/rust-unsafe-checker.h:
16322 (UnsafeChecker::visit): Add AltPattern visitor.
16323 * hir/rust-hir-dump.cc
16324 (Dump::visit): Add AltPattern visitor.
16325 * hir/rust-hir-dump.h:
16326 (Dump::visit): Add AltPattern visitor.
16327 * hir/tree/rust-hir-full-decls.h
16328 (class AltPattern): Add forward declaration.
16329 * hir/tree/rust-hir-pattern.h
16330 (class AltPattern): New class.
16331 * hir/tree/rust-hir-visitor.h:
16332 (HIRFullVisitor::visit): Add AltPattern visitor.
16333 (HIRFullVisitorBase::visit): Add AltPattern visitor.
16334 (HIRPatternVisitor::visit): Add AltPattern visitor.
16335 * hir/tree/rust-hir.h:
16336 (Pattern::PatternType::ALT): New enumerator.
16337 * typecheck/rust-hir-type-check-pattern.cc
16338 (TypeCheckPattern::visit): Add AltPattern visitor.
16339 * typecheck/rust-hir-type-check-pattern.h:
16340 (TypeCheckPattern::visit): Add AltPattern visitor.
16341
16342 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16343
16344 * ast/rust-macro.cc (builtin_macro_from_string): Add identifier
16345 identification.
16346 * ast/rust-macro.h (enum class): Add Stringify builtin macro
16347 type.
16348 * expand/rust-macro-builtins.cc (make_macro_path_str): Add path
16349 for builtin stringify macro.
16350 (MacroBuiltin::stringify_handler): Add handler for builtin
16351 stringify macro.
16352 * expand/rust-macro-builtins.h: Add stringify handler's
16353 prototype.
16354 * util/rust-hir-map.cc (Mappings::insert_macro_def): Add
16355 stringify handler to builtin hir map.
16356
16357 2024-01-16 Nikos Alexandris <[email protected]>
16358
16359 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
16360 Add length checking for tuple patterns.
16361 (TypeCheckPattern::emit_pattern_size_error): New function.
16362 * typecheck/rust-hir-type-check-pattern.h: New function
16363 emit_pattern_size_error.
16364
16365 2024-01-16 goar5670 <[email protected]>
16366
16367 * parse/rust-parse-impl.h (Parser::parse_expr):
16368 split LEFT_SHIFT before null_denotation.
16369
16370 2024-01-16 Parthib <[email protected]>
16371
16372 * rust-object-export.cc: Modified
16373 * hir/rust-ast-lower-type.cc (rust_fatal_error): Removed
16374 (rust_assert): Added
16375
16376 2024-01-16 Owen Avery <[email protected]>
16377
16378 * resolve/rust-early-name-resolver.cc
16379 (EarlyNameResolver::visit):
16380 Check for closure parameter without given type.
16381
16382 2024-01-16 Philip Herron <[email protected]>
16383
16384 * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_resolved_predicate): remove
16385
16386 2024-01-16 Philip Herron <[email protected]>
16387
16388 * resolve/rust-ast-resolve-type.cc (ResolveRelativeQualTypePath::resolve_qual_seg): fix
16389
16390 2024-01-16 Philip Herron <[email protected]>
16391
16392 * ast/rust-path.h: add missing copy for node_id
16393
16394 2024-01-16 Philip Herron <[email protected]>
16395
16396 * rust-gcc.h: remove unused headers
16397
16398 2024-01-16 Philip Herron <[email protected]>
16399
16400 * ast/rust-ast.cc (QualifiedPathInType::as_string): add missing to string
16401 * ast/rust-path.h: add missing copy+move constructors and assignment overloads
16402 * hir/tree/rust-hir-path.h: likewise
16403 * hir/tree/rust-hir.cc (QualifiedPathInType::as_string): add missing to string
16404
16405 2024-01-16 Philip Herron <[email protected]>
16406
16407 * typecheck/rust-tyty.cc (ParamType::get_name): call destructure
16408
16409 2024-01-16 Philip Herron <[email protected]>
16410
16411 * typecheck/rust-hir-trait-resolve.cc: use unify_and infer
16412
16413 2024-01-16 goar5670 <[email protected]>
16414
16415 * parse/rust-parse-impl.h (Parser::parse_closure_param):
16416 Replace parse_pattern with parse_pattern_no_alt.
16417
16418 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16419
16420 * parse/rust-parse-impl.h (Parser::parse_while_let_loop_expr):
16421 Prevent hard error on token skip.
16422 (Parser::null_denotation): Fix parser for while let expressions.
16423
16424 2024-01-16 Philip Herron <[email protected]>
16425
16426 * backend/rust-builtins.cc (BuiltinsContext::setup): add memset builtin to the map
16427 * backend/rust-compile-intrinsic.cc (uninit_handler): implement uninit intrinsic
16428
16429 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16430
16431 * parse/rust-parse-impl.h (Parser::parse_slice_pattern): Add
16432 closing square bracket check.
16433
16434 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16435
16436 * parse/rust-parse-impl.h (Parser::parse_external_type_item):
16437 Fix compilation error due to unnecessary move.
16438
16439 2024-01-16 Abdul Rafey <[email protected]>
16440
16441 * hir/rust-hir-dump.cc (Dump::go): support inner attrs, crate items and node mappings
16442 (Dump::visit): support functions, arith/logical exprs, let stmts and literals
16443
16444 2024-01-16 Nikos Alexandris <[email protected]>
16445
16446 * expand/rust-macro-builtins.cc (load_file_bytes): Add location parameter.
16447 (MacroBuiltin::include_bytes_handler): Pass location to load_file_bytes.
16448 (MacroBuiltin::include_str_handler): Pass location to load_file_bytes.
16449
16450 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16451
16452 * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Handle
16453 RestPattern correctly.
16454
16455 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16456
16457 * ast/rust-pattern.h (class RestPattern): Add NodeId as well as
16458 the clone_impl function.
16459
16460 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16461
16462 * parse/rust-parse-impl.h (Parser::null_denotation): Fix if let
16463 parsing.
16464
16465 2024-01-16 Philip Herron <[email protected]>
16466
16467 * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): wraps op_with_overflow
16468 (std::function<tree): likewise
16469 (op_with_overflow): generate the intrinsic based on the tree_code op
16470
16471 2024-01-16 Arthur Cohen <[email protected]>
16472
16473 * Make-lang.in: Add rust-ast-lower-stmt.o
16474 * hir/rust-ast-lower-stmt.h: Move definitions to...
16475 * hir/rust-ast-lower-stmt.cc: ...here.
16476
16477 2024-01-16 mxlol233 <[email protected]>
16478
16479 * checks/errors/rust-feature-gate.cc: Add definition
16480 for `extern_types`.
16481 * checks/errors/rust-feature-gate.h: Likewise.
16482 * checks/errors/rust-feature.cc: Likewise.
16483 * checks/errors/rust-feature.h: Likewise.
16484
16485 2024-01-16 Owen Avery <[email protected]>
16486
16487 * ast/rust-pattern.h
16488 (StructPatternElements::operator=): Clear vector before inserting.
16489 (TupleStructItemsNoRange::operator=): Clear vector before inserting.
16490 (TupleStructItemsRange::operator=): Clear vectors before inserting.
16491 (TuplePatternItemsMultiple::operator=): Clear vector before inserting.
16492 (TuplePatternItemsRanged::operator=): Clear vectors before inserting.
16493 (SlicePattern::operator=): Clear vector before inserting.
16494 (AltPattern::operator=): Clear vector before inserting.
16495 * hir/tree/rust-hir-pattern.h
16496 (StructPatternElements::operator=): Clear vector before inserting.
16497 (TupleStructItemsNoRange::operator=): Clear vector before inserting.
16498 (TupleStructItemsRange::operator=): Clear vectors before inserting.
16499 (TuplePatternItemsMultiple::operator=): Clear vector before inserting.
16500 (TuplePatternItemsRanged::operator=): Clear vectors before inserting.
16501 (SlicePattern::operator=): Clear vector before inserting.
16502
16503 2024-01-16 bl7awy <[email protected]>
16504
16505 * typecheck/rust-casts.cc (TypeCastRules::cast_rules): Perform destructure on `from` type.
16506
16507 2024-01-16 Owen Avery <[email protected]>
16508
16509 * ast/rust-pattern.h
16510 (struct StructPatternElements): Change to class.
16511 (class StructPatternElements): Change from struct.
16512 * hir/tree/rust-hir-pattern.h
16513 (struct StructPatternElements): Change to class.
16514 (class StructPatternElements): Change from struct.
16515
16516 2024-01-16 Owen Avery <[email protected]>
16517
16518 * typecheck/rust-hir-type-check-pattern.cc
16519 (TypeCheckPattern::visit): Improve error messages.
16520
16521 2024-01-16 Owen Avery <[email protected]>
16522
16523 * hir/tree/rust-hir-pattern.h
16524 (class TupleStructItemsNoRange): Fix formatting.
16525 (class TupleStructItemsRange): Fix formatting.
16526 (class TuplePatternItemsMultiple): Fix formatting.
16527 (class TuplePatternItemsRanged): Fix formatting.
16528 (class SlicePattern): Fix formatting.
16529
16530 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16531
16532 * ast/rust-ast-dump.cc (Dump::visit): Add visitor.
16533 * ast/rust-ast-dump.h: Add visitor prototype.
16534 * ast/rust-ast-full-decls.h (class RestPattern): Add forward
16535 declaration for class RestPattern.
16536 * ast/rust-ast-visitor.h: Add visitor prototype.
16537 * ast/rust-ast.cc (RestPattern::accept_vis): Add function to
16538 accept a foreign visitor.
16539 * ast/rust-pattern.h (class RestPattern): Add class RestPattern.
16540 * checks/errors/rust-feature-gate.h: Add visitor prototype.
16541 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Add
16542 visitor implementation.
16543 * expand/rust-attribute-visitor.h: Add visitor prototype.
16544 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add
16545 visitor implementation.
16546 * hir/rust-ast-lower-base.h: Add visitor prototype.
16547 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add
16548 visitor implementation.
16549 * resolve/rust-ast-resolve-base.h: Add visitor prototype.
16550 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
16551 Add visitor implementation.
16552 * resolve/rust-early-name-resolver.h: Add visitor prototype.
16553 * util/rust-attributes.cc (AttributeChecker::visit): Add visitor
16554 implementation.
16555 * util/rust-attributes.h: Add visitor prototype.
16556
16557 2024-01-16 Philip Herron <[email protected]>
16558
16559 * typecheck/rust-tyty-cmp.h: remove
16560 * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): likewise
16561 (reset_cmp_autoderef_mode): likewise
16562 * typecheck/rust-tyty.h (set_cmp_autoderef_mode): likewise
16563 (reset_cmp_autoderef_mode): likewise
16564
16565 2024-01-16 Philip Herron <[email protected]>
16566
16567 * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): Add new try_flag
16568 (TypeCoercionRules::TypeCoercionRules): set new try flag
16569 (TypeCoercionRules::do_coercion): default to a final unify_and in the else case
16570 (TypeCoercionRules::coerce_unsafe_ptr): cannot coerce to a ptr from ref during autoderef
16571 (TypeCoercionRules::coerce_borrowed_pointer): respect coerceable mutability
16572 * typecheck/rust-coercion.h: update header
16573 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): use new TryCoerce interface
16574 (MethodResolver::append_adjustments): ensure we maintain adjustment mappings
16575 * typecheck/rust-hir-dot-operator.h: add new method append_adjustments
16576 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): extra logging
16577
16578 2024-01-16 Philip Herron <[email protected]>
16579
16580 * typecheck/rust-unify.cc (UnifyRules::go): fix inference check
16581
16582 2024-01-16 Philip Herron <[email protected]>
16583
16584 * backend/rust-compile-base.h: unconsify
16585 * backend/rust-compile.cc (HIRCompileBase::coercion_site): likewise
16586 (HIRCompileBase::coercion_site1): likewise
16587 * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): likewise
16588 (Adjuster::try_raw_deref_type): likewise
16589 (Adjuster::try_unsize_type): likewise
16590 (AutoderefCycle::cycle): likewise
16591 (AutoderefCycle::try_autoderefed): likewise
16592 * typecheck/rust-autoderef.h: likewise
16593 * typecheck/rust-coercion.cc (TypeCoercionRules::select): likewise
16594 * typecheck/rust-coercion.h: likewise
16595 * typecheck/rust-hir-dot-operator.cc (MethodResolver::Probe): likewise
16596 (MethodResolver::select): likewise
16597 * typecheck/rust-hir-dot-operator.h: likewise
16598
16599 2024-01-16 Philip Herron <[email protected]>
16600
16601 * typecheck/rust-unify.cc (UnifyRules::go): respect the emit_errors flag
16602
16603 2024-01-16 Philip Herron <[email protected]>
16604
16605 * typecheck/rust-casts.cc (TypeCastRules::check): update to new interface
16606 * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): likewise
16607 (TypeCoercionRules::TryCoerce): likewise
16608 (TypeCoercionRules::TypeCoercionRules): likewise
16609 * typecheck/rust-coercion.h: likewise
16610 * typecheck/rust-type-util.cc (coercion_site): likewise
16611
16612 2024-01-16 Philip Herron <[email protected]>
16613
16614 * typecheck/rust-unify.cc (UnifyRules::go): allow lhs infer vars
16615
16616 2024-01-16 Philip Herron <[email protected]>
16617
16618 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): update to new inteface
16619 * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_unsafe_ptr): likewise
16620 (TypeCoercionRules::coerce_borrowed_pointer): likewise
16621 * typecheck/rust-hir-type-check.h: likewise
16622 * typecheck/rust-type-util.cc (unify_site_and): new interface to allow for infer and commit
16623 * typecheck/rust-type-util.h (unify_site_and): likewise
16624 * typecheck/rust-typecheck-context.cc (TypeCheckContext::clear_type): new interface
16625 * typecheck/rust-unify.cc (UnifyRules::UnifyRules): update
16626 (UnifyRules::Resolve): new optional flags for commit and infer
16627 (UnifyRules::go): likewise
16628 (UnifyRules::expect_adt): refactor to use new interface
16629 (UnifyRules::expect_reference): likewise
16630 (UnifyRules::expect_pointer): likewise
16631 (UnifyRules::expect_array): likewise
16632 (UnifyRules::expect_slice): likewise
16633 (UnifyRules::expect_fndef): likewise
16634 (UnifyRules::expect_fnptr): likewise
16635 (UnifyRules::expect_tuple): likewise
16636 (UnifyRules::expect_closure): likewise
16637 * typecheck/rust-unify.h: refactor interface
16638
16639 2024-01-16 Philip Herron <[email protected]>
16640
16641 * typecheck/rust-unify.cc (UnifyRules::Resolve): refactor
16642 (UnifyRules::commit): refactor
16643 * typecheck/rust-unify.h: likewise
16644
16645 2024-01-16 Philip Herron <[email protected]>
16646
16647 * typecheck/rust-tyty.cc (ADTType::is_concrete): need to consider if is a num_variant
16648 * typecheck/rust-tyty.h: refactor to cc file
16649
16650 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16651
16652 * parse/rust-parse-impl.h (Parser::parse_external_type_item):
16653 Add function to parser an external type item.
16654 (Parser::parse_external_item):
16655 Add identification and parsing for external type items.
16656 * parse/rust-parse.h:
16657 Add parser_external_type_item prototype.
16658
16659 2024-01-16 omkar-mohanty <[email protected]>
16660
16661 * expand/rust-macro-builtins.cc
16662 (MacroBuiltin::include_str_handler): eager expansion
16663 (make_macro_path_str): macto to string
16664 (parse_single_string_literal): check for eager invocation
16665 (MacroBuiltin::assert_handler): eager expansion
16666 (MacroBuiltin::include_bytes_handler): eager expansion
16667 (MacroBuiltin::include_str_handler): eager expansion
16668 (MacroBuiltin::compile_error_handler): eager expansion
16669 (MacroBuiltin::include_handler): eager expansion
16670
16671 2024-01-16 Arthur Cohen <[email protected]>
16672
16673 * ast/rust-item.h (class Method): Add `is_default` field.
16674 (class Function): Likewise.
16675 * parse/rust-parse-impl.h (Parser::parse_item): Add nice error when
16676 parsing `default` outside of an `impl` block
16677 (Parser::parse_trait_impl_item): Allow parsing functions
16678 or methods when seeing `default`.
16679
16680 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16681
16682 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::cast_site):
16683 Remove cast_site.
16684 * typecheck/rust-hir-type-check-base.h: Remove cast_site
16685 prototype.
16686 * typecheck/rust-type-util.cc (cast_site): Add cast_site.
16687 * typecheck/rust-type-util.h (cast_site): Add cast_site
16688 prototype.
16689
16690 2024-01-16 Arthur Cohen <[email protected]>
16691
16692 * ast/rust-item.h: Add non-const `get_visibility` to ExternalTypeItem.
16693 * ast/rust-ast-dump.cc (Dump::visit): Add implementation for ExternalTypeItem.
16694 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Likewise.
16695
16696 2024-01-16 Arthur Cohen <[email protected]>
16697
16698 * ast/rust-item.h (class ExternalTypeItem): New class.
16699 * ast/rust-ast.cc (ExternalTypeItem::as_string): New function.
16700 (ExternalTypeItem::accept_vis): Likewise.
16701 * ast/rust-ast-full-decls.h (class ExternalTypeItem): Declare class.
16702 * ast/rust-ast-dump.cc (Dump::visit): Add base visitor for ExternalTypeItem.
16703 * ast/rust-ast-dump.h: Likewise.
16704 * ast/rust-ast-visitor.h: Likewise.
16705 * checks/errors/rust-feature-gate.h: Likewise.
16706 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Likewise.
16707 * expand/rust-attribute-visitor.h: Likewise.
16708 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
16709 * hir/rust-ast-lower-base.h: Likewise.
16710 * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
16711 * resolve/rust-ast-resolve-base.h: Likewise.
16712 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
16713 * resolve/rust-early-name-resolver.h: Likewise.
16714 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
16715 * util/rust-attributes.h: Likewise.
16716
16717 2024-01-16 Arthur Cohen <[email protected]>
16718
16719 * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::split_current_token):
16720 Add proper implementation.
16721
16722 2024-01-16 Arthur Cohen <[email protected]>
16723
16724 * ast/rust-item.h (class Trait): Add `has_auto` field.
16725 * checks/errors/rust-feature.cc: Add handling for `feature(optin_builtin_traits)`
16726 * checks/errors/rust-feature.h: Likewise.
16727 * lex/rust-lex.cc: Fix keyword classification using hashmap.
16728 * lex/rust-token.h: Add `auto` keyword token.
16729 * parse/rust-parse-impl.h (Parser::parse_vis_item): Parse auto traits
16730 on `auto` keyword.
16731
16732 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16733
16734 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
16735 Remove TypeCheckBase namespace qualifier.
16736 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::coercion_site):
16737 Remove coercion_site function.
16738 * typecheck/rust-hir-type-check-base.h: Remove coercion_site
16739 prototype.
16740 * typecheck/rust-type-util.cc (coercion_site): Add coercion_site
16741 function.
16742 * typecheck/rust-type-util.h (coercion_site): Add coercion_site
16743 prototype.
16744 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
16745 Remove TypeCheckBase namespace qualifier.
16746 (TypeCheckMethodCallExpr::check): Remove TypeCheckBase namespace
16747 qualifier.
16748
16749 2024-01-16 Pierre-Emmanuel Patry <[email protected]>
16750
16751 * typecheck/rust-autoderef.cc: Remove TypeCheckBase qualifier.
16752 * typecheck/rust-hir-trait-resolve.cc: Remove TypeCheckBase
16753 qualifier.
16754 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site):
16755 Remove unify_site.
16756 * typecheck/rust-hir-type-check-base.h: Remove unify_site
16757 header.
16758 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve):
16759 Remove TypeCheckBase qualifier.
16760 * typecheck/rust-type-util.cc (unify_site): Add unify_site
16761 function.
16762 * typecheck/rust-type-util.h (unify_site): Add unify_site
16763 prototype.
16764 * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::check):
16765 Remove TypeCheckBase qualifier.
16766
16767 2024-01-16 Arthur Cohen <[email protected]>
16768
16769 * parse/rust-parse-impl.h (Parser::parse_type): Allow LEFT_SHIFT to
16770 start a type and then split it in `parse_qualified_path_type`
16771
16772 2024-01-16 Arthur Cohen <[email protected]>
16773
16774 * parse/rust-parse-impl.h (Parser::parse_path_generic_args): Split leading
16775 `LEFT_SHIFT` token into two `LEFT_ANGLE` tokens when parsing generic arguments.
16776 (Parser::parse_type_path_segment): Allow `LEFT_ANGLE` as starting token for
16777 parsing generic arguments.
16778
16779 2024-01-16 mxlol233 <[email protected]>
16780
16781 * checks/errors/rust-feature-gate.cc: Add implementations
16782 for `rustc_attri`.
16783 * checks/errors/rust-feature-gate.h: Likewise.
16784
16785 2024-01-16 Owen Avery <[email protected]>
16786
16787 * parse/rust-parse-impl.h
16788 (Parser::parse_pattern): Add.
16789 (Parser::parse_pattern_no_alt): Rename.
16790 * parse/rust-parse.h:
16791 (Parser::parse_pattern): Add.
16792 (Parser::parse_pattern_no_alt): Rename.
16793
16794 2024-01-04 David Malcolm <[email protected]>
16795
16796 * lang.opt.urls: New file, autogenerated by
16797 regenerate-opt-urls.py.
16798
16799 2023-12-14 Pierre-Emmanuel Patry <[email protected]>
16800 Thomas Schwinge <[email protected]>
16801
16802 * config-lang.in: Add libgrust as a target module for the rust
16803 language.
16804
16805 2023-11-19 David Malcolm <[email protected]>
16806
16807 * rust-location.h: Include "rich-location.h".
16808
16809 2023-10-20 Patrick Palka <[email protected]>
16810
16811 PR rust/111899
16812 * backend/rust-constexpr.cc (potential_constant_expression_1):
16813 Remove NON_DEPENDENT_EXPR handling.
16814 * backend/rust-tree.cc (mark_exp_read): Likewise.
16815 (mark_use): Likewise.
16816 (lvalue_kind): Likewise.
16817
16818 2023-09-28 Richard Sandiford <[email protected]>
16819
16820 * backend/rust-constexpr.cc (rs_fold_indirect_ref): Remove unused
16821 variables.
16822
16823 2023-09-21 Iain Buclaw <[email protected]>
16824
16825 * rust-session-manager.cc (Session::init): Call
16826 targetrustm.rust_os_info.
16827 * rust-target.def (rust_os_info): New hook.
16828
16829 2023-09-21 Iain Buclaw <[email protected]>
16830
16831 * rust-lang.cc (rust_add_target_info): Remove sorry.
16832 * rust-session-manager.cc: Replace include of target.h with
16833 include of tm.h and rust-target.h.
16834 (Session::init): Call targetrustm.rust_cpu_info.
16835 * rust-target.def (rust_cpu_info): New hook.
16836 * rust-target.h (rust_add_target_info): Declare.
16837
16838 2023-09-21 Iain Buclaw <[email protected]>
16839
16840 * rust-target-def.h: New file.
16841 * rust-target.def: New file.
16842 * rust-target.h: New file.
16843
16844 2023-09-11 Parthib <[email protected]>
16845
16846 * Make-lang.in: Removed rust-gcc-diagnostics object file.
16847 * rust-diagnostics.cc (rust_be_get_quotechars): Added from original file.
16848 (rust_be_internal_error_at): Likewise.
16849 (rust_be_error_at): Likewise.
16850 (class rust_error_code_rule): Likewise.
16851 (rust_be_warning_at): Likewise.
16852 (rust_be_fatal_error): Likewise.
16853 (rust_be_inform): Likewise.
16854 (rust_be_debug_p): Likewise.
16855 * rust-gcc-diagnostics.cc: Removed.
16856
16857 2023-09-07 David Malcolm <[email protected]>
16858
16859 * rust-diagnostics.cc (rust_error_at): New overload.
16860 * rust-diagnostics.h (struct ErrorCode): New struct.
16861 (rust_error_at): New.
16862 (rust_be_error_at): Likewise.
16863 * rust-gcc-diagnostics.cc (class rust_error_code_rule): New class.
16864 (rust_be_error_at): New function.
16865 * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error): Emit E0054
16866 when reporting invalid cast error.
16867
16868 2023-07-05 Robin Dapp <[email protected]>
16869 Juzhe-Zhong <[email protected]>
16870
16871 * backend/rust-tree.cc (c_common_type_for_mode): Ditto.
16872
16873 2023-06-22 Paul E. Murphy <[email protected]>
16874
16875 * rust-object-export.cc [TARGET_AIX]: Rename and update usage to
16876 TARGET_AIX_OS.
16877
16878 2023-04-06 Owen Avery <[email protected]>
16879
16880 * parse/rust-parse-impl.h
16881 (Parser::parse_stmt): Handle unsafe expression statements.
16882
16883 2023-04-06 Owen Avery <[email protected]>
16884
16885 * parse/rust-parse-impl.h
16886 (Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling.
16887
16888 2023-04-06 M V V S Manoj Kumar <[email protected]>
16889
16890 * ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.
16891 * ast/rust-expr.h (class InlineAsm):Added class definition.
16892
16893 2023-04-06 Arthur Cohen <[email protected]>
16894
16895 * rust-diagnostics.h (struct Error): Add new Kind enum and various new
16896 static constructors to allow for hints as well.
16897 * rust-diagnostics.cc (Error::Error): Use new `kind` field properly.
16898 * checks/errors/privacy/rust-visibility-resolver.cc
16899 (VisibilityResolver::resolve_module_path): Use new Error API.
16900 * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise.
16901 * expand/rust-macro-expand.cc (parse_many): Likewise.
16902 (transcribe_type): Likewise.
16903 * parse/rust-parse-impl.h (Parser::parse_crate): Likewise.
16904 * rust-session-manager.cc (Session::handle_crate_name): Likewise.
16905 * ast/rust-ast.cc (Module::load_items): Likewise.
16906
16907 2023-04-06 Arthur Cohen <[email protected]>
16908
16909 * ast/rust-ast.h: Keep location in TraitItem base class
16910 * ast/rust-item.h (class TraitItemFunc): Use base class location instead.
16911 (class TraitItemMethod): Likewise.
16912 (class TraitItemConst): Likewise.
16913 (class TraitItemType): Likewise.
16914 * ast/rust-macro.h: Likewise.
16915
16916 2023-04-06 SainiAditya1 <[email protected]>
16917
16918 * hir/tree/rust-hir-full-test.cc: Moved to...
16919 * hir/tree/rust-hir.cc: ...here.
16920 * Make-lang.in: Rename rust-hir-full-test.
16921
16922 2023-04-06 Owen Avery <[email protected]>
16923
16924 * ast/rust-ast-dump.cc
16925 (Dump::visit): Add AltPattern visitor.
16926 * ast/rust-ast-dump.h:
16927 (Dump::visit): Add AltPattern visitor.
16928 * ast/rust-ast-full-decls.h
16929 (class AltPattern): Add declaration.
16930 * ast/rust-ast-visitor.h:
16931 (ASTVisitor::visit): Add AltPattern visitor.
16932 * ast/rust-ast.cc
16933 (AltPattern::as_string): Add definition.
16934 (AltPattern::accept_vis): Add definition.
16935 * ast/rust-pattern.h
16936 (class AltPattern): Add declaration.
16937 * checks/errors/rust-feature-gate.h:
16938 (FeatureGate::visit) Add AltPattern visitor
16939 * expand/rust-attribute-visitor.cc
16940 (AttrVisitor::visit): Add AltPattern visitor.
16941 * expand/rust-attribute-visitor.h:
16942 (AttrVisitor::visit): Add AltPattern visitor.
16943 * hir/rust-ast-lower-base.cc
16944 (ASTLoweringBase::visit): Add AltPattern visitor.
16945 * hir/rust-ast-lower-base.h:
16946 (ASTLoweringBase::visit): Add AltPattern visitor.
16947 * resolve/rust-ast-resolve-base.cc
16948 (ResolverBase::visit): Add AltPattern visitor.
16949 * resolve/rust-ast-resolve-base.h:
16950 (ResolverBase::visit): Add AltPattern visitor.
16951 * resolve/rust-early-name-resolver.cc
16952 (EarlyNameResolver::visit): Add AltPattern visitor.
16953 * resolve/rust-early-name-resolver.h:
16954 (EarlyNameResolver::visit): Add AltPattern visitor.
16955 * util/rust-attributes.cc
16956 (AttributeChecker::visit): Add AltPattern visitor.
16957 * util/rust-attributes.h:
16958 (AttributeChecker::visit): Add AltPattern visitor.
16959
16960 2023-04-06 Owen Avery <[email protected]>
16961
16962 * ast/rust-pattern.h: Fix formatting.
16963
16964 2023-04-06 Arthur Cohen <[email protected]>
16965
16966 * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not
16967 return nullptr token in expansion of `include!()`
16968
16969 2023-04-06 Owen Avery <[email protected]>
16970
16971 * checks/errors/rust-feature-gate.h: Add trailing newline before EOF.
16972
16973 2023-04-06 Philip Herron <[email protected]>
16974
16975 * typecheck/rust-hir-trait-reference.cc (TraitReference::clear_associated_types): make const
16976 (TraitReference::clear_associated_type_projections): new interface
16977 * typecheck/rust-hir-trait-reference.h:
16978 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): refactor
16979 (TraitItemReference::associated_type_reset): reset projections
16980 * typecheck/rust-hir-type-bounds.h:
16981 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): fix bounds
16982 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): refactor into cc file
16983 (TypeBoundsProbe::Probe): refactor
16984 (TypeBoundsProbe::is_bound_satisfied_for_type): likewise
16985 (TypeBoundsProbe::assemble_sized_builtin): add builtin for Sized
16986 (TypeCheckBase::get_predicate_from_bound): refactor
16987 (TypeBoundPredicate::lookup_associated_type): refactor
16988 * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl)
16989 (SubstitutionRef::prepare_higher_ranked_bounds): new interface to clear hanging bounds
16990 (SubstitutionRef::monomorphize): refactor
16991 * typecheck/rust-tyty-subst.h:
16992 * typecheck/rust-tyty.cc (BaseType::get_locus): helper
16993 (BaseType::satisfies_bound): ensure bounds are satisfied and assoicated types
16994 (ParamType::ParamType): new field in constructor
16995 (ParamType::clone): update clone
16996 (ParamType::set_implicit_self_trait): new interface
16997 (ParamType::is_implicit_self_trait): likewise
16998 * typecheck/rust-tyty.h: cleanup
16999 * util/rust-hir-map.cc (Mappings::Mappings): builtin marker
17000 (Mappings::~Mappings): delete marker
17001 (Mappings::lookup_builtin_marker): lookup
17002 * util/rust-hir-map.h: update header
17003
17004 2023-04-06 Philip Herron <[email protected]>
17005
17006 * hir/tree/rust-hir-item.h: implement virtual function
17007 * hir/tree/rust-hir.h: add virtual function
17008
17009 2023-04-06 Philip Herron <[email protected]>
17010
17011 * Make-lang.in: add new dependancy
17012 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor
17013 * typecheck/rust-hir-type-check-base.h: refactor
17014 * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): refactor
17015 * typecheck/rust-type-util.cc: New file.
17016 * typecheck/rust-type-util.h: New file.
17017
17018 2023-04-06 Owen Avery <[email protected]>
17019
17020 * expand/rust-macro-builtins.cc
17021 (MacroBuiltin::include_str_handler): Add check for valid UTF-8.
17022
17023 2023-04-06 Owen Avery <[email protected]>
17024
17025 * parse/rust-parse-impl.h
17026 (Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns.
17027
17028 2023-04-06 Pierre-Emmanuel Patry <[email protected]>
17029
17030 * lex/rust-lex.h: Add file type check.
17031
17032 2023-04-06 Owen Avery <[email protected]>
17033
17034 * backend/rust-compile-pattern.cc
17035 (CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements.
17036 * backend/rust-compile-var-decl.h:
17037 (CompileVarDecl::visit): Remove variable declaration for WildcardPattern.
17038 * resolve/rust-ast-resolve-pattern.h:
17039 (PatternDeclaration::visit): Remove name resolution for WildcardPattern.
17040
17041 2023-04-06 Owen Avery <[email protected]>
17042
17043 * typecheck/rust-tyty-call.cc
17044 (TypeCheckCallExpr::visit): Add variadic argument type checking.
17045 (TypeCheckCallExpr::visit): Fix comment spelling ("varadic").
17046
17047 2023-04-06 mxlol233 <[email protected]>
17048
17049 * checks/errors/rust-feature-gate.cc: Add implementation for
17050 `void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature`
17051 construction process in `FeatureGate::check`.
17052 * checks/errors/rust-feature-gate.h: Add declaration for
17053 `void FeatureGate::visit (AST::ExternBlock &block)`. Add private
17054 variable `valid_feature`.
17055 * checks/errors/rust-feature.h: Change `issue` to `m_issue`.
17056
17057 2023-04-06 Thomas Schwinge <[email protected]>
17058
17059 * ast/rust-ast-fragment.cc: Update copyright years.
17060 * ast/rust-ast-fragment.h: Likewise.
17061 * ast/rust-macro.cc: Likewise.
17062 * checks/errors/rust-feature-gate.cc: Likewise.
17063 * checks/errors/rust-feature-gate.h: Likewise.
17064 * checks/errors/rust-feature.cc: Likewise.
17065 * checks/errors/rust-feature.h: Likewise.
17066 * hir/rust-ast-lower-expr.cc: Likewise.
17067 * hir/rust-ast-lower-type.cc: Likewise.
17068 * resolve/rust-early-name-resolver.cc: Likewise.
17069 * resolve/rust-early-name-resolver.h: Likewise.
17070 * rust-gcc.h: Likewise.
17071 * typecheck/rust-hir-path-probe.cc: Likewise.
17072 * typecheck/rust-hir-trait-reference.cc: Likewise.
17073 * typecheck/rust-tyty-bounds.h: Likewise.
17074 * typecheck/rust-tyty-subst.cc: Likewise.
17075 * typecheck/rust-tyty-subst.h: Likewise.
17076 * typecheck/rust-tyty-util.cc: Likewise.
17077 * typecheck/rust-tyty-util.h: Likewise.
17078 * typecheck/rust-unify.cc: Likewise.
17079 * typecheck/rust-unify.h: Likewise.
17080 * util/rust-inline-visitor.h: Likewise.
17081
17082 2023-04-06 Pierre-Emmanuel Patry <[email protected]>
17083
17084 * rust-session-manager.cc (Session::compile_crate): Update the
17085 environment variable name.
17086
17087 2023-04-06 Pierre-Emmanuel Patry <[email protected]>
17088
17089 * Make-lang.in: Add `rust-hir-trait-reference.o`.
17090 * typecheck/rust-hir-trait-reference.h: Remove multiple function body.
17091 * typecheck/rust-hir-trait-reference.cc: Add multiple function body.
17092
17093 2023-04-06 Arthur Cohen <[email protected]>
17094
17095 * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
17096 Add documentation explaining the algorithm.
17097
17098 2023-04-06 Arthur Cohen <[email protected]>
17099
17100 * ast/rust-macro.cc: New file.
17101 * Make-lang.in: Add `rust-macro.o` object
17102 * ast/rust-ast-fragment.cc (Fragment::Fragment): Change API around
17103 the construction of AST fragments.
17104 (Fragment::operator=): Correct `Fragment::operator=` to take into
17105 account the fragment tokens.
17106 (Fragment::create_error): Use new constructor.
17107 (Fragment::complete): Remove in favor of new constructor.
17108 (Fragment::unexpanded): Remove as that Fragment type is no longer used
17109 or possible.
17110 (Fragment::get_tokens): Add helper to access a fragment's tokens.
17111 * ast/rust-ast-fragment.h (enum class): Remove `FragmentKind::Unused`
17112 * ast/rust-ast.cc (MacroInvocation::as_string): Display
17113 builtin macro invocations properly.
17114 * ast/rust-ast.h: Fix `DelimTokenTree` class copy constructors and
17115 handling of its token vector.
17116 * ast/rust-macro.h (class MacroMatcher): Format.
17117 (class MetaItemSeq): Likewise.
17118 (builtin_macro_from_string): Get a `BuiltinMacroKind` from a given
17119 string, i.e the name of the macro (`assert!`, `cfg!` and so on).
17120 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Do not expand
17121 macros recursively anymore.
17122 (AttrVisitor::maybe_expand_expr): Likewise.
17123 (AttrVisitor::maybe_expand_type): Likewise.
17124 * expand/rust-attribute-visitor.h: Likewise, and remove
17125 `expand_macro_fragment_recursively` function.
17126 * expand/rust-macro-builtins.cc (make_token): Add shorthand for
17127 returning `std::unique_ptr<AST::Token>`s.
17128 (make_macro_invocation): Add shorthand for returning fragments
17129 containing builtin macro invocations.
17130 (try_expand_macro_expression): Do not expand macros recursively.
17131 (try_expand_single_string_literal): Likewise.
17132 (try_expand_many_expr): Likewise.
17133 (parse_single_string_literal): Error out more appropriately.
17134 (MacroBuiltin::compile_error_handler): Add explanation for eager
17135 invocation
17136 (MacroBuiltin::file_handler): Return the proper tokens associated with
17137 macro invocation, and builtin macros in the case of necessary eager
17138 expansion.
17139 (MacroBuiltin::column_handler): Likewise.
17140 (MacroBuiltin::include_bytes_handler): Likewise.
17141 (MacroBuiltin::include_str_handler): Likewise.
17142 (MacroBuiltin::concat_handler): Likewise.
17143 (MacroBuiltin::env_handler): Likewise.
17144 (MacroBuiltin::cfg_handler): Likewise.
17145 (MacroBuiltin::include_handler): Likewise.
17146 (MacroBuiltin::line_handler): Likewise.
17147 * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
17148 Add function to expand eager invocations *once* in the fixed point
17149 pipeline.
17150 (MacroExpander::expand_invoc): Call into `expand_eager_invocations` for
17151 builtin macro invocations.
17152 (MacroExpander::expand_crate): Use new `AttrVisitor` API.
17153 (parse_many): Return tokens in `AST::Fragment`.
17154 (transcribe_expression): Likewise.
17155 (transcribe_type): Likewise.
17156 * expand/rust-macro-expand.h (struct MacroExpander): Add `has_changed`
17157 flag for fixed point checking.
17158 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver):
17159 Keep track of the current macro scope.
17160 (EarlyNameResolver::go): Use `scoped` API.
17161 (EarlyNameResolver::visit): Likewise.
17162 * resolve/rust-early-name-resolver.h: Add `scoped` API.
17163 * rust-session-manager.cc (Session::expansion): Perform macro expansion
17164 in a fixed-point fashion.
17165
17166 2023-04-06 Arthur Cohen <[email protected]>
17167
17168 * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::get_token_slice):
17169 Add API to retrieve token slices when lexing macro expansions.
17170 * expand/rust-macro-invoc-lexer.h: Declare `get_token_slice`.
17171
17172 2023-04-06 Arthur Cohen <[email protected]>
17173
17174 * parse/rust-parse.h: Move `parse_macro_invocation` to public API.
17175
17176 2023-04-06 Arthur Cohen <[email protected]>
17177
17178 * ast/rust-item.h (class BlockExpr): Remove forward declaration of
17179 class `BlockExpr`.
17180
17181 2023-04-06 Owen Avery <[email protected]>
17182
17183 * hir/tree/rust-hir-pattern.h
17184 (TuplePatternItemsRanged::get_lower_patterns): Add method.
17185 (TuplePatternItemsRanged::get_upper_patterns): Add method.
17186 * backend/rust-compile-pattern.cc
17187 (CompilePatternLet::visit): Implement TuplePattern visitor.
17188 * backend/rust-compile-pattern.h
17189 (CompilePatternLet::visit): Move TuplePattern visitor out of header file.
17190
17191 2023-04-06 Philip Herron <[email protected]>
17192
17193 * typecheck/rust-unify.cc (UnifyRules::go): ensure the bounds are checked
17194
17195 2023-04-06 Philip Herron <[email protected]>
17196
17197 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove error message
17198
17199 2023-04-06 Philip Herron <[email protected]>
17200
17201 * typecheck/rust-hir-trait-reference.h: add const infterface
17202 * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): make const
17203 (SubstitutionRef::monomorphize): fix issue
17204 * typecheck/rust-tyty-subst.h: constify interface
17205
17206 2023-04-06 Philip Herron <[email protected]>
17207
17208 * util/rust-lang-item.h:
17209
17210 2023-04-06 Philip Herron <[email protected]>
17211
17212 * typecheck/rust-tyty-subst.cc (SubstitutionArg::is_conrete): fix check
17213
17214 2023-04-06 Philip Herron <[email protected]>
17215
17216 * Make-lang.in: update names
17217 * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
17218 update to use new interface
17219 * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_borrowed_pointer): likewise
17220 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): likewise
17221 * typecheck/rust-tyty.cc (BaseType::destructure): likewise
17222 (InferType::unify): removed old unify interface
17223 (ErrorType::unify): likewise
17224 (ADTType::unify): likewise
17225 (TupleType::unify): likewise
17226 (FnType::unify): likewise
17227 (FnPtr::unify): likewise
17228 (ClosureType::unify): likewise
17229 (ArrayType::unify): likewise
17230 (SliceType::unify): likewise
17231 (BoolType::unify): likewise
17232 (IntType::unify): likewise
17233 (UintType::unify): likewise
17234 (FloatType::unify): likewise
17235 (USizeType::unify): likewise
17236 (ISizeType::unify): likewise
17237 (CharType::unify): likewise
17238 (ReferenceType::unify): likewise
17239 (PointerType::unify): likewise
17240 (ParamType::unify): likewise
17241 (StrType::unify): likewise
17242 (NeverType::unify): likewise
17243 (PlaceholderType::unify): likewise
17244 (ProjectionType::unify): likewise
17245 (DynamicObjectType::unify): likewise
17246 * typecheck/rust-tyty.h: update destructure interface
17247 * typecheck/rust-tyty-rules.h: Removed.
17248 * typecheck/rust-unify.cc: New file.
17249 * typecheck/rust-unify.h: New file.
17250
17251 2023-04-06 Philip Herron <[email protected]>
17252
17253 * typecheck/rust-hir-trait-reference.h: change interface to return self
17254 * typecheck/rust-hir-trait-resolve.cc: likewise
17255 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): likewise
17256 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove monomorphization hack
17257
17258 2023-04-06 Philip Herron <[email protected]>
17259
17260 * typecheck/rust-tyty-subst.cc: add missing callback
17261
17262 2023-04-06 Philip Herron <[email protected]>
17263
17264 * typecheck/rust-tyty-subst.cc: update copy constructors
17265
17266 2023-04-06 Philip Herron <[email protected]>
17267
17268 * typecheck/rust-tyty-bounds.cc: refactor to take a reference
17269 * typecheck/rust-tyty-subst.cc: likewise
17270 (SubstitutionRef::get_substitution_arguments): likewise
17271 (SubstitutionRef::infer_substitions): likewise
17272 * typecheck/rust-tyty-subst.h: likewise
17273 * typecheck/rust-tyty.cc (ADTType::handle_substitions): likewise
17274 (TupleType::handle_substitions): likewise
17275 (FnType::handle_substitions): likewise
17276 (ClosureType::handle_substitions): likewise
17277 (ArrayType::handle_substitions): likewise
17278 (SliceType::handle_substitions): likewise
17279 (ReferenceType::handle_substitions): likewise
17280 (PointerType::handle_substitions): likewise
17281 (ParamType::handle_substitions): likewise
17282 (ProjectionType::handle_substitions): likewise
17283 * typecheck/rust-tyty.h: likewise
17284
17285 2023-04-06 Philip Herron <[email protected]>
17286
17287 * typecheck/rust-hir-trait-ref.h: Moved to...
17288 * typecheck/rust-hir-trait-reference.h: ...here.
17289 * typecheck/rust-hir-trait-resolve.cc: refactor
17290 * typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRAIT_RESOLVE_H): likewise
17291 * typecheck/rust-hir-type-check.h: likewise
17292 * typecheck/rust-tyty.cc: likewise
17293
17294 2023-04-06 Philip Herron <[email protected]>
17295
17296 * Make-lang.in: update name
17297 * typecheck/rust-tyctx.cc: Moved to...
17298 * typecheck/rust-typecheck-context.cc: ...here.
17299
17300 2023-04-06 Philip Herron <[email protected]>
17301
17302 * typecheck/rust-hir-type-check.h: refactor
17303 * typecheck/rust-tyctx.cc (TypeCheckContext::iterate): refactor
17304 (TypeCheckContext::have_loop_context): likewise
17305 (TypeCheckContext::push_new_loop_context): likewise
17306 (TypeCheckContext::push_new_while_loop_context): likewise
17307 (TypeCheckContext::peek_loop_context): likewise
17308 (TypeCheckContext::pop_loop_context): likewise
17309 (TypeCheckContext::swap_head_loop_context): likewise
17310 (TypeCheckContext::insert_trait_reference): likewise
17311 (TypeCheckContext::lookup_trait_reference): likewise
17312 (TypeCheckContext::insert_receiver): likewise
17313 (TypeCheckContext::lookup_receiver): likewise
17314 (TypeCheckContext::insert_associated_type_mapping): likewise
17315 (TypeCheckContext::clear_associated_type_mapping): likewise
17316 (TypeCheckContext::lookup_associated_type_mapping): likewise
17317 (TypeCheckContext::insert_variant_definition): likewise
17318 (TypeCheckContext::lookup_variant_definition): likewise
17319 (TypeCheckContext::insert_operator_overload): likewise
17320 (TypeCheckContext::lookup_operator_overload): likewise
17321 (TypeCheckContext::insert_unconstrained_check_marker): likewise
17322 (TypeCheckContext::have_checked_for_unconstrained): likewise
17323 (TypeCheckContext::insert_resolved_predicate): likewise
17324 (TypeCheckContext::lookup_predicate): likewise
17325 (TypeCheckContext::insert_query): likewise
17326 (TypeCheckContext::query_completed): likewise
17327 (TypeCheckContext::query_in_progress): likewise
17328 (TypeCheckContext::insert_trait_query): likewise
17329 (TypeCheckContext::trait_query_completed): likewise
17330 (TypeCheckContext::trait_query_in_progress): likewise
17331 (TypeCheckContextItem::Item::Item): likewise
17332 (TypeCheckContextItem::TypeCheckContextItem): likewise
17333 (TypeCheckContextItem::get_item): likewise
17334 (TypeCheckContextItem::get_impl_item): likewise
17335 (TypeCheckContextItem::get_trait_item): likewise
17336 (TypeCheckContextItem::get_type): likewise
17337 * typecheck/rust-tyty.cc (StructFieldType::StructFieldType): likewise
17338 (StructFieldType::get_ref): likewise
17339 (StructFieldType::get_name): likewise
17340 (StructFieldType::get_field_type): likewise
17341 (StructFieldType::set_field_type): likewise
17342 (StructFieldType::is_concrete): likewise
17343 (StructFieldType::debug): likewise
17344 (StructFieldType::get_locus): likewise
17345 (VariantDef::variant_type_string): likewise
17346 (VariantDef::VariantDef): likewise
17347 (VariantDef::operator=): likewise
17348 (VariantDef::get_error_node): likewise
17349 (VariantDef::is_error): likewise
17350 (VariantDef::get_id): likewise
17351 (VariantDef::get_defid): likewise
17352 (VariantDef::get_variant_type): likewise
17353 (VariantDef::is_data_variant): likewise
17354 (VariantDef::is_dataless_variant): likewise
17355 (VariantDef::get_identifier): likewise
17356 (VariantDef::num_fields): likewise
17357 (VariantDef::get_field_at_index): likewise
17358 (VariantDef::get_fields): likewise
17359 (VariantDef::lookup_field): likewise
17360 (VariantDef::get_discriminant): likewise
17361 (VariantDef::as_string): likewise
17362 (VariantDef::is_equal): likewise
17363 (VariantDef::clone): likewise
17364 (VariantDef::monomorphized_clone): likewise
17365 (VariantDef::get_ident): likewise
17366 (TupleType::TupleType): likewise
17367 (TupleType::get_unit_type): likewise
17368 (TupleType::is_unit): likewise
17369 (TupleType::num_fields): likewise
17370 (TupleType::is_concrete): likewise
17371 (TupleType::get_fields): likewise
17372 (BoolType::BoolType): likewise
17373 (BoolType::get_name): likewise
17374 (BoolType::is_concrete): likewise
17375 (IntType::IntType): likewise
17376 (IntType::get_name): likewise
17377 (IntType::get_int_kind): likewise
17378 (IntType::is_concrete): likewise
17379 (UintType::UintType): likewise
17380 (UintType::get_name): likewise
17381 (UintType::get_uint_kind): likewise
17382 (UintType::is_concrete): likewise
17383 (FloatType::FloatType): likewise
17384 (FloatType::get_name): likewise
17385 (FloatType::get_float_kind): likewise
17386 (FloatType::is_concrete): likewise
17387 (USizeType::USizeType): likewise
17388 (USizeType::get_name): likewise
17389 (USizeType::is_concrete): likewise
17390 (ISizeType::ISizeType): likewise
17391 (ISizeType::get_name): likewise
17392 (ISizeType::is_concrete): likewise
17393 (CharType::CharType): likewise
17394 (CharType::is_concrete): likewise
17395 (CharType::get_name): likewise
17396 (ReferenceType::ReferenceType): likewise
17397 (ReferenceType::is_concrete): likewise
17398 (ReferenceType::mutability): likewise
17399 (ReferenceType::is_mutable): likewise
17400 (ReferenceType::is_dyn_object): likewise
17401 (ReferenceType::is_dyn_slice_type): likewise
17402 (ReferenceType::is_dyn_str_type): likewise
17403 (PointerType::PointerType): likewise
17404 (PointerType::is_concrete): likewise
17405 (PointerType::mutability): likewise
17406 (PointerType::is_mutable): likewise
17407 (PointerType::is_const): likewise
17408 (PointerType::is_dyn_object): likewise
17409 (PointerType::is_dyn_slice_type): likewise
17410 (PointerType::is_dyn_str_type): likewise
17411 (ParamType::ParamType): likewise
17412 (ParamType::get_generic_param): likewise
17413 (ParamType::can_resolve): likewise
17414 (ParamType::is_concrete): likewise
17415 (StrType::StrType): likewise
17416 (StrType::get_name): likewise
17417 (StrType::is_concrete): likewise
17418 (NeverType::NeverType): likewise
17419 (NeverType::get_name): likewise
17420 (NeverType::is_unit): likewise
17421 (NeverType::is_concrete): likewise
17422 (PlaceholderType::PlaceholderType): likewise
17423 (PlaceholderType::get_name): likewise
17424 (PlaceholderType::is_unit): likewise
17425 (PlaceholderType::get_symbol): likewise
17426 (PlaceholderType::is_concrete): likewise
17427 (ProjectionType::is_unit): likewise
17428 (ProjectionType::get_name): likewise
17429 (ProjectionType::needs_generic_substitutions): likewise
17430 (ProjectionType::supports_substitutions): likewise
17431 (ProjectionType::has_subsititions_defined): likewise
17432 (ProjectionType::get): likewise
17433 (ProjectionType::is_concrete): likewise
17434 (DynamicObjectType::is_concrete): likewise
17435 * typecheck/rust-tyty.h: likewise
17436
17437 2023-04-06 Philip Herron <[email protected]>
17438
17439 * typecheck/rust-hir-path-probe.cc (PathProbeCandidate::Candidate::Candidate): refactor
17440 (PathProbeCandidate::PathProbeCandidate): likewise
17441 (PathProbeCandidate::as_string): likewise
17442 (PathProbeCandidate::is_enum_candidate): likewise
17443 (PathProbeCandidate::is_impl_candidate): likewise
17444 (PathProbeCandidate::is_trait_candidate): likewise
17445 (PathProbeCandidate::is_full_trait_item_candidate): likewise
17446 (PathProbeCandidate::get_error): likewise
17447 (PathProbeCandidate::is_error): likewise
17448 (PathProbeCandidate::get_defid): likewise
17449 (PathProbeCandidate::operator<): likewise
17450 * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
17451
17452 2023-04-06 Philip Herron <[email protected]>
17453
17454 * typecheck/rust-hir-path-probe.cc (PathProbeType::PathProbeType): refactor
17455 (PathProbeType::Probe): likewise
17456 (PathProbeType::visit): likewise
17457 (PathProbeType::process_enum_item_for_candiates): likewise
17458 (PathProbeType::process_impl_items_for_candidates): likewise
17459 (PathProbeType::is_reciever_generic): likewise
17460 (PathProbeImplTrait::PathProbeImplTrait): likewise
17461 (PathProbeImplTrait::Probe): likewise
17462 (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
17463 * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
17464 * typecheck/rust-hir-trait-resolve.cc
17465 (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
17466
17467 2023-04-06 Philip Herron <[email protected]>
17468
17469 * typecheck/rust-tyty.cc (BaseType::BaseType): refactor
17470 (BaseType::~BaseType): likewise
17471 (BaseType::get_ref): likewise
17472 (BaseType::set_ref): likewise
17473 (BaseType::get_ty_ref): likewise
17474 (BaseType::set_ty_ref): likewise
17475 (BaseType::is_equal): likewise
17476 (BaseType::is_unit): likewise
17477 (BaseType::get_kind): likewise
17478 (BaseType::get_combined_refs): likewise
17479 (BaseType::append_reference): likewise
17480 (BaseType::supports_substitutions): likewise
17481 (BaseType::has_subsititions_defined): likewise
17482 (BaseType::can_substitute): likewise
17483 (BaseType::needs_generic_substitutions): likewise
17484 (BaseType::contains_type_parameters): likewise
17485 (BaseType::get_ident): likewise
17486 (BaseType::get_locus): likewise
17487 (InferType::InferType): likewise
17488 (InferType::get_infer_kind): likewise
17489 (InferType::get_name): likewise
17490 (InferType::is_concrete): likewise
17491 (ErrorType::ErrorType): likewise
17492 (ErrorType::is_unit): likewise
17493 (ErrorType::is_concrete): likewise
17494 (ErrorType::get_name): likewise
17495 (ErrorType::monomorphized_clone): likewise
17496 * typecheck/rust-tyty.h (class SubstitutionArgumentMappings): likewise
17497
17498 2023-04-06 Philip Herron <[email protected]>
17499
17500 * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): refactor
17501 (SubstMapper::Resolve): likewise
17502 (SubstMapper::InferSubst): likewise
17503 (SubstMapper::have_generic_args): likewise
17504 (SubstMapper::visit): likewise
17505 (SubstMapperInternal::visit): likewise
17506 (SubstMapperFromExisting::SubstMapperFromExisting): likewise
17507 (SubstMapperFromExisting::Resolve): likewise
17508 (SubstMapperFromExisting::visit): likewise
17509 (GetUsedSubstArgs::GetUsedSubstArgs): likewise
17510 (GetUsedSubstArgs::From): likewise
17511 (GetUsedSubstArgs::visit): likewise
17512 * typecheck/rust-substitution-mapper.h: refactor
17513 * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): likewise
17514
17515 2023-04-06 Philip Herron <[email protected]>
17516
17517 * Make-lang.in: update the makefile
17518 * typecheck/rust-tyty.cc (SubstitutionParamMapping::need_substitution): likewise
17519 (SubstitutionParamMapping::override_context): likewise
17520 (SubstitutionRef::get_mappings_from_generic_args): likewise
17521 (SubstitutionRef::infer_substitions): likewise
17522 (SubstitutionRef::are_mappings_bound): likewise
17523 (SubstitutionRef::solve_missing_mappings_from_this): likewise
17524 (SubstitutionRef::monomorphize): likewise
17525 * typecheck/rust-tyty.h (class SubstitutionParamMapping): likewise
17526 (class SubstitutionArg): likewise
17527 (std::function<void): likewise
17528 (class SubstitutionArgumentMappings): likewise
17529 (class SubstitutionRef): likewise
17530 * typecheck/rust-tyty-subst.cc: New file.
17531 * typecheck/rust-tyty-subst.h: New file.
17532
17533 2023-04-06 Philip Herron <[email protected]>
17534
17535 * Make-lang.in: update makefile
17536 * typecheck/rust-tyty.cc (TyVar::TyVar): move to new file
17537 (TyVar::get_tyty): likewise
17538 (TyVar::get_implicit_infer_var): likewise
17539 (TyVar::subst_covariant_var): likewise
17540 (TyVar::clone): likewise
17541 (TyVar::monomorphized_clone): likewise
17542 (TyWithLocation::TyWithLocation): likewise
17543 * typecheck/rust-tyty.h (class BaseType): cleanup
17544 (class TypeBoundPredicate): move to its own file
17545 (class TypeBoundPredicateItem): likewise
17546 (class TypeBoundsMappings): likewise
17547 (class TyVar): likewise
17548 (class TyWithLocation): likewise
17549 * typecheck/rust-tyty-bounds.h: New file.
17550 * typecheck/rust-tyty-util.cc: New file.
17551 * typecheck/rust-tyty-util.h: New file.
17552
17553 2023-04-06 Philip Herron <[email protected]>
17554
17555 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicateItem::error): refactor
17556 (TypeBoundPredicateItem::is_error): likewise
17557 (TypeBoundPredicateItem::get_parent): likewise
17558 * typecheck/rust-tyty.h: Move the implementation for the above
17559
17560 2023-04-06 Owen Avery <[email protected]>
17561
17562 * backend/rust-compile-expr.cc (CompileExpr::visit): Removed copy-pasted comment.
17563
17564 2023-04-06 mxlol233 <[email protected]>
17565
17566 * Make-lang.in: Add object files: `rust-feature.o` and `rust-feature-gate.o`
17567 * checks/errors/rust-feature-gate.cc: New file.
17568 * checks/errors/rust-feature-gate.h: New file.
17569 * checks/errors/rust-feature.cc: New file.
17570 * checks/errors/rust-feature.h: New file.
17571 * rust-session-manager.cc: Add FeatureGate check.
17572
17573 2023-04-06 Arthur Cohen <[email protected]>
17574
17575 * parse/rust-parse-impl.h (Parser::parse_closure_expr): Advance tokens
17576 properly when parsing closure param list.
17577
17578 2023-04-06 Arthur Cohen <[email protected]>
17579
17580 * parse/rust-parse-impl.h (Parser::parse_generic_arg): Handle type
17581 paths and nested generics properly.
17582
17583 2023-04-06 Owen Avery <[email protected]>
17584
17585 * ast/rust-pattern.h:
17586 (ReferencePattern::is_double_reference): Add method.
17587 (ReferencePattern::get_is_mut): Add method.
17588 * hir/rust-ast-lower-pattern.cc
17589 (ASTLoweringPattern::visit): Add ReferencePattern visitor.
17590 * hir/rust-ast-lower-pattern.h:
17591 (ASTLoweringPattern::visit): Add ReferencePattern visitor.
17592
17593 2023-04-06 Owen Avery <[email protected]>
17594
17595 * hir/tree/rust-hir-pattern.h
17596 (class ReferencePattern): Remove has_two_amps field.
17597 * hir/tree/rust-hir-full-test.cc
17598 (ReferencePattern::as_string): Remove usage of ReferencePattern::has_two_amps.
17599
17600 2023-04-06 Owen Avery <[email protected]>
17601
17602 * backend/rust-compile-fnparam.h
17603 (CompileFnParam::visit): Remove HIR::GroupedPattern visitor.
17604 * backend/rust-compile-pattern.cc
17605 (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
17606 (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
17607 * backend/rust-compile-pattern.h
17608 (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
17609 (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
17610 (CompilePatternLet::visit): Remove HIR::GroupedPattern visitor.
17611 * backend/rust-compile-resolve-path.h
17612 (ResolvePathRef::visit): Remove HIR::GroupedPattern visitor.
17613 * backend/rust-compile-var-decl.h
17614 (CompileVarDecl::visit): Remove HIR::GroupedPattern visitor.
17615 * checks/errors/rust-const-checker.cc
17616 (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
17617 * checks/errors/rust-const-checker.h
17618 (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
17619 * checks/errors/rust-unsafe-checker.cc
17620 (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
17621 * checks/errors/rust-unsafe-checker.h
17622 (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
17623 * hir/rust-hir-dump.cc (Dump::visit): Remove HIR::GroupedPattern visitor.
17624 * hir/rust-hir-dump.h (Dump::visit): Remove HIR::GroupedPattern visitor.
17625 * hir/tree/rust-hir-full-decls.h (class GroupedPattern): Remove class.
17626 * hir/tree/rust-hir-full-test.cc (GroupedPattern::accept_vis): Remove method.
17627 * hir/tree/rust-hir-pattern.h (class GroupedPattern): Remove class.
17628 * hir/tree/rust-hir-visitor.h
17629 (HIRFullVisitor::visit): Remove HIR::GroupedPattern visitor.
17630 (HIRFullVisitorBase::visit): Remove HIR::GroupedPattern visitor.
17631 (HIRPatternVisitor::visit): Remove HIR::GroupedPattern visitor.
17632 * typecheck/rust-hir-type-check-pattern.cc
17633 (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
17634 * typecheck/rust-hir-type-check-pattern.h
17635 (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
17636
17637 2023-04-06 Owen Avery <[email protected]>
17638
17639 * hir/rust-ast-lower-pattern.cc
17640 (ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern.
17641
17642 2023-04-06 MAHAD <[email protected]>
17643
17644 * rust-buffered-queue.h: Moved to...
17645 * util/rust-buffered-queue.h: ...here.
17646
17647 2023-04-06 Arthur Cohen <[email protected]>
17648
17649 * parse/rust-parse-impl.h (Parser::parse_type): Handle double ampersan
17650 properly
17651 (Parser::parse_reference_type): Call into `parse_reference_type_inner`
17652 and wrap double reference types in another `AST::ReferenceType` node
17653 (Parser::parse_reference_type_inner): Add parsing implementation
17654 which does not care about the leading token (& or &&)
17655 (Parser::parse_type_no_bounds): Handle double ampersand properly
17656 * parse/rust-parse.h: Declare `parse_reference_type_inner`
17657
17658 2023-04-06 Owen Avery <[email protected]>
17659
17660 * backend/rust-compile-pattern.cc (CompilePatternLet::visit): New function.
17661 * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
17662 * backend/rust-compile-pattern.h (class CompilePatternLet): New visitor.
17663
17664 2023-04-06 Arthur Cohen <[email protected]>
17665
17666 * ast/rust-macro.h (enum class): Add `BuiltinMacro` enum class.
17667 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Mention
17668 switching on `macro.kind` once builtin macro invocations are properly
17669 handled.
17670 * parse/rust-parse-impl.h (Parser::parse_macro_invocation): Switch to new MacroInvocation
17671 API.
17672 (Parser::parse_type): Likewise.
17673 (Parser::parse_type_no_bounds): Likewise.
17674
17675 2023-04-06 Abdul Rafey <[email protected]>
17676
17677 * ast/rust-ast-dump.cc (Dump::visit): removed extra indentations in trait ast dump
17678
17679 2023-04-06 Abdul Rafey <[email protected]>
17680
17681 * parse/rust-parse-impl.h (Parser::null_denotation): Add proper error
17682 when seeing wildcard var on right side of assignment.
17683
17684 2023-04-06 Abdul Rafey <[email protected]>
17685
17686 * ast/rust-ast.cc: Fix include list.
17687 * ast/rust-expr.h: Likewise.
17688 * hir/tree/rust-hir-expr.h: Likewise.
17689 * rust-backend.h: Likewise.
17690 * util/rust-lang-item.h: Likewise.
17691 * operator.h: Moved to...
17692 * util/rust-operators.h: ...here.
17693
17694 2023-04-06 Parthib <[email protected]>
17695
17696 * Make-lang.in: Rename object file.
17697 * ast/rust-ast-full-test.cc: Moved to...
17698 * ast/rust-ast.cc: ...here.
17699
17700 2023-04-06 Owen Avery <[email protected]>
17701
17702 * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Add proper
17703 visitor.
17704 (CompilePatternBindings::visit): Likewise.
17705 * backend/rust-compile-pattern.h: Declare them.
17706
17707 2023-04-06 Owen Avery <[email protected]>
17708
17709 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add proper
17710 visitor.
17711
17712 2023-04-06 Owen Avery <[email protected]>
17713
17714 * hir/tree/rust-hir-pattern.h: Add get_item method.
17715
17716 2023-04-06 Owen Avery <[email protected]>
17717
17718 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Add proper visitor.
17719 * hir/rust-ast-lower-pattern.h: Declare it.
17720
17721 2023-04-06 Lyra <[email protected]>
17722
17723 * expand/rust-macro-expand.cc (transcribe_expression): Fix ICE when expanding
17724 empty macros.
17725
17726 2023-04-06 Owen Avery <[email protected]>
17727
17728 * resolve/rust-ast-resolve-pattern.h: Support GroupedPattern properly.
17729
17730 2023-04-06 Owen Avery <[email protected]>
17731
17732 * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block):
17733 Allow patterns to declare zero or multiple variables.
17734 * backend/rust-compile-var-decl.h: Change function declaration.
17735
17736 2023-04-06 mxlol233 <[email protected]>
17737
17738 * lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token.
17739 (Lexer::parse_byte_char): Likewise.
17740 (Lexer::parse_byte_string): Likewise.
17741 (Lexer::parse_raw_byte_string): Likewise.
17742 (Lexer::parse_raw_identifier): Likewise.
17743 (Lexer::parse_string): Likewise.
17744 (Lexer::parse_identifier_or_keyword): Likewise.
17745 (Lexer::parse_raw_string): Likewise.
17746 (Lexer::parse_non_decimal_int_literal): Likewise.
17747 (Lexer::parse_decimal_int_or_float): Likewise.
17748 (Lexer::parse_char_or_lifetime): Likewise.
17749
17750 2023-04-06 mxlol233 <[email protected]>
17751
17752 * ast/rust-ast.h: Add get_locus method.
17753 * ast/rust-expr.h: Likewise.
17754 * ast/rust-macro.h: Likewise.
17755
17756 2023-04-06 Owen Avery <[email protected]>
17757
17758 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Cleanup LetStmt
17759 type checking.
17760
17761 2023-04-06 Philip Herron <[email protected]>
17762
17763 * hir/tree/rust-hir-path.h: Add const get_identifier and get_type method.
17764 * typecheck/rust-hir-path-probe.h: Use new SubstitutionArgumentMappings constructor.
17765 * typecheck/rust-hir-trait-resolve.cc: Likewise.
17766 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
17767 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
17768 Do not assert failure on size mismatch anymore.
17769 (TypeBoundPredicate::TypeBoundPredicate): Use new SubstitutionArgumentMappings constructor.
17770 (TypeBoundPredicate::operator=): Likewise.
17771 (TypeBoundPredicate::apply_generic_arguments): Likewise.
17772 (TypeBoundPredicateItem::get_tyty_for_receiver): Likewise.
17773 (TypeBoundPredicate::get_num_associated_bindings): Likewise.
17774 (TypeBoundPredicate::lookup_associated_type): Fix implementation for new system.
17775 (TypeBoundPredicate::get_associated_type_items): Likewise.
17776 * typecheck/rust-tyty.cc (SubstitutionRef::get_mappings_from_generic_args): Add new
17777 behavior.
17778 (SubstitutionRef::infer_substitions): Use new constructor and add comment.
17779 (SubstitutionRef::solve_missing_mappings_from_this): Use new constructor.
17780 * typecheck/rust-tyty.h: Define new constructors.
17781
17782 2023-04-06 Philip Herron <[email protected]>
17783
17784 * resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to
17785 Trait items.
17786
17787 2023-04-06 Raiki Tamura <[email protected]>
17788
17789 * ast/rust-ast-full-decls.h (class MacroItem): Remove forward declaration.
17790 * ast/rust-ast-full-test.cc (MacroRulesDefinition):
17791 Rework MacroRulesDefinition class
17792 * ast/rust-ast.h (class MacroItem): Remove abstract class.
17793 * ast/rust-item.h (class MacroItem): Remove forward declaration.
17794 * ast/rust-macro.h (class MacroItem): Likewise.
17795 (class MacroRulesDefinition): Add MacroKind enum.
17796 (class MacroInvocation): Fix inheritance.
17797 * lex/rust-token.h: Token "macro" is now used.
17798 * parse/rust-parse-impl.h (Parser::parse_item): Add handling for MACRO.
17799 (Parser::parse_vis_item): Call into parse_decl_macro_def.
17800 (Parser::parse_macro_item): Delete function.
17801 (Parser::parse_macro_rules_def): Return MBE macros only.
17802 (Parser::parse_decl_macro_def): New function.
17803 (Parser::parse_stmt): Handle MACRO token.
17804 (Parser::parse_stmt_or_expr_without_block): Call into parse_macro_rules_def.
17805 * parse/rust-parse.h: Declare new function.
17806
17807 2023-04-06 mxlol233 <[email protected]>
17808
17809 * parse/rust-parse-impl.h (Parser::parse_generic_arg): Add proper bound parsing.
17810
17811 2023-04-06 Dave <[email protected]>
17812
17813 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Use StackedContext
17814 class.
17815
17816 2023-04-06 Prajwal S N <[email protected]>
17817
17818 * checks/errors/rust-unsafe-checker.cc (check_target_attr): New function.
17819 (UnsafeChecker::check_function_attr): Call into `check_target_attr`.
17820 (UnsafeChecker::visit): Check for target_feature attributes.
17821 * checks/errors/rust-unsafe-checker.h: Add declarations.
17822 * util/rust-attributes.cc: Add attribute.
17823
17824 2023-04-06 Arthur Cohen <[email protected]>
17825
17826 * rust-session-manager.cc (Session::compile_crate): Fix typo.
17827
17828 2023-02-22 Thomas Schwinge <[email protected]>
17829
17830 * rust-lang.cc (grs_langhook_type_for_mode): Also consider all
17831 'int_n' modes/types.
17832
17833 2023-02-22 Thomas Schwinge <[email protected]>
17834
17835 * rust-lang.cc (grs_langhook_init): Do not initialize
17836 void_list_node.
17837
17838 2023-02-22 Thomas Schwinge <[email protected]>
17839
17840 * config-lang.in (target_libs): Remove.
17841
17842 2023-02-21 Raiki Tamura <[email protected]>
17843
17844 * backend/rust-builtins.cc (BuiltinsContext::setup_math_fns): New functions.
17845
17846 2023-02-21 Arthur Cohen <[email protected]>
17847
17848 * backend/rust-constexpr.cc (get_nth_callarg): Remove function.
17849 (rs_bind_parameters_in_call): Use CALL_EXPR_ARG instead.
17850 (potential_constant_expression_1): Likewise.
17851
17852 2023-02-21 Thomas Schwinge <[email protected]>
17853
17854 * lang.opt: Fix ordering of file.
17855
17856 2023-02-21 Philip Herron <[email protected]>
17857
17858 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Remove unused parameters.
17859 * backend/rust-constexpr.cc (constant_value_1): Likewise.
17860 (fold_non_dependent_init): Likewise.
17861 * backend/rust-tree.cc (publicly_uniquely_derived_p): Likewise.
17862 (instantiation_dependent_expression_p): Likewise.
17863 (type_has_nontrivial_copy_init): Likewise.
17864 (is_normal_capture_proxy): Likewise.
17865 (resolve_nondeduced_context): Likewise.
17866 (undeduced_auto_decl): Likewise.
17867 (require_deduced_type): Likewise.
17868 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
17869 * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
17870 * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
17871 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
17872 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
17873 * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
17874 * checks/lints/rust-lint-unused-var.cc (unused_var_walk_fn): Likewise.
17875 * expand/rust-macro-builtins.cc (try_expand_single_string_literal): Likewise.
17876 (try_expand_many_expr): Likewise.
17877 (parse_single_string_literal): Likewise.
17878 (MacroBuiltin::assert_handler): Likewise.
17879 (MacroBuiltin::file_handler): Likewise.
17880 (MacroBuiltin::column_handler): Likewise.
17881 (MacroBuiltin::concat_handler): Likewise.
17882 (MacroBuiltin::env_handler): Likewise.
17883 (MacroBuiltin::line_handler): Likewise.
17884 * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
17885 (ASTLoweringBase::handle_doc_item_attribute): Likewise.
17886 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
17887 * hir/tree/rust-hir-full-test.cc (ConstGenericParam::accept_vis): Likewise.
17888 * lex/rust-lex.cc (Lexer::parse_utf8_escape): Likewise.
17889 (Lexer::parse_string): Likewise.
17890 (Lexer::parse_char_or_lifetime): Likewise.
17891 * lex/rust-lex.h: Likewise.
17892 * metadata/rust-export-metadata.cc: Likewise.
17893 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
17894 * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
17895 (ResolveTypeToCanonicalPath::visit): Likewise.
17896 * resolve/rust-ast-verify-assignee.h: Likewise.
17897 * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
17898 * typecheck/rust-hir-type-check-expr.h: Likewise.
17899 * typecheck/rust-hir-type-check-item.h: Likewise.
17900 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
17901 * typecheck/rust-tyty-rules.h: Likewise.
17902 * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
17903
17904 2023-02-21 Philip Herron <[email protected]>
17905
17906 * hir/tree/rust-hir-expr.h: Add const `get_method_name`.
17907 * hir/tree/rust-hir-full-decls.h (struct GenericArgs): Move from `struct`...
17908 (class GenericArgs): ...to `class`.
17909 * hir/tree/rust-hir-path.h (struct GenericArgs): Likewise.
17910 (class GenericArgs): Clear `type_args` in copy constructor.
17911 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Reorder
17912 debug print.
17913 * typecheck/rust-tyty.h: Add default constructors for `SubstitutionArgumentMappings`.
17914
17915 2023-02-21 Philip Herron <[email protected]>
17916
17917 * backend/rust-compile-context.cc (Context::push_closure_context): New function.
17918 (Context::pop_closure_context): Likewise.
17919 (Context::insert_closure_binding): Likewise.
17920 (Context::lookup_closure_binding): Likewise.
17921 * backend/rust-compile-context.h: Declare new functions and closure mappings.
17922 * backend/rust-compile-expr.cc (CompileExpr::visit): Visit captures properly.
17923 (CompileExpr::generate_closure_function): Compile captures properly.
17924 * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Check for
17925 closure bindings.
17926 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Compile capture list's
17927 types as well.
17928
17929 2023-02-21 Philip Herron <[email protected]>
17930
17931 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Pass captures
17932 properly to `TyTy::ClosureType` constructor.
17933 * typecheck/rust-tyty.cc (ClosureType::as_string): Fix string representation.
17934 (ClosureType::clone): Pass `captures` argument.
17935 * typecheck/rust-tyty.h: Add `captures` field.
17936
17937 2023-02-21 Philip Herron <[email protected]>
17938
17939 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Use proper closure
17940 contexts.
17941 * resolve/rust-name-resolver.cc (Scope::lookup_decl_type): New function.
17942 (Scope::lookup_rib_for_decl): Likewise.
17943 (Resolver::insert_resolved_name): Insert captured items.
17944 (Resolver::push_closure_context): New function.
17945 (Resolver::pop_closure_context): Likewise.
17946 (Resolver::insert_captured_item): Likewise.
17947 (Resolver::decl_needs_capture): Likewise.
17948 (Resolver::get_captures): Likewise.
17949 * resolve/rust-name-resolver.h: Declare new functions.
17950
17951 2023-02-21 Philip Herron <[email protected]>
17952
17953 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add Rib argument.
17954 (ResolveExpr::resolve_closure_param): Likewise.
17955 * resolve/rust-ast-resolve-implitem.h: Likewise.
17956 * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
17957 (ResolveItem::visit): Likewise.
17958 * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
17959 * resolve/rust-ast-resolve-pattern.h: Likewise.
17960 * resolve/rust-ast-resolve-stmt.h: Likewise.
17961 * resolve/rust-ast-resolve-toplevel.h: Likewise.
17962 * resolve/rust-ast-resolve-type.h: Likewise.
17963 * resolve/rust-name-resolver.cc (Rib::lookup_decl_type): Likewise.
17964 (Scope::insert): Likewise.
17965 (Resolver::insert_builtin_types): Likewise.
17966 * resolve/rust-name-resolver.h: Likewise.
17967
17968 2023-02-21 Philip Herron <[email protected]>
17969
17970 * resolve/rust-name-resolver.cc (MKBUILTIN_TYPE): Remove macro.
17971 (Rib::Rib): Remove `mappings` field.
17972 (Resolver::generate_builtins): Use `setup_builtin` instead of macro.
17973 (Resolver::setup_builtin): New function.
17974 * resolve/rust-name-resolver.h: Declare `setup_builtin`, add FIXME
17975 comment.
17976
17977 2023-02-21 Raiki Tamura <[email protected]>
17978
17979 * lex/rust-lex.cc (Lexer::Lexer): Add `dump_lex` boolean flag.
17980 (Lexer::skip_token): Dump tokens if flag is enabled.
17981 (Lexer::dump_and_skip): New function.
17982 * lex/rust-lex.h: Include optional.h and declare functions.
17983 * parse/rust-parse-impl.h (Parser::debug_dump_lex_output): Remove old
17984 unused function.
17985 * parse/rust-parse.h: Likewise.
17986 * rust-session-manager.cc (Session::compile_crate): Pass lexer dump
17987 option to lexer.
17988 (Session::dump_lex): New function.
17989 * util/rust-optional.h: Add missing constructor.
17990
17991 2023-02-21 Dave <[email protected]>
17992
17993 * ast/rust-item.h: Remoe default location for Visibility class.
17994 * parse/rust-parse-impl.h (Parser::parse_visibility): Pass proper location
17995 when instantiating visibilities.
17996
17997 2023-02-21 Jakub Dupak <[email protected]>
17998
17999 * ast/rust-ast-dump.cc (Dump::visit): Fix dumping of fn params.
18000
18001 2023-02-21 Jakub Dupak <[email protected]>
18002
18003 * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous string when
18004 dumping statements.
18005
18006 2023-02-21 Jakub Dupak <[email protected]>
18007
18008 * ast/rust-ast-dump.cc: Remove unused include.
18009
18010 2023-02-21 Jakub Dupak <[email protected]>
18011
18012 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18013 * ast/rust-ast-dump.h: Likewise.
18014
18015 2023-02-21 Jakub Dupak <[email protected]>
18016
18017 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18018
18019 2023-02-21 Jakub Dupak <[email protected]>
18020
18021 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18022
18023 2023-02-21 Jakub Dupak <[email protected]>
18024
18025 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18026
18027 2023-02-21 Jakub Dupak <[email protected]>
18028
18029 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18030
18031 2023-02-21 Jakub Dupak <[email protected]>
18032
18033 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18034
18035 2023-02-21 Jakub Dupak <[email protected]>
18036
18037 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18038
18039 2023-02-21 Jakub Dupak <[email protected]>
18040
18041 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18042 * ast/rust-ast-dump.h: Add missing getter declaration.
18043 * ast/rust-ast-full-test.cc (BareFunctionType::as_string): Fix bare function
18044 string representation.
18045 * ast/rust-type.h (class BareFunctionType): Declare said getter.
18046
18047 2023-02-21 Jakub Dupak <[email protected]>
18048
18049 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
18050
18051 2023-02-21 Jakub Dupak <[email protected]>
18052
18053 * ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor.
18054
18055 2023-02-21 Jakub Dupak <[email protected]>
18056
18057 * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor.
18058
18059 2023-02-21 Jakub Dupak <[email protected]>
18060
18061 * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor.
18062
18063 2023-02-21 Jakub Dupak <[email protected]>
18064
18065 * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor
18066
18067 2023-02-21 Jakub Dupak <[email protected]>
18068
18069 * ast/rust-ast-dump.cc (Dump::visit): Add missing slice visitor.
18070
18071 2023-02-21 Jakub Dupak <[email protected]>
18072
18073 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors.
18074 * ast/rust-ast-dump.h: Likewise.
18075 * ast/rust-ast.h: Add `get_lifetime_bounds` method.
18076 * ast/rust-item.h: Add missing getter for lifetimes.
18077 * ast/rust-type.h: Likewise.
18078
18079 2023-02-21 Jakub Dupak <[email protected]>
18080
18081 * ast/rust-ast-dump.cc (Dump::visit): Add new reference visitor wrapper.
18082 * ast/rust-ast-dump.h: Declare it.
18083 * ast/rust-item.h: Add mutable visibility getters.
18084
18085 2023-02-21 Arthur Cohen <[email protected]>
18086
18087 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call
18088 to `delete`.
18089
18090 2023-02-21 Dave <[email protected]>
18091
18092 * ast/rust-item.h: Add location member.
18093 * hir/rust-ast-lower.cc (translate_visibility): Pass location argument.
18094 * hir/tree/rust-hir-item.h: Fix constructor to accept Location argument.
18095
18096 2023-02-21 Raiki Tamura <[email protected]>
18097
18098 * util/rust-lang-item.h: Add handling for `phantom_data` lang item.
18099
18100 2023-02-21 Jakub Dupak <[email protected]>
18101
18102 * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures.
18103
18104 2023-02-21 Jakub Dupak <[email protected]>
18105
18106 * ast/rust-ast-dump.h: Fix documentation.
18107
18108 2023-02-21 Jakub Dupak <[email protected]>
18109
18110 * ast/rust-ast-dump.cc (Dump::go): Use new API.
18111 (Dump::format_function_param): Refactor.
18112 (Dump::visit_items_joined_by_separator): New function.
18113 (Dump::emit_attrib): Refactor.
18114 (Dump::visit_as_line): New function.
18115 (Dump::visit_items_as_lines): Likewise.
18116 (Dump::visit_items_as_block): Likewise.
18117 (Dump::visit): Use new API.
18118 (Dump::emit_visibility): Likewise.
18119 (Dump::emit_indented_string): Likewise.
18120 (Dump::emit_generic_params): Likewise.
18121 (Dump::format_tuple_field): Likewise.
18122 (Dump::format_struct_field): Likewise.
18123 (Dump::format_function_common): Likewise.
18124 (Dump::visit_function_common): Likewise.
18125 * ast/rust-ast-dump.h: Declare new functions and add documentation.
18126
18127 2023-02-21 Jakub Dupak <[email protected]>
18128
18129 * ast/rust-ast-dump.cc (Dump::visit): Add new visit function for overloading.
18130 * ast/rust-ast-dump.h: Add documentation for layer.
18131
18132 2023-02-21 Arthur Cohen <[email protected]>
18133
18134 * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): Declare atomic
18135 load intrinsics.
18136 * backend/rust-compile-intrinsic.cc (atomic_load_handler_inner): New handler.
18137 (atomic_load_handler): Likewise.
18138 (unchecked_op_handler): Remove `static` function qualifier.
18139 (build_atomic_builtin_name): Handle load intrinsics.
18140 (atomic_store_handler_inner): New handler.
18141
18142 2023-02-21 Arthur Cohen <[email protected]>
18143
18144 * backend/rust-compile-intrinsic.cc (check_for_basic_integer_type): New function.
18145 (build_atomic_builtin_name): Use HIR Type instead of `tree`.
18146 (atomic_store_handler_inner): Cleanup error handling.
18147 (unchecked_op_inner): Likewise.
18148
18149 2023-02-21 Arthur Cohen <[email protected]>
18150
18151 * backend/rust-compile-intrinsic.cc (wrapping_op_handler): Refactor to return
18152 an `std::function`.
18153 (wrapping_op_handler_inner): Rename.
18154 (wrapping_add_handler): Remove function.
18155 (wrapping_sub_handler): Likewise.
18156 (wrapping_mul_handler): Likewise.
18157
18158 2023-02-21 Arthur Cohen <[email protected]>
18159
18160 * backend/rust-compile-intrinsic.cc (is_basic_integer_type): New function.
18161 (unchecked_op_inner): New handler.
18162 (unchecked_op_handler): New handler.
18163
18164 2023-02-21 Arthur Cohen <[email protected]>
18165
18166 * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): New function.
18167 (BuiltinsContext::setup): Call `setup_atomic_fns`.
18168 * backend/rust-builtins.h: Declare `setup_atomic_fns`.
18169 * backend/rust-compile-intrinsic.cc (atomic_store_handler_inner): New function.
18170 (atomic_store_handler): New handler.
18171 (make_unsigned_long_tree): Add helper around making unsigned long trees.
18172 (prefetch_data_handler): Use `make_unsigned_long_tree`.
18173 (build_atomic_builtin_name): New function.
18174
18175 2023-02-21 Arthur Cohen <[email protected]>
18176
18177 * backend/rust-constexpr.cc (build_anon_member_initialization): Workaround uninitialized
18178 values.
18179 (build_data_member_initialization): Likewise.
18180
18181 2023-02-21 Arthur Cohen <[email protected]>
18182
18183 * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler.
18184
18185 2023-02-21 Arthur Cohen <[email protected]>
18186
18187 * expand/rust-macro-builtins.cc (MacroBuiltin::assert): Rename to...
18188 (MacroBuiltin::assert_handler): ..this.
18189 (MacroBuiltin::file): Rename to...
18190 (MacroBuiltin::file_handler): ..this.
18191 (MacroBuiltin::column): Rename to...
18192 (MacroBuiltin::column_handler): ..this.
18193 (MacroBuiltin::include_bytes): Rename to...
18194 (MacroBuiltin::include_bytes_handler): ..this.
18195 (MacroBuiltin::include_str): Rename to...
18196 (MacroBuiltin::include_str_handler): ..this.
18197 (MacroBuiltin::compile_error): Rename to...
18198 (MacroBuiltin::compile_error_handler): ..this.
18199 (MacroBuiltin::concat): Rename to...
18200 (MacroBuiltin::concat_handler): ..this.
18201 (MacroBuiltin::env): Rename to...
18202 (MacroBuiltin::env_handler): ..this.
18203 (MacroBuiltin::cfg): Rename to...
18204 (MacroBuiltin::cfg_handler): ..this.
18205 (MacroBuiltin::include): Rename to...
18206 (MacroBuiltin::include_handler): ..this.
18207 (MacroBuiltin::line): Rename to...
18208 (MacroBuiltin::line_handler): ..this.
18209 * expand/rust-macro-builtins.h: Rename all handlers.
18210 * util/rust-hir-map.cc (Mappings::insert_macro_def): Use new handler
18211 names.
18212
18213 2023-02-21 Simon Cook <[email protected]>
18214
18215 * util/rust-inline-visitor.h: Remove some offending system includes.
18216
18217 2023-02-21 YizhePKU <[email protected]>
18218
18219 * util/rust-inline-visitor.h: New file.
18220
18221 2023-02-21 Philip Herron <[email protected]>
18222
18223 * backend/rust-compile-expr.cc (CompileExpr::visit): Refactor checking of closures.
18224 (CompileExpr::generate_possible_fn_trait_call): New function.
18225 * backend/rust-compile-expr.h: Declare `generate_possible_fn_trait_call`.
18226
18227 2023-02-21 Philip Herron <[email protected]>
18228
18229 * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Add missing
18230 implementation.
18231
18232 2023-02-21 Philip Herron <[email protected]>
18233
18234 * Make-lang.in: Compile rust-ast-lower-type.cc.
18235 * ast/rust-path.h: Add `get_locus` method to `TypePathFunction`.
18236 * hir/rust-ast-lower-base.cc (ASTLowerTypePath::visit): Move implementation to
18237 rust-ast-lower-type.cc.
18238 (ASTLowerQualifiedPathInType::visit): Likewise.
18239 (ASTLoweringType::visit): Likewise.
18240 * hir/rust-ast-lower-type.h: Move implementations to source file.
18241 * hir/tree/rust-hir-path.h: Likewise.
18242 * hir/rust-ast-lower-type.cc: New file.
18243
18244 2023-02-21 Philip Herron <[email protected]>
18245
18246 * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of
18247 function case.
18248
18249 2023-02-21 Philip Herron <[email protected]>
18250
18251 * backend/rust-compile-context.h: Add new functions: `insert_closure_decl` and
18252 `lookup_closure_decl`.
18253 * backend/rust-compile-expr.cc (CompileExpr::visit): Start compiling Closures properly.
18254 (CompileExpr::generate_closure_function): New function.
18255 (CompileExpr::generate_closure_fntype): Likewise.
18256 * backend/rust-compile-expr.h: Declare `generate_closure_function` and
18257 `generate_closure_fntype`.
18258 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Visit closure types properly.
18259 * backend/rust-mangle.cc (legacy_mangle_name): Add support for closures.
18260 * backend/rust-tree.h (RS_CLOSURE_FLAG): Add new tree macro.
18261 (RS_CLOSURE_TYPE_P): And checking for it on tree nodes.
18262 * typecheck/rust-tyty.cc (ClosureType::is_equal): Add implementation.
18263
18264 2023-02-21 Philip Herron <[email protected]>
18265
18266 * hir/tree/rust-hir-expr.h: Add `get_params` method.
18267 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Typecheck closure nodes.
18268 (TypeCheckExpr::resolve_fn_trait_call): New function.
18269 * typecheck/rust-hir-type-check-expr.h: Declare `resolve_fn_trait_call` and
18270 `resolve_possible_fn_trait_call_method_name`.
18271 * typecheck/rust-hir-type-check.h: Declare `get_context_type`.
18272 * typecheck/rust-tyctx.cc (TypeCheckContextItem::get_context_type): New function.
18273 * typecheck/rust-tyty-cmp.h: Visit closures properly.
18274 * typecheck/rust-tyty-rules.h: Likewise.
18275 * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Add commented out assertin.
18276 (ClosureType::as_string): Implement it.
18277 (ClosureType::clone): Fix closure cloning.
18278 (ClosureType::setup_fn_once_output): New function.
18279 * typecheck/rust-tyty.h: Improve `ClosureType` class and declare `setup_fn_once_output`.
18280
18281 2023-02-21 Philip Herron <[email protected]>
18282
18283 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Visit closures properly.
18284 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
18285 * checks/lints/rust-lint-marklive.h: Likewise.
18286
18287 2023-02-21 Philip Herron <[email protected]>
18288
18289 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Simplify method
18290 call type checking by removing visitor and instead using one static cast. Use the
18291 new interface.
18292 * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
18293 (TypeCheckMethodCallExpr::go): Likewise.
18294 (TypeCheckMethodCallExpr::check): Likewise.
18295 * typecheck/rust-tyty-call.h (class TypeCheckMethodCallExpr): Likewise.
18296 (class Argument): Likewise.
18297
18298 2023-02-21 Philip Herron <[email protected]>
18299
18300 * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Visit closure properly when
18301 name resolving.
18302 (ResolveExpr::resolve_closure_param): Implement closure name resolving.
18303 * resolve/rust-ast-resolve-expr.h: Declare visitors for closure types.
18304
18305 2023-02-21 Philip Herron <[email protected]>
18306
18307 * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::ASTLoweringPattern):
18308 Improve formatting.
18309 (ASTLoweringPattern::translate): Likewise.
18310 * hir/rust-ast-lower-pattern.h: Likewise.
18311 * resolve/rust-ast-resolve-expr.h: Likewise.
18312
18313 2023-02-21 Philip Herron <[email protected]>
18314
18315 * Make-lang.in: Add new object file for expression lowering.
18316 * ast/rust-expr.h: Move implementation of expr lowering to source file.
18317 * backend/rust-compile-block.h: Likewise.
18318 * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
18319 * backend/rust-compile-expr.h: Likewise.
18320 * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
18321 * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
18322 * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
18323 * checks/errors/rust-const-checker.h: Likewise.
18324 * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
18325 * checks/errors/rust-unsafe-checker.h: Likewise.
18326 * hir/rust-ast-lower-base.h: Likewise.
18327 * hir/rust-ast-lower-expr.h (RUST_AST_LOWER_EXPR): Likewise.
18328 * hir/rust-ast-lower.cc (ASTLoweringBase::lower_closure_param): Likewise.
18329 * hir/rust-hir-dump.cc (Dump::visit): Likewise.
18330 * hir/rust-hir-dump.h: Likewise.
18331 * hir/tree/rust-hir-expr.h (class ClosureExpr): Likewise.
18332 (class ClosureExprInner): Likewise.
18333 (class ClosureExprInnerTyped): Likewise.
18334 * hir/tree/rust-hir-full-decls.h (class ClosureExprInner): Likewise.
18335 (class ClosureExprInnerTyped): Likewise.
18336 * hir/tree/rust-hir-full-test.cc (ClosureExprInnerTyped::as_string): Likewise.
18337 (ClosureExprInner::as_string): Likewise.
18338 (ClosureExprInner::accept_vis): Likewise.
18339 (ClosureExpr::accept_vis): Likewise.
18340 (ClosureExprInnerTyped::accept_vis): Likewise.
18341 * hir/tree/rust-hir-visitor.h: Likewise.
18342 * hir/tree/rust-hir.h (class Expr): Likewise.
18343 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
18344 * typecheck/rust-hir-type-check-expr.h: Likewise.
18345 * hir/rust-ast-lower-expr.cc: New file.
18346
18347 2023-02-21 Philip Herron <[email protected]>
18348
18349 * util/rust-lang-item.h: Add handling for `fn_once_output`.
18350
18351 2023-02-21 Arthur Cohen <[email protected]>
18352
18353 * ast/rust-ast-fragment.cc (Fragment::Fragment): Add better APIs.
18354 (Fragment::complete): New function.
18355 (Fragment::unexpanded): New function.
18356 * ast/rust-ast-fragment.h: Declare new APIs and add documentation.
18357 * expand/rust-attribute-visitor.h: Use new Fragment API.
18358 * expand/rust-macro-builtins.cc (MacroBuiltin::file): Likewise.
18359 (MacroBuiltin::column): Likewise.
18360 (MacroBuiltin::include_bytes): Likewise.
18361 (MacroBuiltin::include_str): Likewise.
18362 (MacroBuiltin::concat): Likewise.
18363 (MacroBuiltin::env): Likewise.
18364 (MacroBuiltin::cfg): Likewise.
18365 (MacroBuiltin::include): Likewise.
18366 (MacroBuiltin::line): Likewise.
18367 * expand/rust-macro-expand.cc (parse_many): Likewise.
18368 (transcribe_expression): Likewise.
18369 (transcribe_type): Likewise.
18370 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
18371
18372 2023-02-21 Arthur Cohen <[email protected]>
18373
18374 * ast/rust-ast.h (class ASTFragment): Remove old ASTFragment class.
18375 * ast/rust-macro.h (class MacroRulesDefinition): Use new Fragment API.
18376 * expand/rust-attribute-visitor.h: Likewise.
18377 * expand/rust-macro-builtins.cc (macro_end_token): Likewise.
18378 (MacroBuiltin::assert): Likewise.
18379 (MacroBuiltin::file): Likewise.
18380 (MacroBuiltin::column): Likewise.
18381 (MacroBuiltin::include_bytes): Likewise.
18382 (MacroBuiltin::include_str): Likewise.
18383 (MacroBuiltin::compile_error): Likewise.
18384 (MacroBuiltin::concat): Likewise.
18385 (MacroBuiltin::env): Likewise.
18386 (MacroBuiltin::cfg): Likewise.
18387 (MacroBuiltin::include): Likewise.
18388 (MacroBuiltin::line): Likewise.
18389 * expand/rust-macro-builtins.h: Likewise.
18390 * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
18391 (MacroExpander::expand_invoc): Likewise.
18392 (MacroExpander::match_repetition): Likewise.
18393 (parse_many): Likewise.
18394 (transcribe_many_items): Likewise.
18395 (transcribe_many_ext): Likewise.
18396 (transcribe_many_trait_items): Likewise.
18397 (transcribe_many_impl_items): Likewise.
18398 (transcribe_many_trait_impl_items): Likewise.
18399 (transcribe_expression): Likewise.
18400 (transcribe_type): Likewise.
18401 (transcribe_on_delimiter): Likewise.
18402 (tokens_to_str): Likewise.
18403 * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
18404 * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
18405
18406 2023-02-21 Arthur Cohen <[email protected]>
18407
18408 * Make-lang.in: Add `rust-ast-fragment.o` object file.
18409 * ast/rust-ast-fragment.cc: New file.
18410 * ast/rust-ast-fragment.h: New file.
18411
18412 2023-02-21 Philip Herron <[email protected]>
18413
18414 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): Check if a
18415 trait query is currently in progress.
18416 * typecheck/rust-hir-type-check.h (class TraitQueryGuard): Add helpers around
18417 checking for trait queries and inserting them.
18418
18419 2023-02-21 Arthur Cohen <[email protected]>
18420
18421 * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors for macro definition dumping.
18422 (get_delimiters): New function.
18423 * ast/rust-ast-dump.h: Declare `get_delimiters` and add documentation.
18424 * ast/rust-macro.h: Add `get_token_tree` method.
18425
18426 2023-02-21 Jakub Dupak <[email protected]>
18427
18428 * ast/rust-ast-dump.cc (Dump::visit): Properly handle unloaded modules.
18429
18430 2023-02-21 Arthur Cohen <[email protected]>
18431
18432 * ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules.
18433
18434 2023-02-21 Arthur Cohen <[email protected]>
18435
18436 * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly.
18437
18438 2023-02-21 Arthur Cohen <[email protected]>
18439
18440 * ast/rust-ast-dump.cc: Emit visibility when dumping items.
18441
18442 2023-02-21 Philip Herron <[email protected]>
18443
18444 * hir/rust-ast-lower-base.h (class ItemWrapper): New class.
18445 * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Use
18446 `ItemWrapper` class.
18447 (ASTLoweringBase::handle_doc_item_attribute): Likewise.
18448 (ASTLoweringBase::handle_lang_item_attribute): Likewise.
18449 * hir/rust-ast-lower-implitem.h: Check outer attributes on items.
18450 * hir/tree/rust-hir-item.h: Add `get_trait_locus` methods.
18451 * hir/tree/rust-hir.h: Likewise.
18452 * util/rust-hir-map.h: Add defId mappings and associated functions.
18453 * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Implement insertion to said
18454 mappings.
18455 (Mappings::lookup_trait_item_defid): And looking up said mappings.
18456
18457 2023-02-21 Jakub Dupak <[email protected]>
18458
18459 * ast/rust-ast-dump.cc (Dump::visit): Add code for dumping type aliases.
18460
18461 2023-02-21 Philip Herron <[email protected]>
18462
18463 * typecheck/rust-hir-trait-resolve.cc (TraitResolver::TraitResolver): Do not nullptr init
18464 `resolved_trait_reference` anymore.
18465 (TraitResolver::resolve_path): Simplify function and rename to...
18466 (TraitResolver::resolve_path_to_trait): ...this.
18467 (TraitResolver::lookup_path): Use new interface.
18468 * typecheck/rust-hir-trait-resolve.h (class TraitResolver): Do not inherit `HIRFullVisitor`
18469 class anymore.
18470
18471 2023-02-21 David Faust <[email protected]>
18472
18473 * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs.
18474
18475 2023-02-21 David Faust <[email protected]>
18476
18477 * ast/rust-ast-dump.cc (Dump::visit): Add dump for, BorrowExpr, DereferenceExpr,
18478 ErrorPropagationExpr, NegationExpr, TypeCastExpr and GroupedExpr.
18479
18480 2023-02-21 David Faust <[email protected]>
18481
18482 * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr.
18483
18484 2023-02-21 David Faust <[email protected]>
18485
18486 * ast/rust-ast-dump.cc (Dump::visit): Add dumps for ComparisonExpr and
18487 LazyBooleanExpr.
18488
18489 2023-02-21 David Faust <[email protected]>
18490
18491 * ast/rust-ast-dump.cc (Dump::visit): Fix IfExpr formatting.
18492
18493 2023-02-21 David Faust <[email protected]>
18494
18495 * ast/rust-ast-dump.cc (Dump::visit): Fix block formatting.
18496
18497 2023-02-21 Philip Herron <[email protected]>
18498
18499 * typecheck/rust-autoderef.cc: Add support for multiple resolution candidates.
18500 * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver): Edit
18501 `try_result` field and change constructor.
18502 (MethodResolver::Probe): Return set of candidates instead of singular candidate.
18503 (MethodResolver::select): Add better implementation to account for multiple
18504 candidates.
18505 * typecheck/rust-hir-dot-operator.h (struct MethodCandidate): Overload comparison
18506 operator in order to store them in `std::set`.
18507 * typecheck/rust-hir-inherent-impl-overlap.h: Do not fail assertion on missing type.
18508 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adapt code to use
18509 multiple candidates.
18510 * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): Add code to handle automatic
18511 derefs properly.
18512 (reset_cmp_autoderef_mode): Add helper function to reset said mode.
18513 * typecheck/rust-tyty.h (set_cmp_autoderef_mode): Declare function.
18514 (reset_cmp_autoderef_mode): Likewise.
18515 * typecheck/rust-tyty-cmp.h: Add handling of `autoderef_cmp_flag`
18516
18517 2023-02-21 Philip Herron <[email protected]>
18518
18519 * util/rust-abi.cc (get_abi_from_string): Add missing "rust-call"
18520 possibility for ABI variant.
18521
18522 2023-02-21 Philip Herron <[email protected]>
18523
18524 * util/rust-lang-item.h: Add `fn_once` lang item.
18525
18526 2023-02-21 Philip Herron <[email protected]>
18527
18528 * backend/rust-compile.cc: Add note about missing support for super
18529 traits.
18530 * typecheck/rust-tyty.cc (BaseType::satisfies_bound): New function.
18531 (BaseType::bounds_compatible): New function.
18532 (DynamicObjectType::get_object_items): New function.
18533 * typecheck/rust-hir-trait-ref.h: Use new API to perform type resolution
18534 on dyn objects.
18535
18536 2023-02-21 Arthur Cohen <[email protected]>
18537
18538 * Make-lang.in: Compile early name resolver.
18539 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Move macro
18540 name resolution.
18541 * expand/rust-macro-builtins.cc (try_expand_macro_expression): Run ENR
18542 when recursively expanding macros.
18543 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): No longer
18544 perform name resolution in `expand_invoc`.
18545 * expand/rust-macro-expand.h (struct MacroExpander): Keep ENR within
18546 MacroExpander.
18547 * rust-session-manager.cc (Session::expansion): Run ENR.
18548 * resolve/rust-early-name-resolver.cc: New file.
18549 * resolve/rust-early-name-resolver.h: New file.
18550
18551 2023-02-21 Arthur Cohen <[email protected]>
18552
18553 * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class.
18554
18555 2023-02-21 Arthur Cohen <[email protected]>
18556
18557 * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for
18558 glob import resolving.
18559
18560 2023-02-21 Arthur Cohen <[email protected]>
18561
18562 * util/rust-hir-map.h: Add new mappings.
18563 * util/rust-hir-map.cc (Mappings::insert_macro_invocation): Add insertion
18564 function into mappings.
18565 (Mappings::lookup_macro_invocation): Add lookup function for mappings.
18566
18567 2023-02-21 Marc Poulhiès <[email protected]>
18568
18569 * parse/rust-parse-impl.h (Parser::parse_stmt_or_expr_without_block):
18570 Check if `expr` is valid after parsing it.
18571
18572 2023-02-21 Arthur Cohen <[email protected]>
18573
18574 * backend/rust-builtins.cc (BuiltinsContext::setup): Declare prefetch
18575 intrinsics.
18576 * backend/rust-compile-intrinsic.cc (enum class Prefetch): Add kinds of
18577 prefetch intrinsics.
18578 (prefetch_data_handler): New function.
18579 (prefetch_read_data): Likewise.
18580 (prefetch_write_data): Likewise.
18581
18582 2023-02-21 David Faust <[email protected]>
18583
18584 * ast/rust-ast-dump.cc (Dump::visit): Fill empty functions for
18585 structs, enums and unions.
18586
18587 2023-02-21 David Faust <[email protected]>
18588
18589 * ast/rust-ast-dump.cc (Dump::format_tuple_field): New.
18590 (Dump::format_struct_field): New.
18591 * ast/rust-ast-dump.h (format_tuple_field): New.
18592 (format_struct_field): New.
18593
18594 2023-02-21 David Faust <[email protected]>
18595
18596 * ast/rust-ast-dump.cc (Dump::visit): move generic params dump ...
18597 (Dump::emit_generic_params): ... here.
18598 * ast/rust-ast-dump.h (emit_generic_params): New.
18599
18600 2023-02-21 Philip Herron <[email protected]>
18601
18602 * typecheck/rust-hir-trait-ref.h (lookup_trait_item): Add lookup
18603 in super_trait.
18604
18605 2023-02-21 Philip Herron <[email protected]>
18606
18607 * backend/rust-compile-expr.cc
18608 (CompileExpr::resolve_method_address): Use auto and minor change
18609 in candidate init.
18610 * typecheck/rust-hir-type-check-path.cc
18611 (TypeCheckExpr::resolve_segments): Likewise.
18612 * typecheck/rust-hir-type-check-type.cc: Likewise.
18613 * backend/rust-compile-resolve-path.cc
18614 (HIRCompileBase::query_compile): Likewise. Removecall to
18615 set_ty_ref.
18616 * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): Add
18617 locus initializer in ctor, implement get_defid.
18618 (class PathProbeType::Probe): return a set instead of vector.
18619 Adjust class impl.
18620 (class ReportMultipleCandidateError): Do not inherit from
18621 HIRImplVisitor anymore and remove corresponding impl. Adjust for
18622 change in Probe. Simplify Report handling.
18623 (class PathProbeImplTrait::Probe): Adjust return type.
18624
18625 2023-02-21 Philip Herron <[email protected]>
18626
18627 * typecheck/rust-hir-type-check-enumitem.cc
18628 (TypeCheckEnumItem::visit): Adjust VariantDef ctor calls with
18629 DefID.
18630 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
18631 Likewise.
18632 * typecheck/rust-tyty.h (VariantDef): Add defid parameter to ctor.
18633
18634 2023-02-21 Arthur Cohen <[email protected]>
18635
18636 * Make-lang.in: Add `rust-builtins.o` as target
18637 * backend/rust-builtins.h: Refactor to new file.
18638 * backend/rust-builtins.cc: New file.
18639
18640 2023-02-21 David Faust <[email protected]>
18641
18642 * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for If
18643 expressions.
18644
18645 2023-02-21 David Faust <[email protected]>
18646
18647 * ast/rust-ast-dump.cc (Dump::visit): Dump assignment and compound
18648 assignment expressions.
18649
18650 2023-02-21 Philip Herron <[email protected]>
18651
18652 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type):
18653 Check for recursive queries.
18654 * typecheck/rust-hir-type-check.h: New functions: `query_completed`,
18655 `query_in_progress`, `insert_query`.
18656 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Use `query_type` API.
18657
18658 2023-02-21 Arthur Cohen <[email protected]>
18659
18660 * ast/rust-ast-dump.cc (Dump::emit_visibility): New function.
18661 (Dump::visit): Call into `emit_visibility`.
18662 (Dump::format_function_common): Likewise.
18663 * ast/rust-ast-dump.h: Declare `emit_visibility`.
18664
18665 2023-02-21 Arthur Cohen <[email protected]>
18666
18667 * ast/rust-item.h: Rename get_public_vis_type.
18668 * hir/rust-ast-lower.cc (translate_visibility): Use new name.
18669
18670 2023-02-21 Philip Herron <[email protected]>
18671
18672 * resolve/rust-name-resolver.h: Add miscellenaous item mappings.
18673 * resolve/rust-name-resolver.cc (Resolver::insert_resolved_misc): Use
18674 new mappings.
18675 (Resolver::lookup_resolved_misc): Likewise.
18676 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
18677 Adapt function to insert into miscelleanous mappings.
18678 * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
18679 Allow lookup in miscelleanous mappings in mark-live phase.
18680
18681 2023-02-20 Rainer Orth <[email protected]>
18682
18683 * backend/rust-tree.cc: Include memmodel.h.
18684
18685 2023-02-17 Thomas Schwinge <[email protected]>
18686
18687 * backend/rust-tree.cc: '#include "tm_p.h"'.
18688
18689 2023-01-31 Philip Herron <[email protected]>
18690
18691 * Make-lang.in: Remove `rust-hir-typecheck-toplevel` object and add
18692 `rust-hir-path-probe` one.
18693 * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver):
18694 Remove no longer used `context` and `mapping` fields, and use new
18695 `query_type` API.
18696 (MethodResolver::MethodResolver): Likewise.
18697 (MethodResolver::select): Use new `query_type` API.
18698 * typecheck/rust-hir-path-probe.h: New header.
18699 * typecheck/rust-hir-path-probe.cc: New file.
18700 * typecheck/rust-hir-dot-operator.h (class MethodResolver): Remove no
18701 longer used `context` and `mapping` fields, and use new `query_type` API.
18702 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): New function.
18703 * typecheck/rust-hir-type-check-base.h: Declare `query_type` function.
18704 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add debug print.
18705 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::Resolve):
18706 Refactor and make use of new query system.
18707 (TypeCheckTopLevelExternItem::Resolve): Likewise.
18708 (TypeCheckTopLevelExternItem::visit): Likewise.
18709 (TypeCheckTopLevelImplItem::visit): Likewise.
18710 (TypeCheckImplItem::visit): Likewise.
18711 (TypeCheckImplItem::TypeCheckImplItem): Likewise.
18712 (TypeCheckImplItem::Resolve): Likewise.
18713 (TypeCheckImplItemWithTrait::visit): Likewise.
18714 * typecheck/rust-hir-type-check-implitem.h (class TypeCheckTopLevelImplItem): Likewise.
18715 (class TypeCheckImplItemWithTrait): Likewise.
18716 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::TypeCheckItem): Likewise.
18717 (TypeCheckItem::Resolve): Likewise.
18718 (TypeCheckItem::ResolveImplItem): Likewise.
18719 (TypeCheckItem::ResolveImplBlockSelf): Likewise.
18720 (TypeCheckItem::visit): Likewise.
18721 (TypeCheckItem::resolve_impl_item): Likewise.
18722 (TypeCheckItem::resolve_impl_block_substitutions): Likewise.
18723 (TypeCheckItem::resolve_impl_block_self): Likewise.
18724 * typecheck/rust-hir-type-check-item.h: Likewise.
18725 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise.
18726 (TypeCheckExpr::resolve_segments): Likewise.
18727 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
18728 * typecheck/rust-hir-type-check-stmt.h: Likewise.
18729 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::Resolve): Likewise.
18730 (TypeCheckType::visit): Likewise.
18731 (TypeCheckType::resolve_root_path): Likewise.
18732 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
18733 * typecheck/rust-hir-type-check.h: Likewise.
18734 * typecheck/rust-substitution-mapper.h: Likewise.
18735 * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
18736 (TypeCheckBase::get_predicate_from_bound): Likewise.
18737 (TypeBoundsMappings::add_bound): Likewise.
18738 * typecheck/rust-tyty-cmp.h: Likewise.
18739 * typecheck/rust-tyty.h: Likewise.
18740 * typecheck/rust-tyty.cc (SubstitutionRef::infer_substitions): Likewise.
18741 (ParamType::resolve): Do not infinite loop anymore.
18742 * util/rust-hir-map.h: Add new `hirImplBlockTypeMappings` and
18743 declare `lookup_impl_block_type`.
18744 * util/rust-hir-map.cc (Mappings::insert_hir_impl_block): Use new
18745 `hirImplBlockTypeMappings`
18746 (Mappings::lookup_impl_block_type): New function.
18747
18748 2023-01-31 Philip Herron <[email protected]>
18749
18750 * backend/rust-compile-context.h: Add new optional `asm_name` string
18751 argument to `lookup_function_decl`.
18752 * backend/rust-compile-item.cc (CompileItem::visit): Compute assembly
18753 name and pass it to `lookup_function_decl` when calling it.
18754
18755 2023-01-31 Philip Herron <[email protected]>
18756
18757 * backend/rust-constexpr.cc (eval_store_expression): Remove invalid
18758 assertion on constexpr constructors.
18759
18760 2023-01-31 Philip Herron <[email protected]>
18761
18762 * backend/rust-compile-expr.h: Formatting.
18763
18764 2023-01-31 liushuyu <[email protected]>
18765
18766 * ast/rust-ast.h (class MacroInvocData): Store expander as
18767 member of the class.
18768 (class Expr): Add `is_literal` virtual method
18769 * ast/rust-expr.h: Override `is_literal` for `LiteralExpr`s.
18770 * expand/rust-macro-builtins.cc (try_expand_macro_expression): New function.
18771 (try_extract_string_literal_from_fragment): Likewise.
18772 (try_expand_single_string_literal): Likewise.
18773 (try_expand_many_expr): Likewise.
18774 (parse_single_string_literal): Add macro expander as argument.
18775 (MacroBuiltin::include_bytes): Pass expander as argument to
18776 `parse_single_string_literal`.
18777 (MacroBuiltin::include_str): Likewise.
18778 (MacroBuiltin::compile_error): Likewise.
18779 (MacroBuiltin::include): Likewise.
18780 (MacroBuiltin::concat): Likewise and add better error handling.
18781 (MacroBuiltin::env): Likewise.
18782 * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Expand
18783 invocations recursively.
18784
18785 2023-01-31 Arthur Cohen <[email protected]>
18786
18787 * lang.opt: Add new ``-frust-compile-until` option.
18788 * rust-session-manager.cc (Session::compile_crate): Add stops around
18789 various compilation steps in the pipeline.
18790 * rust-session-manager.h (struct CompileOptions): Add `CompileStep` enum
18791 and field.
18792
18793 2023-01-31 Philip Herron <[email protected]>
18794
18795 * backend/rust-tree.cc (rs_type_quals): Comment out bad assertion
18796
18797 2023-01-31 Philip Herron <[email protected]>
18798
18799 * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit):
18800 Make static items behave more similarly to const items.
18801
18802 2023-01-31 Philip Herron <[email protected]>
18803
18804 * backend/rust-compile-item.cc (CompileItem::visit): Const evaluate
18805 static item expressions.
18806
18807 2023-01-31 Arthur Cohen <[email protected]>
18808
18809 * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Do not lower
18810 null items within modules.
18811
18812 2023-01-31 Arthur Cohen <[email protected]>
18813
18814 * util/rust-attributes.cc: Add `macro_use` to list of builtin
18815 attributes.
18816
18817 2023-01-31 Arthur Cohen <[email protected]>
18818
18819 * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Allow
18820 getting an error string from a specific constant context.
18821 (ConstChecker::ctx_allows_default): New function, check if a context
18822 allows default values for Const generics.
18823 (ConstChecker::visit): Call into `ctx_allows_default`.
18824 * checks/errors/rust-const-checker.h: Declare `ctx_allows_default`.
18825
18826 2023-01-31 liushuyu <[email protected]>
18827
18828 * backend/rust-compile-expr.cc (CompileExpr::visit): Properly formulate
18829 exit condition when compiling while loops.
18830
18831 2023-01-31 Faisal Abbas <[email protected]>
18832
18833 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Turn
18834 constant item typechecking into a coercion site instead of a unify
18835 site.
18836
18837 2023-01-31 Philip Herron <[email protected]>
18838
18839 * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with
18840 substitutions.
18841
18842 2023-01-31 Philip Herron <[email protected]>
18843
18844 * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::contains_associated_types):
18845 Check if a type bound predicate contains assocated types.
18846 * typecheck/rust-tyty.h: Declare the above mentioned function.
18847 * typecheck/rust-hir-trait-resolve.cc: Use `contains_associated_types`
18848 function.
18849
18850 2023-01-31 Philip Herron <[email protected]>
18851
18852 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add
18853 more calls to `rust_debug` for development.
18854
18855 2023-01-31 Philip Herron <[email protected]>
18856
18857 * backend/rust-compile-base.cc: Improve compilation pipeline and simplify
18858 function.
18859
18860 2023-01-31 Philip Herron <[email protected]>
18861
18862 * backend/rust-tree.cc (comptypes): Remove some C++ specific checks in
18863 Rust const folder for now.
18864
18865 2023-01-31 Philip Herron <[email protected]>
18866
18867 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): Add
18868 better unification function with debug calls.
18869 * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): Add more debug
18870 calls and use new unify API.
18871 * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion): Likewise.
18872 (TypeCoercionRules::coerce_borrowed_pointer): Likewise.
18873 (TypeCoercionRules::select): Likewise.
18874 * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Likewise.
18875 * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item): Likewise.
18876 (TypeCheckBase::coercion_site): Likewise.
18877 (TypeCheckBase::cast_site): Likewise.
18878 * typecheck/rust-hir-type-check-base.h: Likewise.
18879 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
18880 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
18881 * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelImplItem::visit): Likewise.
18882 (TypeCheckImplItem::visit): Likewise.
18883 * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
18884 * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): Likewise.
18885 * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
18886 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
18887 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): Likewise.
18888 * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
18889 * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
18890 * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
18891 * typecheck/rust-tyctx.cc (TypeCheckContext::peek_return_type): Likewise.
18892 * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
18893 * typecheck/rust-tyty-cmp.h: Likewise.
18894 * typecheck/rust-tyty-rules.h: Likewise.
18895 * typecheck/rust-tyty.cc (BaseType::mappings_str): Likewise.
18896 (BaseType::debug): Print type name more clearly.
18897 (BaseType::debug_str): Add new function to print type pointer and name.
18898 (TupleType::get_name): Improve type name fetching function.
18899 (ReferenceType::get_name): Likewise.
18900 (PointerType::get_name): Likewise.
18901 * typecheck/rust-tyty.h: Refactor definitions outside of the header.
18902
18903 2023-01-31 Philip Herron <[email protected]>
18904
18905 * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase):
18906 Remove constructor.
18907 (TypeCheckBase::coercion_site): Add `Location` argument to function.
18908 * typecheck/rust-hir-type-check-base.h: Use `TypeCheckBase::coercion_site`
18909 function with location argument.
18910 * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
18911 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
18912 * typecheck/rust-hir-type-check-expr.h (class TypeCheckExpr): Likewise.
18913 * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
18914 * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
18915 * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
18916 * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
18917 (TypeCheckMethodCallExpr::visit): Likewise.
18918 * typecheck/rust-tyty.h: Add missing locus field.
18919 * typecheck/rust-tyty.cc (StructFieldType::clone): Use locus field.
18920 (StructFieldType::monomorphized_clone): Likewise.
18921
18922 2023-01-31 Philip Herron <[email protected]>
18923
18924 * typecheck/rust-tyctx.cc (TypeCheckContext::pop_return_type): Add
18925 guards around `std::vector<T>.pop_back()`.
18926 (TypeCheckContext::peek_context): Likewise for `std::vector<T>.back()`.
18927
18928 2023-01-31 Arthur Cohen <[email protected]>
18929 philberty <[email protected]>
18930
18931 * ast/rust-ast.h: Improve assertions within ASTFragment API.
18932
18933 2023-01-31 Arthur Cohen <[email protected]>
18934
18935 * ast/rust-ast.h: Add assertions and accessors for fragment nodes.
18936 * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion
18937 context typo when visiting `InherentImpl` items.
18938 (AttrVisitor::maybe_expand_expr): Use new Fragment accessor to fetch
18939 properly typed node.
18940 (AttrVisitor::maybe_expand_type): Likewise.
18941 * expand/rust-macro-expand.cc (transcribe_type): Emit parse errors
18942 when trying to parse a type.
18943
18944 2023-01-31 Arthur Cohen <[email protected]>
18945
18946 * ast/rust-ast-dump.h: Add shorthand `AST::Dump::debug` function to
18947 dump an AST node on `stderr`.
18948
18949 2023-01-31 Arthur Cohen <[email protected]>
18950 philberty <[email protected]>
18951
18952 * expand/rust-macro-expand.cc (parse_many): Return early from parsing
18953 loop if we encounter an error, and emit that error in the meantime.
18954
18955 2023-01-31 Arthur Cohen <[email protected]>
18956
18957 * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle
18958 fragments differently based on whether or not we are currently trying
18959 to match a matcher in a repetition context.
18960 (MacroExpander::match_n_matches): Use new `in_repetition` argument
18961 properly when calling `match_matcher`.
18962 * expand/rust-macro-expand.h (MacroExpander::match_matcher): Allow
18963 passing extra `in_repetition` bool argument
18964
18965 2023-01-31 Arthur Cohen <[email protected]>
18966
18967 * parse/rust-parse-impl.h: Allow parsing full range expressions without
18968 erroring out.
18969
18970 2023-01-31 Arthur Cohen <[email protected]>
18971
18972 * checks/lints/rust-lint-scan-deadcode.h: Do not report public items
18973 as dead code.
18974
18975 2023-01-31 Arthur Cohen <[email protected]>
18976
18977 * util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list
18978 of builtin attributes.
18979
18980 2023-01-31 Arthur Cohen <[email protected]>
18981
18982 * backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow
18983 checks logic.
18984 (CompileExpr::array_copied_expr): Insert overflow checks logic.
18985 * backend/rust-compile-item.cc (CompileItem::visit): Insert overflow
18986 checks logic.
18987 * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Insert
18988 overflow checks logic.
18989 * rust-gcc.cc (Gcc_backend::arithmetic_or_logical_expression): Differentiate
18990 existing function from `arithmetic_or_logical_expression_checked`.
18991 This function does insert perform overflow checks.
18992 (Gcc_backend::arithmetic_or_logical_expression_checked): New
18993 function.
18994 (is_overflowing_expr): New function. Check if an expression is an
18995 overflowing one (ADD, SUB, MUL).
18996 (fetch_overflow_builtins): New function.
18997 * rust-backend.h: Declare `arithmetic_or_logical_expression_checked` in
18998 abstract `Backend` class.
18999
19000 2023-01-31 Arthur Cohen <[email protected]>
19001
19002 * backend/rust-builtins.h: Refactor builtin context class and add
19003 overflow builtins.
19004
19005 2023-01-31 Arthur Cohen <[email protected]>
19006
19007 * rust-gcc.cc (class Bvariable): Move class to `rust-gcc.h` header.
19008 * rust-gcc.h: New file.
19009
19010 2023-01-31 Philip Herron <[email protected]>
19011
19012 * hir/rust-ast-lower-expr.h: Lower double borrow expressions to two
19013 `HIR::BorrowExpr`s.
19014 * hir/tree/rust-hir-expr.h: Remove `is_double_borrow` field from
19015 `HIR::BorrowExpr`.
19016 * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Remove
19017 call to `gcc_unreachable` on double borrow expressions.
19018
19019 2023-01-31 Faisal Abbas <[email protected]>
19020
19021 * backend/rust-tree.cc : Add new includes.
19022 (scope_chain): New.
19023 (maybe_add_global): New.
19024 (init_modules): New (copied from cp)
19025 (var_in_constexpr_fn): Likewise.
19026 (member_vec_linear_search): Likewise.
19027 (member_vec_binary_search): Likewise.
19028 (is_overloaded_fn): Likewise.
19029 (ovl_make): Likewise.
19030 (lookup_add): Likewise.
19031 (type_memfn_quals): Likewise.
19032 (struct find_parameter_pack_data): Likewise.
19033 (struct conv_type_hasher): Likewise.
19034 (make_conv_op_name): Likewise.
19035 (builtin_pack_fn_p): Likewise.
19036 (builtin_pack_call_p): Likewise.
19037 (has_extra_args_mechanism_p): Likewise.
19038 (find_parameter_packs_r): Likewise.
19039 (WALK_SUBTREE): Likewise.
19040 (type_memfn_rqual): Likewise.
19041 (maybe_add_lang_type_raw): Likewise.
19042 (struct c_fileinfo): Likewise.
19043 (get_fileinfo): Likewise.
19044 (cxx_make_type): Likewise.
19045 (build_min_array_type): Likewise.
19046 (fields_linear_search): Likewise.
19047 (nothrow_spec_p): Likewise.
19048 (maybe_get_fns): Likewise.
19049 (get_fns): Likewise.
19050 (get_first_fn): Likewise.
19051 (dependent_name): Likewise.
19052 (called_fns_equal): Likewise.
19053 (canonical_eh_spec): Likewise.
19054 (rs_tree_code_length): Likewise.
19055 (rs_tree_operand_length): Likewise.
19056 (rs_tree_equal): Likewise.
19057 (publicly_uniquely_derived_p): Likewise.
19058 (comp_except_types): Likewise.
19059 (comp_except_specs): Likewise.
19060 (compparms): Likewise.
19061 (set_array_type_canon): Likewise.
19062 (struct cplus_array_info): Likewise.
19063 (struct cplus_array_hasher): Likewise.
19064 (cplus_array_hasher::hash): Likewise.
19065 (cplus_array_hasher::equal): Likewise.
19066 (is_byte_access_type): Likewise.
19067 (build_cplus_array_type): Likewise.
19068 (rs_build_qualified_type_real): Likewise.
19069 (vector_targets_convertible_p): Likewise.
19070 (comp_array_types): Likewise.
19071 (same_type_ignoring_top_level_qualifiers_p): Likewise.
19072 (comp_ptr_ttypes_const): Likewise.
19073 (similar_type_p): Likewise.
19074 (structural_comptypes): Likewise.
19075 (comptypes): Likewise.
19076 (next_initializable_field): Likewise.
19077 (sufficient_parms_p): Likewise.
19078 (default_ctor_p): Likewise.
19079 (user_provided_p): Likewise.
19080 (type_has_non_user_provided_default_constructor): Likewise.
19081 (default_init_uninitialized_part): Likewise.
19082 (extract_conversion_operator): Likewise.
19083 (get_class_binding_direct): Likewise.
19084 (lang_check_failed): Likewise.
19085 (skip_artificial_parms_for): Likewise.
19086 (in_class_defaulted_default_constructor): Likewise.
19087 (is_instantiation_of_constexpr): Likewise.
19088 (check_for_uninitialized_const_var): Likewise.
19089 (cv_unqualified): Likewise.
19090 (make_tree_vector): Likewise.
19091 (release_tree_vector): Likewise.
19092 (instantiation_dependent_expression_p): Likewise.
19093 (cp_get_callee): Likewise.
19094 (build_nop): Likewise.
19095 (scalarish_type_p): Likewise.
19096 (type_has_nontrivial_copy_init): Likewise.
19097 (build_local_temp): Likewise.
19098 (is_normal_capture_proxy): Likewise.
19099 (reject_gcc_builtin): Likewise.
19100 (is_bitfield_expr_with_lowered_type): Likewise.
19101 (maybe_undo_parenthesized_ref): Likewise.
19102 (fold_offsetof): Likewise.
19103 (char_type_p): Likewise.
19104 (resolve_nondeduced_context): Likewise.
19105 (instantiate_non_dependent_or_null): Likewise.
19106 (resolve_nondeduced_context_or_error): Likewise.
19107 (really_overloaded_fn): Likewise.
19108 (invalid_nonstatic_memfn_p): Likewise.
19109 (strip_top_quals): Likewise.
19110 (cxx_incomplete_type_inform): Likewise.
19111 (cxx_incomplete_type_diagnostic): Likewise.
19112 (decl_constant_var_p): Likewise.
19113 (undeduced_auto_decl): Likewise.
19114 (require_deduced_type): Likewise.
19115 * backend/rust-tree.h (enum c_tree_index): Likewise.
19116 (GTY): Likewise.
19117 (enum cp_tree_index): Likewise.
19118 (wchar_decl_node): Likewise.
19119 (vtable_entry_type): Likewise.
19120 (delta_type_node): Likewise.
19121 (vtable_index_type): Likewise.
19122 (class_type_node): Likewise.
19123 (unknown_type_node): Likewise.
19124 (init_list_type_node): Likewise.
19125 (explicit_void_list_node): Likewise.
19126 (vtbl_type_node): Likewise.
19127 (vtbl_ptr_type_node): Likewise.
19128 (std_node): Likewise.
19129 (abi_node): Likewise.
19130 (global_namespace): Likewise.
19131 (const_type_info_type_node): Likewise.
19132 (conv_op_marker): Likewise.
19133 (abort_fndecl): Likewise.
19134 (current_aggr): Likewise.
19135 (nullptr_node): Likewise.
19136 (nullptr_type_node): Likewise.
19137 (align_type_node): Likewise.
19138 (char8_type_node): Likewise.
19139 (char16_type_node): Likewise.
19140 (char32_type_node): Likewise.
19141 (wchar_type_node): Likewise.
19142 (underlying_wchar_type_node): Likewise.
19143 (wint_type_node): Likewise.
19144 (signed_size_type_node): Likewise.
19145 (unsigned_ptrdiff_type_node): Likewise.
19146 (intmax_type_node): Likewise.
19147 (uintmax_type_node): Likewise.
19148 (widest_integer_literal_type_node): Likewise.
19149 (widest_unsigned_literal_type_node): Likewise.
19150 (sig_atomic_type_node): Likewise.
19151 (int8_type_node): Likewise.
19152 (int16_type_node): Likewise.
19153 (int32_type_node): Likewise.
19154 (int64_type_node): Likewise.
19155 (uint8_type_node): Likewise.
19156 (c_uint16_type_node): Likewise.
19157 (c_uint32_type_node): Likewise.
19158 (c_uint64_type_node): Likewise.
19159 (int_least8_type_node): Likewise.
19160 (int_least16_type_node): Likewise.
19161 (int_least32_type_node): Likewise.
19162 (int_least64_type_node): Likewise.
19163 (uint_least8_type_node): Likewise.
19164 (uint_least16_type_node): Likewise.
19165 (uint_least32_type_node): Likewise.
19166 (uint_least64_type_node): Likewise.
19167 (int_fast8_type_node): Likewise.
19168 (int_fast16_type_node): Likewise.
19169 (int_fast32_type_node): Likewise.
19170 (int_fast64_type_node): Likewise.
19171 (uint_fast8_type_node): Likewise.
19172 (uint_fast16_type_node): Likewise.
19173 (uint_fast32_type_node): Likewise.
19174 (uint_fast64_type_node): Likewise.
19175 (intptr_type_node): Likewise.
19176 (uintptr_type_node): Likewise.
19177 (truthvalue_type_node): Likewise.
19178 (truthvalue_true_node): Likewise.
19179 (truthvalue_false_node): Likewise.
19180 (char_array_type_node): Likewise.
19181 (char8_array_type_node): Likewise.
19182 (char16_array_type_node): Likewise.
19183 (char32_array_type_node): Likewise.
19184 (wchar_array_type_node): Likewise.
19185 (string_type_node): Likewise.
19186 (const_string_type_node): Likewise.
19187 (default_function_type): Likewise.
19188 (function_name_decl_node): Likewise.
19189 (pretty_function_name_decl_node): Likewise.
19190 (c99_function_name_decl_node): Likewise.
19191 (saved_function_name_decls): Likewise.
19192 (null_node): Likewise.
19193 (ctor_identifier): Likewise.
19194 (complete_ctor_identifier): Likewise.
19195 (base_ctor_identifier): Likewise.
19196 (dtor_identifier): Likewise.
19197 (complete_dtor_identifier): Likewise.
19198 (base_dtor_identifier): Likewise.
19199 (deleting_dtor_identifier): Likewise.
19200 (conv_op_identifier): Likewise.
19201 (delta_identifier): Likewise.
19202 (in_charge_identifier): Likewise.
19203 (vtt_parm_identifier): Likewise.
19204 (as_base_identifier): Likewise.
19205 (this_identifier): Likewise.
19206 (pfn_identifier): Likewise.
19207 (vptr_identifier): Likewise.
19208 (global_identifier): Likewise.
19209 (anon_identifier): Likewise.
19210 (auto_identifier): Likewise.
19211 (decltype_auto_identifier): Likewise.
19212 (init_list_identifier): Likewise.
19213 (for_range__identifier): Likewise.
19214 (for_begin__identifier): Likewise.
19215 (for_end__identifier): Likewise.
19216 (for_range_identifier): Likewise.
19217 (for_begin_identifier): Likewise.
19218 (for_end_identifier): Likewise.
19219 (abi_tag_identifier): Likewise.
19220 (aligned_identifier): Likewise.
19221 (begin_identifier): Likewise.
19222 (end_identifier): Likewise.
19223 (get__identifier): Likewise.
19224 (gnu_identifier): Likewise.
19225 (tuple_element_identifier): Likewise.
19226 (tuple_size_identifier): Likewise.
19227 (type_identifier): Likewise.
19228 (value_identifier): Likewise.
19229 (fun_identifier): Likewise.
19230 (closure_identifier): Likewise.
19231 (heap_uninit_identifier): Likewise.
19232 (heap_identifier): Likewise.
19233 (heap_deleted_identifier): Likewise.
19234 (heap_vec_uninit_identifier): Likewise.
19235 (heap_vec_identifier): Likewise.
19236 (omp_identifier): Likewise.
19237 (lang_name_c): Likewise.
19238 (lang_name_cplusplus): Likewise.
19239 (empty_except_spec): Likewise.
19240 (noexcept_true_spec): Likewise.
19241 (noexcept_false_spec): Likewise.
19242 (noexcept_deferred_spec): Likewise.
19243 (terminate_fn): Likewise.
19244 (call_unexpected_fn): Likewise.
19245 (get_exception_ptr_fn): Likewise.
19246 (begin_catch_fn): Likewise.
19247 (end_catch_fn): Likewise.
19248 (allocate_exception_fn): Likewise.
19249 (free_exception_fn): Likewise.
19250 (throw_fn): Likewise.
19251 (rethrow_fn): Likewise.
19252 (atexit_fn_ptr_type_node): Likewise.
19253 (atexit_node): Likewise.
19254 (dso_handle_node): Likewise.
19255 (dynamic_cast_node): Likewise.
19256 (cleanup_type): Likewise.
19257 (vtt_parm_type): Likewise.
19258 (any_targ_node): Likewise.
19259 (source_location_impl): Likewise.
19260 (OVL_FUNCTION): Likewise.
19261 (OVL_CHAIN): Likewise.
19262 (OVL_DEDUP_P): Likewise.
19263 (OVL_USING_P): Likewise.
19264 (OVL_HIDDEN_P): Likewise.
19265 (OVL_NESTED_P): Likewise.
19266 (OVL_LOOKUP_P): Likewise.
19267 (OVL_EXPORT_P): Likewise.
19268 (OVL_FIRST): Likewise.
19269 (OVL_NAME): Likewise.
19270 (OVL_P): Likewise.
19271 (OVL_SINGLE_P): Likewise.
19272 (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise.
19273 (CLASSTYPE_LAZY_DEFAULT_CTOR): Likewise.
19274 (CLASSTYPE_CONSTRUCTORS): Likewise.
19275 (ATTR_IS_DEPENDENT): Likewise.
19276 (ABI_TAG_IMPLICIT): Likewise.
19277 (PARENTHESIZED_LIST_P): Likewise.
19278 (DECL_DEPENDENT_P): Likewise.
19279 (USING_DECL_SCOPE): Likewise.
19280 (USING_DECL_DECLS): Likewise.
19281 (USING_DECL_TYPENAME_P): Likewise.
19282 (USING_DECL_UNRELATED_P): Likewise.
19283 (DECL_DECLARES_FUNCTION_P): Likewise.
19284 (DECL_DECLARES_TYPE_P): Likewise.
19285 (IDENTIFIER_KIND_BIT_0): Likewise.
19286 (IDENTIFIER_KIND_BIT_1): Likewise.
19287 (IDENTIFIER_KIND_BIT_2): Likewise.
19288 (IDENTIFIER_MARKED): Likewise.
19289 (IDENTIFIER_VIRTUAL_P): Likewise.
19290 (IDENTIFIER_KEYWORD_P): Likewise.
19291 (IDENTIFIER_CDTOR_P): Likewise.
19292 (IDENTIFIER_CTOR_P): Likewise.
19293 (IDENTIFIER_DTOR_P): Likewise.
19294 (IDENTIFIER_ANY_OP_P): Likewise.
19295 (IDENTIFIER_OVL_OP_P): Likewise.
19296 (IDENTIFIER_ASSIGN_OP_P): Likewise.
19297 (IDENTIFIER_CONV_OP_P): Likewise.
19298 (IDENTIFIER_NEWDEL_OP_P): Likewise.
19299 (IDENTIFIER_NEW_OP_P): Likewise.
19300 (CLASSTYPE_DIAMOND_SHAPED_P): Likewise.
19301 (CLASSTYPE_REPEATED_BASE_P): Likewise.
19302 (CLASSTYPE_KEY_METHOD): Likewise.
19303 (CLASSTYPE_MEMBER_VEC): Likewise.
19304 (CLASSTYPE_DECL_LIST): Likewise.
19305 (CLASSTYPE_DESTRUCTOR): Likewise.
19306 (CLASSTYPE_HAS_PRIMARY_BASE_P): Likewise.
19307 (CLASSTYPE_PRIMARY_BINFO): Likewise.
19308 (CLASSTYPE_VBASECLASSES): Likewise.
19309 (CLASSTYPE_AS_BASE): Likewise.
19310 (DECL_CONV_FN_P): Likewise.
19311 (DECL_CONV_FN_TYPE): Likewise.
19312 (same_type_p): Likewise.
19313 (WILDCARD_TYPE_P): Likewise.
19314 (MAYBE_CLASS_TYPE_P): Likewise.
19315 (FUNCTION_REF_QUALIFIED): Likewise.
19316 (FUNCTION_RVALUE_QUALIFIED): Likewise.
19317 (TYPE_PTRMEMFUNC_FN_TYPE): Likewise.
19318 (TYPE_PTRMEMFUNC_FN_TYPE_RAW): Likewise.
19319 (TYPE_DEPENDENT_P): Likewise.
19320 (TYPE_DEPENDENT_P_VALID): Likewise.
19321 (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise.
19322 (TYPE_RAISES_EXCEPTIONS): Likewise.
19323 (IDENTIFIER_BINDING): Likewise.
19324 (LANG_IDENTIFIER_CAST): Likewise.
19325 (IF_COND): Likewise.
19326 (THEN_CLAUSE): Likewise.
19327 (ELSE_CLAUSE): Likewise.
19328 (IF_SCOPE): Likewise.
19329 (IF_STMT_CONSTEXPR_P): Likewise.
19330 (IF_STMT_CONSTEVAL_P): Likewise.
19331 (DECLTYPE_TYPE_EXPR): Likewise.
19332 (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise.
19333 (CLASSTYPE_INTERFACE_ONLY): Likewise.
19334 (TYPE_NAME_STRING): Likewise.
19335 (TYPE_NAME_LENGTH): Likewise.
19336 (CONSTRAINT_VAR_P): Likewise.
19337 (KOENIG_LOOKUP_P): Likewise.
19338 (DECL_PARM_INDEX): Likewise.
19339 (DECL_PARM_LEVEL): Likewise.
19340 (CONV_IMPLICIT): Likewise.
19341 (CONV_STATIC): Likewise.
19342 (CONV_CONST): Likewise.
19343 (CONV_REINTERPRET): Likewise.
19344 (CONV_PRIVATE): Likewise.
19345 (CONV_FORCE_TEMP): Likewise.
19346 (CONV_FOLD): Likewise.
19347 (CONV_OLD_CONVERT): Likewise.
19348 (CONV_C_CAST): Likewise.
19349 (CONV_BACKEND_CONVERT): Likewise.
19350 (WANT_INT): Likewise.
19351 (WANT_FLOAT): Likewise.
19352 (WANT_ENUM): Likewise.
19353 (WANT_POINTER): Likewise.
19354 (WANT_NULL): Likewise.
19355 (WANT_VECTOR_OR_COMPLEX): Likewise.
19356 (WANT_ARITH): Likewise.
19357 (COMPARE_STRICT): Likewise.
19358 (COMPARE_BASE): Likewise.
19359 (COMPARE_DERIVED): Likewise.
19360 (COMPARE_REDECLARATION): Likewise.
19361 (COMPARE_STRUCTURAL): Likewise.
19362 (SF_DEFAULT): Likewise.
19363 (SF_PRE_PARSED): Likewise.
19364 (SF_INCLASS_INLINE): Likewise.
19365 (SD_UNINITIALIZED): Likewise.
19366 (SD_INITIALIZED): Likewise.
19367 (SD_DECOMPOSITION): Likewise.
19368 (SD_DEFAULTED): Likewise.
19369 (SD_DELETED): Likewise.
19370 (TYPE_PTRDATAMEM_P): Likewise.
19371 (RS_TYPE_CONST_P): Likewise.
19372 (TYPE_MAIN_DECL): Likewise.
19373 (DECL_NONTRIVIALLY_INITIALIZED_P): Likewise.
19374 (DECL_DEFAULTED_FN): Likewise.
19375 (TYPE_HAS_USER_CONSTRUCTOR): Likewise.
19376 (DECL_INITIALIZED_IN_CLASS_P): Likewise.
19377 (DECL_DEFAULTED_IN_CLASS_P): Likewise.
19378 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Likewise.
19379 (DECL_HAS_IN_CHARGE_PARM_P): Likewise.
19380 (DECL_HAS_VTT_PARM_P): Likewise.
19381 (FUNCTION_FIRST_USER_PARMTYPE): Likewise.
19382 (FUNCTION_FIRST_USER_PARM): Likewise.
19383 (DECL_CONSTRUCTOR_P): Likewise.
19384 (DECL_DELETED_FN): Likewise.
19385 (BRACE_ENCLOSED_INITIALIZER_P): Likewise.
19386 (DECL_IMMEDIATE_FUNCTION_P): Likewise.
19387 (SET_DECL_IMMEDIATE_FUNCTION_P): Likewise.
19388 (CONSTRUCTOR_MUTABLE_POISON): Likewise.
19389 (PTRMEM_CST_MEMBER): Likewise.
19390 (REF_PARENTHESIZED_P): Likewise.
19391 (TYPE_PTRMEM_P): Likewise.
19392 (TYPE_PTR_OR_PTRMEM_P): Likewise.
19393 (DECL_DECOMPOSITION_P): Likewise.
19394 (DECL_DECOMP_BASE): Likewise.
19395 (DECL_MAYBE_IN_CHARGE_CDTOR_P): Likewise.
19396 (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
19397 (DECL_CLONED_FUNCTION_P): Likewise.
19398 (DECL_CLONED_FUNCTION): Likewise.
19399 (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
19400 (cp_function_chain): Likewise.
19401 (cdtor_label): Likewise.
19402 (current_class_ptr): Likewise.
19403 (current_class_ref): Likewise.
19404 (current_eh_spec_block): Likewise.
19405 (current_in_charge_parm): Likewise.
19406 (current_vtt_parm): Likewise.
19407 (current_retval_sentinel): Likewise.
19408 (current_function_returns_value): Likewise.
19409 (current_function_returns_null): Likewise.
19410 (current_function_returns_abnormally): Likewise.
19411 (current_function_infinite_loop): Likewise.
19412 (in_base_initializer): Likewise.
19413 (in_function_try_handler): Likewise.
19414 (current_function_return_value): Likewise.
19415 (current_class_type): Likewise.
19416 (TYPE_BEING_DEFINED): Likewise.
19417 (DECL_STATIC_FUNCTION_P): Likewise.
19418 (DECL_FUNCTION_MEMBER_P): Likewise.
19419 (LANG_DECL_MIN_CHECK): Likewise.
19420 (LANG_DECL_FN_CHECK): Likewise.
19421 (LANG_DECL_NS_CHECK): Likewise.
19422 (LANG_DECL_PARM_CHECK): Likewise.
19423 (LANG_DECL_DECOMP_CHECK): Likewise.
19424 (RS_INTEGRAL_TYPE_P): Likewise.
19425 (STAT_HACK_P): Likewise.
19426 (STAT_TYPE_VISIBLE_P): Likewise.
19427 (STAT_TYPE): Likewise.
19428 (STAT_DECL): Likewise.
19429 (STAT_VISIBLE): Likewise.
19430 (MAYBE_STAT_DECL): Likewise.
19431 (MAYBE_STAT_TYPE): Likewise.
19432 (STAT_TYPE_HIDDEN_P): Likewise.
19433 (STAT_DECL_HIDDEN_P): Likewise.
19434 (class warning_sentinel): Likewise.
19435 (struct uid_sensitive_constexpr_evaluation_checker): Likewise.
19436 (class iloc_sentinel): Likewise.
19437 (struct GTY): Likewise.
19438 (struct named_decl_hash): Likewise.
19439 (enum lang_decl_selector): Likewise.
19440 (LANG_DECL_HAS_MIN): Likewise.
19441 (struct named_label_entry): Likewise.
19442 (struct named_label_hash): Likewise.
19443 (enum ref_operator): Likewise.
19444 (struct c_fileinfo): Likewise.
19445 (class ovl_iterator): Likewise.
19446 (class lkp_iterator): Likewise.
19447 (enum rs_ref_qualifier): Likewise.
19448 (enum tsubst_flags): Likewise.
19449 (enum cp_identifier_kind): Likewise.
19450 (enum tag_types): Likewise.
19451 (enum compare_bounds_t): Likewise.
19452 (mark_rvalue_use): Likewise.
19453 (type_unknown_p): Likewise.
19454 (init_modules): Likewise.
19455 (var_in_constexpr_fn): Likewise.
19456 (ovl_first): Likewise.
19457 (lookup_add): Likewise.
19458 (ovl_make): Likewise.
19459 (is_overloaded_fn): Likewise.
19460 (maybe_add_lang_type_raw): Likewise.
19461 (type_memfn_rqual): Likewise.
19462 (builtin_pack_fn_p): Likewise.
19463 (make_conv_op_name): Likewise.
19464 (type_memfn_quals): Likewise.
19465 (get_fileinfo): Likewise.
19466 (cxx_make_type): Likewise.
19467 (build_cplus_array_type): Likewise.
19468 (is_byte_access_type): Likewise.
19469 (comptypes): Likewise.
19470 (canonical_eh_spec): Likewise.
19471 (cp_tree_operand_length): Likewise.
19472 (rs_tree_equal): Likewise.
19473 (compparms): Likewise.
19474 (rs_build_qualified_type_real): Likewise.
19475 (rs_build_qualified_type): Likewise.
19476 (cv_qualified_p): Likewise.
19477 (similar_type_p): Likewise.
19478 (vector_targets_convertible_p): Likewise.
19479 (same_type_ignoring_top_level_qualifiers_p): Likewise.
19480 (comp_ptr_ttypes_const): Likewise.
19481 (get_class_binding_direct): Likewise.
19482 (skip_artificial_parms_for): Likewise.
19483 (lang_check_failed): Likewise.
19484 (default_init_uninitialized_part): Likewise.
19485 (type_has_non_user_provided_default_constructor): Likewise.
19486 (default_ctor_p): Likewise.
19487 (user_provided_p): Likewise.
19488 (sufficient_parms_p): Likewise.
19489 (next_initializable_field): Likewise.
19490 (in_class_defaulted_default_constructor): Likewise.
19491 (is_instantiation_of_constexpr): Likewise.
19492 (check_for_uninitialized_const_var): Likewise.
19493 (reduced_constant_expression_p): Likewise.
19494 (cv_unqualified): Likewise.
19495 (cp_get_callee): Likewise.
19496 (cp_get_callee_fndecl_nofold): Likewise.
19497 (is_nondependent_static_init_expression): Likewise.
19498 (maybe_constant_init): Likewise.
19499 (build_nop): Likewise.
19500 (scalarish_type_p): Likewise.
19501 (is_bitfield_expr_with_lowered_type): Likewise.
19502 (convert_bitfield_to_declared_type): Likewise.
19503 (cp_fold_maybe_rvalue): Likewise.
19504 (maybe_undo_parenthesized_ref): Likewise.
19505 (fold_offsetof): Likewise.
19506 (cp_truthvalue_conversion): Likewise.
19507 (fold_non_dependent_expr): Likewise.
19508 (char_type_p): Likewise.
19509 (instantiation_dependent_expression_p): Likewise.
19510 (type_has_nontrivial_copy_init): Likewise.
19511 (build_local_temp): Likewise.
19512 (is_normal_capture_proxy): Likewise.
19513 (reject_gcc_builtin): Likewise.
19514 (resolve_nondeduced_context): Likewise.
19515 (cxx_incomplete_type_diagnostic): Likewise.
19516 (cxx_incomplete_type_error): Likewise.
19517 (invalid_nonstatic_memfn_p): Likewise.
19518 (really_overloaded_fn): Likewise.
19519 (resolve_nondeduced_context_or_error): Likewise.
19520 (instantiate_non_dependent_or_null): Likewise.
19521 (cxx_incomplete_type_inform): Likewise.
19522 (strip_top_quals): Likewise.
19523 (undeduced_auto_decl): Likewise.
19524 (require_deduced_type): Likewise.
19525 (decl_constant_var_p): Likewise.
19526 (type_of_this_parm): Likewise.
19527 (class_of_this_parm): Likewise.
19528 (identifier_p): Likewise.
19529 (gnu_vector_type_p): Likewise.
19530 (make_tree_vector): Likewise.
19531 (release_tree_vector): Likewise.
19532 (class releasing_vec): Likewise.
19533 (vec_safe_push): Likewise.
19534 (null_node_p): Likewise.
19535 * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Correctly
19536 set fndecl as constexpr from qualifiers.
19537 (HIRCompileBase::compile_function): Test if fndecl is constexpr.
19538 (HIRCompileBase::compile_constant_item): Set fndecl as constexpr.
19539 * backend/rust-compile-intrinsic.cc : Update include.
19540 (finalize_intrinsic_block): Set fndecl as constexpr.
19541 * backend/rust-constexpr.cc : Update include.
19542 (VERIFY_CONSTANT): New.
19543 (is_instantiation_of_constexpr): New.
19544 (literal_type_p): New.
19545 (verify_constant): New.
19546 (find_array_ctor_elt): New.
19547 (array_index_cmp): New.
19548 (potential_constant_expression_1): New.
19549 (get_nth_callarg): New.
19550 (unshare_constructor): New.
19551 (maybe_save_constexpr_fundef): New.
19552 (returns): New.
19553 (breaks): New.
19554 (continues): New.
19555 (switches): New.
19556 (struct constexpr_global_ctx): Add new fields.
19557 (constexpr_fundef): New.
19558 (struct constexpr_call): New.
19559 (constexpr_call_hasher : ggc_ptr_hash<constexpr_call>): New.
19560 (enum constexpr_switch_state): New.
19561 (struct constexpr_ctx): Add new fields.
19562 (struct constexpr_fundef_hasher): New.
19563 (constexpr_fundef_table): New.
19564 (constexpr_fundef_hasher::equal): New.
19565 (constexpr_fundef_hasher::hash): New.
19566 (retrieve_constexpr_fundef): New.
19567 (uid_sensitive_constexpr_evaluation_value): New.
19568 (uid_sensitive_constexpr_evaluation_true_counter): New.
19569 (uid_sensitive_constexpr_evaluation_p): New.
19570 (class temp_override): New.
19571 (struct uid_sensitive_constexpr_evaluation_sentinel): New.
19572 (struct uid_sensitive_constexpr_evaluation_checker): New.
19573 (::uid_sensitive_constexpr_evaluation_sentinel): New.
19574 (::uid_sensitive_constexpr_evaluation_checker): New.
19575 (uid_sensitive_constexpr_evaluation_checker::evaluation_restricted_p): New.
19576 (constexpr_call_table): New.
19577 (constexpr_call_hasher::hash): New.
19578 (constexpr_call_hasher::equal): New.
19579 (maybe_initialize_constexpr_call_table): New.
19580 (fundef_copies_table): New.
19581 (get_fundef_copy): New.
19582 (save_fundef_copy): New.
19583 (constexpr_expression): Refactor in ...
19584 (eval_constant_expression): ...this.
19585 (eval_store_expression): Add 3 bool params.
19586 (eval_call_expression): Likewise.
19587 (eval_binary_expression): Likewise.
19588 (eval_statement_list): New.
19589 (extract_string_elt): New.
19590 (eval_conditional_expression): New.
19591 (eval_bit_field_ref): New.
19592 (eval_loop_expr): New.
19593 (eval_switch_expr): New.
19594 (eval_unary_expression): New.
19595 (call_stack): New.
19596 (call_stack_tick): New.
19597 (last_cx_error_tick): New.
19598 (push_cx_call_context): New.
19599 (pop_cx_call_context): New.
19600 (cx_error_context): New.
19601 (fold_expr): Adjust call to eval_constant_expression.
19602 (same_type_ignoring_tlq_and_bounds_p): New.
19603 (union_active_member): Port more for cxx constexpr.
19604 (fold_indirect_ref_1): New.
19605 (rs_fold_indirect_ref): Likewise.
19606 (rs_eval_indirect_ref): New (from corresponding cxx FE file).
19607 (eval_logical_expression): Adjust parameter list.
19608 (lookup_placeholder): New (from corresponding cxx FE file).
19609 (constant_value_1): Remove.
19610 (inline_asm_in_constexpr_error): New (from corresponding cxx FE file).
19611 (verify_ctor_sanity): New.
19612 (get_callee): Remove.
19613 (initialized_type): New.
19614 (maybe_constexpr_fn): Remove.
19615 (init_subob_ctx): New.
19616 (base_field_constructor_elt): New.
19617 (get_or_insert_ctor_field): New.
19618 (eval_vector_conditional_expression): New (from correponding cxx FE file).
19619 (eval_bare_aggregate): New.
19620 (cxx_eval_trinary_expression): New.
19621 (reduced_constant_expression_p): New.
19622 (adjust_temp_type): New.
19623 (free_constructor): New.
19624 (eval_and_check_array_index): New.
19625 (eval_array_reference): New.
19626 (eval_component_reference): New.
19627 (label_matches): New.
19628 (eval_constant_expression): New.
19629 (modifying_const_object_error): New.
19630 (is_empty_field): New.
19631 (eval_store_expression): New.
19632 (eval_binary_expression): New.
19633 (addr_of_non_const_var): New.
19634 (rs_bind_parameters_in_call): New.
19635 (eval_builtin_function_call): New.
19636 (eval_call_expression): New.
19637 (build_anon_member_initialization): New.
19638 (build_data_member_initialization): New.
19639 (constexpr_fn_retval): New.
19640 (constant_value_1): New.
19641 (decl_constant_value): New.
19642 (non_const_var_error): New.
19643 (get_callee): New.
19644 (get_function_named_in_call): New.
19645 (maybe_constexpr_fn): New.
19646 (get_nth_callarg): New.
19647 (var_in_maybe_constexpr_fn): New.
19648 (instantiate_cx_fn_r): New.
19649 (instantiate_constexpr_fns): New.
19650 (array_index_cmp): New.
19651 (unshare_constructor): New.
19652 (find_array_ctor_elt): New.
19653 (verify_constant): New.
19654 (find_heap_var_refs): New.
19655 (find_immediate_fndecl): New.
19656 (diag_array_subscript): New.
19657 (get_array_or_vector_nelts): New.
19658 (eval_and_check_array_index): New.
19659 (extract_string_elt): New.
19660 (is_valid_constexpr_fn): New.
19661 (explain_invalid_constexpr_fn): New.
19662 (register_constexpr_fundef): New.
19663 (maybe_save_constexpr_fundef): New.
19664 (eval_statement_list): New.
19665 (eval_conditional_expression): New.
19666 (eval_bit_field_ref): New.
19667 (returns): New.
19668 (breaks): New.
19669 (continues): New.
19670 (switches): New.
19671 (eval_loop_expr): New.
19672 (eval_switch_expr): New.
19673 (eval_unary_expression): New.
19674 (cxx_eval_outermost_constant_expr): New.
19675 (is_static_init_expression): New.
19676 (is_constant_expression): New.
19677 (is_nondependent_static_init_expression): New.
19678 (maybe_constant_init_1): New.
19679 (maybe_constant_init): New.
19680 (is_nondependent_constant_expression): New.
19681 (cv_cache): New.
19682 (maybe_constant_value): New.
19683 (potential_constant_expression): New.
19684 (struct check_for_return_continue_data): New.
19685 (check_for_return_continue): New.
19686 (decl_namespace_context): New.
19687 (decl_in_std_namespace_p): New.
19688 (is_std_construct_at): New.
19689 (cxx_dynamic_cast_fn_p): New.
19690 (is_std_allocator_allocate): New.
19691 (is_std_allocator_allocate): New.
19692 (potential_constant_expression_1): New.
19693 (potential_constant_expression_1): New.
19694 (fold_non_dependent_init): New.
19695 * backend/rust-constexpr.h (maybe_save_constexpr_fundef): New.
19696
19697 2023-01-31 Arthur Cohen <[email protected]>
19698
19699 * rust-session-manager.cc (Session::compile_crate): Allow the dump of prettified AST
19700 (Session::dump_ast_pretty): New
19701 * rust-session-manager.h: Add new output file for pretty AST dump
19702
19703 2023-01-05 David Malcolm <[email protected]>
19704
19705 * resolve/rust-ast-resolve-item.cc (selftest::rust_flatten_list):
19706 Remove output to stderr.
19707
19708 2023-01-05 David Malcolm <[email protected]>
19709
19710 * Make-lang.in (selftest-rust-gdb): New.
19711 (selftest-rust-valgrind): New.
19712
19713 2022-12-20 Marc Poulhiès <[email protected]>
19714
19715 PR rust/108113
19716 * Make-lang.in (rust.serial): New variable.
19717 (rust1$(exeext)): Depend on $(rust.prev). Call LINK_PROGRESS.
19718
19719 2022-12-14 Jakub Jelinek <[email protected]>
19720
19721 PR rust/106072
19722 * parse/rust-parse-impl.h (parse_closure_param): Store
19723 pattern->get_locus () in a temporary before std::move (pattern) is
19724 invoked.
19725
19726 2022-12-13 Philip Herron <[email protected]>
19727
19728 * CONTRIBUTING.md: New.
19729 * README.md: New.
19730 * logo.png: New.
19731
19732 2022-12-13 Philip Herron <[email protected]>
19733
19734 * config-lang.in: New.
19735
19736 2022-12-13 Arthur Cohen <[email protected]>
19737
19738 * lang.opt (-frust-incomplete-and-experimental-compiler-do-not-use):
19739 New.
19740 * rust-session-manager.cc (Session::compile_crate): Check it.
19741 * Make-lang.in (RUST_SELFTEST_FLAGS): Add it.
19742
19743 2022-12-13 Philip Herron <[email protected]>
19744
19745 * Make-lang.in: New.
19746
19747 2022-12-13 Philip Herron <[email protected]>
19748
19749 * lang.opt: New.
19750
19751 2022-12-13 Philip Herron <[email protected]>
19752
19753 * lang-specs.h: New.
19754
19755 2022-12-13 Philip Herron <[email protected]>
19756
19757 * rust-lang.cc: New.
19758 * rust-session-manager.cc: New.
19759 * rust-session-manager.h: New.
19760
19761 2022-12-13 Philip Herron <[email protected]>
19762
19763 * rustspec.cc: New.
19764
19765 2022-12-13 Philip Herron <[email protected]>
19766
19767 * rust-diagnostics.cc: New.
19768 * rust-diagnostics.h: New.
19769 * rust-gcc-diagnostics.cc: New.
19770 * rust-linemap.cc: New.
19771 * rust-linemap.h: New.
19772 * rust-location.h: New.
19773 * rust-system.h: New.
19774
19775 2022-12-13 Philip Herron <[email protected]>
19776 David Faust <[email protected]>
19777 Faisal Abbas <[email protected]>
19778
19779 * backend/rust-compile-context.cc: New.
19780 * backend/rust-compile-context.h: New.
19781 * backend/rust-compile.cc: New.
19782 * backend/rust-compile.h: New.
19783 * backend/rust-constexpr.cc: New.
19784 * backend/rust-constexpr.h: New.
19785
19786 2022-12-13 Philip Herron <[email protected]>
19787 David Faust <[email protected]>
19788
19789 * backend/rust-compile-block.cc: New.
19790 * backend/rust-compile-block.h: New.
19791 * backend/rust-compile-expr.cc: New.
19792 * backend/rust-compile-expr.h: New.
19793 * backend/rust-compile-extern.h: New.
19794 * backend/rust-compile-fnparam.cc: New.
19795 * backend/rust-compile-fnparam.h: New.
19796 * backend/rust-compile-implitem.cc: New.
19797 * backend/rust-compile-implitem.h: New.
19798 * backend/rust-compile-intrinsic.cc: New.
19799 * backend/rust-compile-intrinsic.h: New.
19800 * backend/rust-compile-item.cc: New.
19801 * backend/rust-compile-item.h: New.
19802 * backend/rust-compile-pattern.cc: New.
19803 * backend/rust-compile-pattern.h: New.
19804 * backend/rust-compile-resolve-path.cc: New.
19805 * backend/rust-compile-resolve-path.h: New.
19806 * backend/rust-compile-stmt.cc: New.
19807 * backend/rust-compile-stmt.h: New.
19808 * backend/rust-compile-struct-field-expr.cc: New.
19809 * backend/rust-compile-struct-field-expr.h: New.
19810 * backend/rust-compile-type.cc: New.
19811 * backend/rust-compile-type.h: New.
19812 * backend/rust-compile-var-decl.h: New.
19813
19814 2022-12-13 Philip Herron <[email protected]>
19815 David Faust <[email protected]>
19816
19817 * backend/rust-builtins.h: New.
19818 * backend/rust-compile-base.cc: New.
19819 * backend/rust-compile-base.h: New.
19820 * backend/rust-mangle.cc: New.
19821 * backend/rust-mangle.h: New.
19822 * backend/rust-tree.cc: New.
19823 * backend/rust-tree.h: New.
19824 * rust-backend.h: New.
19825 * rust-gcc.cc: New.
19826
19827 2022-12-13 Philip Herron <[email protected]>
19828
19829 * metadata/rust-export-metadata.cc: New.
19830 * metadata/rust-export-metadata.h: New.
19831 * metadata/rust-extern-crate.cc: New.
19832 * metadata/rust-extern-crate.h: New.
19833 * metadata/rust-import-archive.cc: New.
19834 * metadata/rust-imports.cc: New.
19835 * metadata/rust-imports.h: New.
19836 * rust-object-export.cc: New.
19837 * rust-object-export.h: New.
19838
19839 2022-12-13 Philip Herron <[email protected]>
19840
19841 * checks/lints/rust-lint-unused-var.cc: New.
19842 * checks/lints/rust-lint-unused-var.h: New.
19843
19844 2022-12-13 Thomas Young <[email protected]>
19845
19846 * checks/lints/rust-lint-marklive-base.h: New.
19847 * checks/lints/rust-lint-marklive.cc: New.
19848 * checks/lints/rust-lint-marklive.h: New.
19849 * checks/lints/rust-lint-scan-deadcode.h: New.
19850
19851 2022-12-13 Arthur Cohen <[email protected]>
19852
19853 * checks/errors/privacy/rust-privacy-check.cc: New.
19854 * checks/errors/privacy/rust-privacy-check.h: New.
19855 * checks/errors/privacy/rust-privacy-common.h: New.
19856 * checks/errors/privacy/rust-privacy-ctx.cc: New.
19857 * checks/errors/privacy/rust-privacy-ctx.h: New.
19858 * checks/errors/privacy/rust-privacy-reporter.cc: New.
19859 * checks/errors/privacy/rust-privacy-reporter.h: New.
19860 * checks/errors/privacy/rust-pub-restricted-visitor.cc: New.
19861 * checks/errors/privacy/rust-pub-restricted-visitor.h: New.
19862 * checks/errors/privacy/rust-reachability.cc: New.
19863 * checks/errors/privacy/rust-reachability.h: New.
19864 * checks/errors/privacy/rust-visibility-resolver.cc: New.
19865 * checks/errors/privacy/rust-visibility-resolver.h: New.
19866
19867 2022-12-13 Arthur Cohen <[email protected]>
19868
19869 * checks/errors/rust-const-checker.cc: New.
19870 * checks/errors/rust-const-checker.h: New.
19871
19872 2022-12-13 Arthur Cohen <[email protected]>
19873
19874 * checks/errors/rust-unsafe-checker.cc: New.
19875 * checks/errors/rust-unsafe-checker.h: New.
19876
19877 2022-12-13 Philip Herron <[email protected]>
19878
19879 * typecheck/rust-autoderef.cc: New.
19880 * typecheck/rust-autoderef.h: New.
19881 * typecheck/rust-casts.cc: New.
19882 * typecheck/rust-casts.h: New.
19883 * typecheck/rust-coercion.cc: New.
19884 * typecheck/rust-coercion.h: New.
19885 * typecheck/rust-hir-dot-operator.cc: New.
19886 * typecheck/rust-hir-dot-operator.h: New.
19887 * typecheck/rust-hir-inherent-impl-overlap.h: New.
19888 * typecheck/rust-hir-path-probe.h: New.
19889 * typecheck/rust-hir-trait-ref.h: New.
19890 * typecheck/rust-hir-type-bounds.h: New.
19891 * typecheck/rust-substitution-mapper.cc: New.
19892 * typecheck/rust-substitution-mapper.h: New.
19893 * typecheck/rust-tycheck-dump.h: New.
19894 * typecheck/rust-tyctx.cc: New.
19895 * typecheck/rust-tyty-bounds.cc: New.
19896 * typecheck/rust-tyty-call.cc: New.
19897 * typecheck/rust-tyty-call.h: New.
19898 * typecheck/rust-tyty-cmp.h: New.
19899 * typecheck/rust-tyty-rules.h: New.
19900
19901 2022-12-13 Philip Herron <[email protected]>
19902
19903 * typecheck/rust-tyty.cc: New.
19904 * typecheck/rust-tyty.h: New.
19905
19906 2022-12-13 Philip Herron <[email protected]>
19907
19908 * typecheck/rust-hir-trait-resolve.cc: New.
19909 * typecheck/rust-hir-trait-resolve.h: New.
19910 * typecheck/rust-hir-type-check-base.cc: New.
19911 * typecheck/rust-hir-type-check-base.h: New.
19912 * typecheck/rust-hir-type-check-enumitem.cc: New.
19913 * typecheck/rust-hir-type-check-enumitem.h: New.
19914 * typecheck/rust-hir-type-check-expr.cc: New.
19915 * typecheck/rust-hir-type-check-expr.h: New.
19916 * typecheck/rust-hir-type-check-implitem.cc: New.
19917 * typecheck/rust-hir-type-check-implitem.h: New.
19918 * typecheck/rust-hir-type-check-item.cc: New.
19919 * typecheck/rust-hir-type-check-item.h: New.
19920 * typecheck/rust-hir-type-check-path.cc: New.
19921 * typecheck/rust-hir-type-check-pattern.cc: New.
19922 * typecheck/rust-hir-type-check-pattern.h: New.
19923 * typecheck/rust-hir-type-check-stmt.cc: New.
19924 * typecheck/rust-hir-type-check-stmt.h: New.
19925 * typecheck/rust-hir-type-check-struct-field.h: New.
19926 * typecheck/rust-hir-type-check-struct.cc: New.
19927 * typecheck/rust-hir-type-check-toplevel.cc: New.
19928 * typecheck/rust-hir-type-check-toplevel.h: New.
19929 * typecheck/rust-hir-type-check-type.cc: New.
19930 * typecheck/rust-hir-type-check-type.h: New.
19931 * typecheck/rust-hir-type-check-util.cc: New.
19932 * typecheck/rust-hir-type-check-util.h: New.
19933 * typecheck/rust-hir-type-check.cc: New.
19934 * typecheck/rust-hir-type-check.h: New.
19935 * typecheck/rust-tyty-visitor.h: New.
19936
19937 2022-12-13 Philip Herron <[email protected]>
19938
19939 * util/rust-canonical-path.h: New.
19940 * util/rust-common.h: New.
19941 * util/rust-hir-map.cc: New.
19942 * util/rust-hir-map.h: New.
19943 * util/rust-identifier.h: New.
19944 * util/rust-lang-item.h: New.
19945 * util/rust-mapping-common.h: New.
19946 * util/rust-stacked-contexts.h: New.
19947
19948 2022-12-13 Arthur Cohen <[email protected]>
19949
19950 * util/rust-attributes.cc: New.
19951 * util/rust-attributes.h: New.
19952
19953 2022-12-13 Arthur Cohen <[email protected]>
19954
19955 * util/rust-optional-test.cc: New.
19956 * util/rust-optional.h: New.
19957
19958 2022-12-13 Arthur Cohen <[email protected]>
19959
19960 * util/rust-base62.cc: New.
19961 * util/rust-base62.h: New.
19962
19963 2022-12-13 Philip Herron <[email protected]>
19964
19965 * util/rust-abi.cc: New.
19966 * util/rust-abi.h: New.
19967
19968 2022-12-13 Philip Herron <[email protected]>
19969
19970 * util/fnv-hash.h: New.
19971
19972 2022-12-13 Philip Herron <[email protected]>
19973
19974 * util/rust-make-unique.h: New.
19975
19976 2022-12-13 Philip Herron <[email protected]>
19977
19978 * hir/rust-ast-lower-base.cc: New.
19979 * hir/rust-ast-lower-base.h: New.
19980 * hir/rust-ast-lower-block.h: New.
19981 * hir/rust-ast-lower-enumitem.h: New.
19982 * hir/rust-ast-lower-expr.h: New.
19983 * hir/rust-ast-lower-extern.h: New.
19984 * hir/rust-ast-lower-implitem.h: New.
19985 * hir/rust-ast-lower-item.cc: New.
19986 * hir/rust-ast-lower-item.h: New.
19987 * hir/rust-ast-lower-pattern.cc: New.
19988 * hir/rust-ast-lower-pattern.h: New.
19989 * hir/rust-ast-lower-stmt.h: New.
19990 * hir/rust-ast-lower-struct-field-expr.h: New.
19991 * hir/rust-ast-lower-type.h: New.
19992 * hir/rust-ast-lower.cc: New.
19993 * hir/rust-ast-lower.h: New.
19994 * hir/rust-hir-dump.cc: New.
19995 * hir/rust-hir-dump.h: New.
19996
19997 2022-12-13 Philip Herron <[email protected]>
19998
19999 * hir/tree/rust-hir-full-decls.h: New.
20000 * hir/tree/rust-hir-full-test.cc: New.
20001 * hir/tree/rust-hir-full.h: New.
20002 * hir/tree/rust-hir-visitor.h: New.
20003 * hir/tree/rust-hir.h: New.
20004
20005 2022-12-13 Philip Herron <[email protected]>
20006
20007 * hir/tree/rust-hir-expr.h: New.
20008 * hir/tree/rust-hir-item.h: New.
20009 * hir/tree/rust-hir-path.h: New.
20010 * hir/tree/rust-hir-pattern.h: New.
20011 * hir/tree/rust-hir-stmt.h: New.
20012 * hir/tree/rust-hir-type.h: New.
20013
20014 2022-12-13 Philip Herron <[email protected]>
20015
20016 * resolve/rust-ast-resolve-base.cc: New.
20017 * resolve/rust-ast-resolve-base.h: New.
20018 * resolve/rust-ast-resolve-expr.cc: New.
20019 * resolve/rust-ast-resolve-expr.h: New.
20020 * resolve/rust-ast-resolve-implitem.h: New.
20021 * resolve/rust-ast-resolve-item.cc: New.
20022 * resolve/rust-ast-resolve-item.h: New.
20023 * resolve/rust-ast-resolve-path.cc: New.
20024 * resolve/rust-ast-resolve-path.h: New.
20025 * resolve/rust-ast-resolve-pattern.cc: New.
20026 * resolve/rust-ast-resolve-pattern.h: New.
20027 * resolve/rust-ast-resolve-stmt.cc: New.
20028 * resolve/rust-ast-resolve-stmt.h: New.
20029 * resolve/rust-ast-resolve-struct-expr-field.cc: New.
20030 * resolve/rust-ast-resolve-struct-expr-field.h: New.
20031 * resolve/rust-ast-resolve-toplevel.h: New.
20032 * resolve/rust-ast-resolve-type.cc: New.
20033 * resolve/rust-ast-resolve-type.h: New.
20034 * resolve/rust-ast-resolve.cc: New.
20035 * resolve/rust-ast-resolve.h: New.
20036 * resolve/rust-ast-verify-assignee.h: New.
20037 * resolve/rust-name-resolver.cc: New.
20038 * resolve/rust-name-resolver.h: New.
20039
20040 2022-12-13 Arthur Cohen <[email protected]>
20041 Philip Herron <[email protected]>
20042 Joel Phillips <[email protected]>
20043
20044 * expand/rust-attribute-visitor.cc: New.
20045 * expand/rust-attribute-visitor.h: New.
20046 * expand/rust-macro-builtins.cc: New.
20047 * expand/rust-macro-builtins.h: New.
20048 * expand/rust-macro-expand.cc: New.
20049 * expand/rust-macro-expand.h: New.
20050 * expand/rust-macro-invoc-lexer.cc: New.
20051 * expand/rust-macro-invoc-lexer.h: New.
20052 * expand/rust-macro-substitute-ctx.cc: New.
20053 * expand/rust-macro-substitute-ctx.h: New.
20054
20055 2022-12-13 Joel Phillips <[email protected]>
20056 Philip Herron <[email protected]>
20057 Arthur Cohen <[email protected]>
20058
20059 * parse/rust-parse-impl.h: New, second half.
20060
20061 2022-12-13 Joel Phillips <[email protected]>
20062 Philip Herron <[email protected]>
20063 Arthur Cohen <[email protected]>
20064
20065 * parse/rust-cfg-parser.cc: New.
20066 * parse/rust-cfg-parser.h: New.
20067 * parse/rust-parse-impl.h: New.
20068 * parse/rust-parse.cc: New.
20069 * parse/rust-parse.h: New.
20070
20071 2022-12-13 Joel Phillips <[email protected]>
20072 Philip Herron <[email protected]>
20073 Arthur Cohen <[email protected]>
20074 Mark Wielaard <[email protected]>
20075
20076 * lex/rust-codepoint.h: New.
20077 * lex/rust-lex.cc: New.
20078 * lex/rust-lex.h: New.
20079 * lex/rust-token.cc: New.
20080 * lex/rust-token.h: New.
20081 * rust-buffered-queue.h: New.
20082
20083 2022-12-13 Joel Phillips <[email protected]>
20084 Philip Herron <[email protected]>
20085 Arthur Cohen <[email protected]>
20086
20087 * ast/rust-ast-dump.cc: New.
20088 * ast/rust-ast-dump.h: New.
20089 * ast/rust-ast-visitor.h: New.
20090 * ast/rust-cond-compilation.h: New.
20091
20092 2022-12-13 Joel Phillips <[email protected]>
20093 Philip Herron <[email protected]>
20094
20095 * ast/rust-expr.h: New.
20096 * ast/rust-macro.h: New.
20097 * ast/rust-path.h: New.
20098 * ast/rust-pattern.h: New.
20099 * ast/rust-stmt.h: New.
20100 * ast/rust-type.h: New.
20101
20102 2022-12-13 Joel Phillips <[email protected]>
20103 Philip Herron <[email protected]>
20104
20105 * ast/rust-item.h: New.
20106
20107 2022-12-13 Joel Phillips <[email protected]>
20108 Philip Herron <[email protected]>
20109 Arthur Cohen <[email protected]>
20110
20111 * ast/rust-ast-full-decls.h: New.
20112 * ast/rust-ast-full-test.cc: New.
20113 * ast/rust-ast-full.h: New.
20114 * ast/rust-ast.h: New.
20115 * operator.h: New.
20116
20117 Copyright (C) 2022-2025 Free Software Foundation, Inc.
20118
20119 Copying and distribution of this file, with or without modification,
20120 are permitted in any medium without royalty provided the copyright
20121 notice and this notice are preserved.