diagnostics: capture backtraces in SARIF notifications [PR116602]
[official-gcc.git] / gcc / rust / ChangeLog
blobf3371663400c81306fc3eac526df563b18f6a410
1 2024-09-26  Owen Avery  <powerboat9.gamer@gmail.com>
3         * checks/errors/borrowck/rust-bir.h
4         (class AbstractExpr): Add virtual destructor.
6 2024-09-25  Mikael Morin  <mikael@gcc.gnu.org>
8         PR other/116801
9         * lang.opt.urls: Regenerate.
11 2024-09-20  David Malcolm  <dmalcolm@redhat.com>
13         PR other/116613
14         * resolve/rust-ast-resolve-expr.cc
15         (funny_ice_finalizer): : Convert first param from
16         diagnostic_context * to diagnostic_text_output_format &.
17         (ResolveExpr::visit): Update for renaming.
19 2024-08-12  Arthur Cohen  <arthur.cohen@embecosm.com>
21         * checks/errors/borrowck/rust-bir-builder.h: Cast size_t values to unsigned
22         long before printing.
23         * checks/errors/borrowck/rust-bir-fact-collector.h: Likewise.
25 2024-08-12  Arthur Cohen  <arthur.cohen@embecosm.com>
27         * checks/errors/borrowck/rust-bir-fact-collector.h (points): Rename
28         `push_subset(PlaceId, PlaceId)` to `push_subset_place(PlaceId, PlaceId)`
30 2024-08-05  Thomas Schwinge  <tschwinge@baylibre.com>
32         * Make-lang.in (RUST_LIBDEPS): Inline into all users.
34 2024-08-05  Thomas Schwinge  <tschwinge@baylibre.com>
36         * Make-lang.in (LIBS): Don't override.
37         (crab1$(exeext):): Use 'CRAB1_LIBS'.
39 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
41         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
42         inherent impl type.
44 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
46         * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Bump copyright.
47         * checks/errors/borrowck/ffi-polonius/src/lib.rs: Bump copyright.
48         * checks/errors/borrowck/polonius/rust-polonius-ffi.h: Bump copyright.
49         * checks/errors/borrowck/polonius/rust-polonius.h: Bump copyright.
50         * checks/errors/borrowck/rust-bir-dump.cc: Bump copyright.
51         * checks/errors/borrowck/rust-bir-fact-collector.h: Bump copyright.
52         * checks/errors/borrowck/rust-bir-free-region.h: Bump copyright.
54 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
56         * checks/errors/borrowck/rust-bir-dump.cc (renumber_places):
57         Remove unecessary braces.
58         (Dump::go): Remove unecessary braces.
59         (Dump::visit): Remove unecessary braces.
60         (Dump::visit_scope): Remove unecessary braces.
61         * checks/errors/borrowck/rust-bir-fact-collector.h (class FactCollector):
62         Remove unecessary braces.
63         (points): Remove unecessary braces.
64         * checks/errors/borrowck/rust-bir-free-region.h: Remove unecessary braces.
65         * checks/errors/borrowck/rust-bir-place.h: Remove unecessary braces.
66         * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
67         Remove unecessary braces.
68         * checks/errors/borrowck/rust-function-collector.h: Remove unecessary braces.
70 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
72         * checks/errors/borrowck/rust-bir-fact-collector.h: New file.
73         * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
74         Enable fact collection.
76 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
78         * checks/errors/borrowck/rust-bir-place.h (struct Lifetime):
79         Extended regions and loans.
80         (struct Loan): Representation of loan (result of borrowing)
81         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
82         Fix let stmt handling.
83         * checks/errors/borrowck/rust-bir-builder-pattern.h: improved
84         pattern translation
85         * checks/errors/borrowck/rust-bir-builder-internal.h: region binding
86         * checks/errors/borrowck/rust-bir-builder-expr-stmt.h (class ExprStmtBuilder):
87         Region support.
88         (class RenumberCtx): Region support.
89         * checks/errors/borrowck/rust-bir-builder.h (class Builder): Region support.
90         * checks/errors/borrowck/rust-bir-dump.cc (get_lifetime_name): Region support.
91         (renumber_places): Region support.
92         (Dump::go): Region support.
93         (Dump::visit): Region support.
94         (Dump::visit_lifetime): Region support.
95         (Dump::visit_scope): Region support.
96         * checks/errors/borrowck/rust-bir.h (class AbstractExpr): Region support.
97         (struct Function): Region support.
98         (class BorrowExpr): Region support.
99         (class CallExpr): Region support.
101 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
103         * typecheck/rust-tyty-variance-analysis-private.h (class FieldVisitorCtx):
104         Region extraction.
105         * typecheck/rust-tyty-variance-analysis.cc (query_field_regions): Region extraction.
106         (FieldVisitorCtx::collect_regions): Region extraction.
107         (FieldVisitorCtx::add_constraints_from_ty): Region extraction.
108         (FieldVisitorCtx::add_constraints_from_region): Region
109         extraction.
110         (FieldVisitorCtx::add_constrints_from_param): Region extraction.
111         * typecheck/rust-tyty-variance-analysis.h (query_field_regions):
112         Region extraction.
114 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
116         * checks/errors/borrowck/rust-bir-free-region.h: New file.
118 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
120         * checks/errors/borrowck/ffi-polonius/Cargo.toml: New file.
121         * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: New file.
122         * checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs: New file.
123         * checks/errors/borrowck/ffi-polonius/src/lib.rs: New file.
124         * checks/errors/borrowck/polonius/rust-polonius-ffi.h: New file.
125         * checks/errors/borrowck/polonius/rust-polonius.h: New file.
127 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
129         * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit): const
130         visitor
131         * checks/errors/borrowck/rust-bir-dump.h: const visitor
132         * checks/errors/borrowck/rust-bir-visitor.h: const visitor
133         * checks/errors/borrowck/rust-bir.h: const getter
135 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
137         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Emit moves.
138         * checks/errors/borrowck/rust-bir-builder-internal.h: Emit moves.
139         * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Emit moves.
140         * checks/errors/borrowck/rust-bir-dump.cc (Dump::visit_move_place): Emit moves.
141         (Dump::visit): Emit moves.
142         * checks/errors/borrowck/rust-bir-place.h (struct Place): Emit moves.
143         * checks/errors/borrowck/rust-bir-visitor.h: Emit moves.
144         * checks/errors/borrowck/rust-bir.h (enum class): Emit moves.
145         (class AbstractExpr): Emit moves.
146         (BasicBlock::is_terminated): Emit moves.
148 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
150         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop):
151         Loop handling.
152         (ExprStmtBuilder::visit): Handle scopes.
153         * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext):
154         Handle scopes.
155         * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Dump scopes.
156         (Dump::visit): Add scopes dump.
157         (Dump::indent): Add indentation logic.
158         (Dump::visit_scope): Dump scope.
159         * checks/errors/borrowck/rust-bir-dump.h: Dump methods.
160         * checks/errors/borrowck/rust-bir-place.h (std::numeric_limits::max): Scope constants.
161         (struct Scope): Scope representation.
162         (class PlaceDB): Scope tracking.
164 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
166         * checks/errors/borrowck/rust-bir-place.h:
167         Create place tree traverse API.
169 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
171         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
172         Use callable API
174 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
176         * checks/errors/borrowck/bir-design-notes.md (nodes): Rename node to statement.
177         (Nodes): Rename node to statement.
178         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
179         Rename node to statement.
180         * checks/errors/borrowck/rust-bir-builder-internal.h: Rename node to statement.
181         * checks/errors/borrowck/rust-bir-builder.h: Rename node to statement.
182         * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Rename node to statement.
183         (Dump::visit): Rename node to statement.
184         * checks/errors/borrowck/rust-bir-dump.h (class Dump): Rename node to statement.
185         * checks/errors/borrowck/rust-bir-visitor.h (class Node): Rename node to statement.
186         (class Statement): Rename node to statement.
187         * checks/errors/borrowck/rust-bir.h (class Node): Rename node to statement.
188         (class Statement): Rename node to statement.
189         (class AbstractExpr): Rename node to statement.
190         (struct Function): Rename node to statement.
191         (struct BasicBlock): Rename node to statement.
193 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
195         * checks/errors/borrowck/rust-bir-dump.cc: Use rust-system.h
196         * checks/errors/borrowck/rust-bir-dump.h (RUST_BIR_DUMP_H): Use rust-system.h
197         * checks/errors/borrowck/rust-bir-place.h (RUST_BIR_PLACE_H): Use rust-system.h
198         * checks/errors/borrowck/rust-function-collector.h: Use rust-system.h
199         * rust-system.h: Use rust-system.h
200         * typecheck/rust-hir-type-check.h: Use rust-system.h
201         * typecheck/rust-tyty-subst.cc: Use rust-system.h
202         * typecheck/rust-tyty-subst.h: Use rust-system.h
203         * typecheck/rust-tyty.h: Use rust-system.h
205 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
207         * typecheck/rust-unify.cc (UnifyRules::go): Always unify to `ltype` if
208         we are matching against a `Never` in `rtype`.
209         (UnifyRules::expect_never): Always unify to the expected type.
211 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
213         * lex/rust-lex.cc
214         (Lexer::parse_raw_string):
215         Bring handling of edge cases to par with parse_raw_byte_string.
217 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
219         * parse/rust-parse-impl.h
220         (Parser::parse_vis_item):
221         Call parse_function instead of parse_async_item when finding
222         UNSAFE or EXTERN_KW during lookahead.
224 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
226         * util/rust-attribute-values.h
227         (Attributes::UNSTABLE): New.
228         * util/rust-attributes.cc
229         (__definitions): Add Attributes::UNSTABLE.
231 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
233         * util/rust-attribute-values.h
234         (Attributes::RUSTC_DEPRECATED): New.
235         * util/rust-attributes.cc
236         (__definitions): Add Attributes::RUSTC_DEPRECATED.
238 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
240         * lex/rust-lex.cc
241         (Lexer::parse_raw_byte_string):
242         Bring handling of edge cases to par with parse_byte_string.
244 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
246         * resolve/rust-forever-stack.h: Change dfs function prototype and
247         declare dfs return type structure.
248         * resolve/rust-forever-stack.hxx: Adapt dfs function to the new return
249         type.
251 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
253         * backend/rust-compile-resolve-path.cc: Attempt to resolve names
254         also using new name resolution context.
255         * backend/rust-compile-resolve-path.h: Add new declaration.
257 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
259         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob):
260         Change function prototype to use a reference instead.
261         (TopLevel::handle_use_dec): Likewise.
262         (TopLevel::handle_rebind): Add name resolution on rebind use
263         declarations.
264         (flatten_rebind): Change prototype to accept a pair of path/alias.
265         (flatten_list): Adapt call to flatten_rebind.
266         (flatten): Adapt call to flatten_rebind.
267         (flatten_glob): Remove unused part.
268         (TopLevel::visit): Add rebind resolution.
269         * resolve/rust-toplevel-name-resolver-2.0.h: Adapt function prototypes.
271 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
273         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add mapping
274         implementation.
275         * resolve/rust-late-name-resolver-2.0.h: Add function visitor prototype
276         override.
278 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
280         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
281         Replace the string format %<%s%> with the proper %qs format.
283 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
285         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
286         Only get immutable name resolution context when name resolution 2.0 is
287         used.
288         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
289         Likewise.
291 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
293         * util/rust-canonical-path.h: Also assign crate number.
295 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
297         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
298         Self generic parameter injection and a warning.
299         * resolve/rust-toplevel-name-resolver-2.0.h: Add function prototype.
301 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
303         * backend/rust-compile-item.cc (CompileItem::visit): Check the resolver
304         flag and use the new one when required.
306 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
308         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
309         empty visit function.
310         * resolve/rust-default-resolver.h: Remove function prototype.
312 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
314         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
315         visitor implementation and scoping.
316         * resolve/rust-default-resolver.h: Remove function prototype.
318 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
320         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
321         constant identifiers to the resolver.
323 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
325         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Change
326         search location for struct types.
328 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
330         * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
331         Change enum type namespace.
333 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
335         * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
336         Add tuple struct type to the resolver's context.
338 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
340         * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
341         Add the struct constructor when the struct is a unit.
343 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
345         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change the
346         namespace for values from "label" to "values".
348 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
350         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
351         function implementation.
352         * resolve/rust-default-resolver.h: Remove function prototype.
354 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
356         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
357         constant item's types.
359 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
361         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
362         function return type.
364 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
366         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
367         Change error message to match old resolver and test case.
369 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
371         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
372         the struct constructor to the value namespace.
374 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
376         * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Adapt
377         resolved type to the new API.
378         (Early::visit_attributes): Retrieve the node id from the definition.
379         * resolve/rust-forever-stack.h: Change the return type of getter
380         functions. Those functions now return a definition type instead of a
381         node id.
382         * resolve/rust-forever-stack.hxx: Change member function implementation
383         in the forever stack to accomodate it's API changes.
384         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Use internal
385         node id. Emit an error when resolving multiple ambiguous values.
386         * resolve/rust-rib.cc (Rib::Definition::Definition): Add a default
387         constructor.
388         (Rib::Definition::is_ambiguous): Add a new function to determine
389         whether a function definition is ambiguous or not.
390         (Rib::Definition::to_string): Add a member function to convert a given
391         definition to a string.
392         (Rib::insert): Add new rules for value insertion in a rib. Insertion
393         order does not impact the result anymore: inserting a shadowable value
394         after a non shadowable one does not trigger an error anymore. All
395         shadowable values inserted in a rib are kepts until being replaced by a
396         non shadowable one.
397         (Rib::get): Return a definition instead of a node id.
398         * resolve/rust-rib.h: Update function prototypes.
399         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob):
400         Update return value container to match the new function's prototype.
401         (TopLevel::handle_use_dec): Likewise.
402         (flatten_glob): Likewise.
404 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
406         * resolve/rust-forever-stack.h: Add a new function prototype to insert
407         a shadowable definition.
408         * resolve/rust-forever-stack.hxx: Add the new insert_shadowable
409         function to insert shadowable definition into the forever stack.
410         * resolve/rust-name-resolution-context.cc (NameResolutionContext::insert_shadowable):
411         Likewise with the name resolution context.
412         * resolve/rust-name-resolution-context.h: Add name resolution context
413         insert_shadowable member function prototype.
414         * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
415         Insert shadowable definition into the forever stack for glob use
416         declaration.
418 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
420         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add a check
421         for missing item.
422         * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::go):
423         Add a new function in the visitor to dispatch the visitor to items in
424         the given module.
425         (TopLevel::handle_use_glob): Change call to visitor to use the pointer.
426         * resolve/rust-toplevel-name-resolver-2.0.h: Add prototype for new
427         member function.
429 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
431         * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
432         Add code path for the resolver 2.0
433         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove failing
434         label context resolve call.
436 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
438         * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
439         Insert names into their namespace.
440         (TopLevel::visit): Insert ast module.
441         (TopLevel::handle_use_dec): Resolve use declaration.
442         (TopLevel::handle_use_glob): Use globbing visitor.
443         (flatten_list): Use globbing path vector.
444         (flatten_glob): Likewise.
445         (flatten): Likewise.
446         (prefix_subpaths): Add a function to prefix subpath.
447         * resolve/rust-toplevel-name-resolver-2.0.h (class GlobbingVisitor):
448         Add globbing visitor.
449         * util/rust-hir-map.cc (Mappings::insert_ast_module): Add function to
450         insert module in module hashmap.
451         (Mappings::lookup_ast_module): Add function to retrieve ast module.
452         * util/rust-hir-map.h: Add module map and getter/setter prototypes.
454 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
456         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Module
457         should be added to the type namespace in order to be retrieved later.
459 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
461         * resolve/rust-late-name-resolver-2.0.cc (Late::setup_builtin_types):
462         Setup bool as builtin type.
464 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
466         * resolve/rust-toplevel-name-resolver-2.0.cc (insert_macros): Add
467         constraint over the ast node id.
468         (TopLevel::visit): Likewise.
470 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
472         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Change
473         error message.
475 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
477         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
478         Use the new dict to track down already resolved use declarations.
479         * resolve/rust-toplevel-name-resolver-2.0.h: Add new dict to store
480         previous use declarations.
482 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
484         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_or_error_out):
485         Add new constraint to duplicate errors.
487 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
489         * resolve/rust-forever-stack.hxx: Start using Rib::Definition for
490         shadowable information.
491         * resolve/rust-late-name-resolver-2.0.cc (next_node_id): New.
492         (next_hir_id): New.
493         (Late::setup_builtin_types): Improve builtin type setup.
494         * resolve/rust-rib.cc (Rib::Definition::Definition): New constructor.
495         (Rib::Definition::Shadowable): Likewise.
496         (Rib::Definition::NonShadowable): Likewise.
497         (Rib::Rib): Fix general constructor.
498         (Rib::insert): Use Definition class.
499         (Rib::get): Likewise.
500         * resolve/rust-rib.h: New Definition class, new prototypes.
502 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
504         * resolve/rust-name-resolution-context.cc (NameResolutionContext::map_usage):
505         Use newtype pattern.
506         (NameResolutionContext::lookup): Likewise.
507         * resolve/rust-name-resolution-context.h (class Usage): New class.
508         (class Definition): Likewise.
509         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Create instances
510         of Usage and Definition.
512 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
514         * backend/rust-compile-base.cc: Use new ImmutableNrCtx.
515         * backend/rust-compile-context.h: Likewise.
516         * backend/rust-compile-expr.cc: Likewise.
517         * backend/rust-compile-item.cc: Likewise.
519 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
521         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Start
522         fetching name resolution information in the typechecker.
523         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
524         Likewise.
525         * typecheck/rust-hir-type-check-path.cc: Use nr 2.0.
527 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
529         * resolve/rust-name-resolution-context.cc (NameResolutionContext::lookup):
530         Add lookup function.
531         * resolve/rust-name-resolution-context.h: Include mappings and optional.
533 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
535         * rust-session-manager.cc (Session::compile_crate): Create an immutable
536         view of the name resolution context.
538 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
540         * rust-session-manager.cc: Add files for dumping name resolution, call
541         name resolution dump function.
542         (Session::dump_name_resolution): New.
543         * rust-session-manager.h: New declaration.
545 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
547         * rust-session-manager.cc (Session::compile_crate): Create name resolution
548         context for Session::expansion and subsequent name resolution passes.
549         (Session::expansion): Take name resolution context as a parameter
550         instead.
551         * rust-session-manager.h (Session::expansion): Fix declaration.
553 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
555         * Make-lang.in: Compile it.
556         * resolve/rust-immutable-name-resolution-context.cc: New file.
557         * resolve/rust-immutable-name-resolution-context.h: New file.
559 2024-08-01  Thomas Schwinge  <tschwinge@baylibre.com>
561         * lex/rust-lex.cc (is_identifier_start): Placate clang-format.
563 2024-08-01  jjasmine  <tanghocle456@gmail.com>
565         * Make-lang.in: add new .o builds for new .cc files
566         * expand/rust-cfg-strip.h (RUST_CFG_STRIP_H): Add include guards
567         for rust-cfg-strip
568         * expand/rust-macro-builtins.cc (make_macro_path_str): moved to new respective files
569         (make_token): moved to new respective files
570         (make_string): moved to new respective files
571         (macro_end_token): moved to new respective files
572         (try_extract_string_literal_from_fragment): moved to new respective files
573         (try_expand_many_expr): moved to new respective files
574         (parse_single_string_literal): moved to new respective files
575         (source_relative_path): moved to new respective files
576         (load_file_bytes): moved to new respective files
577         (MacroBuiltin::assert_handler): moved to new respective files
578         (MacroBuiltin::file_handler): moved to new respective files
579         (MacroBuiltin::column_handler): moved to new respective files
580         (MacroBuiltin::include_bytes_handler): moved to new respective files
581         (MacroBuiltin::include_str_handler): moved to new respective files
582         (MacroBuiltin::compile_error_handler): moved to new respective files
583         (MacroBuiltin::concat_handler): moved to new respective files
584         (MacroBuiltin::env_handler): moved to new respective files
585         (MacroBuiltin::cfg_handler): moved to new respective files
586         (MacroBuiltin::include_handler): moved to new respective files
587         (MacroBuiltin::line_handler): moved to new respective files
588         (MacroBuiltin::stringify_handler): moved to new respective files
589         (struct FormatArgsInput): moved to new respective files
590         (struct FormatArgsParseError): moved to new respective files
591         (format_args_parse_arguments): moved to new respective files
592         (MacroBuiltin::format_args_handler): moved to new respective files
593         * expand/rust-macro-builtins.h (builtin_macro_from_string):
594         merge tl::optional from master
595         * expand/rust-macro-builtins-asm.cc: New file.
596         * expand/rust-macro-builtins-format-args.cc: New file.
597         * expand/rust-macro-builtins-helpers.cc: New file.
598         * expand/rust-macro-builtins-helpers.h: New file.
599         * expand/rust-macro-builtins-include.cc: New file.
600         * expand/rust-macro-builtins-location.cc: New file.
601         * expand/rust-macro-builtins-log-debug.cc: New file.
602         * expand/rust-macro-builtins-test-bench.cc: New file.
603         * expand/rust-macro-builtins-trait.cc: New file.
604         * expand/rust-macro-builtins-utility.cc: New file.
606 2024-08-01  Guillaume Gomez  <guillaume1.gomez@gmail.com>
608         * expand/rust-derive.cc (DeriveVisitor::derive): Fix typo
610 2024-08-01  jjasmine  <tanghocle456@gmail.com>
612         * hir/rust-ast-lower-extern.h: Add translate_visiblity
613         * hir/tree/rust-hir-item.h: Fix constructor of ExternalTypeItem
615 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
617         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
618         Collect variance info from types.
620 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
622         * Make-lang.in: Add new .cc file.
623         * rust-session-manager.cc (Session::compile_crate): Run
624         analysis.
625         * typecheck/rust-tyty-variance-analysis-private.h: New file.
626         * typecheck/rust-tyty-variance-analysis.cc: New file.
627         * typecheck/rust-tyty-variance-analysis.h: New file.
628         * typecheck/rust-typecheck-context.cc
629         (TypeCheckContext::get_variance_analysis_ctx):
630         Variance analysis context.
631         * typecheck/rust-hir-type-check.h (TypeCheckItem::visit):
632         Variance analysis context.
634 2024-08-01  Jakub Dupak  <dev@jakubdupak.com>
636         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_arg_at):
637         Add unified API.
639 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
641         * expand/rust-macro-builtins.cc (struct FormatArgsInput): Store the format_str
642         as a string instead of an AST::Expr.
643         (format_args_parse_arguments): Transform format_expr into a format string
644         properly - add note for handling eager macro invocations later on.
645         (MacroBuiltin::format_args_handler): Parse the correct input, append
646         newline to format_str if necessary.
648 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
650         * ast/rust-ast-builder.h: Rename AST::AstBuilder -> AST::Builder
651         * ast/rust-ast-builder.cc: Likewise.
652         * expand/rust-derive.cc: Use new AST::Builder name.
653         * expand/rust-derive.h: Likewise.
654         * ast/rust-builtin-ast-nodes.h: Add required getters.
655         * expand/rust-expand-format-args.cc (format_arg): New.
656         (get_trait_name): New.
657         (expand_format_args): Properly expand basic format_args!() invocations.
658         * expand/rust-expand-format-args.h (expand_format_args): Fix signature.
659         * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
660         Call into expand_format_args().
662 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
664         * ast/rust-fmt.cc (ffi::RustHamster::to_string): New.
665         (Pieces::collect): Adapt to use new handle API.
666         (Pieces::~Pieces): Likewise.
667         (Pieces::Pieces): Likewise.
668         (Pieces::operator=): Likewise.
669         * ast/rust-fmt.h (struct RustString): Add members.
670         (struct FormatArgsHandle): New.
671         (clone_pieces): Adapt for new FFI API.
672         (destroy_pieces): Likewise.
673         (struct Pieces): Store new FormatArgsHandle type.
674         * expand/rust-expand-format-args.cc (expand_format_args): Use proper
675         namespace.
676         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): FormatArgs
677         nodes are already resolved, so do nothing.
679 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
681         * Make-lang.in: Add new object.
682         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Remove calls to
683         FormatArgsLowering.
684         * expand/rust-expand-format-args.cc: New file.
685         * expand/rust-expand-format-args.h: New file.
687 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
689         * ast/rust-macro.h: Use proper node id instead of the one in the base
690         Expr class - which is uninitialized.
692 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
694         * ast/rust-ast-collector.cc (TokenCollector::visit): Remove reference
695         to unique pointer and replace it with a direct reference to the wrapped
696         data.
697         * ast/rust-ast.cc (VariadicParam::as_string): Likewise.
698         (BlockExpr::normalize_tail_expr): Likewise.
699         * ast/rust-expr.h: Likewise and add pointer getter in order to allow
700         pointer reseat.
701         * ast/rust-item.h: Likewise and add pointer getter for reseat.
702         * ast/rust-path.h: Likewise.
703         * ast/rust-pattern.h: Likewise.
704         * ast/rust-stmt.h: Likewise.
705         * ast/rust-type.h: Likewise.
706         * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_struct_fields):
707         Remove references to unique pointers and replace it with direct
708         references to the wrapped object.
709         (CfgStrip::maybe_strip_tuple_fields): Likewise.
710         (CfgStrip::maybe_strip_generic_args): Likewise.
711         (CfgStrip::maybe_strip_qualified_path_type): Likewise.
712         (CfgStrip::visit): Likewise.
713         * expand/rust-expand-visitor.cc (ExpandVisitor::maybe_expand_expr):
714         Likewise.
715         (ExpandVisitor::maybe_expand_type): Likewise.
716         (ExpandVisitor::visit): Likewise.
717         * expand/rust-expand-visitor.h: Likewise.
718         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_binding):
719         Likewise.
720         (ASTLoweringBase::lower_generic_args): Likewise.
721         (ASTLoweringBase::lower_self): Likewise.
722         (ASTLoweringBase::lower_type_no_bounds): Likewise.
723         (ASTLoweringBase::lower_bound): Likewise.
724         (ASTLoweringBase::lower_range_pattern_bound): Likewise.
725         * hir/rust-ast-lower-base.h: Likewise.
726         * hir/rust-ast-lower-block.h: Likewise.
727         * hir/rust-ast-lower-enumitem.h: Likewise.
728         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::translate): Likewise.
729         (ASTLoweringExpr::visit): Likewise.
730         * hir/rust-ast-lower-expr.h: Likewise.
731         * hir/rust-ast-lower-extern.h: Likewise.
732         * hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::translate):
733         Likewise.
734         (ASTLowerImplItem::visit): Likewise.
735         (ASTLowerTraitItem::translate): Likewise.
736         (ASTLowerTraitItem::visit): Likewise.
737         * hir/rust-ast-lower-implitem.h: Likewise.
738         * hir/rust-ast-lower-item.cc (ASTLoweringItem::translate): Likewise.
739         (ASTLoweringItem::visit): Likewise.
740         * hir/rust-ast-lower-item.h: Likewise.
741         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate):
742         Likewise.
743         (ASTLoweringPattern::visit): Likewise.
744         * hir/rust-ast-lower-pattern.h: Likewise.
745         * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
746         * hir/rust-ast-lower-struct-field-expr.h: Likewise.
747         * hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Likewise.
748         (ASTLowerQualifiedPathInType::visit): Likewise.
749         (ASTLoweringType::translate): Likewise.
750         (ASTLoweringType::visit): Likewise.
751         (ASTLowerGenericParam::translate): Likewise.
752         (ASTLowerGenericParam::visit): Likewise.
753         (ASTLoweringTypeBounds::translate): Likewise.
754         (ASTLoweringTypeBounds::visit): Likewise.
755         (ASTLowerWhereClauseItem::visit): Likewise.
756         * hir/rust-ast-lower-type.h: Likewise.
757         * hir/rust-ast-lower.cc (ASTLowering::go): Likewise.
758         (ASTLoweringBlock::visit): Likewise.
759         (ASTLoweringIfBlock::visit): Likewise.
760         (ASTLoweringIfLetBlock::visit): Likewise.
761         (ASTLowerStructExprField::visit): Likewise.
762         (ASTLoweringExprWithBlock::visit): Likewise.
763         (ASTLoweringBase::lower_qual_path_type): Likewise.
764         (ASTLoweringBase::lower_closure_param): Likewise.
765         * resolve/rust-ast-resolve-base.cc (ResolverBase::resolve_visibility):
766         Likewise.
767         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::go): Likewise.
768         (ResolveExpr::visit): Likewise.
769         (ResolveExpr::resolve_closure_param): Likewise.
770         * resolve/rust-ast-resolve-expr.h: Likewise.
771         * resolve/rust-ast-resolve-implitem.h: Likewise.
772         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
773         Likewise.
774         (ResolveItem::go): Likewise.
775         (ResolveItem::visit): Likewise.
776         (ResolveItem::resolve_impl_item): Likewise.
777         (ResolveItem::resolve_extern_item): Likewise.
778         (ResolveImplItems::go): Likewise.
779         (ResolveExternItem::go): Likewise.
780         (ResolveExternItem::visit): Likewise.
781         * resolve/rust-ast-resolve-item.h: Likewise.
782         * resolve/rust-ast-resolve-path.cc (ResolvePath::go): Likewise.
783         (ResolvePath::resolve_path): Likewise.
784         * resolve/rust-ast-resolve-path.h: Likewise.
785         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
786         Likewise.
787         (PatternDeclaration::visit): Likewise.
788         (resolve_range_pattern_bound): Likewise.
789         * resolve/rust-ast-resolve-pattern.h: Likewise.
790         * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): Likewise.
791         * resolve/rust-ast-resolve-stmt.h: Likewise.
792         * resolve/rust-ast-resolve-struct-expr-field.cc (ResolveStructExprField::go):
793         Likewise.
794         (ResolveStructExprField::visit): Likewise.
795         * resolve/rust-ast-resolve-struct-expr-field.h: Likewise.
796         * resolve/rust-ast-resolve-toplevel.h: Likewise.
797         * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
798         (ResolveRelativeTypePath::go): Likewise.
799         (ResolveRelativeQualTypePath::resolve_qual_seg): Likewise.
800         (ResolveTypeToCanonicalPath::go): Likewise.
801         (ResolveTypeToCanonicalPath::visit): Likewise.
802         (ResolveGenericArgs::resolve_disambiguated_generic): Likewise.
803         (ResolveGenericArgs::go): Likewise.
804         * resolve/rust-ast-resolve-type.h: Likewise.
805         * resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
806         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
807         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_qualified_path_type):
808         Likewise.
809         (EarlyNameResolver::visit): Likewise.
810         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
811         Likewise.
812         * checks/errors/rust-ast-validation.cc: Likewise.
814 2024-08-01  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
816         * ast/rust-item.h: Change getter function prototype to return a
817         reference directly instead of a reference to the wrapper type.
818         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Fix
819         the code to accept references instead.
820         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Change
821         function implementation to return a reference.
822         * hir/rust-ast-lower-base.h: Accept a reference instead of a unique
823         pointer reference.
824         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Adapt the code
825         to a reference instead of a unique pointer.
827 2024-08-01  Thomas Schwinge  <tschwinge@baylibre.com>
829         * backend/rust-tree.cc (c_common_type_for_mode): Placate clang-format.
831 2024-08-01  0xn4utilus  <gyanendrabanjare8@gmail.com>
833         * ast/rust-ast-collector.cc (TokenCollector::visit):
834         Remove dead code.
835         * ast/rust-ast-collector.h: Likewise.
836         * ast/rust-ast-full-decls.h (class ExternalFunctionItem):
837         Likewise.
838         * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
839         Likewise.
840         * ast/rust-ast-visitor.h: Likewise.
841         * ast/rust-ast.cc (ExternalFunctionItem::as_string): Likewise.
842         (ExternalFunctionItem::accept_vis): Likewise.
843         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
844         Likewise.
845         * checks/errors/rust-ast-validation.h: Likewise.
846         * checks/errors/rust-feature-gate.h: Likewise.
847         * expand/rust-cfg-strip.cc (CfgStrip::visit):
848         Likewise.
849         * expand/rust-cfg-strip.h: Likewise.
850         * expand/rust-derive.h: Likewise.
851         * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
852         Likewise.
853         * expand/rust-expand-visitor.h: Likewise.
854         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit):
855         Likewise.
856         * hir/rust-ast-lower-base.h: Likewise.
857         * metadata/rust-export-metadata.cc (ExportContext::emit_function):
858         Likewise.
859         * parse/rust-parse-impl.h: Likewise.
860         * parse/rust-parse.h: Likewise.
861         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit):
862         Likewise.
863         * resolve/rust-ast-resolve-base.h: Likewise.
864         * resolve/rust-default-resolver.cc (DefaultResolver::visit):
865         Likewise.
866         * resolve/rust-default-resolver.h: Likewise.
867         * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
868         * util/rust-attributes.h: Likewise.
870 2024-08-01  0xn4utilus  <gyanendrabanjare8@gmail.com>
872         * checks/errors/rust-feature-gate.cc (FeatureGate::visit):
873         Check if function is_external or not.
874         * hir/rust-ast-lower-extern.h: Use AST::Function
875         instead of AST::ExternalFunctionItem.
876         * parse/rust-parse-impl.h (Parser::parse_external_item):
877         Likewise.
878         (Parser::parse_pattern): Fix clang format.
879         * resolve/rust-ast-resolve-implitem.h: Likewise.
880         * resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
881         Likewise.
882         * resolve/rust-ast-resolve-item.h: Likewise.
883         * resolve/rust-default-resolver.cc (DefaultResolver::visit):
884         Check if param has_pattern before using get_pattern.
886 2024-08-01  0xn4utilus  <gyanendrabanjare8@gmail.com>
888         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
889         Add external function validation support. Add ErrorCode::E0130.
890         * parse/rust-parse-impl.h (Parser::parse_function): Parse
891         external functions from `parse_function`.
892         (Parser::parse_external_item): Clang format.
893         (Parser::parse_pattern): Clang format.
894         * parse/rust-parse.h: Add default parameter
895         `is_external` in `parse_function`.
897 2024-08-01  0xn4utilus  <gyanendrabanjare8@gmail.com>
899         * ast/rust-ast.h: Add Kind Enum to
900         Pattern.
901         * ast/rust-macro.h: Add get_pattern_kind().
902         * ast/rust-path.h: Likewise.
903         * ast/rust-pattern.h: Likewise.
905 2024-08-01  0xn4utilus  <gyanendrabanjare8@gmail.com>
907         * ast/rust-ast.cc (Function::Function): Add `is_external_function` field.
908         (Function::operator=): Likewise.
909         * ast/rust-ast.h: New constructor for ExternalItem.
910         * ast/rust-item.h (class Function): Add `is_external_function`
911         field. Update `get_node_id`.
912         * ast/rust-macro.h: Update copy constructor.
914 2024-08-01  Sourabh Jaiswal  <sourabhrj31@gmail.com>
916         * expand/rust-expand-visitor.cc
917         (ExpandVisitor::expand_inner_items): Adjust to use has_value ()
918         (ExpandVisitor::expand_inner_stmts): Likewise
919         * expand/rust-macro-builtins.cc (builtin_macro_from_string): Likewise
920         (make_macro_path_str): Likewise
921         * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise
922         * util/rust-lang-item.cc (LangItem::Parse): Adjust to return tl::optional
923         (LangItem::toString) Likewise
924         * util/rust-token-converter.cc (handle_suffix): Adjust to use value.or ()
925         (from_literal) Likewise
926         * util/bi-map.h (BiMap::lookup): Adjust to use tl::optional for
927         lookups
929 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
931         * ast/rust-pattern.h
932         (class TupleStructPattern): Assert that items != nullptr.
933         (class TuplePattern): Likewise.
934         (TupleStructPattern::has_items): Remove.
935         (TuplePattern::has_tuple_pattern_items): Likewise.
936         * parse/rust-parse-impl.h
937         (Parser::parse_ident_leading_pattern):
938         Prevent construction of TupleStructPattern with
939         (items == nullptr).
940         (Parser::parse_pattern_no_alt): Likewise.
941         * ast/rust-ast-collector.cc
942         (TokenCollector::visit): Remove usage of
943         TupleStructPattern::has_items.
944         * ast/rust-ast-visitor.cc
945         (DefaultASTVisitor::visit): Likewise.
946         * resolve/rust-early-name-resolver.cc
947         (EarlyNameResolver::visit): Likewise.
949 2024-08-01  jjasmine  <tanghocle456@gmail.com>
951         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
953 2024-08-01  jjasmine  <tanghocle456@gmail.com>
955         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
957 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
959         * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Add
960         documentation regarding future tasks.
962 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
964         * Make-lang.in: Compile the new source file.
965         * ast/rust-ast-collector.cc (TokenCollector::visit): Error out when
966         visiting FormatArgs nodes.
967         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
968         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
969         * ast/rust-ast.cc (FormatArgs::get_locus): New.
970         * ast/rust-builtin-ast-nodes.h: Improve FormatArgs API.
971         * ast/rust-fmt.cc (Pieces::~Pieces): Cleanup.
972         (Pieces::Pieces): Likewise.
973         * ast/rust-fmt.h (struct Pieces): Add pieces_vector member.
974         * hir/rust-ast-lower-format-args.cc: New file.
975         * hir/rust-ast-lower-format-args.h: New file.
977 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
979         * ast/rust-ast.cc: Make FormatArgs inherit from AST::Expr
980         * ast/rust-builtin-ast-nodes.h: Improve FormatArg* nodes and helpers.
981         * ast/rust-fmt.cc (Pieces::collect): Fix interface to match FFI function.
982         * ast/rust-fmt.h (collect_pieces): Likewise.
983         (struct Pieces): Add append_newline parameter.
984         * expand/rust-macro-builtins.cc: Add proper parsing of format_args
985         input.
986         * hir/rust-ast-lower-base.cc: Include diagnostics header.
988 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
990         * parse/rust-parse.h: New method.
992 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
994         * expand/rust-macro-builtins.cc (format_args_maker): New function.
995         (try_expand_many_expr): Add comment about reworking function.
996         (MacroBuiltin::format_args_handler): Add newline parameter.
997         * expand/rust-macro-builtins.h: Likewise.
999 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1001         * ast/rust-builtin-ast-nodes.h: New file.
1002         * ast/rust-ast-full-decls.h (class FormatArgs): Declare new class.
1003         * ast/rust-ast-collector.cc: Handle FormatArgs nodes properly.
1004         * ast/rust-ast-collector.h: Likewise.
1005         * ast/rust-ast-full.h: Likewise.
1006         * ast/rust-ast-visitor.cc: Likewise.
1007         * ast/rust-ast-visitor.h: Likewise.
1008         * ast/rust-ast.cc: Likewise.
1009         * ast/rust-ast.h: Likewise.
1010         * expand/rust-derive.h: Likewise.
1011         * hir/rust-ast-lower-base.cc: Likewise.
1012         * hir/rust-ast-lower-base.h: Likewise.
1013         * hir/rust-ast-lower-expr.cc: Likewise.
1014         * hir/rust-ast-lower-expr.h: Likewise.
1015         * resolve/rust-ast-resolve-base.cc: Likewise.
1016         * resolve/rust-ast-resolve-base.h: Likewise.
1018 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
1020         * resolve/rust-default-resolver.cc
1021         (DefaultResolver::visit): Visit inner AST nodes of ClosureExprInner,
1022         ClosureExprInnerTyped, IfExpr, IfExprConseqElse, MatchExpr,
1023         PathInExpression, EnumItemTuple, EnumItemStruct, and
1024         EnumItemDiscriminant.
1025         * ast/rust-item.h
1026         (EnumItemDiscriminant::has_expr): New function.
1028 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1030         * hir/rust-ast-lower-extern.h: Lower to HIR::ExternalTypeItem nodes.
1031         * hir/tree/rust-hir-item.h (class ExternalTypeItem): Create private
1032         visibility by default as extern types have no visibility - add a comment
1033         about the correctness of this.
1035 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1037         * hir/tree/rust-hir-item.h (class ExternalTypeItem): New class.
1038         * hir/tree/rust-hir.cc (ExternalTypeItem::as_string): Likewise.
1039         * backend/rust-compile-extern.h: Add base for handling HIR::ExternalTypeItem
1040         node.
1041         * checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
1042         * checks/errors/borrowck/rust-function-collector.h: Likewise.
1043         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
1044         * checks/errors/rust-const-checker.h: Likewise.
1045         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
1046         * checks/errors/rust-unsafe-checker.h: Likewise.
1047         * hir/rust-ast-lower-extern.h: Likewise.
1048         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
1049         * hir/rust-hir-dump.h: Likewise.
1050         * hir/tree/rust-hir-full-decls.h (class ExternalTypeItem): Likewise.
1051         * hir/tree/rust-hir-visitor.h: Likewise.
1052         (ExternalTypeItem::accept_vis): Likewise.
1053         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise.
1054         * typecheck/rust-hir-type-check-implitem.h: Likewise.
1056 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1058         * resolve/rust-ast-resolve-implitem.h: Declare external types as new
1059         types.
1061 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1063         * util/rust-lang-item.h (class RustLangItem): Renamed to...
1064         (class LangItem): ...this. Rename ItemType enum to Kind
1065         * util/rust-lang-item.cc: Rename methods to use new class name.
1066         * backend/rust-compile-expr.cc (CompileExpr::visit): Use new lang-item API.
1067         (CompileExpr::resolve_operator_overload): Likewise.
1068         * backend/rust-compile-expr.h: Likewise.
1069         * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_lang_item_attribute): Likewise.
1070         * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): Likewise.
1071         (AutoderefCycle::cycle): Likewise.
1072         * typecheck/rust-autoderef.h: Likewise.
1073         * typecheck/rust-hir-type-bounds.h: Likewise.
1074         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate): Likewise.
1075         * typecheck/rust-hir-type-check-base.h: Likewise.
1076         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
1077         * typecheck/rust-hir-type-check-expr.h: Likewise.
1078         * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise.
1079         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): Likewise.
1080         (TypeBoundsProbe::assemble_builtin_candidate): Likewise.
1081         (TypeCheckBase::get_predicate_from_bound): Likewise.
1082         * typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
1083         * util/rust-hir-map.cc (Mappings::get_lang_item): Likewise.
1084         (Mappings::lookup_trait_item_lang_item): Likewise.
1085         * util/rust-hir-map.h: Likewise.
1087 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1089         * Make-lang.in: Compile new rust-lang-item.o.
1090         * util/rust-lang-item.h: Split into header and source.
1091         * util/rust-lang-item.cc: Cleanup parsing of lang items by using a hashmap
1092         and returning optional values, cleanup handling of exhaustive lang item
1093         lookups.
1094         * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_lang_item_attribute): Use
1095         new optional API.
1097 2024-08-01  jjasmine  <tanghocle456@gmail.com>
1099         * expand/rust-macro-builtins.cc: Change BuiltinMacro in
1100         builtin_macro_from_string to tl::optional<>
1101         * expand/rust-macro-builtins.h (enum class): Change BuiltinMacro
1102         in builtin_macro_from_string to tl::optional<>
1103         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
1104         Resolved wrong type dependency of builtin_macro_from_string
1106 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1108         * ast/rust-fmt.cc (Pieces::collect): Fix signature to take ownership
1109         of the given string.
1110         * ast/rust-fmt.h (struct Pieces): Store parsed string in the struct.
1112 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1114         * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
1115         Transform entire invocation token stream into string for the parser.
1117 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1119         * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
1120         Construct string to parser properly.
1122 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1124         * ast/rust-fmt.cc (Pieces::~Pieces): Call libformat_parser's release
1125         function in destructor.
1126         * ast/rust-fmt.h (struct PieceSlice): Add capacity.
1127         (destroy_pieces): New.
1128         (struct Pieces): Add destructor.
1130 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1132         * ast/rust-fmt.cc (Pieces::collect): Use new Pieces API.
1133         * ast/rust-fmt.h: Update interface with new FFI bindings.
1135 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1137         * ast/rust-fmt.h: Add remaining FFI types.
1139 2024-08-01  Thomas Schwinge  <tschwinge@baylibre.com>
1141         * Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
1142         build in libgrust.
1143         (%.toml:, $(LIBFORMAT_PARSER):): Remove.
1145 2024-08-01  Thomas Schwinge  <tschwinge@baylibre.com>
1147         * Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
1148         directory.
1149         * ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
1151 2024-08-01  Thomas Schwinge  <tschwinge@baylibre.com>
1153         * Make-lang.in (LIBFORMAT_PARSER): Point to the actual build artifact.
1154         ($(LIBFORMAT_PARSER)): Don't cache it.
1156 2024-08-01  Thomas Schwinge  <tschwinge@baylibre.com>
1158         * Make-lang.in (LIBPROC_MACRO_INTERNAL): New.
1159         (RUST_LIBDEPS, crab1$(exeext), rust/libformat_parser.a): Use it.
1161 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1163         * Make-lang.in: Compile libformat_parser.
1164         * ast/rust-fmt.cc: New FFI definitions.
1165         * ast/rust-fmt.h: Likewise.
1166         * expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Call
1167         into libformat_parser.
1168         * expand/rust-macro-builtins.h: Define format_args!() handler proper.
1170 2024-08-01  Arthur Cohen  <arthur.cohen@embecosm.com>
1172         * Make-lang.in: Compile rust-fmt object
1173         * ast/rust-fmt.cc: New file.
1174         * ast/rust-fmt.h: New file.
1176 2024-08-01  Marc Poulhiès  <dkm@kataplop.net>
1178         * rust-lang.cc (grs_langhook_type_for_mode): simplify code for
1179         xImode. Add missing long_double_type_node.
1181 2024-08-01  Owen Avery  <powerboat9.gamer@gmail.com>
1183         * hir/rust-ast-lower-pattern.cc
1184         (ASTLoweringPattern::visit):
1185         Reset is_let_top_level while visiting GroupedPattern.
1187 2024-08-01  Thomas Schwinge  <thomas@codesourcery.com>
1189         * backend/rust-compile-base.cc (HIRCompileBase::compile_function):
1190         For 'main', initialize 'main_identifier_node'.
1192 2024-07-12  Daniel Bertalan  <dani@danielbertalan.dev>
1194         * metadata/rust-imports.cc (Import::try_package_in_directory):
1195         Change NULL to nullptr.
1197 2024-06-25  Kewen Lin  <linkw@linux.ibm.com>
1199         * rust-gcc.cc (float_type): Use TYPE_PRECISION of
1200         {float,double,long_double}_type_node to replace
1201         {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE.
1203 2024-06-11  Arthur Cohen  <arthur.cohen@embecosm.com>
1205         * Make-lang.in: Remove overazealous LIBS = -ldl -lpthread line, link
1206         crab1 against CRAB1_LIBS.
1208 2024-04-15  Thomas Schwinge  <tschwinge@baylibre.com>
1210         * Make-lang.in (RUST_LIBDEPS): Inline into single user.
1212 2024-04-15  Thomas Schwinge  <tschwinge@baylibre.com>
1214         * Make-lang.in (LIBPROC_MACRO_INTERNAL): New.
1215         (RUST_LIBDEPS, crab1$(exeext)): Use it.
1217 2024-04-15  Thomas Schwinge  <tschwinge@baylibre.com>
1219         * Make-lang.in (RUST_LDFLAGS): Inline into single user.
1221 2024-04-15  Thomas Schwinge  <tschwinge@baylibre.com>
1223         * Make-lang.in (RUST_LDFLAGS): Remove
1224         'libgrust/libproc_macro_internal'.
1226 2024-04-09  Christophe Lyon  <christophe.lyon@linaro.org>
1228         * Make-lang.in (rust.install-dvi, rust.install-html): New rules.
1230 2024-03-04  Mark Wielaard  <mark@klomp.org>
1232         * lang.opt.urls: Regenerate.
1234 2024-02-21  0xn4utilus  <gyanendrabanjare8@gmail.com>
1236         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
1237         Add variadic check on all parameters.
1239 2024-02-21  Owen Avery  <powerboat9.gamer@gmail.com>
1241         * backend/rust-compile-pattern.cc
1242         (CompilePatternLet::visit):
1243         Lookup type of sub-pattern, not tuple pattern itself.
1245 2024-02-21  Marc Poulhiès  <dkm@kataplop.net>
1247         * backend/rust-builtins.cc
1248         (BuiltinsContext::register_rust_mappings): Add powi and reformat.
1249         * backend/rust-builtins.h: Add missing copyright header.
1251 2024-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1253         * expand/rust-macro-expand.h (struct MacroExpander): Nitpick: fix
1254         formatting of emitted error.
1256 2024-02-21  Owen Avery  <powerboat9.gamer@gmail.com>
1258         * resolve/rust-ast-resolve-item.cc
1259         (flatten_glob): Use Import class.
1260         (flatten_rebind): Likewise.
1261         (flatten_list): Likewise.
1262         (flatten): Likewise.
1263         (flatten_use_dec_to_paths): Likewise.
1264         (flatten_use_dec_to_imports): Likewise.
1265         (ResolveItem::visit): Likewise.
1266         (Import::add_prefix): New.
1267         (rust_flatten_nested_glob): Adjust test.
1268         (rust_flatten_glob): Likewise.
1269         (rust_flatten_rebind_none): Likewise.
1270         (rust_flatten_rebind): Likewise.
1271         (rust_flatten_rebind_nested): Likewise.
1272         (rust_flatten_list): Likewise.
1273         * resolve/rust-ast-resolve-item.h
1274         (class Import): New.
1276 2024-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1278         * typecheck/rust-hir-type-check-implitem.h: Fix typo in field
1279         (region_costraints -> region_constraints).
1281 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1283         * parse/rust-parse-impl.h (Parser::parse_trait_item):
1284         Handle macros in trait items similar to how its handled for trait
1285         implementation items.
1287 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1289         * ast/rust-ast-collector.cc (TokenCollector::visit):
1290         Remove obsolete classes and functions.
1291         * ast/rust-ast-collector.h:
1292         Likewise.
1293         * ast/rust-ast-full-decls.h (class TraitFunctionDecl):
1294         Likewise.
1295         (class TraitItemFunc):
1296         Likewise.
1297         (class TraitMethodDecl):
1298         Likewise.
1299         (class TraitItemMethod):
1300         Likewise.
1301         * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
1302         Likewise.
1303         * ast/rust-ast-visitor.h:
1304         Likewise.
1305         * ast/rust-ast.cc (TraitItemFunc::TraitItemFunc):
1306         Likewise.
1307         (TraitItemFunc::operator=):
1308         Likewise.
1309         (TraitItemFunc::as_string):
1310         Likewise.
1311         (TraitFunctionDecl::as_string):
1312         Likewise.
1313         (TraitItemMethod::TraitItemMethod):
1314         Likewise.
1315         (TraitItemMethod::operator=):
1316         Likewise.
1317         (TraitItemMethod::as_string):
1318         Likewise.
1319         (TraitMethodDecl::as_string):
1320         Likewise.
1321         (TraitItemFunc::accept_vis):
1322         Likewise.
1323         (TraitItemMethod::accept_vis):
1324         Likewise.
1325         * ast/rust-item.h (class TraitFunctionDecl):
1326         Likewise.
1327         (class TraitItemFunc):
1328         Likewise.
1329         (class TraitMethodDecl):
1330         Likewise.
1331         (class TraitItemMethod):
1332         Likewise.
1333         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
1334         Likewise.
1335         * checks/errors/rust-ast-validation.h:
1336         Likewise.
1337         * checks/errors/rust-feature-gate.h:
1338         Likewise.
1339         * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_trait_function_decl):
1340         Likewise.
1341         (CfgStrip::maybe_strip_trait_method_decl):
1342         Likewise.
1343         (CfgStrip::visit):
1344         Likewise.
1345         * expand/rust-cfg-strip.h:
1346         Likewise.
1347         * expand/rust-derive.h:
1348         Likewise.
1349         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_trait_function_decl):
1350         Likewise.
1351         (ExpandVisitor::expand_trait_method_decl):
1352         Likewise.
1353         (ExpandVisitor::visit):
1354         Likewise.
1355         * expand/rust-expand-visitor.h:
1356         Likewise.
1357         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit):
1358         Likewise.
1359         * hir/rust-ast-lower-base.h:
1360         Likewise.
1361         * hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit):
1362         Likewise.
1363         * hir/rust-ast-lower-implitem.h:
1364         Likewise.
1365         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit):
1366         Likewise.
1367         * resolve/rust-ast-resolve-base.h:
1368         Likewise.
1369         * resolve/rust-ast-resolve-implitem.h (visit):
1370         Likewise.
1371         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
1372         Likewise.
1373         * resolve/rust-ast-resolve-item.h:
1374         Likewise.
1375         * resolve/rust-default-resolver.cc (DefaultResolver::visit):
1376         Likewise.
1377         * resolve/rust-default-resolver.h:
1378         Likewise.
1379         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
1380         Likewise.
1381         * resolve/rust-toplevel-name-resolver-2.0.h:
1382         Likewise.
1383         * util/rust-attributes.cc (AttributeChecker::visit):
1384         Likewise.
1385         * util/rust-attributes.h:
1386         Likewise.
1388 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1390         * parse/rust-parse-impl.h (Parser::parse_trait_item):
1391         Use parse_function() to parse trait functions.
1393 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1395         * hir/rust-ast-lower-implitem.cc (ASTLowerTraitItem::visit):
1396         Provide visitor for AST::Function.
1397         * hir/rust-ast-lower-implitem.h:
1398         Likewise.
1399         * resolve/rust-ast-resolve-implitem.h:
1400         Likewise.
1401         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
1402         Likewise.
1403         * resolve/rust-ast-resolve-item.h:
1404         Likewise.
1406 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1408         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
1409         Add checks for Trait functions.
1411 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1413         * ast/rust-ast.h: Replace TraitItem with AssociatedItem.
1414         * ast/rust-item.h (class Trait): Likewise.
1415         * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
1416         Likewise.
1417         * parse/rust-parse-impl.h (Parser::parse_trait): Likewise.
1418         * parse/rust-parse.h: Likewise.
1420 2024-02-07  Philip Herron  <herron.philip@googlemail.com>
1422         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): use destructure
1424 2024-02-07  Nobel Singh  <nobel2073@gmail.com>
1426         * Make-lang.in: Add rust-ast-lower-implitem.cc to list of objects.
1427         * hir/rust-ast-lower-implitem.h (RUST_AST_LOWER_IMPLITEM_H): Remove
1428         implementation.
1429         * hir/rust-ast-lower-implitem.cc: Copy implementation from header.
1431 2024-02-07  Philip Herron  <herron.philip@googlemail.com>
1433         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): refactor
1434         * typecheck/rust-hir-type-check.h: new prototype
1435         * typecheck/rust-typecheck-context.cc (TypeCheckContext::compute_inference_variables): x
1437 2024-02-07  Philip Herron  <herron.philip@googlemail.com>
1439         * typecheck/rust-hir-type-check-type.cc: remove hack
1441 2024-02-07  Philip Herron  <herron.philip@googlemail.com>
1443         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): remove hack
1445 2024-02-07  Philip Herron  <herron.philip@googlemail.com>
1447         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): fix
1449 2024-02-07  Nobel Singh  <nobel2073@gmail.com>
1451         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
1452         Change default ABI to C for extern functions
1453         (ASTLoweringBase::lower_extern_block): Likewise
1455 2024-02-07  Jakub Dupak  <dev@jakubdupak.com>
1457         * typecheck/rust-tyty.cc (BaseType::BaseType): Store orig ref.
1458         (BaseType::get_orig_ref): Add getter.
1459         * typecheck/rust-tyty.h: Store orig ref.
1461 2024-02-07  Jakub Dupak  <dev@jakubdupak.com>
1463         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
1464         Add region constraints.
1465         (TypeCheckImplItem::visit): Add region constraints.
1466         * typecheck/rust-hir-type-check-implitem.h: Add region constraints.
1467         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelf):
1468         Add region constraints.
1469         (TypeCheckItem::visit): Add region constraints.
1470         (TypeCheckItem::resolve_impl_item): Add region constraints.
1471         (TypeCheckItem::resolve_impl_block_substitutions): Add region constraints.
1472         * typecheck/rust-hir-type-check-item.h: Add region constraints.
1473         * typecheck/rust-hir-type-check-type.cc (ResolveWhereClauseItem::Resolve):
1474         Add region constraints.
1475         (ResolveWhereClauseItem::visit): Add region constraints.
1476         * typecheck/rust-hir-type-check-type.h (class ResolveWhereClauseItem):
1477         Add region constraints.
1478         * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
1479         Add region constraints.
1480         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate):
1481         Add region constraints.
1482         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_region_constraints):
1483         Add region constraints.
1484         * typecheck/rust-tyty-subst.h (class BaseType): Add region constraints.
1485         (struct RegionConstraints): Add region constraints.
1486         * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): Add region constraints.
1487         (ADTType::clone): Add region constraints.
1488         (FnType::clone): Add region constraints.
1489         (ProjectionType::clone): Add region constraints.
1490         * typecheck/rust-tyty.h: Add region constraints.
1492 2024-02-07  Jakub Dupak  <dev@jakubdupak.com>
1494         * typecheck/rust-hir-trait-resolve.cc: add regions
1495         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal):
1496         add regions, resolve generic lifetimes
1497         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): add regions
1498         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
1499         add regions, resolve lifetimes
1500         (TypeCheckImplItem::visit): add regions, resove lifetimes
1501         * typecheck/rust-hir-type-check-implitem.h: add default value for result
1502         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): add regions,
1503         resove lifetimes
1504         (TypeCheckItem::resolve_impl_block_substitutions): add regions, resove lifetimes
1505         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): add regions,
1506         resove lifetimes
1507         (TypeCheckExpr::resolve_root_path): add regions, resove lifetimes
1508         (TypeCheckExpr::resolve_segments): add regions, resove lifetimes
1509         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): add regions,
1510         resove lifetimes
1511         (TypeCheckType::resolve_root_path): add regions, resove lifetimes
1512         (ResolveWhereClauseItem::Resolve): add regions, resove lifetimes
1513         (ResolveWhereClauseItem::visit): add regions, resove lifetimes
1514         * typecheck/rust-hir-type-check.cc (TypeCheckContext::LifetimeResolver::resolve):
1515         add regions, resolve lifetimes
1516         (TraitItemReference::get_type_from_fn): add regions, resove lifetimes
1517         * typecheck/rust-hir-type-check.h: add regions, resove lifetimes
1518         * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): add regions,
1519         resove lifetimes
1520         (SubstMapper::Resolve): add regions, resove lifetimes
1521         (SubstMapper::InferSubst): add regions, resove lifetimes
1522         (SubstMapper::visit): add regions, resove lifetimes
1523         * typecheck/rust-substitution-mapper.h: add regions, resove lifetimes
1524         * typecheck/rust-typecheck-context.cc (TypeCheckContext::TypeCheckContext):
1525         lifetime resolution
1526         (TypeCheckContext::regions_from_generic_args): lifetime resolution helper
1527         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate):
1528         add regions, resove lifetimes
1529         (TypeBoundPredicate::operator=): add regions, resove lifetimes
1530         (TypeBoundPredicate::apply_generic_arguments): add regions, resove lifetimes
1531         (TypeBoundPredicateItem::get_tyty_for_receiver): add regions, resove lifetimes
1532         * typecheck/rust-tyty-subst.cc (SubstitutionArgumentMappings::get_regions):
1533         add regions, resove lifetimes
1534         (SubstitutionArgumentMappings::get_mut_regions): getter
1535         (SubstitutionArgumentMappings::error): split error and empty
1536         (SubstitutionArgumentMappings::empty): split error and empty
1537         (SubstitutionArgumentMappings::find_symbol): helper
1538         (SubstitutionRef::get_num_lifetime_params): getter
1539         (SubstitutionRef::get_num_type_params): getter
1540         (SubstitutionRef::needs_substitution): extend to regions
1541         (SubstitutionRef::get_mappings_from_generic_args): helper
1542         (SubstitutionRef::infer_substitions): add regions
1543         * typecheck/rust-tyty-subst.h (class RegionParamList): region param handler
1544         * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): add regions, resove lifetimes
1545         (InferType::default_type): add regions, resove lifetimes
1546         (FnType::clone): add regions, resove lifetimes
1547         (ReferenceType::ReferenceType): add regions
1548         (ReferenceType::get_region): getter
1549         (ReferenceType::clone): add regions
1550         * typecheck/rust-tyty.h: add regions, resove
1552 2024-02-07  Jakub Dupak  <dev@jakubdupak.com>
1554         * hir/tree/rust-hir-item.h: Add missing getter
1556 2024-02-07  Jakub Dupak  <dev@jakubdupak.com>
1558         * typecheck/rust-tyty-region.h: New file.
1560 2024-02-07  Jakub Dupak  <dev@jakubdupak.com>
1562         * typecheck/rust-hir-type-check.h (class Lifetime): add interned lifetime class
1563         * typecheck/rust-typecheck-context.cc (TypeCheckContext::TypeCheckContext): add
1564         resolution tool
1565         (TypeCheckContext::intern_lifetime): add method to intern lifetime from tyctx
1566         (TypeCheckContext::lookup_lifetime): add method to lookup lifetime from tyctx
1567         (TypeCheckContext::intern_and_insert_lifetime): add a helper method
1569 2024-02-07  Raiki Tamura  <tamaron1203@gmail.com>
1571         * rust-lang.cc (run_rust_tests): Add test.
1572         * rust-system.h: Add <algorithm>.
1573         * util/make-rust-unicode.py: Output NFC_Quick_Check table.
1574         * util/rust-codepoint.h (struct Codepoint): Add is_supplementary
1575         method.
1576         * util/rust-unicode-data.h: Generated.
1577         * util/rust-unicode.cc (binary_search_sorted_array): Removed.
1578         (lookup_cc): Remove namespace.
1579         (is_alphabetic): Use std::binary_search
1580         (nfc_quick_check): New function.
1581         (nfc_normalize): Use nfc_quick_check.
1582         (is_nfc_qc_maybe): New function.
1583         (is_nfc_qc_no): New function.
1584         (rust_nfc_qc_test): New test.
1585         * util/rust-unicode.h (is_nfc_qc_no): New function.
1586         (is_nfc_qc_maybe): New function.
1587         (enum class): New enum class.
1588         (nfc_quick_check): New function.
1589         (rust_nfc_qc_test): New test.
1591 2024-02-07  Kushal Pal  <kushalpal109@gmail.com>
1593         * parse/rust-parse-impl.h (Parser::parse_function):
1594         Skip token if its a COMMA.
1596 2024-01-30  Owen Avery  <powerboat9.gamer@gmail.com>
1598         * ast/rust-ast-full-decls.h
1599         (class TraitImplItem): Remove forward declaration.
1600         (class AssociatedItem): Add forward declaration.
1601         * ast/rust-ast.h
1602         (class TraitImplItem): Remove.
1603         (class TraitItem): Inherit from AssociatedItem.
1604         (SingleASTNode::take_trait_impl_item):
1605         Return std::unique_ptr<AssociatedItem> instead of
1606         std::unique_ptr<TraitImplItem>.
1607         * ast/rust-item.h
1608         (class Function): Inherit from AssociatedItem instead of
1609         TraitImplItem.
1610         (class TypeAlias): Likewise.
1611         (class ConstantItem): Likewise.
1612         (class TraitImpl): Store items as AssociatedItem.
1613         * expand/rust-derive-clone.cc
1614         (DeriveClone::clone_fn): Return std::unique_ptr<AssociatedItem>.
1615         (DeriveClone::clone_impl): Take std::unique_ptr<AssociatedItem>.
1616         * expand/rust-derive-clone.h
1617         (DeriveClone::clone_fn): Return std::unique_ptr<AssociatedItem>.
1618         (DeriveClone::clone_impl): Take std::unique_ptr<AssociatedItem>.
1619         * expand/rust-expand-visitor.cc
1620         (ExpandVisitor::visit): Handle changes to
1621         SingleASTNode::take_trait_impl_item.
1622         * parse/rust-parse-impl.h
1623         (Parser::parse_impl): Parse TraitImpl as containing AssociatedItem.
1624         (Parser::parse_trait_impl_item): Return
1625         std::unique_ptr<AssociatedItem>.
1626         (Parser::parse_trait_impl_function_or_method): Likewise.
1627         * parse/rust-parse.h
1628         (Parser::parse_trait_impl_item): Return
1629         std::unique_ptr<AssociatedItem>.
1630         (Parser::parse_trait_impl_function_or_method): Likewise.
1632 2024-01-30  Robert Goss  <goss.robert@gmail.com>
1634         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit) Add additional check
1635         * typecheck/rust-hir-type-check-struct-field.h: A helper method to make error added
1636         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve) Update message
1638 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1640         * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): fix for lifetimes
1641         (ASTLowerWhereClauseItem::visit): fix for lifetimes
1643 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1645         * parse/rust-parse-impl.h (Parser::parse_where_clause): fix parsing
1646         (Parser::parse_where_clause_item): fix parsing
1647         (Parser::parse_type_bound_where_clause_item): fix parsing
1648         (Parser::parse_trait_bound): fix parsing
1649         * parse/rust-parse.h: fix parsing
1651 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1653         * lex/rust-lex.cc (Lexer::dump_and_skip):
1654         Changed " " to '\n'
1656 2024-01-30  Owen Avery  <powerboat9.gamer@gmail.com>
1658         * ast/rust-ast-fragment.cc
1659         (Fragment::assert_single_fragment): Update.
1660         * ast/rust-ast.h
1661         (class TraitImplItem): Move definition before that of TraitItem.
1662         (class TraitItem):
1663         Inherit from TraitImplItem instead of AssociatedItem.
1664         (class SingleASTNode): Unify handling of associated items.
1665         (SingleASTNode::take_assoc_item): Move from...
1666         (SingleASTNode::take_impl_item): ...here, but leave stub calling
1667         take_assoc_item behind.
1668         (SingleASTNode::take_trait_item):
1669         Cast associated item to TraitItem.
1670         (SingleASTNode::take_trait_impl_item):
1671         Cast associated item to TraitImplItem.
1672         * ast/rust-ast.cc
1673         (SingleASTNode::SingleASTNode):
1674         Unify handling of associated items.
1675         (SingleASTNode::operator=): Likewise.
1676         (SingleASTNode::accept_vis): Likewise.
1677         (SingleASTNode::is_error): Likewise.
1678         (SingleASTNode::as_string): Likewise.
1679         * ast/rust-item.h
1680         (class Function): Remove direct inheritence from AssociatedItem.
1681         (class ConstantItem): Likewise.
1682         * ast/rust-macro.h
1683         (class MacroInvocation):
1684         Remove direct inheritence from AssociatedItem and TraitImplItem.
1686 2024-01-30  Robert Goss  <goss.robert@gmail.com>
1688         * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool
1689         * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields
1691 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1693         * parse/rust-parse-impl.h (Parser::parse_inherent_impl_item):
1694         Added switch-case for ASYNC token.
1696 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1698         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
1699         Enclose const in single quotes.
1701 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1703         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
1704         Added check for `async` functions inside trait.
1705         * parse/rust-parse-impl.h (Parser::parse_trait_item):
1706         Added switch-case for ASYNC token.
1708 2024-01-30  Nirmal Patel  <nirmal@nirmal.dev>
1710         * lex/rust-lex.cc (Lexer::parse_byte_string): Handle newline
1711         while parsing byte strings
1712         (Lexer::parse_string): Handle newline while parsing strings
1714 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1716         * backend/rust-compile-expr.cc (CompileExpr::visit): Use new API.
1717         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Use new API.
1718         * typecheck/rust-tyty-cmp.h: Remove old API.
1719         * typecheck/rust-tyty.cc (FnPtr::is_equal): Use new API.
1720         * typecheck/rust-tyty.h: Remove old API.
1721         * typecheck/rust-unify.cc (UnifyRules::expect_fnptr): Use new API.
1723 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1725         * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): For lifetimes.
1727 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1729         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime): Propagate static
1730         requirement.
1731         * hir/rust-ast-lower-base.h: Propagate static requirement.
1732         * hir/rust-ast-lower-implitem.h: Propagate static requirement.
1733         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Propagate static requirement.
1734         * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): Propagate static requirement.
1735         (ASTLoweringType::visit): Propagate static requirement.
1736         * hir/rust-ast-lower-type.h: Propagate static requirement.
1738 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1740         * parse/rust-parse-impl.h (Parser::parse_generic_param): Lifetime elision control.
1741         (Parser::parse_lifetime_where_clause_item): Lifetime elision control.
1742         (Parser::parse_type_param_bound): Lifetime elision control.
1743         (Parser::parse_lifetime_bounds): Lifetime elision control.
1744         (Parser::parse_lifetime): Lifetime elision control.
1745         (Parser::parse_path_generic_args): Lifetime elision control.
1746         (Parser::parse_self_param): Lifetime elision control.
1747         (Parser::parse_break_expr): Lifetime elision control.
1748         (Parser::parse_continue_expr): Lifetime elision control.
1749         (Parser::parse_reference_type_inner): Lifetime elision control.
1750         * parse/rust-parse.h: Lifetime elision control.
1752 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1754         * ast/rust-ast.h: Elided lifetime static constructor
1755         * ast/rust-type.h: Default lifetime to elided.
1756         * parse/rust-parse-impl.h (Parser::parse_lifetime_param): Use elided lifetime.
1757         (Parser::parse_lifetime): Use elided lifetime/
1758         (Parser::lifetime_from_token): Use elided lifetime.
1759         (Parser::parse_self_param): Use elided lifetime.
1760         (Parser::parse_reference_type_inner): Use elided lifetime.
1762 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1764         * parse/rust-parse-impl.h (Parser::lifetime_from_token): Fix matched pattern.
1766 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1768         * checks/errors/rust-ast-validation.cc (ASTValidation::visit):
1769         Added check for `async` function inside trait.
1771 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1773         * parse/rust-parse-impl.h (Parser::parse_trait_impl_item):
1774         Handled `async` items
1776 2024-01-30  Raiki Tamura  <tamaron1203@gmail.com>
1778         * Make-lang.in: Add .o files
1779         * backend/rust-mangle.cc (struct V0Path): moved to splitted files
1780         (v0_path): Likewise.
1781         (legacy_mangle_name): Likewise.
1782         (legacy_mangle_canonical_path): Likewise.
1783         (legacy_hash): Likewise.
1784         (v0_tuple_prefix): Likewise.
1785         (v0_numeric_prefix): Likewise.
1786         (v0_simple_type_prefix): Likewise.
1787         (v0_complex_type_prefix): Likewise.
1788         (v0_integer_62): Likewise.
1789         (v0_opt_integer_62): Likewise.
1790         (v0_disambiguator): Likewise.
1791         (v0_type_prefix): Likewise.
1792         (v0_generic_args): Likewise.
1793         (v0_identifier): Likewise.
1794         (v0_type_path): Likewise.
1795         (v0_function_path): Likewise.
1796         (v0_scope_path): Likewise.
1797         (v0_crate_path): Likewise.
1798         (v0_inherent_or_trait_impl_path): Likewise.
1799         (v0_closure): Likewise.
1800         (legacy_mangle_item): Likewise.
1801         (v0_mangle_item): Likewise.
1802         * backend/rust-mangle.h (legacy_mangle_item): Likewise.
1803         (v0_mangle_item): Likewise.
1804         * backend/rust-mangle-legacy.cc: New file.
1805         * backend/rust-mangle-v0.cc: New file.
1807 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1809         * checks/errors/borrowck/rust-bir-place.h: Cleanup.
1810         * checks/errors/borrowck/rust-borrow-checker.h: Cleanup.
1812 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1814         * typecheck/rust-tyty.h (BaseType::is): Cast API.
1815         (SubstitutionRef>): Cast API.
1816         (BaseType::as): Cast API.
1817         (BaseType::try_as): Cast API.
1819 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1821         * typecheck/rust-tyty.h (class ClosureType): Inherit interface.
1822         (class FnPtr): Inherit interface.
1823         (class FnType): Inherit interface.
1824         (class CallableTypeInterface): New interface.
1825         (BaseType::is): Detect interface members API.
1827 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1829         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Refactor.
1831 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1833         * checks/errors/borrowck/rust-bir-builder-internal.h: Replace nodiscard.
1834         * checks/errors/borrowck/rust-bir-place.h: Replace nodiscard.
1836 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1838         * typecheck/rust-tyty.h: Fix nodiscard to warn unused.
1840 2024-01-30  Jakub Dupak  <dev@jakubdupak.com>
1842         * hir/tree/rust-hir-item.h: Ad lifetime getter.
1843         * hir/tree/rust-hir-path.h: Make getter const ref.
1844         * hir/tree/rust-hir.h: Const ref and new getter.
1846 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
1848         * Make-lang.in (GRS_OBJS): Add rust-attribs.o.
1849         * backend/rust-builtins.cc (builtin_const, builtin_noreturn)
1850         (builtin_novops): Remove.
1851         (BuiltinsContext::lookup_simple_builtin): Adjust.
1852         (BuiltinsContext::setup_overflow_fns): Remove.
1853         (BuiltinsContext::define_function_type): Set builtin type to
1854         errormark so the builtin is considered unavailable.
1855         (BuiltinsContext::setup_math_fns): Remove.
1856         (BuiltinsContext::setup_atomic_fns): Remove.
1857         (build_c_type_nodes): Refactor based on D frontend.
1858         (BuiltinsContext::define_builtin_types): Likewise.
1859         (DEF_PRIMITIVE_TYPE): New.
1860         (DEF_FUNCTION_TYPE_0): New.
1861         (DEF_FUNCTION_TYPE_1): New.
1862         (DEF_FUNCTION_TYPE_2): New.
1863         (DEF_FUNCTION_TYPE_3): New.
1864         (DEF_FUNCTION_TYPE_4): New.
1865         (DEF_FUNCTION_TYPE_5): New.
1866         (DEF_FUNCTION_TYPE_6): New.
1867         (DEF_FUNCTION_TYPE_7): New.
1868         (DEF_FUNCTION_TYPE_8): New.
1869         (DEF_FUNCTION_TYPE_9): New.
1870         (DEF_FUNCTION_TYPE_10): New.
1871         (DEF_FUNCTION_TYPE_11): New.
1872         (DEF_FUNCTION_TYPE_VAR_0): New.
1873         (DEF_FUNCTION_TYPE_VAR_1): New.
1874         (DEF_FUNCTION_TYPE_VAR_2): New.
1875         (DEF_FUNCTION_TYPE_VAR_3): New.
1876         (DEF_FUNCTION_TYPE_VAR_4): New.
1877         (DEF_FUNCTION_TYPE_VAR_5): New.
1878         (DEF_FUNCTION_TYPE_VAR_6): New.
1879         (DEF_FUNCTION_TYPE_VAR_7): New.
1880         (DEF_FUNCTION_TYPE_VAR_11): New.
1881         (DEF_POINTER_TYPE): New.
1882         (BuiltinsContext::setup): Adjust.
1883         (BuiltinsContext::define_builtin_attributes): New.
1884         (DEF_ATTR_NULL_TREE): New.
1885         (DEF_ATTR_INT): New.
1886         (DEF_ATTR_STRING): New.
1887         (DEF_ATTR_IDENT): New.
1888         (DEF_ATTR_TREE_LIST): New.
1889         (handle_flags): Remove.
1890         (BuiltinsContext::define_builtins): New.
1891         (DEF_BUILTIN): New.
1892         (BuiltinsContext::define_builtin): Remove.
1893         (BuiltinsContext::register_rust_mappings): New. Add all missing
1894         builtins.
1895         (BuiltinsContext::lookup_gcc_builtin): Adjust.
1896         * backend/rust-builtins.h (DEF_PRIMITIVE_TYPE): New.
1897         (DEF_FUNCTION_TYPE_0): New.
1898         (DEF_FUNCTION_TYPE_1): New.
1899         (DEF_FUNCTION_TYPE_2): New.
1900         (DEF_FUNCTION_TYPE_3): New.
1901         (DEF_FUNCTION_TYPE_4): New.
1902         (DEF_FUNCTION_TYPE_5): New.
1903         (DEF_FUNCTION_TYPE_6): New.
1904         (DEF_FUNCTION_TYPE_7): New.
1905         (DEF_FUNCTION_TYPE_8): New.
1906         (DEF_FUNCTION_TYPE_9): New.
1907         (DEF_FUNCTION_TYPE_10): New.
1908         (DEF_FUNCTION_TYPE_11): New.
1909         (DEF_FUNCTION_TYPE_VAR_0): New.
1910         (DEF_FUNCTION_TYPE_VAR_1): New.
1911         (DEF_FUNCTION_TYPE_VAR_2): New.
1912         (DEF_FUNCTION_TYPE_VAR_3): New.
1913         (DEF_FUNCTION_TYPE_VAR_4): New.
1914         (DEF_FUNCTION_TYPE_VAR_5): New.
1915         (DEF_FUNCTION_TYPE_VAR_6): New.
1916         (DEF_FUNCTION_TYPE_VAR_7): New.
1917         (DEF_FUNCTION_TYPE_VAR_11): New.
1918         (DEF_POINTER_TYPE): New.
1919         (DEF_ATTR_NULL_TREE): New.
1920         (DEF_ATTR_INT): New.
1921         (DEF_ATTR_STRING): New.
1922         (DEF_ATTR_IDENT): New.
1923         (DEF_ATTR_TREE_LIST): New.
1924         * backend/rust-compile-intrinsic.cc (Intrinsics::compile): Add
1925         comment.
1926         (op_with_overflow_inner): Adjust.
1927         (copy_handler_inner): Adjust.
1928         (prefetch_data_handler): Adjust.
1929         (build_atomic_builtin_name): Adjust.
1930         (atomic_load_handler_inner): Adjust.
1931         (uninit_handler): Adjust.
1932         (move_val_init_handler): Adjust.
1933         (expect_handler_inner): Adjust.
1934         * rust-gcc.cc (fetch_overflow_builtins): Adjust.
1935         * rust-lang.cc (rust_localize_identifier): Adjust.
1936         (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): New.
1937         * rust-attribs.cc: New file.
1939 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
1941         * expand/rust-cfg-strip.cc (CfgStrip::visit): Change calls from visitor
1942         to default visitor.
1943         (CfgStrip::go): Add call to visit crate.
1944         * expand/rust-cfg-strip.h (class CfgStrip): Update prototypes and
1945         remove empty ones.
1946         * ast/rust-ast-visitor.cc: add WhereClause condition check.
1948 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
1950         * expand/rust-expand-visitor.cc (ExpandVisitor::go): Add call to visit
1951         on the crate.
1952         (ExpandVisitor::visit): Remove some visit functions in favor of their
1953         default visitor counterpart.
1954         * expand/rust-expand-visitor.h (class ExpandVisitor): Inherit from
1955         default visitor and remove now useless function prototypes.
1957 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
1959         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
1960         duplicated functions.
1961         * resolve/rust-default-resolver.h (class DefaultResolver): Make the
1962         default resolver inherit from the default visitor.
1964 2024-01-30  Owen Avery  <powerboat9.gamer@gmail.com>
1966         * checks/errors/rust-feature.cc
1967         (Feature::name_hash_map):
1968         Add entries for Name::LANG_ITEMS and Name::NO_CORE.
1969         * checks/errors/rust-feature.h
1970         (Feature::Name::LANG_ITEMS): New.
1971         (Feature::Name::NO_CORE): New.
1973 2024-01-30  Kushal Pal  <kushalpal109@gmail.com>
1975         * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
1976         Renamed `WIN64` to `WIN_64`
1977         * util/rust-abi.cc (get_abi_from_string): Likewise
1978         (get_string_from_abi): Likewise
1979         * util/rust-abi.h (enum ABI): Likewise
1981 2024-01-30  Nobel Singh  <nobel2073@gmail.com>
1983         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
1984         check for const funtion.
1986 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
1988         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
1989         a validation check and emit an error depending on the context.
1991 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
1993         * ast/rust-ast-collector.cc (TokenCollector::visit): Adapt defintion
1994         getter.
1995         * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
1996         * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
1997         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
1998         * hir/rust-ast-lower-implitem.h: Likewise.
1999         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
2000         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
2001         * resolve/rust-ast-resolve-stmt.h: Likewise.
2002         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
2003         * util/rust-attributes.cc (AttributeChecker::visit):  Likewise.
2004         * parse/rust-parse-impl.h: Allow empty function body during parsing.
2005         * ast/rust-ast.cc (Function::Function): Constructor now take an
2006         optional for the body.
2007         (Function::operator=): Adapt to new optional member.
2008         (Function::as_string): Likewise.
2009         * ast/rust-item.h (class Function): Make body optional and do not
2010         rely on nullptr anymore.
2012 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2014         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_generic_args):
2015         Move function.
2016         (EarlyNameResolver::resolve_qualified_path_type): Likewise.
2017         (EarlyNameResolver::visit): Add a top level visit function for crate
2018         and remove duplicated code.
2019         * resolve/rust-early-name-resolver.h (class EarlyNameResolver): Update
2020         overriden function list.
2022 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2024         * util/rust-attributes.cc (AttributeChecker::visit): Add visit function
2025         for crates.
2026         * util/rust-attributes.h (class AttributeChecker): Update function
2027         prototypes.
2029 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2031         * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Add a visit
2032         function for the crate level.
2033         (FeatureGate::check): Add call to crate visit.
2034         * checks/errors/rust-feature-gate.h (class FeatureGate): Remove now
2035         useless visit functions (traversal only).
2037 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2039         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2040         const check.
2041         * checks/errors/rust-ast-validation.h: Add visit function prototype.
2043 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2045         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2046         async const check.
2048 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2050         * parse/rust-parse-impl.h (Parser::parse_vis_item): Allow parsing async
2051         items in const.
2052         (Parser::parse_async_item): Account for const offset during async
2053         lookahead.
2055 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2057         * ast/rust-ast-builder.cc (AstBuilder::fn_qualifiers): Change
2058         constructor to match the new arguments.
2059         * ast/rust-ast-collector.cc (TokenCollector::visit): Change behavior
2060         to handle both const and async specifiers at the same time.
2061         * ast/rust-ast.cc (FunctionQualifiers::as_string): Likewise.
2062         * ast/rust-item.h (class FunctionQualifiers): Remove AsyncConstStatus
2063         and replace it with both Async and Const status. Also change the safety
2064         arguments to use an enum instead of a boolean.
2065         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
2066         Update constructor call.
2067         * hir/tree/rust-hir-item.h: Add Const and Async status, remove
2068         AsyncConstStatus, update the constructor.
2069         * hir/tree/rust-hir.cc (FunctionQualifiers::as_string): Update with
2070         the new status.
2071         * parse/rust-parse-impl.h (Parser::parse_function_qualifiers): Update
2072         constructor call.
2073         * util/rust-common.h (enum Mutability): Make an enum class.
2074         (enum class): Add Async and Const enum class to avoid booleans.
2075         (enum Unsafety): Change to an enum class.
2077 2024-01-30  Owen Avery  <powerboat9.gamer@gmail.com>
2079         * ast/rust-ast-full-decls.h
2080         (class InherentImplItem): Remove.
2081         * ast/rust-ast.h
2082         (class InherentImplItem): Remove.
2083         (class SingleASTNode):
2084         Store pointer to AssociatedItem instead of InherentImplItem.
2085         * ast/rust-ast.cc
2086         (SingleASTNode::SingleASTNode):
2087         Use clone_associated_item instead of clone_inherent_impl_item.
2088         (SingleASTNode::operator=): Likewise.
2089         * ast/rust-item.h
2090         (class InherentImpl):
2091         Use AssociatedItem rather than InherentImplItem.
2092         (class Function): Likewise.
2093         (class ConstantItem): Likewise.
2094         * ast/rust-macro.h
2095         (class MacroInvocation): Likewise.
2096         * expand/rust-expand-visitor.cc
2097         (ExpandVisitor::visit): Likewise.
2098         * parse/rust-parse-impl.h
2099         (Parser::parse_impl): Likewise.
2100         (Parser::parse_inherent_impl_item): Likewise.
2101         (Parser::parse_inherent_impl_function_or_method): Likewise.
2102         * parse/rust-parse.h
2103         (Parser::parse_inherent_impl_item): Likewise.
2104         (Parser::parse_inherent_impl_function_or_method): Likewise.
2106 2024-01-30  Philip Herron  <herron.philip@googlemail.com>
2108         * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block): removed
2109         * backend/rust-compile-base.h: update header
2110         * backend/rust-compile-block.cc (CompileBlock::visit): remove old logic
2111         * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function): likewise
2112         * backend/rust-compile-stmt.cc (CompileStmt::visit): likewise
2113         * backend/rust-compile-var-decl.h: ensure we setup tuple bindings correctly
2115 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2117         * ast/rust-item.h: Add safety getter to modules.
2118         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Check
2119         a module's safety and emit an error when meeting an unsafe module.
2120         * checks/errors/rust-ast-validation.h: Add function prototype.
2121         * parse/rust-parse-impl.h (Parser::parse_module): Move the module locus
2122         to the first token instead of the mod keyword.
2124 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2126         * parse/rust-parse-impl.h (Parser::parse_vis_item): Dispatch to parse
2127         module when meeting an unsafe module.
2128         (Parser::parse_module): Set unsafe status when the parser encounter an
2129         unsafe keyword.
2131 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2133         * ast/rust-item.h: Add safety status to Modules in the AST.
2134         * parse/rust-parse-impl.h (Parser::parse_module): Adapt constructors.
2136 2024-01-30  Owen Avery  <powerboat9.gamer@gmail.com>
2138         * hir/tree/rust-hir-pattern.h
2139         (class TupleItems): New.
2140         (class TupleStructItems): Inherit from TupleItems.
2141         (class TuplePatternItems): Likewise.
2143 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2145         * resolve/rust-toplevel-name-resolver-2.0.cc
2146         (TopLevel::insert_or_error_out): New functions.
2147         (TopLevel::handle_use_dec): New function.
2148         (flatten_rebind): Likewise.
2149         (flatten_list): Likewise.
2150         (flatten_glob): Likewise.
2151         (flatten): Likewise.
2152         (TopLevel::visit): Visit various `use` declaration nodes.
2153         * resolve/rust-toplevel-name-resolver-2.0.h: Declare functions and
2154         visitors.
2156 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2158         * resolve/rust-early-name-resolver-2.0.cc
2159         (Early::visit): Remove visitors.
2160         * resolve/rust-early-name-resolver-2.0.h: Likewise.
2162 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2164         * ast/rust-item.h (class UseTree): Add `node_id` member.
2166 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2168         * resolve/rust-toplevel-name-resolver-2.0.cc
2169         (TopLevel::insert_or_error_out): Add documentation comment.
2170         (TopLevel::go): Likewise.
2172 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2174         * resolve/rust-early-name-resolver-2.0.cc
2175         (Early::insert_once): New function.
2176         (Early::visit): Likewise.
2177         * resolve/rust-early-name-resolver-2.0.h: Likewise.
2179 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2181         * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Store mappings
2182         after having resolved them.
2183         * resolve/rust-late-name-resolver-2.0.h: Add `TypePath` visitor.
2185 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2187         * resolve/rust-late-name-resolver-2.0.cc
2188         (Late::setup_builtin_types): New function.
2189         (Late::go): Setup builtin types.
2190         * resolve/rust-late-name-resolver-2.0.h:
2191         * resolve/rust-name-resolution-context.cc
2192         (NameResolutionContext::map_usage): New function.
2193         * resolve/rust-name-resolution-context.h: Likewise.
2195 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2197         * resolve/rust-name-resolution-context.h: Store a reference to the
2198         mappings.
2199         * resolve/rust-name-resolution-context.cc
2200         (NameResolutionContext::NameResolutionContext): Likewise.
2202 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2204         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use
2205         the DefaultResolver in the toplevel visitor.
2207 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2209         * Make-lang.in: Compile late name resolver.
2210         * resolve/rust-late-name-resolver-2.0.cc: New file.
2211         * resolve/rust-late-name-resolver-2.0.h: New file.
2213 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2215         * resolve/rust-name-resolution-context.h: Add a Labels stack.
2217 2024-01-30  M V V S Manoj Kumar  <mvvsmanojkumar@gmail.com>
2219         * parse/rust-parse-impl.h (Parser::parse_item): Likewise.
2220         (Parser::parse_vis_item): Likewise.
2221         (Parser::parse_async_item): Likewise.
2222         * parse/rust-parse.h: Made declaration for parse_async_item.
2224 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2226         * lex/rust-lex.cc (Lexer::classify_keyword): Update keyword map name.
2227         * lex/rust-token.h (enum PrimitiveCoreType): Remove some deprecated
2228         comments.
2229         * util/rust-keyword-values.cc (get_keywords): Update the keyword map
2230         name.
2231         (RS_TOKEN): Define as empty
2232         (RS_TOKEN_KEYWORD_2015): Add the emission value.
2233         (RS_TOKEN_KEYWORD_2018): Likewise.
2234         * util/rust-keyword-values.h (RS_KEYWORD_LIST): Introduce the keyword
2235         list.
2236         (RS_TOKEN_KEYWORD_2018): Define multiple new keywords.
2238 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2240         * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value.
2241         * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Likewise.
2242         (Parser::parse_item): Likewise.
2243         (Parser::parse_vis_item): Likewise.
2244         (Parser::parse_macro_rules_def): Likewise.
2245         (Parser::parse_union): Likewise.
2246         (Parser::parse_trait_impl_item): Likewise.
2247         (Parser::parse_stmt): Likewise.
2248         (Parser::parse_stmt_or_expr): Likewise.
2250 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2252         * util/rust-keyword-values.h (class WeakKeywords): Add new class with
2253         weak keyword constexpr.
2255 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2257         * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value
2258         with keyword call.
2259         * ast/rust-ast.h: Likewise.
2260         * parse/rust-parse-impl.h (Parser::parse_path_ident_segment): Likewise.
2261         (Parser::parse_macro_match_fragment): Likewise.
2262         (Parser::parse_extern_crate): Likewise.
2263         (Parser::parse_use_tree): Likewise.
2264         (Parser::parse_const_item): Likewise.
2265         (Parser::parse_literal_expr): Likewise.
2266         (Parser::parse_maybe_named_param): Likewise.
2267         (Parser::parse_pattern_no_alt): Likewise.
2268         (Parser::left_denotation): Likewise.
2269         (Parser::parse_path_in_expression_pratt): Likewise.
2271 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2273         * lex/rust-token.h (enum PrimitiveCoreType): Add await keyword
2274         definition.
2276 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2278         * lex/rust-token.h (enum PrimitiveCoreType): Change macro for
2279         underscore in token list.
2281 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2283         * lex/rust-token.h (enum PrimitiveCoreType): Change enum macro calls.
2284         (RS_TOKEN_KEYWORD): Remove generic token keyword macro.
2285         (RS_TOKEN_KEYWORD_2015): Introduce keywords for edition 2015.
2286         (RS_TOKEN_KEYWORD_2018): Likewise with edition 2018.
2287         * lex/rust-token.cc (RS_TOKEN_KEYWORD): Remove old macro definition.
2288         (RS_TOKEN_KEYWORD_2015): Replace with 2015 definition...
2289         (RS_TOKEN_KEYWORD_2018): ... and 2018 definition.
2290         * util/rust-keyword-values.cc (RS_TOKEN_KEYWORD):  Likewise.
2291         (RS_TOKEN_KEYWORD_2015): Likewise.
2292         (RS_TOKEN_KEYWORD_2018): Likewise.
2293         * util/rust-keyword-values.h (RS_TOKEN_KEYWORD): Likewise.
2294         (RS_TOKEN_KEYWORD_2015): Likewise.
2295         (RS_TOKEN_KEYWORD_2018): Likewise.
2297 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2299         * lex/rust-token.h (enum PrimitiveCoreType): Change keyword suffix from
2300         tok to kw.
2301         * ast/rust-ast-collector.cc (TokenCollector::visit): Update suffix to
2302         match the new declaration.
2303         * lex/rust-lex.cc (Lexer::parse_raw_identifier): Likewise.
2304         * parse/rust-parse-impl.h (can_tok_start_type): Likewise.
2305         (Parser::parse_item): Likewise.
2306         (Parser::parse_vis_item): Likewise.
2307         (Parser::parse_extern_crate): Likewise.
2308         (Parser::parse_function): Likewise.
2309         (Parser::parse_function_qualifiers): Likewise.
2310         (Parser::parse_struct): Likewise.
2311         (Parser::parse_enum): Likewise.
2312         (Parser::parse_static_item): Likewise.
2313         (Parser::parse_trait_item): Likewise.
2314         (Parser::parse_inherent_impl_item): Likewise.
2315         (Parser::parse_trait_impl_item): Likewise.
2316         (Parser::parse_extern_block): Likewise.
2317         (Parser::parse_external_item): Likewise.
2318         (Parser::parse_stmt): Likewise.
2319         (Parser::parse_return_expr): Likewise.
2320         (Parser::parse_match_expr): Likewise.
2321         (Parser::parse_type): Likewise.
2322         (Parser::parse_for_prefixed_type): Likewise.
2323         (Parser::parse_type_no_bounds): Likewise.
2324         (Parser::parse_stmt_or_expr): Likewise.
2325         * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewie.
2326         * util/rust-token-converter.cc (convert): Likewise.
2328 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2330         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2331         zero field check during ast validation pass.
2332         * checks/errors/rust-ast-validation.h: Add union visit function
2333         prototype.
2335 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2337         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2338         ast validation pass to reject variadic arguments on regular functions.
2340 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2342         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add auto
2343         trait associated item check in AST validation pass.
2344         * parse/rust-parse-impl.h: Remove old error emission done during
2345         parsing pass.
2347 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2349         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Reject
2350         auto traits with super traits.
2352 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2354         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2355         check for generics on auto traits.
2356         * checks/errors/rust-ast-validation.h: Add visit function prototype.
2358 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2360         * resolve/rust-forever-stack.hxx: Remove debug log.
2362 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2364         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Format.
2366 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2368         * resolve/rust-forever-stack.h: New method.
2369         * resolve/rust-forever-stack.hxx: Likewise.
2371 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2373         * resolve/rust-forever-stack.h: New method.
2374         * resolve/rust-forever-stack.hxx: Likewise.
2376 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2378         * resolve/rust-forever-stack.hxx: Do not copy segment when
2379         dereferencing iterator in `find_starting_point`.
2381 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2383         * resolve/rust-forever-stack.h: Fix `ForeverStack::resolve_path`
2384         signature.
2385         * resolve/rust-forever-stack.hxx: Likewise.
2386         * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Use new API.
2387         (Early::visit_attributes): Likewise.
2389 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2391         * resolve/rust-forever-stack.hxx: Add specific behavior for
2392         `ForeverStack::get` when dealing with labels.
2394 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2396         * resolve/rust-forever-stack.h: Improve resolve_path API.
2397         * resolve/rust-forever-stack.hxx: Likewise and fix implementation.
2399 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2401         * resolve/rust-rib.h: Add Namespace enum.
2403 2024-01-30  Arthur Cohen  <arthur.cohen@embecosm.com>
2405         * ast/rust-ast.h: Change Path API to be more consistent.
2406         * ast/rust-path.h: Likewise.
2407         * ast/rust-ast-collector.cc (TokenCollector::visit): Use new API.
2408         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.
2409         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
2410         * resolve/rust-forever-stack.hxx: Likewise.
2412 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2414         * parse/rust-parse-impl.h (Parser::parse_function): Early return on
2415         unrecoverable errors.
2416         (Parser::parse_trait_item): Likewise.
2417         (Parser::parse_self_param): Update return type.
2418         * parse/rust-parse.h (enum ParseSelfError): Add enumeration to describe
2419         different self parameter parsing errors.
2421 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2423         * parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop
2424         exit condition.
2426 2024-01-30  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2428         * ast/rust-item.h (struct Visibility): Move Visibility from here...
2429         * ast/rust-ast.h (struct Visibility): ...to here.
2430         * parse/rust-parse-impl.h (Parser::parse_trait_item): Parse visibility
2431         before giving it back to the item parsing function.
2432         (Parser::parse_trait_type): Add visibility modifier.
2433         * parse/rust-parse.h (RUST_PARSE_H): Change function prototype.
2435 2024-01-18  Arthur Cohen  <arthur.cohen@embecosm.com>
2437         * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
2438         Cast size_t value to unsigned long.
2439         * expand/rust-proc-macro.cc (load_macros): Likewise.
2440         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
2442 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
2444         * hir/tree/rust-hir-pattern.h
2445         (TupleStructItems::ItemType::RANGE): Rename to...
2446         (TupleStructItems::ItemType::RANGED): ...here.
2447         (TupleStructItems::ItemType::NO_RANGE): Rename to...
2448         (TupleStructItems::ItemType::MULTIPLE): ...here.
2449         (TuplePatternItems::TuplePatternItemType): Rename to...
2450         (TuplePatternItems::ItemType): ...here.
2451         : Handle renames.
2452         * backend/rust-compile-pattern.cc: Likewise.
2453         * typecheck/rust-hir-type-check-pattern.cc: Likewise.
2454         * checks/errors/borrowck/rust-bir-builder-pattern.h: Likewise.
2456 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2458         * lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Remove
2459         additional zero after empty floating point.
2460         * parse/rust-parse-impl.h (Parser::left_denotation): Handle float with
2461         empty floating point.
2463 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
2465         * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
2466         Fix reference to node.
2467         * backend/rust-mangle.cc (struct V0Path): Modified to accept closures.
2468         (v0_crate_path): Modified to accept closures.
2469         (v0_closure): New function to mangle closures.
2470         (v0_path): Modified to accept closures
2471         * util/rust-mapping-common.h (UNKNOWN_NODEID): Change to UINT32_MAX.
2472         (UNKNOWN_HIRID): Change to UINT32_MAX.
2474 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2476         * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Move from here...
2477         * ast/rust-ast-visitor.h: ... to here.
2479 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2481         * ast/rust-ast-collector.cc (TokenCollector::visit): Move to header
2482         file.
2483         (TokenCollector::visit_items_joined_by_separator): Likewise.
2484         (TokenCollector::visit_as_line): Likewise.
2485         (TokenCollector::visit_items_as_lines): Likewise.
2486         (TokenCollector::visit_items_as_block): Likewise.
2487         * ast/rust-ast-collector.h: Add implementation.
2489 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2491         * ast/rust-ast-collector.cc (TokenCollector::visit): Add visitor for
2492         VariadicParam and remove Self parameter visitor from Function visit.
2493         * expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_self_param): Remove
2494         function.
2495         (CfgStrip::maybe_strip_trait_method_decl): Remove self parameter visit.
2496         (CfgStrip::maybe_strip_function_params): Handle new function
2497         parameters.
2498         (CfgStrip::visit): Handle VariadicParam, SelfParam and FunctionParam.
2499         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_self_param):
2500         Remove function.
2501         (ExpandVisitor::expand_trait_method_decl): Do not visit self parameter.
2502         (ExpandVisitor::visit): Add visit for VariadicParam, FunctionParam and
2503         SelfParam.
2504         (ExpandVisitor::expand_function_params): Visit parameters instead.
2505         * expand/rust-expand-visitor.h: Update function prototypes.
2506         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Update visit
2507         with new parameters.
2508         (ResolveTraitItems::visit): Likewise.
2509         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
2510         Update visit functions with the new visitor functions for VariadicParam
2511         SelfParam and FunctionParam.
2512         * resolve/rust-early-name-resolver.h: Update function prototypes.
2513         * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Update visitor
2514         according to the new function parameter structures.
2515         * ast/rust-ast-visitor.h: Update prototypes and add visitor virtual
2516         functions for SelfParam, FunctionParam and VariadicParam.
2517         * ast/rust-ast.cc (Function::Function): Move constructor in
2518         implementation instead of header.
2519         (Function::operator=): Likewise.
2520         (Function::as_string): Update function with pointer dereference.
2521         (VariadicParam::as_string): Likewise.
2522         (TraitFunctionDecl::as_string): Likewise.
2523         (TraitMethodDecl::as_string): Likewise.
2524         (FunctionParam::accept_vis): Add function for visitor.
2525         (SelfParam::accept_vis): Likewise.
2526         (VariadicParam::accept_vis): Likewise.
2527         (TraitItemFunc::TraitItemFunc): Move constructor to implementation
2528         file.
2529         (TraitItemFunc::operator=): Likewise.
2530         (TraitItemMethod::TraitItemMethod): Likewise.
2531         (TraitItemMethod::operator=): Likewise.
2532         * ast/rust-item.h (class Function): Remove self optional member.
2533         (class TraitMethodDecl): Likewise.
2534         (class TraitFunctionDecl): Likewise.
2535         (class Param): Add abstract parameter class.
2536         (class SelfParam): Inherit from Param and remove parameter common
2537         members.
2538         (class FunctionParam): Likewise.
2539         (class VariadicParam): Likewise.
2540         (struct Visibility): Move structure declaration.
2541         (class VisItem):  Likewise.
2542         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2543         a self parameter check during AST validation.
2544         * checks/errors/rust-ast-validation.h: Add function prototype.
2545         * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Update function
2546         constructor.
2547         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Rework
2548         function for the new parameters.
2549         (ASTLoweringBase::visit): Add visit functions for VariadicParam,
2550         FunctionParam and SelfParam.
2551         * hir/rust-ast-lower-base.h: Update function prototypes.
2552         * parse/rust-parse-impl.h (Parser::parse_function): Update function
2553         according to new function representation.
2554         (Parser::parse_function_param): Return vector of abstract param instead
2555         of FunctionParam.
2556         (Parser::parse_method): Update according to new representation.
2557         (Parser::parse_trait_item): Likewise.
2558         (Parser::parse_self_param): Error out with
2559         self pointers and prevent the lexer from eating regular function
2560         parameters. Update return type.
2561         * parse/rust-parse.h: Update function return types.
2562         * ast/rust-ast-collector.h: Add VariadicParam visit prototype.
2563         * ast/rust-ast.h (struct Visibility): Move struct declaration.
2564         (class VisItem): Likewise.
2565         * ast/rust-expr.h: Update included files.
2566         * checks/errors/rust-feature-gate.h: Add visitor functions for
2567         SelfParam, FunctionParam and VariadicParam.
2568         * expand/rust-cfg-strip.h: Update function prototypes.
2569         * expand/rust-derive.h: Likewise.
2570         * hir/rust-ast-lower-implitem.h: Handle special arguments.
2571         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
2572         * metadata/rust-export-metadata.cc (ExportContext::emit_function):
2573         Likewise.
2574         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add visitor
2575         functions.
2576         * resolve/rust-ast-resolve-base.h: Update prototypes.
2577         * resolve/rust-ast-resolve-stmt.h: Handle new parameter kind.
2578         * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
2579         * resolve/rust-default-resolver.h: Update prototype.
2580         * util/rust-attributes.cc (AttributeChecker::visit): Add visitor
2581         functions for SelfParam and VariadicParam.
2582         * util/rust-attributes.h: Add visit prototypes.
2584 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2586         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
2587         check for additional named argument as well as variadic argument's
2588         position.
2589         * checks/errors/rust-ast-validation.h: Add visit function prototype for
2590         external functions.
2592 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2594         * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Push the new
2595         trait context when visiting a trait.
2596         * ast/rust-ast-visitor.h: Add visit function prototype and TRAIT
2597         context.
2599 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2601         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Change
2602         reported error location to the lifetime location.
2604 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2606         * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Check if there is
2607         a label before visit.
2608         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Emit an
2609         error when a label has a forbidden name.
2610         * checks/errors/rust-ast-validation.h: Add function prototype.
2612 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2614         * ast/rust-expr.h (class BreakExpr): Change Lifetime to LoopLabel.
2615         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Lower lifetime
2616         inside the label instead.
2617         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve the
2618         inner lifetime.
2620 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2622         * lex/rust-lex.cc (Lexer::parse_raw_identifier): Use const value.
2623         * parse/rust-parse-impl.h (Parser::parse_simple_path_segment):
2624         Likewise.
2626 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2628         * lex/rust-lex.cc (RS_TOKEN): Remove local map.
2629         (RS_TOKEN_KEYWORD): Likewise.
2630         (Lexer::classify_keyword): Change call to utils.
2631         * util/rust-keyword-values.cc (get_keywords): Add init function.
2632         (RS_TOKEN_KEYWORD): Call to X macro.
2633         * util/rust-keyword-values.h: Change from set to a map.
2635 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2637         * checks/errors/rust-ast-validation.cc (RS_TOKEN): Remove locale set.
2638         (RS_TOKEN_KEYWORD): Likewise.
2639         (ASTValidation::visit): Change keyword set call to the one from utils.
2641 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2643         * Make-lang.in: Add rust-keyword-values.cc to the list.
2644         * util/rust-keyword-values.cc: New file.
2645         * util/rust-keyword-values.h: New file.
2647 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2649         * util/rust-attribute-values.h (RUST_ATTRIBUTES_VALUE_H): Remove old
2650         header guard.
2651         (RUST_ATTRIBUTE_VALUES_H): Add new one.
2653 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2655         * checks/errors/rust-ast-validation.cc (RS_TOKEN): Add keyword set.
2656         (RS_TOKEN_KEYWORD): Likewise.
2657         (ASTValidation::visit): Add validation on lifetime visit.
2658         * checks/errors/rust-ast-validation.h: Add function prototype.
2660 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
2662         * ast/rust-item.h
2663         (class Method): Remove.
2664         (Function::self_param): New.
2665         (Function::has_self_param): New.
2666         (Function::Function): Initialize self_param.
2667         (Function::operator=): Likewise.
2668         (Function::get_self_param): New.
2669         * ast/rust-ast.cc
2670         (Method::as_string): Remove.
2671         (Method::accept_vis): Remove.
2672         * ast/rust-ast-collector.cc
2673         (TokenCollector::visit):
2674         Remove AST::Method visitor, handle self_param in AST::Function visitor.
2675         * ast/rust-ast-collector.h
2676         (TokenCollector::visit): Remove AST::Method visitor.
2677         * ast/rust-ast-full-decls.h (class Method): Remove.
2678         * ast/rust-ast-visitor.h
2679         (ASTVisitor::visit): Remove AST::Method visitor.
2680         (DefaultASTVisitor::visit): Likewise.
2681         * ast/rust-ast-visitor.cc
2682         (DefaultASTVisitor::visit):
2683         Remove AST::Method visitor, handle self_param in AST::Function visitor.
2684         * checks/errors/rust-feature-gate.cc
2685         (FeatureGate::visit): Remove AST::Method visitor.
2686         * checks/errors/rust-feature-gate.h
2687         (FeatureGate::visit): Likewise..
2688         * expand/rust-cfg-strip.cc
2689         (CfgStrip::visit):
2690         Remove AST::Method visitor, handle self_param in AST::Function visitor.
2691         * expand/rust-cfg-strip.h
2692         (CfgStrip::visit): Remove AST::Method visitor.
2693         * expand/rust-derive-clone.cc
2694         (DeriveClone::clone_fn): Return AST::Function instead of AST::Method.
2695         * expand/rust-derive.h (DeriveVisitor::visit): Remove AST::Method visitor.
2696         * expand/rust-expand-visitor.cc
2697         (ExpandVisitor::visit):
2698         Remove AST::Method visitor, handle self_param in AST::Function visitor.
2699         * expand/rust-expand-visitor.h:
2700         (ExpandVisitor::visit): Remove AST::Method visitor.
2701         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
2702         * hir/rust-ast-lower-base.h (ASTLoweringBase::visit): Likewise.
2703         * hir/rust-ast-lower-implitem.h
2704         (ASTLowerImplItem::visit):
2705         Remove AST::Method visitor, handle self_param in AST::Function visitor.
2706         * parse/rust-parse-impl.h: Include optional.h.
2707         (Parser::parse_function): Adjust AST::Function construction.
2708         (Parser::parse_inherent_impl_function_or_method):
2709         Construct AST::Function instead of AST::Method,
2710         adjust AST::Function construction.
2711         (Parser::parse_trait_impl_function_or_method): Likewise.
2712         (Parser::parse_method):
2713         Return std::unique_ptr<AST::Function> instead of AST::Method.
2714         * parse/rust-parse.h
2715         (Parser::parse_method): Likewise.
2716         * resolve/rust-ast-resolve-base.cc
2717         (ResolverBase::visit): Remove AST::Method visitor.
2718         * resolve/rust-ast-resolve-base.h
2719         (ResolverBase::visit): Likewise.
2720         * resolve/rust-ast-resolve-implitem.h
2721         (ResolveToplevelImplItem::visit): Likewise.
2722         * resolve/rust-ast-resolve-item.cc
2723         (ResolveItem::visit): Remove AST::Method visitor,
2724         handle self_param in AST::Function visitor.
2725         * resolve/rust-ast-resolve-item.h
2726         (ResolveItem::visit): Remove AST::Method visitor.
2727         * resolve/rust-default-resolver.cc
2728         (DefaultResolver::visit): Remove AST::Method visitor.
2729         * resolve/rust-default-resolver.h
2730         (DefaultResolver::visit): Likewise.
2731         * resolve/rust-early-name-resolver.cc
2732         (EarlyNameResolver::visit): Remove AST::Method visitor,
2733         handle self_param in AST::Function visitor.
2734         * resolve/rust-early-name-resolver.h
2735         (EarlyNameResolver::visit): Remove AST::Method visitor.
2736         * resolve/rust-toplevel-name-resolver-2.0.cc
2737         (TopLevel::visit): Likewise.
2738         * resolve/rust-toplevel-name-resolver-2.0.h
2739         (TopLevel::visit): Likewise.
2740         * util/rust-attributes.cc
2741         (AttributeChecker::visit): Likewise.
2742         * util/rust-attributes.h
2743         (AttributeChecker::visit): Likewise.
2745 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2747         * parse/rust-parse-impl.h (Parser::parse_named_function_param): Add
2748         new parsing ability.
2750 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2752         * ast/rust-ast.cc (ExternalFunctionItem::as_string): Adapt as_string
2753         function to the new ast representation.
2754         (NamedFunctionParam::as_string): Likewise.
2755         * ast/rust-item.h: Add a function to test whether a FunctionParam has
2756         a name pattern.
2757         * expand/rust-cfg-strip.cc (CfgStrip::visit): Adapt cfg strip visitor
2758         for the new variadic arguments.
2759         * hir/rust-ast-lower-extern.h: Adapt lowering to the new variadic
2760         function representation.
2761         * metadata/rust-export-metadata.cc (ExportContext::emit_function):
2762         Change call to constructor.
2763         * parse/rust-parse-impl.h (Parser::parse_named_function_param): Change
2764         NamedFunctionParam parsing to accomodate new variadic representation.
2765         (Parser::parse_external_item): Change external item parsing to use the
2766         new NamedFunctionParam variadics.
2767         * parse/rust-parse.h: Add new parsing function prototypes.
2768         * ast/rust-ast-collector.cc (TokenCollector::visit): Rework token
2769         collection to take into account variadic parameters.
2770         * ast/rust-ast-visitor.cc: Likewise.
2771         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change function
2772         bound to avoid getting the type of a variadic parameter.
2773         * resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
2774         Likewise.
2775         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
2776         Likewise.
2778 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2780         * ast/rust-item.h (class NamedFunctionParam): Add variadic boolean and
2781         another constructor.
2782         * hir/rust-ast-lower-extern.h: Avoid last parameter when variadic.
2784 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2786         * ast/rust-item.h: Add a getter to check if a given function is
2787         variadic.
2789 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2791         * parse/rust-parse-impl.h (Parser::parse_function_param): Parse
2792         variadic functions.
2794 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2796         * ast/rust-item.h (class FunctionParam): Add some informations to
2797         function parameters in order to be able to store variadic argument as
2798         a function parameter.
2800 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2802         * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Adapt
2803         the call to the new visit functions.
2804         (ASTValidation::check): Launch the parent class visitor root function.
2805         * checks/errors/rust-ast-validation.h (class ASTValidation): Inherit
2806         from the contextual visitor.
2808 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2810         * ast/rust-ast-visitor.cc (ContextualASTVisitor::visit): Add multiple
2811         context saving calls.
2812         * ast/rust-ast-visitor.h (class DefaultASTVisitor): Make visit
2813         functions virtual.
2814         (class ContextualASTVisitor): Add a stack like container for the
2815         current context chain.
2817 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2819         * Make-lang.in: Add the new visitor object file.
2820         * ast/rust-ast-visitor.h (class DefaultASTVisitor): Create the default
2821         visitor class.
2822         * ast/rust-ast.h: Add a new reference getter for visitor pattern.
2823         * ast/rust-ast-visitor.cc: New file.
2825 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2827         * ast/rust-ast.h: Add some missing mutable reference getters.
2828         * ast/rust-expr.h: Likewise.
2829         * ast/rust-item.h: Likewise.
2830         * ast/rust-path.h: Likewise.
2832 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2834         * ast/rust-ast-collector.cc (TokenCollector::visit): Check for presence
2835         of a type and use the default value instead of the type.
2837 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2839         * checks/errors/rust-ast-validation.cc (ASTValidation::check): Launch
2840         check over the whole given crate.
2841         (ASTValidation::visit): Implement visitor for some members of the ast.
2842         * checks/errors/rust-ast-validation.h: Update some prototype according
2843         to implemented visitor functions. Also add a context tracker.
2845 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2847         * rust-session-manager.cc (Session::compile_crate): Add call to ast
2848         validation.
2850 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2852         * lang.opt: Add the new compile options and update the enum values.
2853         * rust-session-manager.h (struct CompileOptions): Add the new steps to
2854         the enumeration.
2856 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2858         * Make-lang.in: Add the new object file the list.
2859         * checks/errors/rust-ast-validation.cc: New file.
2860         * checks/errors/rust-ast-validation.h: New file.
2862 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2864         * expand/rust-cfg-strip.cc (CfgStrip::visit): Add expr value check.
2865         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
2866         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
2867         Likewise.
2869 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2871         * ast/rust-ast.h: Move implementation from here...
2872         * ast/rust-ast.cc (SingleASTNode::SingleASTNode): ...to here.
2873         (SingleASTNode::operator=): ...and here...
2874         (SingleASTNode::accept_vis): ...and here...
2875         (SingleASTNode::is_error): ...and here...
2876         (SingleASTNode::as_string): ...also here.
2878 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2880         * ast/rust-ast.h: Add override specifier.
2881         * ast/rust-item.h: Likewise.
2883 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2885         * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::split_current_token):
2886         Add implementation for multiple token split.
2887         * expand/rust-macro-invoc-lexer.h: Add function prototype.
2888         * expand/rust-proc-macro-invoc-lexer.cc (ProcMacroInvocLexer::split_current_token):
2889         Add implementation for 2+ token split for procedural macros.
2890         * expand/rust-proc-macro-invoc-lexer.h: Add function prototype.
2891         * lex/rust-lex.cc (Lexer::split_current_token): Add function to split a
2892         token in multiple other tokens.
2893         * lex/rust-lex.h: Add function prototype for split_current_token.
2894         * parse/rust-parse-impl.h (Parser::left_denotation): Handle float tuple
2895         index identified as a float literal.
2897 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
2899         * hir/rust-hir-dump.cc (Dump::visit): Remove obsolete member.
2900         * hir/tree/rust-hir-expr.h (class BorrowExpr): Remove obsolete member.
2901         * hir/tree/rust-hir.cc (BorrowExpr::as_string): Remove obsolete member.
2903 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
2905         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Fix typo.
2907 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
2909         * backend/rust-compile-expr.cc
2910         (patterns_mergeable): Remove.
2911         (struct PatternMerge): Remove.
2912         (sort_tuple_patterns): Remove.
2913         (simplify_tuple_match): Remove.
2914         (CompileExpr::visit): Modify compilation of MatchExpr.
2915         * backend/rust-compile-pattern.cc
2916         (CompilePatternCaseLabelExpr::visit): Replace with...
2917         (CompilePatternCheckExpr::visit): ...this.
2918         * backend/rust-compile-pattern.h
2919         (class CompilePatternCaseLabelExpr): Replace with...
2920         (class CompilePatternCheckExpr): ...this.
2921         * backend/rust-compile-type.cc
2922         (TyTyResolveCompile::get_implicit_enumeral_node_type):
2923         Make enumeral type equivalent to isize.
2925 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2927         * backend/rust-compile-base.cc (get_attributes): Add documentation for
2928         indices 3 and 4.
2929         (get_trait_name): Add documentation for index 1.
2931 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2933         * Make-lang.in: Add gcc/rust/backend/rust-compile-proc-macro.cc to the
2934         list of file to compile.
2935         * backend/rust-compile.cc (attribute_array): Move to
2936         rust-compile-proc-macro.cc
2937         (derive_proc_macro): Likewise.
2938         (bang_proc_macro): Likewise.
2939         (attribute_proc_macro): Likewise.
2940         (proc_macro_payload): Likewise.
2941         (proc_macro): Likewise.
2942         (proc_macro_buffer): Likewise.
2943         (entrypoint): Likewise.
2944         (proc_macro_array): Likewise.
2945         (CompileCrate::add_proc_macro_symbols): Likewise.
2946         * backend/rust-compile-proc-macro.cc: New file.
2948 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2950         * backend/rust-compile.cc (proc_macro_buffer): Update type builder with
2951         array length information.
2952         (proc_macro_array): Update type initializer with array length
2953         information.
2955 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2957         * backend/rust-compile.cc (build_attribute_array): Renamed from...
2958         (attribute_array): ...to attribute array.
2959         (build_derive_proc_macro): Likewise from...
2960         (derive_proc_macro): ... to derive_proc_macro.
2961         (build_bang_proc_macro): Likewise from...
2962         (bang_proc_macro): ...to bang_proc_macro.
2963         (build_attribute_proc_macro): Likewise from...
2964         (attribute_proc_macro): ... to attribute_proc_macro.
2965         (build_proc_macro_payload): Likewise from...
2966         (proc_macro_payload): to proc_macro_payload.
2967         (build_proc_macro): Likewise from...
2968         (proc_macro): ...to proc_macro.
2969         (build_proc_macro_buffer): Likewise from...
2970         (proc_macro_buffer): ... to proc_macro_buffer.
2971         (build_entrypoint): Likewise from...
2972         (entrypoint): ...to entrypoint.
2973         (init_derive_proc_macro): Renamed to it's shorter counterpart.
2974         (init_attribute_proc_macro): Likewise.
2975         (init_bang_proc_macro): Likewise.
2976         (init_proc_macro): Likewise.
2977         (initialize_proc_macro_array): Likewise.
2978         (proc_macro_array): Likewise.
2979         (CompileCrate::add_proc_macro_symbols): Update function calls.
2981 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
2983         * backend/rust-compile-base.h: Make static function address_expression
2984         public.
2985         * backend/rust-compile.cc (CompileCrate::add_proc_macro_symbols): Add
2986         new global variable in export function.
2987         (build_bang_proc_macro): Add a function to build the bang proc macro
2988         structure type.
2989         (build_proc_macro): Add a function to build the proc macro structure
2990         type.
2991         (build_proc_macro_payload): Add a function to build the proc macro
2992         union used in proc macro structures.
2993         (init_derive_proc_macro): Add a function to initialize custom derive
2994         proc macros.
2995         (init_attribute_proc_macro): Add a function to initialize attribute
2996         proc macros.
2997         (init_bang_proc_macro): Add a function to initialize bang proc macros.
2998         (init_proc_macro): Add a function to initialize proc macro structures.
2999         (initialize_proc_macro_array): Add a function to initialize the proc
3000         macro buffer array.
3001         (CompileCrate::add_proc_macro_symbols): Add call to the new functions
3002         to correctly initialize proc macros as well as their entrypoint.
3004 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3006         * expand/rust-proc-macro.cc (CustomDeriveProcMacro::CustomDeriveProcMacro):
3007         Remove constant string declaration.
3008         (load_macros_array): Add call to the new generation function.
3009         (generate_proc_macro_decls_symbol): Add a new function to generate the
3010         entrypoint symbol name from the stable crate id.
3011         (PROC_MACRO_DECLS_FMT_ARGS):
3012         New macro to keep formats arguments in sync between each call.
3013         * expand/rust-proc-macro.h (generate_proc_macro_decls_symbol): Add
3014         function prototype.
3015         * rust-system.h: Include <iomanip>.
3017 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3019         * backend/rust-compile.cc (build_attribute_array): Add a function to
3020         build the attribute array type.
3021         (build_derive_proc_macro): Add a function to build the derive proc
3022         macro type.
3023         (build_bang_proc_macro): Add a function to build the bang proc macro
3024         type.
3025         (build_attribute_proc_macro): Add a function to build the attribute
3026         proc macro type.
3027         (build_proc_macro): Add a function to build the proc macro tagged union
3028         type.
3029         (build_proc_macro_buffer): Add a function to build the proc macro
3030         buffer type.
3031         (build_entrypoint): Add a function to build the proc macro entrypoint
3032         type.
3033         * backend/rust-compile.h: Add function prototype.
3035 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3037         * backend/rust-compile-context.h: Add getters.
3039 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3041         * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
3042         Make the function non static in order to be able to access the
3043         compile context. Also add the whole proc macro infomrmation
3044         collection.
3045         (get_attributes): Add a function to retrieve the different
3046         attributes from a derive procedural macro definition attribute.
3047         (get_trait_name): Add a function to retrieve the trait name from
3048         a derive procedural macro definition attribute.
3049         * backend/rust-compile-base.h: Add function prototypes.
3051 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3053         * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options):
3054         Reformat uncorrectly formatted comments.
3056 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3058         * backend/rust-compile-context.h (struct CustomDeriveInfo): Add
3059         new derive procedural macro metadata information holder for
3060         mappings.
3062 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3064         * ast/rust-ast.h: Add const getter.
3066 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3068         * backend/rust-compile-base.cc (handle_proc_macro_common): Add
3069         new attribute "gccrs_proc_macro" to all procedural macro
3070         functions.
3071         (get_abi): Add a function to retrieve the correct ABI depending
3072         on wether the function is a proc macro or not.
3074 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3076         * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
3077         Add proc macro handlers dispatch.
3078         (handle_proc_macro_common): Add a function for common behavior
3079         between all kinds of proc macros.
3080         * backend/rust-compile-base.h: Add function prototypes.
3082 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3084         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop): Move.
3085         (ExprStmtBuilder::get_label_ctx): Move.
3086         (ExprStmtBuilder::get_unnamed_loop_ctx): Moved.
3087         (ExprStmtBuilder::visit): BIR improvements.
3088         * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Refactor.
3089         * checks/errors/borrowck/rust-bir-builder-internal.h (class LifetimeResolver):
3090         Refactor.
3091         (struct BuilderContext): Move.Refactor.
3092         (optional_from_ptr): Map on null ptr.
3093         * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h (class LazyBooleanExprBuilder):
3094         Refactor.
3095         * checks/errors/borrowck/rust-bir-builder-pattern.h: Refactor.
3096         * checks/errors/borrowck/rust-bir-builder-struct.h (class StructBuilder): Refactor.
3097         * checks/errors/borrowck/rust-bir-builder.h: Refactor.
3098         * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Refactor.
3099         (Dump::visit): Refactor.
3100         (Dump::visit_place): Refactor.
3101         (Dump::visit_move_place): Refactor.
3102         (Dump::visit_lifetime): Refactor.
3103         * checks/errors/borrowck/rust-bir-dump.h: Refactor.
3104         * checks/errors/borrowck/rust-bir-place.h: Refactor.
3106 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3108         * checks/errors/borrowck/dev-notes.md: New file.
3110 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3112         * checks/errors/borrowck/bir-design-notes.md: New file.
3114 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3116         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Use goto.
3117         * checks/errors/borrowck/rust-bir-builder-internal.h: Explicit goto.
3118         * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Explicit goto.
3120 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3122         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Continue.
3123         (ExprStmtBuilder::setup_loop): Continue.
3125 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3127         * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Detech infinite loops.
3129 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3131         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Push ctx.
3132         (ExprStmtBuilder::setup_loop): Common loop infractructure setup.
3133         * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Loop ctx.
3134         * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext): Loop ctx.
3136 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3138         * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Improve jumps dump.
3139         (Dump::visit): Improve jumps dump.
3140         * checks/errors/borrowck/rust-bir-dump.h (class Dump): Improve jumps dump.
3142 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3144         * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Simplify cfg logic.
3145         (Dump::go): Run simplify cfg.
3146         * checks/errors/borrowck/rust-bir-dump.h: Option to simplify cfg.
3148 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3150         * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Use new print.
3151         (print_comma_separated): Comma separation print.
3152         (Dump::visit): Use new print.
3154 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3156         * Make-lang.in: Build BIR dump.
3157         * checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Cross-platform mkdir.
3158         (dump_function_bir): Save dump to file.
3159         (BorrowChecker::go): Run dump during borrowck.
3160         * checks/errors/borrowck/rust-bir-dump.cc: New file.
3161         * checks/errors/borrowck/rust-bir-dump.h: New file.
3163 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3165         * Make-lang.in: Compile BIR expr visitor.
3166         * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Use BIR builder.
3167         * rust-session-manager.cc (Session::compile_crate): Run borrow checker.
3168         * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc: New file.
3169         * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: New file.
3170         * checks/errors/borrowck/rust-bir-builder-internal.h: New file.
3171         * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: New file.
3172         * checks/errors/borrowck/rust-bir-builder-pattern.h: New file.
3173         * checks/errors/borrowck/rust-bir-builder-struct.h: New file.
3174         * checks/errors/borrowck/rust-bir-builder.h: New file.
3176 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3178         * checks/errors/borrowck/rust-borrow-checker.cc: Include to compile new code.
3179         * checks/errors/borrowck/rust-bir-place.h: New file.
3180         * checks/errors/borrowck/rust-bir-visitor.h: New file.
3181         * checks/errors/borrowck/rust-bir.h: New file.
3183 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3185         * lang.opt: CLI flag.
3186         * rust-session-manager.cc (Session::compile_crate): Guard execution.
3188 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3190         * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::BorrowChecker): Opt dump.
3191         (BorrowChecker::go): Opt dump.
3192         * checks/errors/borrowck/rust-borrow-checker.h (class BorrowChecker): Opt dump.
3193         * lang.opt: Add compile until borrowcheck.
3194         * rust-session-manager.cc (Session::enable_dump): Add BIR.
3195         (Session::compile_crate): Handle new options.
3196         * rust-session-manager.h (struct CompileOptions): Add BIR.
3198 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3200         * Make-lang.in: Build borrowck.
3201         * checks/errors/borrowck/rust-borrow-checker.cc: New file.
3202         * checks/errors/borrowck/rust-borrow-checker.h: New file.
3203         * checks/errors/borrowck/rust-function-collector.h: New file.
3205 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3207         * ast/rust-pattern.h: Add override modifier to overriding methods.
3209 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3211         * ast/rust-item.h: Add a new constructor for const with no value
3212         expression.
3213         * parse/rust-parse-impl.h (Parser::parse_const_item): Allow const with
3214         no expression value.
3216 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3218         * hir/tree/rust-hir-path.h: Avoid copy in getter.
3220 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3222         * backend/rust-compile-expr.cc (CompileExpr::visit): Rename method.
3223         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Rename method.
3224         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Rename method.
3225         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Rename method.
3226         * hir/rust-hir-dump.cc (Dump::visit): Rename method.
3227         * hir/tree/rust-hir-expr.h: Rename method.
3228         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Rename method.
3229         * typecheck/rust-tyty.h: Rename method.
3231 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3233         * backend/rust-compile-base.cc: Rename method.
3234         * backend/rust-compile-expr.cc (sort_tuple_patterns): Rename method.
3235         * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Rename method.
3236         (CompilePatternBindings::visit): Rename method.
3237         (CompilePatternLet::visit): Rename method.
3238         * backend/rust-compile-stmt.cc (CompileStmt::visit): Rename method.
3239         * backend/rust-compile-var-decl.h: Rename method.
3240         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate): Rename method.
3241         * hir/rust-hir-dump.cc (Dump::visit): Rename method.
3242         * hir/tree/rust-hir-path.h: Rename method.
3243         * hir/tree/rust-hir-pattern.h: Rename method.
3244         * hir/tree/rust-hir.h: Rename method.
3245         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::Resolve): Rename method.
3246         (TypeCheckPattern::visit): Rename method.
3247         (ClosureParamInfer::visit): Rename method.
3248         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Rename method.
3249         * util/rust-hir-map.cc (Mappings::insert_hir_pattern): Rename method.
3251 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3253         * hir/tree/rust-hir-expr.h: Add getter for name.
3255 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3257         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Implement for tuple pat.
3258         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Implement for tupple pat.
3260 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3262         * hir/tree/rust-hir-path.h: Avoid copy in getter.
3263         * hir/tree/rust-hir-pattern.h: Avoid copy in getter.
3264         * hir/tree/rust-hir.h: Avoid copy in getter.
3266 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3268         * resolve/rust-ast-resolve-implitem.h
3269         (ResolveToplevelImplItem::go): Take AssociatedItem as parameter.
3270         (ResolveTopLevelTraitItems::go): Likewise.
3271         * resolve/rust-ast-resolve-item.cc
3272         (ResolveTraitItems::go): Likewise.
3273         (ResolveItem::resolve_impl_item): Likewise.
3274         (ResolveImplItems::go): Likewise.
3275         * resolve/rust-ast-resolve-item.h
3276         (ResolveTraitItems::go): Likewise.
3277         (ResolveItem::resolve_impl_item): Likewise.
3278         (ResolveImplItems::go): Likewise.
3280 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3282         * hir/rust-ast-lower-implitem.h
3283         (ASTLoweringImplItem::translate): Take AssociatedItem as parameter.
3284         (ASTLoweringTraitItem::translate): Likewise.
3286 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3288         * backend/rust-compile-expr.cc (CompileExpr::visit): Bail on labelled block.
3290 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3292         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add loop ctx.
3294 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3296         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Resolve using loop logic.
3298 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3300         * hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Call loop lowering and add it to constr.
3301         * hir/tree/rust-hir-expr.h (class LoopLabel): Move before BlockExpr and add to BlockExpr.
3303 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3305         * ast/rust-ast-builder.cc (AstBuilder::block): Add label arg to constructor call.
3306         * ast/rust-expr.h (class LoopLabel): Move before BlockExpr.
3307         (class BlockExpr): Add LoopLabel member.
3308         * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Add label arg to constructor call.
3309         * parse/rust-parse-impl.h (Parser::parse_block_expr): Add label parameter.
3310         (Parser::parse_labelled_loop_expr): Add label arg to constructor call.
3311         * parse/rust-parse.h: Add label arg to constructor call.
3313 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3315         * ast/rust-ast.h
3316         (class AssociatedItem):
3317         New, based on TraitItem, InherentImplItem, and TraitImplItem classes.
3318         (class TraitItem): Inherit from AssociatedItem.
3319         (class InherentImplItem): Likewise.
3320         (class TraitImplItem): Likewise.
3321         * ast/rust-item.h
3322         (class Method): Update cloning functions.
3323         (class Function): Likewise.
3324         (class TypeAlias): Likewise.
3325         (class ConstantItem): Likewise.
3326         (class TraitItemFunc): Likewise.
3327         (class TraitItemMethod): Likewise.
3328         (class TraitItemConst): Likewise.
3329         (class TraitItemType): Likewise.
3330         * ast/rust-macro.h
3331         (class MacroInvocation): Likewise.
3333 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
3335         * backend/rust-mangle.cc (v0_identifier): Fix broken encoding.
3336         (v0_scope_path): Modify paramter.
3337         (v0_path): Fix namespace for modules.
3339 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3341         * parse/rust-parse-impl.h (Parser::parse_closure_expr_pratt): Fix
3342         closure parsing function to handle consecutive parameter lists.
3344 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3346         * ast/rust-macro.h: Add PATH fragment to follow set restrictions.
3348 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3350         * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Add a function
3351         that checks tokens given by the lexer represents an accurate macro
3352         definition. This will reduce code duplication.
3353         (Parser::parse_item): Replace condition with call to new checking
3354         function.
3355         (Parser::parse_stmt): Likewise.
3356         * parse/rust-parse.h: Add function prototype for is_macro_rules_def.
3358 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3360         * parse/rust-parse-impl.h (Parser::parse_expr): Fix range from expr.
3362 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3364         * parse/rust-parse-impl.h (Parser::parse_item): Relax constraints
3365         around default identifier at item scope to accept "default" macros.
3367 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3369         * parse/rust-parse-impl.h (Parser::parse_path_expr_segment): Accept
3370         left shift tokens in order to let generic parsing function split the
3371         token.
3373 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3375         * ast/rust-ast.h
3376         (Pattern::get_pattern_node_id): Rename to...
3377         (Pattern::get_node_id): ...here.
3378         * ast/rust-macro.h
3379         (MacroInvocation::get_pattern_node_id): Rename to...
3380         (MacroInvocation::get_node_id): ...here.
3381         * ast/rust-path.h
3382         (PathInExpression::get_pattern_node_id): Remove.
3383         (QualifiedPathInExpression::get_pattern_node_id): Remove.
3384         * ast/rust-pattern.h
3385         (LiteralPattern::get_pattern_node_id): Remove.
3386         (IdentifierPattern::get_pattern_node_id): Remove.
3387         (WildcardPattern::get_pattern_node_id): Remove.
3388         (RestPattern::get_pattern_node_id): Rename to...
3389         (RestPattern::get_node_id): ...here.
3390         (RangePattern::get_pattern_node_id): Remove.
3391         (ReferencePattern::get_pattern_node_id): Remove.
3392         (StructPattern::get_pattern_node_id): Remove.
3393         (TupleStructPattern::get_pattern_node_id): Remove.
3394         (TuplePattern::get_pattern_node_id): Remove.
3395         (GroupedPattern::get_pattern_node_id): Remove.
3396         (SlicePattern::get_pattern_node_id): Remove.
3397         (AltPattern::get_pattern_node_id): Remove.
3398         * resolve/rust-early-name-resolver.cc
3399         (EarlyNameResolver::visit):
3400         Use get_node_id instead of get_pattern_node_id.
3402 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3404         * parse/rust-parse-impl.h (Parser::parse_expr): Add comma delimiter.
3406 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3408         * parse/rust-parse-impl.h (Parser::parse_visibility): Relax constraints
3409         over public visibility return condition in order to accept pub unit
3410         types.
3412 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3414         * typecheck/rust-tyty.cc (BaseType::is_unit): Refactor.
3415         (BaseType::satisfies_bound): Refactor.
3416         (BaseType::get_root): Refactor.
3417         (BaseType::destructure): Refactor.
3418         (BaseType::monomorphized_clone): Refactor.
3419         (BaseType::is_concrete): Refactor.
3420         (InferType::InferType): Refactor.
3421         (InferType::clone): Refactor.
3422         (InferType::apply_primitive_type_hint): Refactor.
3423         (StructFieldType::is_equal): Refactor.
3424         (ADTType::is_equal): Refactor.
3425         (handle_substitions): Refactor.
3426         (ADTType::handle_substitions): Refactor.
3427         (TupleType::TupleType): Refactor.
3428         (TupleType::is_equal): Refactor.
3429         (TupleType::handle_substitions): Refactor.
3431 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3433         * typecheck/rust-tyty.cc (InferType::InferType): Use static constant for kind information.
3434         (ErrorType::ErrorType): Use static constant for kind information.
3435         (TupleType::TupleType): Use static constant for kind information.
3436         (BoolType::BoolType): Use static constant for kind information.
3437         (IntType::IntType): Use static constant for kind information.
3438         (UintType::UintType): Use static constant for kind information.
3439         (FloatType::FloatType): Use static constant for kind information.
3440         (USizeType::USizeType): Use static constant for kind information.
3441         (ISizeType::ISizeType): Use static constant for kind information.
3442         (CharType::CharType): Use static constant for kind information.
3443         (ReferenceType::ReferenceType): Use static constant for kind information.
3444         (PointerType::PointerType): Use static constant for kind information.
3445         (ParamType::ParamType): Use static constant for kind information.
3446         (StrType::StrType): Use static constant for kind information.
3447         (NeverType::NeverType): Use static constant for kind information.
3448         (PlaceholderType::PlaceholderType): Use static constant for kind information.
3449         * typecheck/rust-tyty.h: Add static kind information to all TyTy classes.
3450         Create safe cast and check methods.
3452 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3454         * parse/rust-parse-impl.h (Parser::parse_type_param_bound): Add missing
3455         case for lifetime switch.
3457 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3459         * lex/rust-token.cc (Token::as_string): Update function to output scope
3460         resolution tokens correctly.
3461         * parse/rust-parse-impl.h (Parser::parse_generic_param): Change call to
3462         as_string.
3464 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
3466         * backend/rust-compile-context.h: Modify declaration.
3467         * backend/rust-mangle.cc (struct V0Path): New struct.
3468         (v0_path): New function.
3469         (legacy_mangle_name): Take Context as argument.
3470         (v0_numeric_prefix): Fix type strings.
3471         (v0_complex_type_prefix): New function.
3472         (v0_add_integer_62): Deleted
3473         (v0_integer_62): New function.
3474         (v0_add_opt_integer_62): Deleted.
3475         (v0_opt_integer_62): New function.
3476         (v0_add_disambiguator): Deleted.
3477         (v0_disambiguator): New function.
3478         (v0_type_prefix): Support more types.
3479         (v0_generic_args): New function.
3480         (v0_add_identifier): Deleted.
3481         (v0_identifier): New function.
3482         (v0_type_path): New function.
3483         (v0_function_path): New function.
3484         (v0_scope_path): New function.
3485         (v0_crate_path): New function.
3486         (v0_inherent_or_trait_impl_path): New function.
3487         (v0_mangle_item): Use v0_path.
3488         (Mangler::mangle_item): Take Context as argument.
3489         * backend/rust-mangle.h (class Context): Add forward declaration.
3490         * hir/tree/rust-hir-item.h: Fix include.
3492 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3494         * hir/tree/rust-hir-pattern.h
3495         (TupleStructItems::clone_tuple_struct_items_impl): Rename to...
3496         (TupleStructItems::clone_tuple_items_impl): ...here.
3497         (TupleStructItemsNoRange::clone_tuple_struct_items_impl): Rename to...
3498         (TupleStructItemsNoRange::clone_tuple_items_impl): ...here.
3499         (TupleStructItemsRange::clone_tuple_struct_items_impl): Rename to...
3500         (TupleStructItemsRange::clone_tuple_items_impl): ...here.
3501         (TuplePatternItems::clone_tuple_pattern_items_impl): Rename to...
3502         (TuplePatternItems::clone_tuple_items_impl): ...here.
3503         (TuplePatternItemsMultiple::clone_tuple_pattern_items_impl): Rename to...
3504         (TuplePatternItemsMultiple::clone_tuple_items_impl): ...here.
3505         (TuplePatternItemsRanged::clone_tuple_pattern_items_impl): Rename to...
3506         (TuplePatternItemsRanged::clone_tuple_items_impl): ...here.
3508 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3510         * hir/tree/rust-hir-pattern.h
3511         (TuplePatternItems::get_pattern_type): Rename to...
3512         (TuplePatternItems::get_item_type): ...here.
3513         (TuplePatternItemsMultiple::get_pattern_type): Rename to...
3514         (TuplePatternItemsMultiple::get_item_type): ...here.
3515         (TuplePatternItemsRanged::get_pattern_type): Rename to...
3516         (TuplePatternItemsRanged::get_item_type): ...here.
3517         * backend/rust-compile-expr.cc: Adjust calls to renamed methods.
3518         * backend/rust-compile-pattern.cc: Likewise.
3519         * typecheck/rust-hir-type-check-pattern.cc: Likewise.
3521 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
3523         * backend/rust-compile-expr.cc (CompileExpr::visit): Merge 2 if clauses.
3524         * backend/rust-compile-extern.h: Fix typo in comment.
3526 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3528         * parse/rust-parse-impl.h: Add missing token consumption
3530 2024-01-16  Mohammed Rizan Farooqui  <rizanfarooqui@gmail.com>
3532         * expand/rust-macro-builtins.cc (MacroBuiltin::include_str_handler): Comment removed
3533         (MacroBuiltin::env_handler): Comment removed
3534         (MacroBuiltin::cfg_handler): Comment removed
3535         (MacroBuiltin::line_handler): Comment removed
3537 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
3539         * backend/rust-compile.cc (HIRCompileBase::coercion_site1): Fix wrong cast
3541 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3543         * rust-session-manager.cc (Session::expansion): Add early break on
3544         error.
3546 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
3548         * util/rust-canonical-path.h: Add new segment kind for inherent impl.
3549         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Use it.
3550         * resolve/rust-ast-resolve-toplevel.h: Use it.
3552 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3554         * ast/rust-expr.h: Fix spelling of "doesn't".
3555         * backend/rust-compile-expr.cc: Fix spelling of "accessors".
3556         * backend/rust-compile-implitem.h: Fix spelling of "normal".
3557         * backend/rust-constexpr.cc: Fix spelling of "actual".
3559 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
3561         * hir/rust-hir-dump.cc (Dump::debug): New.
3562         (debug): New.
3563         * hir/rust-hir-dump.h (debug): New.
3565 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
3567         * Make-lang.in: fixup formatting
3568         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): remove old check
3569         * rust-session-manager.cc (Session::compile_crate): call new lint
3570         * resolve/rust-ast-verify-assignee.h: Removed.
3571         * checks/errors/rust-readonly-check.cc: New file.
3572         * checks/errors/rust-readonly-check.h: New file.
3574 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
3576         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
3577         Added ErrorCode & more fixit hints.
3579 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
3581         * backend/rust-compile-block.h: remove HIR::ForLoopExpr
3582         * backend/rust-compile-expr.h: likewise
3583         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): likewise
3584         * checks/errors/privacy/rust-privacy-reporter.h: likewise
3585         * checks/errors/rust-const-checker.cc (ConstChecker::visit): likewise
3586         * checks/errors/rust-const-checker.h: likewise
3587         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): likewise
3588         * checks/errors/rust-unsafe-checker.h: likewise
3589         * checks/lints/rust-lint-marklive.h: likewise
3590         * hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): likewise
3591         * hir/rust-hir-dump.cc (Dump::visit): likewise
3592         * hir/rust-hir-dump.h: likewise
3593         * hir/tree/rust-hir-expr.h (class ForLoopExpr): likewise
3594         * hir/tree/rust-hir-full-decls.h (class ForLoopExpr): likewise
3595         * hir/tree/rust-hir-visitor.h: likewise
3596         * hir/tree/rust-hir.cc (ForLoopExpr::as_string): likewise
3597         (ForLoopExpr::accept_vis): likewise
3598         * typecheck/rust-hir-type-check-expr.h: likewise
3600 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
3602         * backend/rust-compile-expr.cc (CompileExpr::visit): Fix typo in varIadic.
3603         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
3604         * rust-backend.h (function_type_varadic): Rename into ...
3605         (function_type_variadic): ... this.
3606         * rust-gcc.cc (function_type_varadic): Rename into ...
3607         (function_type_variadic): ... this.
3608         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
3609         * typecheck/rust-tyty.h (is_varadic): Renamed into ...
3610         (is_variadic): ... this.
3612 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
3614         * backend/rust-compile-base.cc (HIRCompileBase::compile_function):
3615         Fix typo in substitutions.
3616         (HIRCompileBase::resolve_method_address): Likewise.
3617         * backend/rust-compile-extern.h (CompileExternItem::visit):
3618         Likewise.
3619         * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
3620         Likewise.
3621         * backend/rust-compile-intrinsic.cc (maybe_override_ctx):
3622         Likewise.
3623         * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
3624         * backend/rust-compile-resolve-path.cc
3625         (HIRCompileBase::query_compile): Likewise.
3626         * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion):
3627         Likewise.
3628         * typecheck/rust-hir-type-check-item.cc
3629         (TypeCheckItem::ResolveImplBlockSelfWithInference): Likewise.
3630         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit):
3631         Likewise.
3632         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
3633         Likewise.
3634         * typecheck/rust-tyty.cc (BaseType::has_subsititions_defined):
3635         Renamed into ...
3636         (BaseType::has_substitutions_defined): ... this.
3637         (ADTType::is_equal): Fix typo in substitutions.
3638         (handle_substitions): Likewise.
3639         (FnType::is_equal): Likewise.
3640         (FnType::handle_substitions): Likewise.
3641         * typecheck/rust-tyty.h (has_subsititions_defined): Renamed into
3642         ...
3643         (has_substitutions_defined): ... this.
3645 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3647         * backend/rust-compile-intrinsic.cc
3648         (get_identifier): Add declaration.
3649         (assume_handler): New.
3650         (generic_intrinsics): Add assume_handler entry.
3652 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3654         * rust-gcc.cc
3655         (Backend::wchar_type): Store static wchar tree.
3657 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3659         * rust-backend.h
3660         (complex_type): Remove.
3661         (complex_constant_expression): Remove.
3662         (real_part_expression): Remove.
3663         (imag_part_expression): Remove.
3664         (complex_expression): Remove.
3665         * rust-gcc.cc
3666         (complex_type): Remove.
3667         (complex_constant_expression): Remove.
3668         (real_part_expression): Remove.
3669         (imag_part_expression): Remove.
3670         (complex_expression): Remove.
3672 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3674         * rust-gcc.cc
3675         (namespace Backend):
3676         Use namespace definition instead of qualified names.
3678 2024-01-16  liushuyu  <liushuyu011@gmail.com>
3680         * backend/rust-compile-intrinsic.cc: add `copy`
3681         intrinsics and make `copy_nonoverlapping` handler more generic
3683 2024-01-16  liushuyu  <liushuyu011@gmail.com>
3685         * backend/rust-builtins.cc: add `expect` builtin definition.
3686         * backend/rust-compile-intrinsic.cc: add `likely` and `unlikely`
3687         intrinsics handler.
3689 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3691         * rust_error_codes.def: Moved to...
3692         * rust-error-codes.def: ...here...
3693         * rust-diagnostics.h: ...and update references.
3695 2024-01-16  Guillaume Gomez  <guillaume1.gomez@gmail.com>
3697         * backend/rust-compile-intrinsic.cc: Simplify `make_unsigned_long_tree`
3698         * rust-backend.h: Remove `integer_constant_expression`
3699         * rust-gcc.cc: Remove `integer_constant_expression`
3701 2024-01-16  Dave Evans  <dave@dmetwo.org>
3703         * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit):
3704         Add AltPattern visitor function
3705         * backend/rust-compile-pattern.h:
3706         Update CompilePatternCaseLabelExpr::visit(AltPattern&).
3707         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
3708         Update AltPattern visitor
3710 2024-01-16  Guillaume Gomez  <guillaume1.gomez@gmail.com>
3712         * backend/rust-compile-intrinsic.cc: Remove unused argument
3714 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
3716         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
3717         Added new error message, rich location and error code.
3719 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3721         * rust-backend.h
3722         (class Backend): Convert to ...
3723         (namespace Backend): ... namespace.
3724         * rust-gcc.cc
3725         (Backend::Backend): Rename to ...
3726         (Backend::init): ... here.
3727         (rust_get_backend): Remove.
3728         * rust-session-manager.cc
3729         (rust_get_backend): Remove.
3730         (Session::init): Use Backend::init instead of rust_get_backend.
3731         (Session::compile_crate):
3732         Initialize Context without pointer to Backend.
3733         * rust-session-manager.h
3734         (Session::backend): Remove.
3735         * backend/rust-compile-context.cc
3736         (Context::Context): Remove pointer to Backend.
3737         * backend/rust-compile-context.h
3738         (class Context): Remove pointer to Backend, update function calls.
3739         * backend/rust-compile-base.cc: Update function calls.
3740         * backend/rust-compile-block.cc: Likewise.
3741         * backend/rust-compile-expr.cc: Likewise.
3742         * backend/rust-compile-extern.h: Likewise.
3743         * backend/rust-compile-fnparam.cc: Likewise.
3744         * backend/rust-compile-intrinsic.cc: Likewise.
3745         * backend/rust-compile-item.cc: Likewise.
3746         * backend/rust-compile-pattern.cc: Likewise.
3747         * backend/rust-compile-resolve-path.cc: Likewise.
3748         * backend/rust-compile-type.cc: Likewise.
3749         * backend/rust-compile-var-decl.h: Likewise.
3750         * backend/rust-compile.cc: Likewise.
3752 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3754         * ast/rust-ast.cc (Attribute::check_cfg_predicate): Change raw
3755         string to constexpr call.
3756         (Attribute::separate_cfg_attrs): Likewise.
3757         * backend/rust-compile-base.cc (should_mangle_item): Likewise.
3758         (HIRCompileBase::setup_fndecl): Likewise.
3759         (HIRCompileBase::handle_cold_attribute_on_fndecl): Likewise.
3760         * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
3761         Likewise.
3762         * checks/errors/rust-unsafe-checker.cc (check_target_attr):
3763         Likewise.
3764         * expand/rust-cfg-strip.cc (fails_cfg): Likewise.
3765         (fails_cfg_with_expand): Likewise.
3766         (expand_cfg_attrs): Likewise.
3767         * expand/rust-macro-builtins.cc: Likewise.
3768         * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Likewise.
3769         (ASTLoweringBase::lower_macro_definition): Likewise.
3770         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
3771         * parse/rust-parse-impl.h (Parser::parse_doc_comment): Likewise.
3772         * parse/rust-parse.cc (extract_module_path): Likewise.
3773         * resolve/rust-early-name-resolver.cc (is_macro_use_module):
3774         Likewise.
3775         (EarlyNameResolver::visit): Likewise.
3776         * resolve/rust-toplevel-name-resolver-2.0.cc (is_macro_export):
3777         Likwise.
3778         * rust-session-manager.cc (Session::injection): Likewise.
3779         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): Likewise.
3780         * util/rust-attributes.cc (is_proc_macro_type): Likewise.
3781         (AttributeChecker::check_attribute): Likewise.
3782         (AttributeChecker::visit): Likewise.
3783         * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
3784         * util/rust-attribute-values.h: New file.
3786 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3788         * rust-backend.h
3789         (Backend::Backend): New.
3790         (Backend::~Backend): Remove.
3791         (class Gcc_backend): Remove.
3792         * rust-gcc.cc
3793         (Gcc_backend::Gcc_backend): Rename to ...
3794         (Backend::Backend): ... here.
3795         (rust_get_backend): Construct Backend instead of Gcc_backend.
3797 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3799         * expand/rust-proc-macro.cc (tokenstream_from_string): Change
3800         linemap null pointer to the current linemap.
3802 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3804         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
3805         Add proc macro definition insertion.
3807 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3809         * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_def):
3810         Change the function body to fetch the node id from the macro
3811         parameter.
3812         (Mappings::insert_bang_proc_macro_def): Likewise.
3813         (Mappings::insert_attribute_proc_macro_def): Likewise.
3814         * util/rust-hir-map.h: Update the function's prototype by
3815         removing the node id from the list of arguments.
3817 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3819         * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
3820         Add proc macro handle retrieval for attribute and derive proc macros.
3822 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3824         * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macro_def):
3825         Update function to accomodate new signature.
3826         (Mappings::lookup_bang_proc_macro_def): Likewise.
3827         (Mappings::lookup_attribute_proc_macro_def): Likewise.
3828         * util/rust-hir-map.h: Update function signatures.
3830 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3832         * expand/rust-macro-expand.h (struct MacroExpander): Update
3833         lookup function prototypes.
3834         * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macro_invocation):
3835         Update lookup function according to new signature.
3836         (Mappings::lookup_bang_proc_macro_invocation): Likewise.
3837         (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
3838         * util/rust-hir-map.h: Update function prototypes.
3840 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3842         * rust-backend.h
3843         (Backend::write_export_data): Remove.
3844         * rust-gcc.cc
3845         (Backend::write_export_data): Remove.
3847 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
3849         * rust-backend.h
3850         (Backend::real_part_expression): Make non-virtual.
3851         (Backend::imag_part_expression): Likewise.
3852         (Backend::complex_expression): Likewise.
3853         (Backend::convert_expression): Likewise.
3854         (Backend::struct_field_expression): Likewise.
3855         (Backend::compound_expression): Likewise.
3856         (Backend::conditional_expression): Likewise.
3857         (Backend::negation_expression): Likewise.
3858         (Backend::arithmetic_or_logical_expression): Likewise.
3859         (Backend::arithmetic_or_logical_expression_checked): Likewise.
3860         (Backend::comparison_expression): Likewise.
3861         (Backend::lazy_boolean_expression): Likewise.
3862         (Backend::constructor_expression): Likewise.
3863         (Backend::array_constructor_expression): Likewise.
3864         (Backend::array_initializer): Likewise.
3865         (Backend::array_index_expression): Likewise.
3866         (Backend::call_expression): Likewise.
3867         (Gcc_backend::real_part_expression): Remove.
3868         (Gcc_backend::imag_part_expression): Remove.
3869         (Gcc_backend::complex_expression): Remove.
3870         (Gcc_backend::convert_expression): Remove.
3871         (Gcc_backend::struct_field_expression): Remove.
3872         (Gcc_backend::compound_expression): Remove.
3873         (Gcc_backend::conditional_expression): Remove.
3874         (Gcc_backend::negation_expression): Remove.
3875         (Gcc_backend::arithmetic_or_logical_expression): Remove.
3876         (Gcc_backend::arithmetic_or_logical_expression_checked): Remove.
3877         (Gcc_backend::comparison_expression): Remove.
3878         (Gcc_backend::lazy_boolean_expression): Remove.
3879         (Gcc_backend::constructor_expression): Remove.
3880         (Gcc_backend::array_constructor_expression): Remove.
3881         (Gcc_backend::array_initializer): Remove.
3882         (Gcc_backend::array_index_expression): Remove.
3883         (Gcc_backend::call_expression): Remove.
3884         * rust-gcc.cc
3885         (Gcc_backend::real_part_expression): Rename to ...
3886         (Backend::real_part_expression): ... here.
3887         (Gcc_backend::imag_part_expression): Rename to ...
3888         (Backend::imag_part_expression): ... here.
3889         (Gcc_backend::complex_expression): Rename to ...
3890         (Backend::complex_expression): ... here.
3891         (Gcc_backend::convert_expression): Rename to ...
3892         (Backend::convert_expression): ... here.
3893         (Gcc_backend::struct_field_expression): Rename to ...
3894         (Backend::struct_field_expression): ... here.
3895         (Gcc_backend::compound_expression): Rename to ...
3896         (Backend::compound_expression): ... here.
3897         (Gcc_backend::conditional_expression): Rename to ...
3898         (Backend::conditional_expression): ... here.
3899         (Gcc_backend::negation_expression): Rename to ...
3900         (Backend::negation_expression): ... here.
3901         (Gcc_backend::arithmetic_or_logical_expression): Rename to ...
3902         (Backend::arithmetic_or_logical_expression): ... here.
3903         (Gcc_backend::arithmetic_or_logical_expression_checked): Rename to ...
3904         (Backend::arithmetic_or_logical_expression_checked): ... here.
3905         (Gcc_backend::comparison_expression): Rename to ...
3906         (Backend::comparison_expression): ... here.
3907         (Gcc_backend::lazy_boolean_expression): Rename to ...
3908         (Backend::lazy_boolean_expression): ... here.
3909         (Gcc_backend::constructor_expression): Rename to ...
3910         (Backend::constructor_expression): ... here.
3911         (Gcc_backend::array_constructor_expression): Rename to ...
3912         (Backend::array_constructor_expression): ... here.
3913         (Gcc_backend::array_initializer): Rename to ...
3914         (Backend::array_initializer): ... here.
3915         (Gcc_backend::array_index_expression): Rename to ...
3916         (Backend::array_index_expression): ... here.
3917         (Gcc_backend::call_expression): Rename to ...
3918         (Backend::call_expression): ... here.
3920 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3922         * rust-session-manager.cc (Session::load_extern_crate): Change
3923         variable name, add temporaries and comments.
3925 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3927         * expand/rust-proc-macro.h: Change get_trait_name to get_name in
3928         order to be coherent with the others proc macro type name
3929         convention.
3930         * resolve/rust-toplevel-name-resolver-2.0.cc (insert_macros):
3931         Add a templated funtion that inserts a proc macro into the
3932         context and emit an error on failure.
3933         (TopLevel::visit): Change from manual insertion to a function
3934         call.
3936 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3938         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
3939         Change to assertion.
3940         * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macros):
3941         Add empty line.
3942         (Mappings::lookup_bang_proc_macros): Likewise.
3943         (Mappings::lookup_attribute_proc_macros): Likewise.
3945 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3947         * metadata/rust-extern-crate.cc (ExternCrate::ExternCrate):
3948         Update definition to allow Extern crate with no content (pure
3949         proc macros).
3950         (ExternCrate::ok): Panic on no content.
3951         (ExternCrate::load): Likewise.
3952         * metadata/rust-extern-crate.h: Update prototypes.
3953         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
3954         Remove macro resolution.
3955         (TopLevel::visit): Likewise.
3956         * resolve/rust-toplevel-name-resolver-2.0.h: Add visit prototype
3957         for extern crate.
3958         * rust-session-manager.cc (Session::load_extern_crate): Adapt
3959         content depending on the loaded crate's content.
3960         * util/rust-hir-map.cc (Mappings::lookup_derive_proc_macros):
3961         Change return type to optional because it is way more
3962         convenient.
3963         (Mappings::lookup_bang_proc_macros): Likewise.
3964         (Mappings::lookup_attribute_proc_macros): Likewise.
3965         * util/rust-hir-map.h: Update function prototypes.
3967 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3969         * metadata/rust-imports.cc (Import::try_package_in_directory):
3970         Remove error when some macro are found even if no import data is
3971         available.
3973 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
3975         * ast/rust-ast.h (class BangProcMacro): Move class from here to
3976         rust-proc-macro.h. Also remove related functions.
3977         (class AttributeProcMacro): Likewise.
3978         (class CustomDeriveProcMacro): Likewise.
3979         (struct Crate): Remove proc macro vector members.
3980         * expand/rust-macro-expand.h (struct MacroExpander): Change the
3981         type to the newly created classes.
3982         * expand/rust-proc-macro.cc (BangProcMacro::BangProcMacro): Add
3983         constructor implementation.
3984         (AttributeProcMacro::AttributeProcMacro): Likewise.
3985         (CustomDeriveProcMacro::CustomDeriveProcMacro): Likewise.
3986         * expand/rust-proc-macro.h (class BangProcMacro): Move class to
3987         here.
3988         (class AttributeProcMacro): Likewise.
3989         (class CustomDeriveProcMacro): Likewise.
3990         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
3991         Change top level visitor to check mappings instead
3992         * rust-session-manager.cc (Session::load_extern_crate):
3993         Add back macro collection to mappings.
3994         * util/rust-hir-map.cc (Mappings::insert_derive_proc_macros):
3995         Update getter signature with new types.
3996         (Mappings::insert_bang_proc_macros): Likewise.
3997         (Mappings::insert_attribute_proc_macros): Likewise.
3998         (Mappings::lookup_derive_proc_macros): Likewise.
3999         (Mappings::lookup_bang_proc_macros): Likewise.
4000         (Mappings::lookup_attribute_proc_macros): Likewise.
4001         (Mappings::insert_derive_proc_macro_def): Likewise.
4002         (Mappings::insert_bang_proc_macro_def): Likewise.
4003         (Mappings::insert_attribute_proc_macro_def): Likewise.
4004         (Mappings::lookup_derive_proc_macro_def): Likewise.
4005         (Mappings::lookup_bang_proc_macro_def): Likewise.
4006         (Mappings::lookup_attribute_proc_macro_def): Likewise.
4007         (Mappings::insert_derive_proc_macro_invocation): Likewise.
4008         (Mappings::lookup_derive_proc_macro_invocation): Likewise.
4009         (Mappings::insert_bang_proc_macro_invocation): Likewise.
4010         (Mappings::lookup_bang_proc_macro_invocation): Likewise.
4011         (Mappings::insert_attribute_proc_macro_invocation): Likewise.
4012         (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
4013         * util/rust-hir-map.h: Update function prototypes as well as map
4014         types.
4016 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4018         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::go):
4019         Visit crate's newly stored proc macros.
4020         * rust-session-manager.cc (Session::load_extern_crate):
4021         Store proc macros in the parsed crate instead of a local
4022         variable to achieve mappings.
4024 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4026         * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
4027         Change argument to reference.
4028         * resolve/rust-early-name-resolver-2.0.h: Update function
4029         prototype.
4031 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4033         * ast/rust-ast.h: Add getters.
4035 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4037         * ast/rust-ast.h (struct Crate): Add proc macro members.
4039 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4041         * ast/rust-ast.h (class BangProcMacro): Add new proc macro
4042         abstraction.
4043         (class AttributeProcMacro): Likewise.
4044         (class CustomDeriveProcMacro): Likewise.
4046 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4048         * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
4049         Add function to handle attributes.
4050         (Early::visit): Override visitor functions.
4051         * resolve/rust-early-name-resolver-2.0.h: Add prototype.
4053 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4055         * ast/rust-ast.cc (Attribute::get_traits_to_derive): Convert
4056         tokenstream to path list.
4058 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4060         * ast/rust-ast.cc (Attribute::is_derive): Remove tokenstream
4061         condition.
4063 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4065         * ast/rust-ast.cc (Attribute::get_traits_to_derive): Change
4066         return type to a vector of references.
4067         * ast/rust-ast.h: Update constructor.
4068         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
4069         Update function call.
4071 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4073         * ast/rust-ast.cc (Attribute::get_traits_to_derive): Add
4074         function as member function.
4075         * ast/rust-ast.h: Add prototype.
4076         * expand/rust-expand-visitor.cc (get_traits_to_derive): Remove
4077         function.
4078         (ExpandVisitor::expand_inner_stmts): Update function call.
4080 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4082         * ast/rust-ast.cc (Attribute::is_derive): Add member function.
4083         * ast/rust-ast.h: Likewise.
4084         * expand/rust-expand-visitor.cc (is_derive): Remove old
4085         function.
4086         (ExpandVisitor::expand_inner_stmts): Update function call.
4087         (ExpandVisitor::visit_inner_using_attrs): Likewise.
4089 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4091         * backend/rust-compile-expr.cc (CompileExpr::visit): use a temp for the value
4093 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4095         * rust-backend.h
4096         (Backend::block): Make non-virtual.
4097         (Backend::block_add_statements): Likewise.
4098         (Gcc_backend::block): Remove.
4099         (Gcc_backend::block_add_statements): Remove.
4100         * rust-gcc.cc
4101         (Gcc_backend::block): Rename to ...
4102         (Backend::block): ... here.
4103         (Gcc_backend::block_add_statements): Rename to ...
4104         (Backend::block_add_statements): ... here.
4106 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4108         * expand/rust-macro-expand.h: Change include directive with the
4109         new name.
4110         * expand/rust-proc-macro.h (RUST_PROC_MACRO_H): Likewise.
4111         * util/rust-hir-map.h: Likewise.
4112         * util/rust-token-converter.h: Likewise.
4113         * util/rust-token-converter.cc: Remove useless include
4114         directive.
4115         * Make-lang.in: Rename library.
4117 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4119         * rust-backend.h
4120         (Backend::init_statement): Make non-virtual.
4121         (Backend::assignment_statement): Likewise.
4122         (Backend::return_statement): Likewise.
4123         (Backend::if_statement): Likewise.
4124         (Backend::loop_expression): Likewise.
4125         (Backend::exit_expression): Likewise.
4126         (Backend::compound_statement): Likewise.
4127         (Backend::statement_list): Likewise.
4128         (Backend::exception_handler_statement): Likewise.
4129         (Gcc_backend::init_statement): Remove.
4130         (Gcc_backend::assignment_statement): Remove.
4131         (Gcc_backend::return_statement): Remove.
4132         (Gcc_backend::if_statement): Remove.
4133         (Gcc_backend::compound_statement): Remove.
4134         (Gcc_backend::statement_list): Remove.
4135         (Gcc_backend::exception_handler_statement): Remove.
4136         (Gcc_backend::loop_expression): Remove.
4137         (Gcc_backend::exit_expression): Remove.
4138         * rust-gcc.cc
4139         (Gcc_backend::init_statement): Rename to ...
4140         (Backend::init_statement): ... here.
4141         (Gcc_backend::assignment_statement): Rename to ...
4142         (Backend::assignment_statement): ... here.
4143         (Gcc_backend::return_statement): Rename to ...
4144         (Backend::return_statement): ... here.
4145         (Gcc_backend::exception_handler_statement): Rename to ...
4146         (Backend::exception_handler_statement): ... here.
4147         (Gcc_backend::if_statement): Rename to ...
4148         (Backend::if_statement): ... here.
4149         (Gcc_backend::loop_expression): Rename to ...
4150         (Backend::loop_expression): ... here.
4151         (Gcc_backend::exit_expression): Rename to ...
4152         (Backend::exit_expression): ... here.
4153         (Gcc_backend::compound_statement): Rename to ...
4154         (Backend::compound_statement): ... here.
4155         (Gcc_backend::statement_list): Rename to ...
4156         (Backend::statement_list): ... here.
4158 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4160         * rust-backend.h
4161         (Backend::function): Make non-virtual.
4162         (Backend::function_defer_statement): Likewise.
4163         (Backend::function_set_parameters): Likewise.
4164         (Backend::write_global_definitions): Likewise.
4165         (Backend::write_export_data): Likewise.
4166         (Gcc_backend::function): Remove.
4167         (Gcc_backend::function_defer_statement): Remove.
4168         (Gcc_backend::function_set_parameters): Remove.
4169         (Gcc_backend::write_global_definitions): Remove.
4170         (Gcc_backend::write_export_data): Remove.
4171         * rust-gcc.cc
4172         (Gcc_backend::function): Rename to ...
4173         (Backend::function): ... here.
4174         (Gcc_backend::function_defer_statement):
4175         Fix a qualified lookup of Backend::label and rename to ...
4176         (Backend::function_defer_statement): ... here.
4177         (Gcc_backend::function_set_parameters) Rename to ...
4178         (Backend::function_set_parameters): ... here.
4179         (Gcc_backend::write_global_definitions): Rename to ...
4180         (Backend::write_global_definitions): ... here.
4181         (Gcc_backend::write_export_data): Rename to ...
4182         (Backend::write_export_data): ... here.
4184 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4186         * typecheck/rust-hir-inherent-impl-overlap.h:
4187         Added rich location and errorcode.
4188         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
4189         likewise.
4191 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4193         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
4194         Added error code.
4196 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4198         * rust-backend.h
4199         (Backend::zero_expression): Make non-virtual.
4200         (Backend::var_expression): Likewise.
4201         (Backend::integer_constant_expression): Likewise.
4202         (Backend::float_constant_expression): Likewise.
4203         (Backend::complex_constant_expression): Likewise.
4204         (Backend::string_constant_expression): Likewise.
4205         (Backend::char_constant_literal): Likewise.
4206         (Backend::wchar_constant_literal): Likewise.
4207         (Backend::boolean_constant_expression): Likewise.
4208         (Gcc_backend::zero_expression): Remove.
4209         (Gcc_backend::var_expression): Remove.
4210         (Gcc_backend::integer_constant_expression): Remove.
4211         (Gcc_backend::float_constant_expression): Remove.
4212         (Gcc_backend::complex_constant_expression): Remove.
4213         (Gcc_backend::string_constant_expression): Remove.
4214         (Gcc_backend::wchar_constant_expression): Remove.
4215         (Gcc_backend::char_constant_expression): Remove.
4216         (Gcc_backend::boolean_constant_expression): Remove.
4217         * rust-gcc.cc
4218         (Gcc_backend::zero_expression): Rename to ...
4219         (Backend::zero_expression): ... here.
4220         (Gcc_backend::var_expression): Rename to ...
4221         (Backend::var_expression): ... here.
4222         (Gcc_backend::integer_constant_expression): Rename to ...
4223         (Backend::integer_constant_expression): ... here.
4224         (Gcc_backend::float_constant_expression): Rename to ...
4225         (Backend::float_constant_expression): ... here.
4226         (Gcc_backend::complex_constant_expression): Rename to ...
4227         (Backend::complex_constant_expression): ... here.
4228         (Gcc_backend::string_constant_expression): Rename to ...
4229         (Backend::string_constant_expression): ... here.
4230         (Gcc_backend::wchar_constant_expression): Rename to ...
4231         (Backend::wchar_constant_expression): ... here.
4232         (Gcc_backend::char_constant_expression): Rename to ...
4233         (Backend::char_constant_expression): ... here.
4234         (Gcc_backend::boolean_constant_expression): Rename to ...
4235         (Backend::boolean_constant_expression): ... here.
4237 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4239         * rust-backend.h
4240         (Backend::global_variable): Make non-virtual.
4241         (Backend::global_variable_set_init): Likewise.
4242         (Backend::local_variable): Likewise.
4243         (Backend::parameter_variable): Likewise.
4244         (Backend::static_chain_variable): Likewise.
4245         (Backend::temporary_variable): Likewise.
4246         (Gcc_backend::global_variable): Remove.
4247         (Gcc_backend::global_variable_set_init): Remove.
4248         (Gcc_backend::local_variable): Remove.
4249         (Gcc_backend::parameter_variable): Remove.
4250         (Gcc_backend::static_chain_variable): Remove.
4251         (Gcc_backend::temporary_variable): Remove.
4252         (Gcc_backend::non_zero_size_type): Move to ...
4253         (Backend::non_zero_size_type): ... here.
4254         (Gcc_backend::convert_tree): Move to ...
4255         (Backend::convert_tree): ... here.
4256         * rust-gcc.cc
4257         (Gcc_backend::non_zero_size_type): Rename to ...
4258         (Backend::non_zero_size_type): ... here.
4259         (Gcc_backend::convert_tree): Rename to ...
4260         (Backend::convert_tree): ... here.
4261         (Gcc_backend::global_variable): Rename to ...
4262         (Backend::global_variable): ... here.
4263         (Gcc_backend::global_variable_set_init): Rename to ...
4264         (Backend::global_variable_set_init): ... here.
4265         (Gcc_backend::local_variable): Rename to ...
4266         (Backend::local_variable): ... here.
4267         (Gcc_backend::parameter_variable): Rename to ...
4268         (Backend::parameter_variable): ... here.
4269         (Gcc_backend::static_chain_variable): Rename to ...
4270         (Backend::static_chain_variable): ... here.
4271         (Gcc_backend::temporary_variable): Rename to ...
4272         (Backend::temporary_variable): ... here.
4274 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4276         * checks/errors/privacy/rust-privacy-reporter.cc
4277         (PrivacyReporter::check_for_privacy_violation):
4278         Added errorcode & richlocation.
4280 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4282         * rust-backend.h
4283         (Backend::debug): Make non-virtual.
4284         (Backend::get_identifier_node): Likewise.
4285         (Gcc_backend::debug): Remove.
4286         (Gcc_backend::get_identifier_node): Remove.
4287         * rust-gcc.cc
4288         (Gcc_backend::debug): Rename to ...
4289         (Backend::debug): ... here.
4290         (Gcc_backend::get_identifier_node): Rename to ...
4291         (Backend::get_identifier_node): ... here.
4293 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4295         * typecheck/rust-hir-type-check-expr.cc
4296         (TypeCheckExpr::visit): Expect if conditions to have type bool.
4298 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4300         * rust-backend.h
4301         (Backend::label): Make non-virtual.
4302         (Backend::label_definition_statement): Likewise.
4303         (Backend::goto_statement): Likewise.
4304         (Backend::label_address): Likewise.
4305         (Gcc_backend::label): Remove.
4306         (Gcc_backend::label_definition_statement): Remove.
4307         (Gcc_backend::goto_statement): Remove.
4308         (Gcc_backend::label_address): Remove.
4309         * rust-gcc.cc
4310         (Gcc_backend::label): Rename to ...
4311         (Backend::label): ... here.
4312         (Gcc_backend::label_definition_statement): Rename to ...
4313         (Backend::label_definition_statement): ... here.
4314         (Gcc_backend::goto_statement): Rename to ...
4315         (Backend::goto_statement): ... here.
4316         (Gcc_backend::label_address): Rename to ...
4317         (Backend::label_address): ... here.
4319 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4321         * backend/rust-constexpr.cc
4322         (struct constexpr_fundef): Rename to ...
4323         (struct rust_constexpr_fundef): ... here.
4324         (struct constexpr_call): Rename to ...
4325         (struct rust_constexpr_call): ... here.
4327 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4329         * lex/rust-input-source.h: Move constants from here...
4330         * util/rust-codepoint.h (struct Codepoint): ... to here
4331         * util/rust-attributes.cc (check_no_mangle_function): New function.
4332         (AttributeChecker::visit): Use it.
4333         * util/rust-unicode.cc (is_ascii_only): New function.
4334         * util/rust-unicode.h (is_ascii_only): Likewise.
4335         * backend/rust-mangle.cc (legacy_mangle_name): Use it.
4336         * util/rust-punycode.cc (extract_basic_string): Likewise.
4337         * lex/rust-lex.cc (Lexer::parse_byte_char): Likewise.
4339 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4341         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit):
4342         Added richlocation & error code.
4344 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4346         * typecheck/rust-hir-type-check-expr.cc
4347         (TypeCheckExpr::resolve_fn_trait_call): Add TODO comment.
4348         * typecheck/rust-tyty-bounds.cc
4349         (TypeBoundPredicate::TypeBoundPredicate):
4350         Add assertions, new error constructor.
4351         (TypeBoundPredicate::error): Use new error constructor.
4352         * typecheck/rust-tyty.h
4353         (struct TypeBoundPredicate::mark_is_error): New.
4354         (TypeBoundPredicate::TypeBoundPredicate):
4355         Add new error constructor.
4357 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4359         * rust-backend.h:
4360         (Backend::wchar_type): Make non-virtual.
4361         (Backend::get_pointer_size): Likewise.
4362         (Backend::raw_str_type): Likewise.
4363         (Backend::integer_type): Likewise.
4364         (Backend::float_type): Likewise.
4365         (Backend::complex_type): Likewise.
4366         (Backend::pointer_type): Likewise.
4367         (Backend::reference_type): Likewise.
4368         (Backend::immutable_type): Likewise.
4369         (Backend::function_type): Likewise.
4370         (Backend::function_type_varadic): Likewise.
4371         (Backend::function_ptr_type): Likewise.
4372         (Backend::struct_type): Likewise.
4373         (Backend::union_type): Likewise.
4374         (Backend::array_type): Likewise.
4375         (Backend::named_type): Likewise.
4376         (Backend::type_size): Likewise.
4377         (Backend::type_alignment): Likewise.
4378         (Backend::type_field_alignment): Likewise.
4379         (Backend::type_field_offset): Likewise.
4380         (Gcc_backend::wchar_type): Remove.
4381         (Gcc_backend::get_pointer_size): Remove.
4382         (Gcc_backend::raw_str_type): Remove.
4383         (Gcc_backend::integer_type): Remove.
4384         (Gcc_backend::float_type): Remove.
4385         (Gcc_backend::complex_type): Remove.
4386         (Gcc_backend::pointer_type): Remove.
4387         (Gcc_backend::reference_type): Remove.
4388         (Gcc_backend::immutable_type): Remove.
4389         (Gcc_backend::function_type): Remove.
4390         (Gcc_backend::function_type_varadic): Remove.
4391         (Gcc_backend::function_ptr_type): Remove.
4392         (Gcc_backend::struct_type): Remove.
4393         (Gcc_backend::union_type): Remove.
4394         (Gcc_backend::array_type): Remove.
4395         (Gcc_backend::named_type): Remove.
4396         (Gcc_backend::type_size): Remove.
4397         (Gcc_backend::type_alignment): Remove.
4398         (Gcc_backend::type_field_alignment): Remove.
4399         (Gcc_backend::type_field_offset): Remove.
4400         (Gcc_backend::fill_in_fields): Move to ...
4401         (Backend::fill_in_fields): ... here.
4402         (Gcc_backend::fill_in_array): Move to ...
4403         (Backend::fill_in_array): ... here.
4404         * rust-gcc.cc
4405         (Gcc_backend::wchar_type): Rename to ...
4406         (Backend::wchar_type): ... here.
4407         (Gcc_backend::get_pointer_size): Rename to ...
4408         (Backend::get_pointer_size): ... here.
4409         (Gcc_backend::raw_str_type): Rename to ...
4410         (Backend::raw_str_type): ... here.
4411         (Gcc_backend::integer_type): Rename to ...
4412         (Backend::integer_type): ... here.
4413         (Gcc_backend::float_type): Rename to ...
4414         (Backend::float_type): ... here.
4415         (Gcc_backend::complex_type): Rename to ...
4416         (Backend::complex_type): ... here.
4417         (Gcc_backend::pointer_type): Rename to ...
4418         (Backend::pointer_type): ... here.
4419         (Gcc_backend::reference_type): Rename to ...
4420         (Backend::reference_type): ... here.
4421         (Gcc_backend::immutable_type): Rename to ...
4422         (Backend::immutable_type): ... here.
4423         (Gcc_backend::function_type): Rename to ...
4424         (Backend::function_type): ... here.
4425         (Gcc_backend::function_type_varadic): Rename to ...
4426         (Backend::function_type_varadic): ... here.
4427         (Gcc_backend::function_ptr_type): Rename to ...
4428         (Backend::function_ptr_type): ... here.
4429         (Gcc_backend::struct_type): Rename to ...
4430         (Backend::struct_type): ... here.
4431         (Gcc_backend::union_type): Rename to ...
4432         (Backend::union_type): ... here.
4433         (Gcc_backend::fill_in_fields): Rename to ...
4434         (Backend::fill_in_fields): ... here.
4435         (Gcc_backend::array_type): Rename to ...
4436         (Backend::array_type): ... here.
4437         (Gcc_backend::fill_in_array): Rename to ...
4438         (Backend::fill_in_array): ... here.
4439         (Gcc_backend::named_type): Rename to ...
4440         (Backend::named_type): ... here.
4441         (Gcc_backend::type_size): Rename to ...
4442         (Backend::type_size): ... here.
4443         (Gcc_backend::type_alignment): Rename to ...
4444         (Backend::type_alignment): ... here.
4445         (Gcc_backend::type_field_alignment): Rename to ...
4446         (Backend::type_field_alignment): ... here.
4447         (Gcc_backend::type_field_offset): Rename to ...
4448         (Backend::type_field_offset): ... here.
4450 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4452         * backend/rust-compile-intrinsic.cc (move_val_init_handler): mark as side-effects
4454 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4456         * backend/rust-compile-intrinsic.cc (uninit_handler): Update fndecl attributes
4458 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4460         * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): fix use before init
4462 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4464         * backend/rust-compile-intrinsic.cc (enter_intrinsic_block): take the locals vector
4465         (uninit_handler): make a temp variable and use the address of it
4467 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4469         * resolve/rust-early-name-resolver-2.0.cc (Early::visit):
4470         Collect error instead of lambda.
4471         * resolve/rust-early-name-resolver-2.0.h (std::function<void):
4472         Remove type alias.
4473         * rust-diagnostics.h: Change collection type.
4474         * rust-session-manager.cc (Session::expansion): Change
4475         collection container.
4477 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4479         * resolve/rust-early-name-resolver-2.0.cc (Early::visit):
4480         Collect error instead of emitting it. Also add invocation
4481         registration.
4482         * resolve/rust-early-name-resolver-2.0.h (std::function<void):
4483         Add type definition for collection.
4484         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
4485         Register macro rule definition in mappings.
4486         * rust-session-manager.cc (Session::expansion): Add macro
4487         resolve error collection.
4489 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4491         * config-lang.in:
4492         Add "backend/rust-tree.h" and "backend/rust-tree.h" to gtfiles.
4493         * backend/rust-tree.cc: Include new header generated by gengtype.
4494         * backend/rust-tree.h
4495         (struct language_function): Add TODO.
4496         * rust-lang.cc:
4497         Include "rust-tree.h".
4498         (struct lang_type): Remove duplicate definition.
4499         (struct lang_decl): Likewise.
4500         (struct lang_identifier): Likewise.
4501         (struct language_function): Likewise.
4503 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4505         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
4506         Added error code and rich location.
4508 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4510         * backend/rust-tree.h
4511         (struct rust_cp_class_binding): Fork from gcc/cp/name_lookup.h.
4512         (struct rust_cp_binding_level): Likewise.
4513         (struct named_label_entry): Remove declaration...
4514         (struct rust_named_label_entry): ... and fork definition from gcc/cp/decl.cc.
4516 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4518         * rust-diagnostics.cc (rust_be_error_at): Added overload function.
4519         (rust_error_at): non-const `rich_location *` function.
4520         * rust-diagnostics.h (rust_error_at): Implementation of overloaded
4521         function.
4522         (rust_be_error_at): likewise.
4523         * rust_error_codes.def: Added GNU license.
4525 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4527         * typecheck/rust-tyty.cc (BaseType::satisfies_bound):
4528         Added errorcode and user-friendly error message.
4530 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4532         * backend/rust-tree.cc
4533         (resort_data): Fork from c++ frontend.
4534         (resort_member_name_cmp): Likewise.
4535         (resort_type_member_vec): Likewise.
4536         * backend/rust-tree.h
4537         (resort_type_member_vec): Likewise.
4539 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4541         * backend/rust-tree.cc
4542         (struct conv_type_hasher): Rename to ...
4543         (struct rust_conv_type_hasher): ... here.
4544         (struct cplus_array_hasher): Rename to ...
4545         (struct rust_cplus_array_hasher): ... here.
4546         (struct source_location_table_entry_hash): Rename to ...
4547         (struct rust_source_location_table_entry_hash): ... here.
4548         * backend/rust-tree.h
4549         (struct named_decl_hash): Rename to ...
4550         (struct rust_named_decl_hash): ... here.
4551         (struct cxx_saved_binding): Rename to ...
4552         (struct rust_cxx_saved_binding): ... here.
4553         (struct named_label_hash): Rename to ...
4554         (struct rust_named_label_hash): ... here.
4555         (struct tree_pair_s): Rename to ...
4556         (struct rust_tree_pair_s): ... here.
4557         (struct tree_pair_p): Rename to ...
4558         (struct rust_tree_pair_p): ... here.
4560 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4562         * backend/rust-tree.cc
4563         (Rust::gt_pch_nx): Move external function declaration ...
4564         (gt_pch_nx): ... out of Rust namespace.
4565         * backend/rust-tree.h
4566         (OVL_FIRST): Qualify function name.
4568 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4570         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): do a final lookup
4572 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4574         * parse/rust-parse-impl.h (Parser::parse_generic_params):
4575         Added more user friendly message.
4577 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4579         * expand/rust-macro-builtins.cc
4580         (MacroBuiltin::include_str_handler): Use vector::data.
4582 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4584         * typecheck/rust-hir-type-check-type.cc:
4585         Added last variant name, errorcode & rich location. for enum candidates.
4587 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4589         * backend/rust-tree.h
4590         (struct stmt_tree_s): Remove.
4591         (typedef stmt_tree): Remove.
4592         (c_language_function::x_stmt_tree): Remove.
4593         (saved_scope::x_stmt_tree): Remove.
4594         (lang_decl_fn::pending_inline_p): Remove.
4595         (lang_decl_fn::spare): Adjust size.
4596         (lang_decl_fn::pending_inline_info): Remove.
4598 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4600         * backend/rust-constexpr.cc:
4601         Include gt-rust-rust-constexpr.h.
4602         (struct constexpr_call_hasher): Rename to ...
4603         (struct rust_constexpr_call_hasher): ... here.
4604         (struct constexpr_fundef_hasher): Rename to ...
4605         (struct rust_constexpr_fundef_hasher): ... here.
4606         * config-lang.in: Add rust-constexpr.cc to gtfiles.
4608 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4610         * backend/rust-mangle.cc (v0_add_identifier): Added punycode encoding
4611         (v0_mangle_item): Likewise.
4612         * lex/rust-lex.cc (assert_source_content): Change type
4613         (test_buffer_input_source): Change type
4614         (test_file_input_source): Change type
4615         * resolve/rust-ast-resolve-toplevel.h: fix typo
4616         * rust-session-manager.cc (Session::load_extern_crate): fix typo
4617         * util/rust-canonical-path.h: fix typo
4618         * util/rust-hir-map.cc (NodeMapping::get_error): fix typo
4619         (Mappings::Mappings): fix typo
4620         * util/rust-mapping-common.h (UNKNOWN_CREATENUM): fix typo
4621         (UNKNOWN_CRATENUM): Change 0 to UINT32_MAX
4623 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4625         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
4626         Updated errorcode & more userfriendly message.
4628 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4630         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit):
4631         Added more helpful error message.
4633 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4635         * typecheck/rust-hir-path-probe.h:
4636         Fixes issue & added rich location message.
4637         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
4638         Added rich location and error code.
4640 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4642         * lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Only
4643         accept digits after a dot instead of accepting any float
4644         member.
4646 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4648         * ast/rust-pattern.h: No need of assertion, we are handling it.
4649         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
4650         Added check which emits error instead of using assertion.
4651         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
4652         Added rich location and error code.
4654 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4656         * backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
4657         Added rich_location & error code.
4659 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4661         * parse/rust-parse-impl.h (Parser::parse_trait):
4662         added errorcode & updated error message.
4664 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4666         * parse/rust-parse-impl.h (Parser::parse_outer_attribute):
4667         Added errorcode & updated error function.
4669 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4671         * rust-diagnostics.cc (va_constructor):
4672         Added constructor for all possible cases.
4673         (Error::Error): Updated error struct
4674         for all possible cases.
4675         * rust-diagnostics.h (struct Error):
4676         Updated error struct to support error
4677         code & rich location support.
4679 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4681         * backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
4682         Added rich_location & error code.
4684 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4686         * rust-diagnostics.cc: Switch from new[] to xcalloc
4688 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4690         * util/make-rust-unicode.py: Add type annotation
4692 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4694         * backend/rust-compile-intrinsic.cc (check_for_cached_intrinsic):
4695         simplify this cached intrinsic check
4696         * backend/rust-mangle.cc (legacy_mangle_item): use new interface
4697         * typecheck/rust-tyty.h: new managle helper
4699 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4701         * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
4702         use the single candidate
4704 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
4706         * hir/rust-hir-dump.cc (Dump::visit): Remove useless if/else
4707         already handled by visit_field.
4709 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4711         * util/rust-punycode.cc: Add CHECKING_P guard.
4713 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4715         * backend/rust-mangle.cc (legacy_mangle_name): Use Unicode escape
4717 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
4719         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): remove hack
4721 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4723         * expand/rust-proc-macro-invoc-lexer.cc
4724         (ProcMacroInvocLexer::skip_token): Remove.
4725         * expand/rust-proc-macro-invoc-lexer.h:
4726         Include "rust-macro-invoc-lexer.h".
4727         (class ProcMacroInvocLexer):
4728         Extend MacroInvocLexerBase.
4730 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4732         * lex/rust-codepoint.h: Moved to...
4733         * util/rust-codepoint.h: ...here.
4734         * lex/rust-input-source.h: Add missing license
4735         * util/rust-unicode.cc: Add missing license
4736         * util/rust-punycode.cc (extract_basic_string): Remove constant
4738 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4740         * expand/rust-macro-expand.h: Keep optional references for last_def
4741         and last_invoc.
4742         * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Store
4743         optional references.
4744         * rust-session-manager.cc (Session::expansion): Use tl::optional's APIs
4745         for better checking.
4747 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
4749         * hir/rust-hir-dump.h (do_ifexpr): New.
4750         * hir/rust-hir-dump.cc (Dump::do_ifexpr): New.
4751         (Dump::visit): Use do_ifexpr and visit_field
4753 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4755         * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
4756         Refactored ErrorCodes & error messages.
4758 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4760         * backend/rust-compile-base.cc:
4761         Added ErrorCode.
4763 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4765         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers):
4766         called error function.
4767         (ASTLoweringBase::lower_extern_block): likewise.
4769 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4771         * ast/rust-ast-collector.cc: Adjust formatting.
4772         * checks/errors/rust-feature-gate.cc: Add trailing newline.
4773         * rust-diagnostics.h: Remove old comment.
4775 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4777         * rust-gcc.cc
4778         (Gcc_backend::struct_type): Remove references to "this".
4779         (Gcc_backend::union_type): Likewise.
4780         (Gcc_backend::array_type): Likewise.
4781         (Gcc_backend::wchar_constant_expression): Likewise.
4782         (Gcc_backend::convert_expression): Likewise.
4783         (Gcc_backend::constructor_expression): Likewise.
4784         (Gcc_backend::array_initializer): Likewise.
4785         (Gcc_backend::assignment_statement): Likewise.
4786         (Gcc_backend::global_variable): Likewise.
4787         (Gcc_backend::temporary_variable): Likewise.
4788         (Gcc_backend::function_defer_statement): Likewise.
4790 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4792         * Make-lang.in: Add rust-punycode.o.
4793         * rust-lang.cc (run_rust_tests): Add selftest.
4794         * util/rust-punycode.cc: New file.
4795         * util/rust-punycode.h: New file.
4797 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4799         * backend/rust-compile.cc (HIRCompileBase::verify_array_capacities):
4800         Added ErrorCode.
4802 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4804         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve):
4805         added errorcode.
4807 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4809         * rust-backend.h
4810         (Backend::error_variable): Remove.
4811         (Gcc_backend::error_variable): Move to ...
4812         * rust-gcc.cc
4813         (Bvariable::error_variable): ... here ...
4814         * rust-gcc.h
4815         (Bvariable::error_variable): ... and declare here.
4816         (Gcc_backend::global_variable): Update error_variable call.
4817         (Gcc_backend::local_variable): Likewise.
4818         (Gcc_backend::parameter_variable): Likewise.
4819         (Gcc_backend::static_chain_variable): Likewise.
4820         (Gcc_backend::temporary_variable): Likewise.
4821         * backend/rust-compile-extern.h
4822         (CompileExternItem::visit): Likewise.
4823         * backend/rust-compile-fnparam.cc
4824         (CompileFnParam::CompileFnParam): Likewise.
4826 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
4828         * backend/rust-compile-type.cc
4829         (TyTyResolveCompile::visit): Inline Backend::bool_type call.
4830         * rust-backend.h
4831         (Backend::bool_type): Remove.
4832         (Backend::char_type): Remove.
4833         (Gcc_backend::bool_type): Remove.
4834         (Gcc_backend::char_type): Remove.
4835         * rust-gcc.cc
4836         (Gcc_backend::char_constant_expression): Inline Backend::char_type call.
4838 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4840         * lex/rust-lex.cc (assert_source_content): Fix namespace specifier
4841         (test_buffer_input_source): Likewise.
4842         (test_file_input_source): Likewise.
4843         * lex/rust-lex.h: Move InputSource ...
4844         * lex/rust-input-source.h: ... to here. (New file)
4845         * lex/rust-token.cc (nfc_normalize_token_string): New function
4846         * lex/rust-token.h (nfc_normalize_token_string): New function
4847         * rust-lang.cc (run_rust_tests): Modify order of selftests.
4848         * rust-session-manager.cc (validate_crate_name): Modify interface of Utf8String.
4849         * util/rust-unicode.cc (lookup_cc): Modify codepoint_t typedef.
4850         (lookup_recomp): Likewise.
4851         (recursive_decomp_cano): Likewise.
4852         (decomp_cano): Likewise.
4853         (sort_cano): Likewise.
4854         (compose_hangul): Likewise.
4855         (assert_normalize): Likewise.
4856         (Utf8String::nfc_normalize): New function.
4857         * util/rust-unicode.h: Modify interface of Utf8String.
4859 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4861         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
4862         Added ErrorCode.
4864 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
4866         * util/rust-common.h (enum_to_str): Remove extra semicolon after
4867         the function.
4869 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4871         * checks/errors/rust-const-checker.cc (ConstChecker::visit):
4872         Use of mutable reference in constant functions.
4873         * checks/errors/rust-feature-gate.cc (FeatureGate::gate):
4874         ErrorCode for intrinsics are subject to change.
4876 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4878         * checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
4879         Added errorcode.
4881 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4883         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
4884         Added errorcode.
4886 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4888         * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Declare
4889         macros in the current rib if they are macros 2.0.
4891 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4893         * ast/rust-macro.h: Add new method to `MacroRulesDefinition` to allow
4894         getting the `MacroKind` contained.
4896 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4898         * rust-session-manager.cc
4899         (Session::expansion): Use new `Early` name resolution 2.0 pass
4901 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4903         * Make-lang.in: Add new object file.
4904         * resolve/rust-early-name-resolver-2.0.cc: New file.
4905         * resolve/rust-early-name-resolver-2.0.h: New file.
4907 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4909         * resolve/rust-default-resolver.cc
4910         (DefaultResolver::visit): Visit CallExpr and MethodCallExpr properly.
4911         * resolve/rust-default-resolver.h: Switch "node" to plural in documentation.
4913 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4915         * resolve/rust-toplevel-name-resolver-2.0.cc
4916         (TopLevel::insert_or_error_out): Fix format string.
4917         (is_macro_export): New method.
4918         (TopLevel::visit): Handle macro definitions.
4920 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4922         * resolve/rust-name-resolution-context.cc
4923         (Resolver::insert): Do not call into `rust_unreachable` when resolving
4924         macros anymore.
4926 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4928         * resolve/rust-forever-stack.h
4929         (insert_at_root): New method.
4930         (resolve_path): New method.
4931         (reverse_iter): Iterate on `Node`s instead of `Rib`s
4932         * resolve/rust-forever-stack.hxx: Add path resolution.
4934 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4936         * resolve/rust-rib.h: Add shadowing parameter. Make kind field public.
4937         * resolve/rust-rib.cc (Rib::insert): Likewise.
4939 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4941         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
4942         refactored message and called error function.
4944 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4946         * checks/errors/rust-feature-gate.cc (FeatureGate::check):
4947         errorcode support for unknown feature.
4949 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
4951         * typecheck/rust-unify.cc (UnifyRules::emit_type_mismatch):
4952         refactored & called error function.
4954 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
4956         * expand/rust-macro-builtins.cc
4957         (load_file_bytes): Return a tl::optional.
4958         (MacroBuiltin::include_byte_handler): Adjust and check file was
4959         correctly opened.
4960         (MacroBuiltin::include_str_handler): Likewise.
4962 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4964         * resolve/rust-toplevel-name-resolver-2.0.h
4965         (class TopLevel): Inherit from DefaultResolver
4966         * resolve/rust-toplevel-name-resolver-2.0.cc
4967         (TopLevel::TopLevel): Remove unecessary methods
4969 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4971         * Make-lang.in: Add new object file.
4972         * resolve/rust-default-resolver.cc: New file.
4973         * resolve/rust-default-resolver.h: New file.
4975 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
4977         * util/rust-unicode.cc (decomp_cano): Decompose Hangul.
4978         (sort_cano): Fix bounds check.
4979         (recomp): use `compose_hangul`.
4980         (compose_hangul): Compose Hangul.
4981         (rust_utf8_normalize_test): Add tests.
4983 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4985         * resolve/rust-forever-stack.hxx: assert() -> rust_assert()
4987 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4989         * Make-lang.in: Add new object file.
4990         * resolve/rust-toplevel-name-resolver-2.0.cc: New file.
4991         * resolve/rust-toplevel-name-resolver-2.0.h: New file.
4993 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
4995         * Make-lang.in: Add new object file.
4996         * resolve/rust-name-resolution-context.cc: New file.
4997         * resolve/rust-name-resolution-context.h: New file.
4999 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5001         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5002         called error function.
5004 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5006         * expand/rust-macro-invoc-lexer.cc
5007         (MacroInvocLexer::skip_token): Remove.
5008         * expand/rust-macro-invoc-lexer.h
5009         (class MacroInvocLexer): Extend MacroInvocLexerBase.
5011 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
5013         * ast/rust-ast-fragment.cc (Fragment::create_empty): New.
5014         * ast/rust-ast-fragment.h (MacroTranscriberFunc): New.
5015         * ast/rust-macro.h (MacroRulesDefinition): Use MacroTranscriberFunc.
5016         * expand/rust-macro-builtins.cc
5017         (MacroBuiltin::builtin_transcribers): likewise.
5018         (MacroBuiltin::assert_handler): Return optional.
5019         (MacroBuiltin::file_handler): Likewise.
5020         (MacroBuiltin::column_handler): Likewise.
5021         (MacroBuiltin::include_bytes_handler): Likewise.
5022         (MacroBuiltin::include_str_handler): Likewise.
5023         (MacroBuiltin::compile_error_handler): Likewise.
5024         (MacroBuiltin::concat_handler): Likewise.
5025         (MacroBuiltin::env_handler): Likewise.
5026         (MacroBuiltin::cfg_handler): Likewise.
5027         (MacroBuiltin::include_handler): Likewise.
5028         (MacroBuiltin::line_handler): Likewise.
5029         (MacroBuiltin::stringify_handler): Likewise.
5030         (MacroBuiltin::sorry): Likewise.
5031         * expand/rust-macro-builtins.h (builtin_transcribers): Use
5032         MacroTranscriberFunc.
5033         (assert_handler): Return optional.
5034         (file_handler): Likewise.
5035         (column_handler): Likewise.
5036         (include_bytes_handler): Likewise.
5037         (include_str_handler): Likewise.
5038         (compile_error_handler): Likewise.
5039         (concat_handler): Likewise.
5040         (env_handler): Likewise.
5041         (cfg_handler): Likewise.
5042         (include_handler): Likewise.
5043         (line_handler): Likewise.
5044         (stringify_handler): Likewise.
5045         (sorry): Likewise.
5046         * expand/rust-macro-expand.cc (MacroExpander::expand_invoc):
5047         Adjust to transcribers returning optional.
5049 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
5051         * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
5052         always resolve the type even when its an a mandatory trait item
5053         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
5054         Add check for enum candidates otherwise you get undefined behaviour
5056 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
5058         * lex/rust-codepoint.h: Add comment
5059         * lex/rust-lex.h: New method to get decoded characters
5060         * rust-session-manager.cc (validate_crate_name): Modify unicode check
5061         (rust_crate_name_validation_test): Add testcases
5062         * util/rust-unicode.h (RUST_UNICODE_H): New class Utf8String.
5063         (class Utf8String): New class.
5064         * util/rust-unicode.cc (binary_search_sorted_array): Add comment.
5065         (recursive_decomp_cano): Add comment.
5066         (recomp): Remove dead code.
5067         (dump_string): Removed.
5069 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5071         * util/rust-unicode.cc: Add CHECKING_P guard.
5073 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
5075         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5076         We need to check if a function context exists
5078 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
5080         * expand/rust-proc-macro.cc (literal_from_string): update Lexer constructor
5081         (tokenstream_from_string): likewise
5082         * lex/rust-lex.cc (Lexer::Lexer): likewise
5083         * lex/rust-lex.h: pass through Linemap
5084         * parse/rust-cfg-parser.cc (parse_cfg_option): likewise
5085         * rust-session-manager.cc (Session::load_extern_crate): likewise
5086         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
5087         dont apply Sized on self
5088         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate): new
5089         * typecheck/rust-hir-type-check-base.h: add prototype
5090         * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::Resolve): apply Sized
5091         (TypeResolveGenericParam::visit): likewise
5092         * typecheck/rust-hir-type-check-type.h: update prototypes
5093         * typecheck/rust-typecheck-context.cc: remove bad assertions
5094         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): cleanup
5095         (TypeCheckBase::get_predicate_from_bound): apply sized rules properly
5096         * util/rust-hir-map.cc (Mappings::lookup_trait_item_lang_item): helpers
5097         (Mappings::get_lang_item): likewise
5098         * util/rust-hir-map.h: likewise
5099         * util/rust-token-converter.cc (from_ident): update lexer ctor
5100         (from_punct): likewise
5102 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
5104         * typecheck/rust-hir-path-probe.cc: track regular polarity
5105         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): likewise
5106         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
5107         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): likewise
5108         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
5109         (TypeBoundPredicate::TypeBoundPredicate): update ctor
5110         (TypeBoundPredicate::operator=): update copy assignment ctor
5111         (TypeBoundPredicate::error): update error node
5112         * typecheck/rust-tyty.h: add polarity field to predicate
5114 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
5116         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): use new BoundPolarity enum
5117         * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): likewise
5118         * hir/rust-hir-dump.cc (BoundPolarityString): new helper
5119         (Dump::visit): update hir dump
5120         * hir/tree/rust-hir-item.h (class ImplBlock): likewise
5121         * hir/tree/rust-hir-type.h (class TraitBound): likewise
5122         * hir/tree/rust-hir.cc (TraitBound::as_string): fix as string
5123         * util/rust-common.h (enum Polarity): add new anti bound
5124         (enum BoundPolarity): likewise
5125         * util/rust-hir-map.cc (Mappings::Mappings): update naming
5127 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5129         * rust-backend.h: Include "rust-gcc.h".
5130         (class Gcc_backend): Move to ...
5131         * rust-gcc.cc (class Gcc_backend): ... here.
5133 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
5135         * typecheck/rust-hir-type-check-item.cc: add is_error check
5137 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
5139         * Make-lang.in: Add rust-unicode.o
5140         * rust-lang.cc (run_rust_tests): Add test.
5141         * rust-system.h: Include <array>
5142         * util/make-rust-unicode.py: Generater of rust-unicode-data.h.
5143         * util/rust-unicode-data.h: Auto-generated file.
5144         * util/rust-unicode.cc: New file.
5145         * util/rust-unicode.h: New file.
5147 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
5149         * rust-diagnostics.cc: Rework `make_description` and `make_url` functions.
5150         * rust-diagnostics.h: Specify ErrorCode's underlying type,
5151         remove error_codes_strings table.
5152         * rust_error_codes.def: New file.
5154 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5156         * rust-location.h (typedef Location): Remove.
5157         * expand/rust-proc-macro.cc
5158         (register_callback): Replace Location constructor with UNDEF_LOCATION.
5159         * ast/rust-ast-collector.h: Replace Location with location_t.
5160         * checks/errors/privacy/rust-privacy-reporter.cc: Likewise.
5161         * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
5162         * checks/errors/privacy/rust-pub-restricted-visitor.cc: Likewise.
5163         * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
5164         * checks/errors/rust-feature-gate.cc: Likewise.
5165         * checks/errors/rust-feature-gate.h: Likewise.
5166         * metadata/rust-imports.h: Likewise.
5167         * resolve/rust-ast-resolve-path.h: Likewise.
5168         * resolve/rust-name-resolver.h: Likewise.
5169         * rust-backend.h: Likewise.
5170         * rust-diagnostics.h: Likewise.
5171         * rust-gcc.cc: Likewise.
5172         * rust-linemap.h: Likewise.
5173         * util/rust-attributes.cc: Likewise.
5174         * util/rust-hir-map.cc: Likewise.
5175         * util/rust-hir-map.h: Likewise.
5176         * util/rust-token-converter.cc: Likewise.
5178 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5180         * typecheck/rust-autoderef.cc: Replace Location with location_t.
5181         * typecheck/rust-coercion.cc: Likewise.
5182         * typecheck/rust-coercion.h: Likewise.
5183         * typecheck/rust-hir-path-probe.h: Likewise.
5184         * typecheck/rust-hir-trait-reference.cc: Likewise.
5185         * typecheck/rust-hir-trait-resolve.cc: Likewise.
5186         * typecheck/rust-hir-type-check-base.cc: Likewise.
5187         * typecheck/rust-hir-type-check-expr.cc: Likewise.
5188         * typecheck/rust-hir-type-check-expr.h: Likewise.
5189         * typecheck/rust-hir-type-check-implitem.cc: Likewise.
5190         * typecheck/rust-hir-type-check-item.cc: Likewise.
5191         * typecheck/rust-hir-type-check-path.cc: Likewise.
5192         * typecheck/rust-hir-type-check-pattern.cc: Likewise.
5193         * typecheck/rust-hir-type-check-stmt.cc: Likewise.
5194         * typecheck/rust-hir-type-check-struct.cc: Likewise.
5195         * typecheck/rust-hir-type-check-type.cc: Likewise.
5196         * typecheck/rust-hir-type-check-type.h: Likewise.
5197         * typecheck/rust-type-util.cc: Likewise.
5198         * typecheck/rust-type-util.h: Likewise.
5199         * typecheck/rust-tyty-bounds.cc: Likewise.
5200         * typecheck/rust-tyty-call.cc: Likewise.
5201         * typecheck/rust-tyty-call.h: Likewise.
5202         * typecheck/rust-tyty-cmp.h: Likewise.
5203         * typecheck/rust-tyty-subst.cc: Likewise.
5204         * typecheck/rust-tyty-subst.h: Likewise.
5205         * typecheck/rust-tyty.cc: Likewise.
5207 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5209         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5210         refactored error message & called error function.
5212 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5214         * expand/rust-proc-macro.cc (literal_from_string): Add callback
5215         function.
5216         (load_macros_array): Likewise.
5218 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5220         * util/rust-token-converter.cc (handle_suffix): Rework function
5221         to make it work with the new literal conversion function.
5222         (convert_literal): Add a new function to convert to a proc macro
5223         literal from a literal tokenptr. The function will abort if the
5224         pointer does not point to a literal.
5225         (convert): Add call to convert literal for every literal case.
5226         * util/rust-token-converter.h (convert_literal): Add public
5227         prototype.
5229 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5231         * expand/rust-proc-macro.cc: Remove static modifier and move to
5232         an anonymous namespace.
5234 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5236         * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
5237         Formatted according to enum class.
5238         * checks/errors/rust-feature-gate.cc (FeatureGate::gate): likewise.
5239         * checks/errors/rust-unsafe-checker.cc (check_unsafe_call): likewise.
5240         * hir/rust-ast-lower-base.cc (struct_field_name_exists): likewise.
5241         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): likewise.
5242         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
5243         likewise.
5244         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): likewise.
5245         (PatternDeclaration::add_new_binding): likewise.
5246         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): likewise.
5247         * resolve/rust-ast-verify-assignee.h: likewise.
5248         * rust-diagnostics.cc: updated make_desc & url function for enum class.
5249         * rust-diagnostics.h (struct ErrorCode): removed struct to switch to enum.
5250         (enum class): Switched from errorcode struct to enum class.
5251         (XSTR): Macro for converting enum to string.
5252         (STR): macro Used by XSTR for converting to string.
5253         (ERROR_CODE): macro used by map for check.
5254         (TABLE_TO_MAP): macro used by map for check
5255         * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
5256         Formatted according to enum class.
5257         * typecheck/rust-hir-path-probe.h: likewise.
5258         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise.
5259         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
5260         likewise.
5261         (TypeCheckImplItemWithTrait::visit): likewise.
5262         * typecheck/rust-hir-type-check-item.cc: likewise.
5263         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): likewise.
5264         (emit_invalid_field_error): likewise.
5265         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): likewise.
5266         * typecheck/rust-tyty-call.cc (emit_unexpected_argument_error): likewise.
5267         (TypeCheckCallExpr::visit): likewise.
5268         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
5269         likewise.
5270         * typecheck/rust-tyty.cc (BaseType::bounds_compatible): likewise.
5272 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5274         * util/rust-attributes.cc (check_proc_macro_non_root): Add
5275         function to emit this specific error.
5276         (AttributeChecker::visit): Modify visitor to propagate to some
5277         containers that were not handled correctly.
5279 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5281         * backend/rust-compile-base.h: Replace Location with location_t.
5282         * metadata/rust-imports.h: Likewise.
5283         * resolve/rust-name-resolver.cc: Likewise.
5284         * resolve/rust-name-resolver.h: Likewise.
5285         * rust-backend.h: Likewise.
5286         * rust-gcc.cc: Likewise.
5287         * rust-gcc.h: Likewise.
5289 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5291         * expand/rust-proc-macro.cc (available): Remove function.
5292         (load_macros_array): There was no need for an indirection here.
5294 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5296         * expand/rust-proc-macro.cc (available): Add symbol
5297         registration.
5298         (load_macros_array): Likewise.
5300 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5302         * expand/rust-proc-macro.cc (load_macros_array): Symbol rename.
5304 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5306         * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
5307         Refactor the function to be safer and more efficient.
5309 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5311         * checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
5312         Add a new function to find a potential proc macro type
5313         attribute on a given item.
5314         (proc_macro_privacy_check): Move all proc macro privacy check in
5315         their own function to avoid cluttering the usual privacy check.
5316         (PrivacyReporter::go): Add call to newly created proc macro
5317         privacy check function.
5319 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5321         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::go):
5322         Add visibility verification.
5324 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5326         * util/rust-attributes.cc (is_proc_macro_type): Add function to
5327         identify matching proc macro attribute type.
5328         (check_proc_macro_non_function): Add function to check and emit
5329         error.
5330         (AttributeChecker::visit): Add cal to new check function.
5332 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5334         * ast/rust-ast.h: Remove NodeId from identifiers.
5336 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5338         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
5339         Added check for error code support.
5341 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5343         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
5344         called error function.
5346 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5348         * backend/rust-compile-base.cc: Replace Location with location_t.
5349         * backend/rust-compile-base.h: Likewise.
5350         * backend/rust-compile-expr.cc: Likewise.
5351         * lex/rust-token.h: Likewise.
5352         * metadata/rust-import-archive.cc: Likewise.
5353         * metadata/rust-imports.cc: Likewise.
5354         * metadata/rust-imports.h: Likewise.
5355         * rust-backend.h: Likewise.
5356         * rust-diagnostics.cc: Likewise.
5357         * rust-diagnostics.h: Likewise.
5358         * rust-gcc.cc: Likewise.
5359         * rust-linemap.cc: Likewise.
5360         * util/rust-token-converter.cc: Likewise.
5362 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5364         * ast/rust-ast-builder.h: Replace Location with location_t.
5365         * ast/rust-ast.h: Likewise.
5366         * ast/rust-expr.h: Likewise.
5367         * ast/rust-item.h: Likewise.
5368         * ast/rust-macro.h: Likewise.
5369         * ast/rust-path.h: Likewise.
5370         * hir/tree/rust-hir-expr.h: Likewise.
5371         * hir/tree/rust-hir-item.h: Likewise.
5372         * hir/tree/rust-hir-path.h: Likewise.
5373         * hir/tree/rust-hir.h: Likewise.
5374         * lex/rust-lex.cc: Likewise.
5375         * lex/rust-lex.h: Likewise.
5377 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5379         * expand/rust-derive-clone.cc: Replace Location with location_t.
5380         * expand/rust-derive-clone.h: Likewise.
5381         * expand/rust-derive-copy.cc: Likewise.
5382         * expand/rust-derive-copy.h: Likewise.
5383         * expand/rust-derive.cc: Likewise.
5384         * expand/rust-derive.h: Likewise.
5385         * expand/rust-macro-builtins.cc: Likewise.
5386         * expand/rust-macro-builtins.h: Likewise.
5387         * expand/rust-macro-expand.cc: Likewise.
5388         * parse/rust-parse-impl.h: Likewise.
5389         * parse/rust-parse.cc: Likewise.
5390         * parse/rust-parse.h: Likewise.
5392 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5394         * parse/rust-parse-impl.h
5395         (Parser::parse_macro_match): Use token_id_is_keyword.
5397 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5399         * ast/rust-ast.h (class Identifier): Remove interface
5400         inheritance.
5401         (class SimplePath): Likewise.
5402         * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
5403         return type.
5404         (derive_item): Update according to get_traits_to_derive return
5405         type.
5406         (expand_item_attribute): Likewise.
5407         (ExpandVisitor::expand_inner_stmts): Likewise.
5408         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
5409         * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_invocation):
5410         Change input type to SimplePath.
5411         (Mappings::lookup_derive_proc_macro_invocation): Likewise.
5412         (Mappings::insert_attribute_proc_macro_invocation): Likewise.
5413         (Mappings::lookup_attribute_proc_macro_invocation): Likewise.
5414         * util/rust-hir-map.h: Likewise with function prototypes.
5415         * util/rust-proc-macro-invocation.h: Removed.
5417 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5419         * ast/rust-ast.h: Add new constructor for SimplePath from an
5420         identifier.
5421         * expand/rust-expand-visitor.cc (get_traits_to_derive): Add
5422         conversion.
5424 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5426         * expand/rust-macro-expand.cc (MacroExpander::import_proc_macros):
5427         Remove function.
5428         * expand/rust-macro-expand.h (struct MacroExpander): Remove
5429         import_proc_macro function.
5430         * util/rust-hir-map.cc (Mappings::insert_derive_proc_macro_def):
5431         Add a function to insert a derive proc macro definition.
5432         (Mappings::insert_bang_proc_macro): Remove function.
5433         (Mappings::insert_bang_proc_macro_def): Add function to insert a
5434         bang proc macro definition.
5435         (Mappings::insert_attribute_proc_macro_def): Likewise with
5436         attribute proc macros.
5437         (Mappings::lookup_derive_proc_macro_def): Add a function to
5438         lookup a defined derive proc macro definition.
5439         (Mappings::lookup_bang_proc_macro): Remove function.
5440         (Mappings::lookup_bang_proc_macro_def): Add a function to lookup
5441         a bang proc macro definition.
5442         (Mappings::lookup_attribute_proc_macro_def): Add a function to
5443         lookup an attribute prod macro definition.
5444         (Mappings::insert_derive_proc_macro_invocation): Add a function
5445         to insert a derive proc macro invocation.
5446         (Mappings::lookup_derive_proc_macro_invocation): Add a function
5447         to lookup a derive proc macro invocation.
5448         (Mappings::insert_bang_proc_macro_invocation): Add a function to
5449         insert a bang proc macro invocation.
5450         (Mappings::lookup_bang_proc_macro_invocation): Add a function to
5451         lookup a bang proc macro invocation.
5452         (Mappings::insert_attribute_proc_macro_invocation): Add a
5453         function to insert an attribute proc macro invocation.
5454         (Mappings::lookup_attribute_proc_macro_invocation): Add a
5455         function to lookup an attribute proc macro invocation.
5456         * util/rust-hir-map.h: Add different proc macro mappings
5457         and change function prototypes.
5458         * expand/rust-expand-visitor.cc (get_traits_to_derive): Return a
5459         vector of SimplePath instead.
5460         (derive_item): Accept SimplePath instead of a string.
5461         * ast/rust-ast.h: Add common ProcMacroInvocable interface to
5462         Identifiers and SimplePath nodes.
5463         * ast/rust-ast.cc: Add const modifier.
5464         * ast/rust-macro.h: Change path and identifier getters.
5465         * ast/rust-path.h: Change return type to reference.
5466         * util/rust-proc-macro-invocation.h: New file.
5468 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5470         * util/rust-attributes.h (RUST_ATTRIBUTES_H): Add missing header
5471         guard.
5473 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5475         * ast/rust-ast.h (class MetaItem): Add MetaItem dispatch values.
5476         * ast/rust-expr.h: Add LitExpr and PathLit dispatch.
5477         * ast/rust-macro.h: Add remaining dispatch getters.
5479 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5481         * metadata/rust-extern-crate.h: Add proc macro getter.
5482         * rust-session-manager.cc (Session::load_extern_crate): Collect
5483         mappings and create mappings.
5484         * util/rust-hir-map.cc: Add insertion and lookup functions for
5485         every mapping.
5486         * util/rust-hir-map.h: Add function prototypes.
5488 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5490         * metadata/rust-imports.cc (Import::try_package_in_directory):
5491         Add call to load macros before loading metadatas.
5492         * expand/rust-proc-macro.cc: Return empty vector instead of
5493         panicking on error.
5495 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5497         * metadata/rust-import-archive.cc (Stream_concatenate::do_peek):
5498         Remove deletion.
5499         (Stream_concatenate::do_advance): Likewise.
5500         (Import::find_archive_export_data): Replace with a smart
5501         pointer.
5502         * metadata/rust-imports.cc (add_search_path): Change return type
5503         to smart pointer.
5504         (Import::open_package): Likewise.
5505         (Import::try_package_in_directory): Likewise.
5506         (Import::find_export_data): Likewise.
5507         (Import::find_object_export_data): Likewise.
5508         (Import::Import): Change constructor to accept unique_ptr.
5509         * metadata/rust-imports.h: Change constructor prototype.
5510         * rust-session-manager.cc (Session::load_extern_crate): Change
5511         pointer to smart pointer.
5513 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5515         * metadata/rust-extern-crate.cc (ExternCrate::ExternCrate):
5516         Change constructor to accept procedural macro vector.
5517         * metadata/rust-extern-crate.h: Add vector of procecural macro
5518         in extern crate.
5519         * rust-session-manager.cc (Session::load_extern_crate): Add
5520         argument to new constructor call.
5522 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5524         * metadata/rust-imports.cc (add_search_path): Change prototype,
5525         now return a pair of Stream and procedural macro vector.
5526         (Import::open_package): Likewise.
5527         (Import::try_package_in_directory): Likewise.
5528         * metadata/rust-imports.h: Likewise.
5529         * rust-session-manager.cc (Session::load_extern_crate):
5530         Likewise.
5532 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5534         * metadata/rust-imports.h: Make the function to load a given
5535         file public.
5536         * rust-session-manager.cc (Session::load_extern_crate): Change
5537         path resolution depending on extern crate declaration in cli
5538         arguments.
5540 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5542         * ast/rust-ast-collector.h
5543         (TokenCollector::visit):
5544         Replace default argument with UNDEF_LOCATION.
5546 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5548         * backend/rust-compile-base.cc: Replace Location with location_t.
5549         * backend/rust-compile-base.h: Likewise.
5550         * backend/rust-compile-block.cc: Likewise.
5551         * backend/rust-compile-expr.cc: Likewise.
5552         * backend/rust-compile-expr.h: Likewise.
5553         * backend/rust-compile-extern.h: Likewise.
5554         * backend/rust-compile-implitem.h: Likewise.
5555         * backend/rust-compile-intrinsic.cc: Likewise.
5556         * backend/rust-compile-item.h: Likewise.
5557         * backend/rust-compile-pattern.h: Likewise.
5558         * backend/rust-compile-resolve-path.cc: Likewise.
5559         * backend/rust-compile-stmt.cc: Likewise.
5560         * backend/rust-compile-type.cc: Likewise.
5561         * backend/rust-compile.cc: Likewise.
5562         * backend/rust-constexpr.cc: Likewise.
5564 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5566         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
5567         refactored and call error function.
5569 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5571         * util/rust-attributes.cc (AttributeChecker::visit): Add help
5572         message.
5574 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5576         * util/rust-attributes.cc (AttributeChecker::visit): Add
5577         attribute input check.
5579 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5581         * util/rust-attributes.cc (AttributeChecker::visit): Add
5582         attribute check on functions.
5584 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5586         * util/rust-token-converter.cc (from_ident): Adapt code to new
5587         constructor.
5589 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5591         * expand/rust-proc-macro.cc (tokenstream_from_string): Add a
5592         function that creates a tokenstream from a given string.
5593         (load_macros_array): Add call to registration function.
5595 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
5597         * lang.opt: Add option
5598         * rust-session-manager.cc: Add option registration in session
5599         target options.
5600         * rust-session-manager.h (struct CompileOptions): Add new getter
5601         for proc macros instead of a boolean.
5603 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
5605         * resolve/rust-forever-stack.h: New file.
5606         * resolve/rust-forever-stack.hxx: New file.
5608 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
5610         * hir/rust-hir-dump.cc (convert_param_kind_to_str): New.
5611         (convert_new_bind_type_to_str): New.
5612         (convert_mut_to_str): New.
5613         (Dump::go): New.
5614         (Dump::put): New.
5615         (Dump::begin): New.
5616         (Dump::end): New.
5617         (Dump::begin_field): New.
5618         (Dump::end_field): New.
5619         (Dump::put_field): New.
5620         (Dump::visit_field): New.
5621         (Dump::visit): Refactor.
5622         (Dump::visit_collection): New.
5623         (Dump::do_traititem): New.
5624         (Dump::do_vis_item): New.
5625         (Dump::do_functionparam): New.
5626         (Dump::do_pathpattern): New.
5627         (Dump::do_structexprstruct): New.
5628         (Dump::do_expr): New.
5629         (Dump::do_pathexpr): New.
5630         (Dump::do_typepathsegment): New.
5631         (Dump::do_typepathfunction): New.
5632         (Dump::do_qualifiedpathtype): New.
5633         (Dump::do_operatorexpr): New.
5634         (Dump::do_mappings): New.
5635         (Dump::do_inner_attrs): New.
5636         (Dump::do_outer_attrs): New.
5637         (Dump::do_baseloopexpr): New.
5638         (Dump::do_ifletexpr): New.
5639         (Dump::do_struct): New.
5640         (Dump::do_enumitem): New.
5641         (Dump::do_traitfunctiondecl): New.
5642         (Dump::do_externalitem): New.
5643         (Dump::do_namefunctionparam): New.
5644         (Dump::do_stmt): New.
5645         (Dump::do_type): New.
5646         (Dump::do_item): New.
5647         (Dump::do_tuplefield): New.
5648         (Dump::do_structfield): New.
5649         (Dump::do_genericargs): New.
5650         (Dump::do_maybenamedparam): New.
5651         * hir/rust-hir-dump.h: Refactor.
5652         * hir/tree/rust-hir-item.h (enum_to_str): New.
5653         * hir/tree/rust-hir-type.h (enum_to_str): New.
5654         * hir/tree/rust-hir.cc (enum_to_str): New.
5655         * util/rust-common.h (enum_to_str): New.
5657 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
5658             Matthew Jasper  <mjjasper1@gmail.com>
5660         * Make-lang.in: Add `rust-rib.cc` object.
5661         * resolve/rust-rib.cc: New file.
5662         * resolve/rust-rib.h: New file.
5664 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5666         * ast/rust-ast.h: Replace Location with location_t.
5667         * ast/rust-expr.h: Likewise.
5668         * ast/rust-item.h: Likewise.
5669         * ast/rust-macro.h: Likewise.
5670         * ast/rust-path.h: Likewise.
5671         * ast/rust-pattern.h: Likewise.
5672         * ast/rust-stmt.h: Likewise.
5673         * ast/rust-type.h: Likewise.
5674         * hir/rust-ast-lower-base.h: Likewise.
5675         * hir/tree/rust-hir-expr.h: Likewise.
5676         * hir/tree/rust-hir-item.h: Likewise.
5677         * hir/tree/rust-hir-path.h: Likewise.
5678         * hir/tree/rust-hir-pattern.h: Likewise.
5679         * hir/tree/rust-hir-stmt.h: Likewise.
5680         * hir/tree/rust-hir-type.h: Likewise.
5681         * hir/tree/rust-hir.h: Likewise.
5682         * lex/rust-token.h: Likewise.
5683         * resolve/rust-ast-resolve-pattern.h: Likewise.
5684         * typecheck/rust-hir-trait-reference.h: Likewise.
5685         * typecheck/rust-tyty-bounds.h: Likewise.
5686         * typecheck/rust-tyty-call.h: Likewise.
5687         * typecheck/rust-tyty-subst.h: Likewise.
5688         * typecheck/rust-tyty-util.h: Likewise.
5689         * typecheck/rust-tyty.h: Likewise.
5691 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5693         * ast/rust-ast-collector.cc: Replace Location with location_t.
5694         * ast/rust-ast.cc: Likewise.
5695         * ast/rust-ast.h: Likewise.
5696         * ast/rust-expr.h: Likewise.
5697         * ast/rust-item.h: Likewise.
5698         * ast/rust-macro.h: Likewise.
5699         * ast/rust-path.cc: Likewise.
5700         * ast/rust-path.h: Likewise.
5701         * ast/rust-pattern.h: Likewise.
5702         * ast/rust-stmt.h: Likewise.
5703         * ast/rust-type.h: Likewise.
5704         * backend/rust-compile-base.cc: Likewise.
5705         * backend/rust-compile-base.h: Likewise.
5706         * backend/rust-compile-block.cc: Likewise.
5707         * backend/rust-compile-expr.cc: Likewise.
5708         * backend/rust-compile-expr.h: Likewise.
5709         * backend/rust-compile-fnparam.cc: Likewise.
5710         * backend/rust-compile-fnparam.h: Likewise.
5711         * backend/rust-compile-intrinsic.cc: Likewise.
5712         * backend/rust-compile-pattern.cc: Likewise.
5713         * backend/rust-compile-resolve-path.h: Likewise.
5714         * backend/rust-compile.cc: Likewise.
5715         * checks/errors/rust-const-checker.cc: Likewise.
5716         * checks/errors/rust-const-checker.h: Likewise.
5717         * checks/errors/rust-unsafe-checker.cc: Likewise.
5718         * checks/errors/rust-unsafe-checker.h: Likewise.
5719         * expand/rust-macro-builtins.cc: Likewise.
5720         * expand/rust-macro-expand.h: Likewise.
5721         * hir/rust-ast-lower-base.h: Likewise.
5722         * hir/rust-ast-lower-implitem.h: Likewise.
5723         * hir/rust-ast-lower-item.cc: Likewise.
5724         * hir/tree/rust-hir-expr.h: Likewise.
5725         * hir/tree/rust-hir-item.h: Likewise.
5726         * hir/tree/rust-hir-path.h: Likewise.
5727         * hir/tree/rust-hir-pattern.h: Likewise.
5728         * hir/tree/rust-hir-stmt.h: Likewise.
5729         * hir/tree/rust-hir-type.h: Likewise.
5730         * hir/tree/rust-hir.cc: Likewise.
5731         * hir/tree/rust-hir.h: Likewise.
5732         * lex/rust-token.h: Likewise.
5733         * metadata/rust-extern-crate.cc: Likewise.
5734         * metadata/rust-extern-crate.h: Likewise.
5735         * parse/rust-parse-impl.h: Likewise.
5736         * parse/rust-parse.h: Likewise.
5737         * resolve/rust-ast-resolve-expr.cc: Likewise.
5738         * resolve/rust-ast-resolve-implitem.h: Likewise.
5739         * resolve/rust-ast-resolve-pattern.h: Likewise.
5740         * resolve/rust-ast-resolve-stmt.h: Likewise.
5741         * resolve/rust-ast-resolve-toplevel.h: Likewise.
5742         * resolve/rust-ast-resolve-type.h: Likewise.
5743         * resolve/rust-name-resolver.cc: Likewise.
5744         * resolve/rust-name-resolver.h: Likewise.
5745         * rust-diagnostics.cc: Likewise.
5746         * rust-diagnostics.h: Likewise.
5747         * rust-gcc.cc: Likewise.
5748         * rust-session-manager.cc: Likewise.
5749         * rust-session-manager.h: Likewise.
5750         * typecheck/rust-casts.cc: Likewise.
5751         * typecheck/rust-casts.h: Likewise.
5752         * typecheck/rust-coercion.cc: Likewise.
5753         * typecheck/rust-coercion.h: Likewise.
5754         * typecheck/rust-hir-path-probe.cc: Likewise.
5755         * typecheck/rust-hir-path-probe.h: Likewise.
5756         * typecheck/rust-hir-trait-reference.cc: Likewise.
5757         * typecheck/rust-hir-trait-reference.h: Likewise.
5758         * typecheck/rust-hir-trait-resolve.cc: Likewise.
5759         * typecheck/rust-hir-type-check-base.cc: Likewise.
5760         * typecheck/rust-hir-type-check-base.h: Likewise.
5761         * typecheck/rust-hir-type-check-item.cc: Likewise.
5762         * typecheck/rust-hir-type-check-item.h: Likewise.
5763         * typecheck/rust-hir-type-check-path.cc: Likewise.
5764         * typecheck/rust-hir-type-check-pattern.cc: Likewise.
5765         * typecheck/rust-hir-type-check-pattern.h: Likewise.
5766         * typecheck/rust-hir-type-check-type.cc: Likewise.
5767         * typecheck/rust-hir-type-check-type.h: Likewise.
5768         * typecheck/rust-hir-type-check.cc: Likewise.
5769         * typecheck/rust-hir-type-check.h: Likewise.
5770         * typecheck/rust-substitution-mapper.cc: Likewise.
5771         * typecheck/rust-substitution-mapper.h: Likewise.
5772         * typecheck/rust-type-util.cc: Likewise.
5773         * typecheck/rust-typecheck-context.cc: Likewise.
5774         * typecheck/rust-tyty-bounds.cc: Likewise.
5775         * typecheck/rust-tyty-call.h: Likewise.
5776         * typecheck/rust-tyty-subst.cc: Likewise.
5777         * typecheck/rust-tyty-subst.h: Likewise.
5778         * typecheck/rust-tyty-util.cc: Likewise.
5779         * typecheck/rust-tyty-util.h: Likewise.
5780         * typecheck/rust-tyty.cc: Likewise.
5781         * typecheck/rust-tyty.h: Likewise.
5782         * typecheck/rust-unify.cc: Likewise.
5783         * typecheck/rust-unify.h: Likewise.
5784         * util/rust-hir-map.cc: Likewise.
5785         * util/rust-hir-map.h: Likewise.
5786         * util/rust-identifier.h: Likewise.
5788 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5790         * rust-gcc.cc
5791         (Gcc_backend::debug): Move out of class declaration.
5792         (Gcc_backend::get_identifier_node): Likewise.
5793         (Gcc_backend::wchar_type): Likewise.
5795 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5797         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
5798         called error function.
5800 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5802         * rust-linemap.h (Linemap::predeclared_location): Remove.
5803         * backend/rust-compile-type.cc:
5804         Replace Linemap::predeclared_location with BUILTINS_LOCATION.
5805         * resolve/rust-name-resolver.cc: Likewise.
5806         * typecheck/rust-hir-type-check-type.cc: Likewise.
5807         * typecheck/rust-tyty.cc: Likewise.
5809 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5811         * rust-gcc.h: Add include guard.
5813 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
5815         * rust-system.h (rust_unreachable): Change definition to fancy_abort
5816         * ast/rust-ast-collector.cc (TokenCollector::visit): Use rust_unreachable
5817         instead of gcc_unreachable.
5818         (get_delimiters): Likewise.
5819         * ast/rust-ast-dump.h: Likewise.
5820         * ast/rust-ast-formatting.cc (get_string_in_delims): Likewise.
5821         (get_mode_dump_desc): Likewise.
5822         * ast/rust-ast.cc (Visibility::as_string): Likewise.
5823         (UseTreeGlob::as_string): Likewise.
5824         * ast/rust-ast.h: Likewise.
5825         * ast/rust-macro.h: Likewise.
5826         * ast/rust-path.h: Likewise.
5827         * backend/rust-compile-expr.cc (sort_tuple_patterns): Likewise.
5828         (CompileExpr::visit): Likewise.
5829         (CompileExpr::generate_closure_fntype): Likewise.
5830         * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): Likewise.
5831         * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): Likewise.
5832         (CompilePatternLet::visit): Likewise.
5833         * backend/rust-constexpr.cc (base_field_constructor_elt): Likewise.
5834         (eval_array_reference): Likewise.
5835         (label_matches): Likewise.
5836         (eval_store_expression): Likewise.
5837         (eval_call_expression): Likewise.
5838         (build_data_member_initialization): Likewise.
5839         (array_index_cmp): Likewise.
5840         (get_array_or_vector_nelts): Likewise.
5841         (eval_bit_field_ref): Likewise.
5842         (eval_loop_expr): Likewise.
5843         (potential_constant_expression_1): Likewise.
5844         * backend/rust-mangle.cc (v0_simple_type_prefix): Likewise.
5845         (v0_type_prefix): Likewise.
5846         (v0_mangle_item): Likewise.
5847         (Mangler::mangle_item): Likewise.
5848         * backend/rust-tree.cc (convert_to_void): Likewise.
5849         (type_memfn_quals): Likewise.
5850         (rs_tree_equal): Likewise.
5851         (fold_offsetof): Likewise.
5852         (fold_builtin_source_location): Likewise.
5853         (lvalue_error): Likewise.
5854         * backend/rust-tree.h (struct named_decl_hash): Likewise.
5855         (struct named_label_hash): Likewise.
5856         * checks/errors/privacy/rust-visibility-resolver.cc
5857         (VisibilityResolver::resolve_visibility): Likewise.
5858         (VisibilityResolver::visit): Likewise.
5859         * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Likewise.
5860         * checks/errors/rust-feature.cc (Feature::create): Likewise.
5861         * expand/rust-expand-visitor.cc (get_traits_to_derive): Likewise.
5862         (derive_item): Likewise.
5863         (expand_item_attribute): Likewise.
5864         (expand_stmt_attribute): Likewise.
5865         * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Likewise.
5866         (MacroExpander::match_repetition): Likewise.
5867         (transcribe_context): Likewise.
5868         (MacroExpander::import_proc_macros): Likewise.
5869         (MacroExpander::parse_proc_macro_output): Likewise.
5870         * expand/rust-macro-expand.h: Likewise.
5871         * expand/rust-macro-invoc-lexer.h: Likewise.
5872         * expand/rust-macro-substitute-ctx.cc (SubstituteCtx::substitute_token): Likewise.
5873         * expand/rust-proc-macro-invoc-lexer.h: Likewise.
5874         * expand/rust-proc-macro.cc (load_macros): Likewise.
5875         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_generic_args): Likewise.
5876         (ASTLoweringBase::lower_literal): Likewise.
5877         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
5878         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Likewise.
5879         * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Likewise.
5880         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
5881         * hir/tree/rust-hir.cc (get_string_in_delims): Likewise.
5882         (Visibility::as_string): Likewise.
5883         (UseTreeGlob::as_string): Likewise.
5884         (CompoundAssignmentExpr::as_string): Likewise.
5885         (ArithmeticOrLogicalExpr::as_string): Likewise.
5886         * lex/rust-lex.cc (Lexer::parse_byte_string): Likewise.
5887         (Lexer::parse_string): Likewise.
5888         * lex/rust-token.cc (RS_TOKEN): Likewise.
5889         * parse/rust-parse-impl.h (Parser::parse_simple_path_segment): Likewise.
5890         (Parser::parse_path_ident_segment): Likewise.
5891         (Parser::parse_attr_input): Likewise.
5892         (Parser::parse_inherent_impl_item): Likewise.
5893         (Parser::parse_trait_impl_item): Likewise.
5894         (Parser::parse_type_path_segment): Likewise.
5895         (Parser::parse_reference_type): Likewise.
5896         (get_lbp_for_comparison_expr): Likewise.
5897         * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewise.
5898         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
5899         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
5900         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
5901         (ResolveTypeToCanonicalPath::visit): Likewise.
5902         (ResolveGenericArgs::resolve_disambiguated_generic): Likewise.
5903         * rust-gcc.cc (operator_to_tree_code): Likewise.
5904         (fetch_overflow_builtins): Likewise.
5905         (Gcc_backend::non_zero_size_type): Likewise.
5906         (Gcc_backend::convert_tree): Likewise.
5907         * rust-lang.cc (grs_langhook_type_for_mode): Likewise.
5908         (grs_langhook_global_bindings_p): Likewise.
5909         (grs_langhook_pushdecl): Likewise.
5910         (grs_langhook_getdecls): Likewise.
5911         (convert): Likewise.
5912         * typecheck/rust-autoderef.h: Likewise.
5913         * typecheck/rust-hir-path-probe.cc: Likewise.
5914         * typecheck/rust-hir-trait-reference.cc (TraitItemReference::get_tyty): Likewise.
5915         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): Likewise.
5916         * typecheck/rust-hir-type-check-expr.cc: Likewise.
5917         * typecheck/rust-hir-type-check-expr.h: Likewise.
5918         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): Likewise.
5919         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
5920         * typecheck/rust-hir-type-check-stmt.h: Likewise.
5921         * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
5922         * typecheck/rust-substitution-mapper.h: Likewise.
5923         * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::get_context_type): Likewise.
5924         * typecheck/rust-tyty-call.h: Likewise.
5925         * typecheck/rust-tyty.cc (TypeKindFormat::to_string): Likewise.
5926         (BaseType::monomorphized_clone): Likewise.
5927         (VariantDef::variant_type_string): Likewise.
5928         (ClosureType::handle_substitions): Likewise.
5929         (IntType::as_string): Likewise.
5930         (UintType::as_string): Likewise.
5931         (FloatType::as_string): Likewise.
5932         * typecheck/rust-unify.cc (UnifyRules::expect_projection): Likewise.
5933         * util/rust-token-converter.cc (convert): Likewise.
5934         (from_literal): Likewise.
5935         (from_group): Likewise.
5936         (from_tokentree): Likewise.
5938 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5940         * checks/errors/rust-feature-gate.cc (FeatureGate::gate):
5941         called error function.
5943 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5945         * backend/rust-compile-intrinsic.cc (Intrinsics::compile):
5946         called error function.
5948 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
5950         * checks/errors/rust-unsafe-checker.cc (check_unsafe_call):
5951         called error function.
5953 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5955         * rust-location.h
5956         (typedef RichLocation): Remove.
5957         * expand/rust-macro-expand.cc: Replace RichLocation with rich_location.
5958         * hir/rust-ast-lower-base.cc: Likewise.
5959         * resolve/rust-ast-resolve-implitem.h: Likewise.
5960         * resolve/rust-ast-resolve-stmt.h: Likewise.
5961         * resolve/rust-ast-resolve-toplevel.h: Likewise.
5962         * rust-diagnostics.cc: Likewise.
5963         * rust-diagnostics.h: Likewise.
5964         * rust-session-manager.cc: Likewise.
5965         * typecheck/rust-casts.cc: Likewise.
5966         * typecheck/rust-coercion.cc: Likewise.
5967         * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
5968         * typecheck/rust-hir-path-probe.h: Likewise.
5969         * typecheck/rust-hir-trait-reference.cc: Likewise.
5970         * typecheck/rust-hir-type-check-expr.cc: Likewise.
5971         * typecheck/rust-hir-type-check-implitem.cc: Likewise.
5972         * typecheck/rust-hir-type-check-item.cc: Likewise.
5973         * typecheck/rust-hir-type-check-pattern.cc: Likewise.
5974         * typecheck/rust-tyty-cmp.h: Likewise.
5975         * typecheck/rust-tyty-subst.cc: Likewise.
5976         * typecheck/rust-tyty.cc: Likewise.
5977         * typecheck/rust-unify.cc: Likewise.
5979 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5981         * lex/rust-lex.cc
5982         (Lexer::start_line): Use linemap_line_start.
5983         * rust-linemap.cc
5984         (Linemap::start_line): Remove.
5985         * rust-linemap.h
5986         (Linemap::start_line): Remove.
5988 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
5990         * rust-linemap.cc
5991         (RichLocation::RichLocation): Remove.
5992         (RichLocation::~RichLocation): Remove.
5993         (RichLocation::add_range): Remove.
5994         (RichLocation::add_fixit_insert_before): Remove.
5995         (RichLocation::add_fixit_insert_after): Remove.
5996         * rust-location.h
5997         (class RichLocation): Remove.
5998         * rust-diagnostics.cc
5999         (rust_be_error_at): Remove RichLocation::get invocation.
6000         * expand/rust-macro-expand.cc: Fix RichLocation constructor.
6001         * hir/rust-ast-lower-base.cc: Likewise.
6002         * resolve/rust-ast-resolve-implitem.h: Likewise.
6003         * resolve/rust-ast-resolve-stmt.h: Likewise.
6004         * resolve/rust-ast-resolve-toplevel.h: Likewise.
6005         * rust-session-manager.cc: Likewise.
6006         * typecheck/rust-casts.cc: Likewise.
6007         * typecheck/rust-coercion.cc: Likewise.
6008         * typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
6009         * typecheck/rust-hir-path-probe.h: Likewise.
6010         * typecheck/rust-hir-trait-reference.cc: Likewise.
6011         * typecheck/rust-hir-type-check-expr.cc: Likewise.
6012         * typecheck/rust-hir-type-check-implitem.cc: Likewise.
6013         * typecheck/rust-hir-type-check-item.cc: Likewise.
6014         * typecheck/rust-hir-type-check-pattern.cc: Likewise.
6015         * typecheck/rust-tyty-cmp.h: Likewise.
6016         * typecheck/rust-tyty-subst.cc: Likewise.
6017         * typecheck/rust-tyty.cc: Likewise.
6018         * typecheck/rust-unify.cc: Likewise.
6020 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6022         * lex/rust-lex.cc
6023         (Lexer::get_current_location): Use linemap_position_for_column.
6024         * rust-session-manager.cc
6025         (Session::handle_crate_name): Likewise.
6026         * rust-linemap.cc
6027         (Linemap::get_location): Remove.
6028         * rust-linemap.h
6029         (Linemap::get_location): Likewise.
6031 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6033         * lex/rust-token.cc (escape_special_chars): Add a function that
6034         escape a given string.
6035         (Token::as_string): Add call to escape function for string/char
6036         representations.
6038 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6040         * hir/tree/rust-hir-type.h (MaybeNamedParam::get_type): Remove
6041         rust_assert.
6042         (BareFunctionType::get_return_type): Likewise.
6044 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6046         * backend/rust-compile-intrinsic.cc (offset_handler): Remove
6047         braces.
6048         (sizeof_handler): Likewise.
6049         (transmute_handler): Likewise.
6050         (rotate_handler): Likewise.
6051         (wrapping_op_handler_inner): Likewise.
6052         (op_with_overflow_inner): Likewise.
6053         (atomic_load_handler_inner): Likewise.
6054         (unchecked_op_inner): Likewise.
6055         (uninit_handler): Likewise.
6057 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6059         * ast/rust-ast.h: Add virtual destructor.
6060         * expand/rust-macro-expand.h: Likewise.
6062 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6064         * hir/tree/rust-hir-full-decls.h (struct Crate): Change to
6065         class.
6066         (class Crate): Likewise.
6067         (struct StructField): Likewise.
6068         (class StructField): Likewise.
6069         (struct TupleField): Likewise.
6070         (class TupleField): Likewise.
6071         (struct TraitFunctionDecl): Likewise.
6072         (class TraitFunctionDecl): Likewise.
6073         * rust-session-manager.h (struct Crate): Likewise.
6074         (class Crate): Likewise.
6076 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6078         * ast/rust-expr.h
6079         (MetaItemPathLit::get_locus): Remove copy construction.
6080         * backend/rust-constexpr.cc
6081         (eval_constant_expression): Likewise.
6082         (is_valid_constexpr_fn): Likewise.
6083         * util/rust-token-converter.cc
6084         (convert): Likewise.
6086 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6088         * lex/rust-lex.cc
6089         (Lexer::dump_and_skip): Use location_to_string.
6090         * rust-linemap.cc
6091         (Linemap::to_string): Move to...
6092         (Linemap::location_to_string): ... here.
6093         * rust-linemap.h
6094         (Linemap::to_string): Remove.
6095         (Linemap::location_to_string): Remove definition.
6097 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6099         * hir/tree/rust-hir-expr.h (TypeCastExpr::get_casted_expr): Remove
6100         assert in accessor.
6101         (TypeCastExpr::get_type_to_convert_to): Likewise.
6102         (CompoundAssignmentExpr::get_left_expr): Likewise.
6103         (CompoundAssignmentExpr::get_right_expr): Likewise.
6104         (GroupedExpr::get_expr_in_parens): Likewise.
6105         (TupleIndexExpr::get_tuple_expr): Likewise.
6106         (FieldAccessExpr::get_receiver_expr): Likewise.
6107         (ClosureParam::get_pattern): Likewise.
6108         (ClosureParam::get_type): Likewise.
6109         (ExprType::get_return_type): Likewise.
6110         (IfLetExpr::get_scrutinee_expr): Likewise.
6111         (MatchArm::get_guard_expr): Likewise.
6112         (MatchExpr::get_scrutinee_expr): Likewise.
6113         * hir/tree/rust-hir-item.h (TypeParam::get_type): Likewise.
6114         (SelfParam::get_type): Likewise.
6115         (Function::get_return_type): Likewise.
6116         (TypeAlias::get_type_aliased): Likewise.
6117         (StructField::get_field_type): Likewise.
6118         (TraitFunctionDecl::get_block_expr): Likewise.
6119         (ImplBlock::get_trait_ref): Likewise.
6120         * hir/tree/rust-hir-path.h (ConstGenericArg::get_expression): New.
6121         (TypePathFunction::get_return_type): Remove assert in accessor.
6122         (QualifiedPathType::get_trait): Likewise.
6123         * hir/tree/rust-hir-pattern.h (PatternType::get_lower_bound): Likewise.
6124         (PatternType::get_upper_bound): Likewise.
6125         (ReferencePattern::get_referenced_pattern): Likewise.
6126         * hir/tree/rust-hir.h (ConstGenericParam::get_default_expression): Likewise.
6128 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6130         * hir/rust-ast-lower-base.cc (struct_field_name_exists):
6131         called error function.
6133 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6135         * rust-diagnostics.cc
6136         (rust_be_error_at): Add function accepting location_t and ErrorCode.
6137         (rust_error_at): Likewise.
6138         * rust-diagnostics.h
6139         (rust_error_at): Likewise.
6140         (rust_be_error_at): Likewise.
6142 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6144         * rust-linemap.cc
6145         (class Gcc_linemap): Remove.
6146         (Gcc_linemap::start_file): Move to...
6147         (Linemap::start_file): ... here.
6148         (Gcc_linemap::to_string): Move to...
6149         (Linemap::to_string): ... here.
6150         (Gcc_linemap::stop): Move to...
6151         (Linemap::stop): ... here.
6152         (Gcc_linemap::start_line): Move to...
6153         (Linemap::start_line): ... here.
6154         (Gcc_linemap::get_location): Move to...
6155         (Linemap::get_location): ... here.
6156         (rust_get_linemap): Use Linemap.
6157         * rust-linemap.h
6158         (Linemap::in_file_): New field from Gcc_linemap.
6159         (Linemap::Linemap): Initialize in_file_.
6160         (Linemap::~Linemap): Make non-virtual.
6161         (Linemap::start_file): Likewise.
6162         (Linemap::start_line): Likewise.
6163         (Linemap::get_location): Likewise.
6164         (Linemap::stop): Likewise.
6165         (Linemap::to_string): Likewise.
6167 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
6169         * Make-lang.in: Remove rust-optional-test.cc's object file
6170         * ast/rust-macro.h: Remove use of Rust::Optional
6171         * backend/rust-compile-base.cc
6172         (HIRCompileBase::resolve_method_address): Likewise.
6173         * checks/errors/privacy/rust-privacy-reporter.cc
6174         (PrivacyReporter::check_for_privacy_violation): Likewise.
6175         (PrivacyReporter::visit): Likewise.
6176         * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
6177         * checks/errors/rust-feature-gate.cc (FeatureGate::check): Likewise.
6178         * checks/errors/rust-feature.cc (Feature::create): Likewise.
6179         (Feature::as_name): Likewise.
6180         * checks/errors/rust-feature.h: Likewise.
6181         * expand/rust-macro-builtins.cc: Likewise.
6182         * lex/rust-lex.cc (Lexer::Lexer): Likewise.
6183         (Lexer::skip_token): Likewise.
6184         (Lexer::dump_and_skip): Likewise.
6185         * lex/rust-lex.h: Likewise.
6186         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise.
6187         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise.
6188         * rust-lang.cc (run_rust_tests): Likewise.
6189         * rust-session-manager.cc (Session::compile_crate): Likewise.
6190         (TargetOptions::dump_target_options): Likewise.
6191         * rust-session-manager.h (struct TargetOptions): Likewise.
6192         * util/rust-hir-map.cc (Mappings::lookup_module_children): Likewise.
6193         (Mappings::lookup_module_chidren_items): Likewise.
6194         (Mappings::lookup_module_child): Likewise.
6195         (Mappings::lookup_parent_module): Likewise.
6196         * util/rust-hir-map.h (RUST_HIR_MAP_H): Likewise.
6197         * util/rust-optional-test.cc: Removed.
6198         * util/rust-optional.h: Removed.
6200 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6202         * rust-linemap.h (Linemap::unknown_location): Remove.
6203         * ast/rust-ast.cc:
6204         Replace Linemap::unknown_location with UNKNOWN_LOCATION.
6205         * ast/rust-path.cc: Likewise.
6206         * hir/tree/rust-hir.cc: Likewise.
6207         * metadata/rust-imports.cc: Likewise.
6208         * parse/rust-parse-impl.h: Likewise.
6209         * parse/rust-parse.h: Likewise.
6210         * rust-backend.h: Likewise.
6211         * rust-diagnostics.cc: Likewise.
6212         * rust-session-manager.cc: Likewise.
6213         * typecheck/rust-tyty.cc: Likewise.
6215 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6217         * resolve/rust-ast-verify-assignee.h: called error function.
6219 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6221         * typecheck/rust-tyty-call.cc (emit_unexpected_argument_error):
6222         Refactored invalid number of argument into one function.
6223         (TypeCheckCallExpr::visit): called refactored function.
6224         (TypeCheckMethodCallExpr::check): likewise.
6226 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
6228         * util/expected.h: Adapt class to GCC requirements.
6230 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
6232         * util/expected.h: New file.
6234 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
6236         * util/optional.h: Adapt for GCC.
6238 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
6240         * util/optional.h: New file.
6242 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6244         * rust-location.h (UNDEF_LOCATION): New.
6245         * ast/rust-ast-collector.cc: Replace Location () with UNDEF_LOCATION.
6246         * ast/rust-ast-fragment.cc: Likewise.
6247         * ast/rust-ast.h: Likewise.
6248         * ast/rust-expr.h: Likewise.
6249         * ast/rust-item.h: Likewise.
6250         * ast/rust-macro.h: Likewise.
6251         * ast/rust-path.h: Likewise.
6252         * ast/rust-type.h: Likewise.
6253         * backend/rust-compile-expr.cc: Likewise.
6254         * backend/rust-compile-extern.h: Likewise.
6255         * backend/rust-compile-implitem.h: Likewise.
6256         * backend/rust-compile-intrinsic.cc: Likewise.
6257         * backend/rust-compile-item.h: Likewise.
6258         * backend/rust-compile.cc: Likewise.
6259         * backend/rust-constexpr.cc: Likewise.
6260         * expand/rust-expand-visitor.cc: Likewise.
6261         * expand/rust-macro-expand.cc: Likewise.
6262         * expand/rust-macro-expand.h: Likewise.
6263         * expand/rust-macro-invoc-lexer.cc: Likewise.
6264         * expand/rust-proc-macro-invoc-lexer.cc: Likewise.
6265         * expand/rust-proc-macro.cc: Likewise.
6266         * hir/tree/rust-hir-expr.h: Likewise.
6267         * hir/tree/rust-hir-item.h: Likewise.
6268         * hir/tree/rust-hir-path.h: Likewise.
6269         * hir/tree/rust-hir-type.h: Likewise.
6270         * hir/tree/rust-hir.h: Likewise.
6271         * lex/rust-lex.cc: Likewise.
6272         * metadata/rust-export-metadata.cc: Likewise.
6273         * parse/rust-parse-impl.h: Likewise.
6274         * resolve/rust-ast-resolve-item.cc: Likewise.
6275         * resolve/rust-ast-resolve.cc: Likewise.
6276         * rust-diagnostics.h: Likewise.
6277         * rust-session-manager.cc: Likewise.
6278         * typecheck/rust-autoderef.cc: Likewise.
6279         * typecheck/rust-coercion.cc: Likewise.
6280         * typecheck/rust-hir-dot-operator.cc: Likewise.
6281         * typecheck/rust-hir-path-probe.cc: Likewise.
6282         * typecheck/rust-hir-trait-reference.cc: Likewise.
6283         * typecheck/rust-hir-trait-reference.h: Likewise.
6284         * typecheck/rust-hir-type-check-expr.cc: Likewise.
6285         * typecheck/rust-hir-type-check-implitem.cc: Likewise.
6286         * typecheck/rust-hir-type-check-type.cc: Likewise.
6287         * typecheck/rust-hir-type-check.cc: Likewise.
6288         * typecheck/rust-tyty-bounds.cc: Likewise.
6289         * typecheck/rust-tyty-subst.cc: Likewise.
6290         * typecheck/rust-tyty.cc: Likewise.
6291         * util/rust-hir-map.cc: Likewise.
6293 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6295         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix abit
6296         output format.
6298 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6300         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix
6301         external item trailing semicolon and outer attributes.
6303 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6305         * ast/rust-ast-collector.cc (TokenCollector::visit): Output
6306         outer attributes on external functions.
6308 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6310         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix method
6311         qualifier output.
6313 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6315         * ast/rust-ast-collector.cc (TokenCollector::visit): Add where
6316         clause.
6318 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6320         * ast/rust-ast-collector.cc (TokenCollector::visit): Add outer
6321         attributes to collector output.
6323 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6325         * ast/rust-ast-collector.cc (TokenCollector::visit): Add
6326         variadics in collector output.
6328 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6330         * ast/rust-ast-collector.cc (TokenCollector::visit): Add
6331         generics.
6333 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6335         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix generic
6336         output.
6338 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6340         * ast/rust-ast-collector.cc (TokenCollector::visit): Reformat
6341         trait impl block.
6343 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6345         * ast/rust-ast-collector.cc (TokenCollector::visit): Output
6346         generic in inherent impl.
6348 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6350         * ast/rust-ast-dump.cc (Dump::require_spacing): Change dollar
6351         spacing rule.
6353 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6355         * ast/rust-ast-collector.cc (TokenCollector::visit): Change
6356         formatting.
6358 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6360         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix trait
6361         impl block output.
6363 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6365         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix binding
6366         args.
6368 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6370         * ast/rust-ast-collector.cc (TokenCollector::visit): Output
6371         function qualifiers after visibility.
6373 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6375         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix self
6376         param output.
6378 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6380         * ast/rust-ast-dump.cc (Dump::require_spacing): Add a rule to
6381         remove spaces around dots and after references.
6383 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6385         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix several
6386         token collection rules.
6387         * ast/rust-ast-dump.cc (Dump::require_spacing): Add spacing rule
6388         for comma.
6390 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6392         * expand/rust-macro-invoc-lexer.h
6393         (class MacroInvocLexerBase): New.
6395 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6397         * expand/rust-macro-builtins.cc
6398         (source_relative_path): Use LOCATION_FILE.
6399         (MacroBuiltin::file_handler): Likewise.
6400         (MacroBuiltin::column_handler): Use LOCATION_COLUMN.
6401         (MacroBuiltin::line_handler): Use LOCATION_LINE.
6402         * rust-linemap.cc
6403         (Gcc_linemap::location_file): Remove.
6404         (Gcc_linemap::location_line): Remove.
6405         (Gcc_linemap::location_column): Remove.
6406         * rust-linemap.h
6407         (Linemap::location_file): Remove.
6408         (Linemap::location_line): Remove.
6409         (Linemap::location_column): Remove.
6410         (Linemap::location_to_file): Remove.
6411         (Linemap::location_to_line): Remove.
6412         (Linemap::location_to_column): Remove.
6414 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6416         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
6417         called error function and changed error message
6418         similiar to rustc.
6420 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6422         * rust-linemap.cc
6423         (Gcc_linemap::get_unknown_location): Remove.
6424         (Gcc_linemap::get_predeclared_location): Remove.
6425         (Gcc_linemap::is_predeclared): Remove.
6426         (Gcc_linemap::is_unknown): Remove.
6427         * rust-linemap.h
6428         (Linemap::get_predeclared_location): Remove.
6429         (Linemap::get_unknown_location): Remove.
6430         (Linemap::is_predeclared): Remove.
6431         (Linemap::is_unknown): Remove.
6432         (Linemap::predeclared_location): Use BUILTINS_LOCATION.
6433         (Linemap::unknown_location): Use UNKNOWN_LOCATION.
6434         (Linemap::is_predeclared_location): Remove.
6435         (Linemap::is_unknown_location): Remove.
6437 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6439         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
6440         called error function
6442 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6444         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve):
6445         called error function.
6447 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
6449         * lex/rust-lex.cc (Lexer::input_source_is_valid_utf8): New method of `Lexer`.
6450         * lex/rust-lex.h: Likewise.
6451         * rust-session-manager.cc (Session::compile_crate): Add error.
6453 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6455         * expand/rust-macro-expand.cc
6456         (transcribe_expression): Skip trailing semicolon.
6458 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6460         * typecheck/rust-hir-type-check-item.cc: called error function.
6462 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
6464         * ast/rust-ast.h: Modify constructors of `Rust::Identifier`
6465         * ast/rust-pattern.h: Likewise.
6466         * hir/tree/rust-hir-item.h: Likewise.
6467         * parse/rust-parse-impl.h (Parser::parse_macro_rules_def): Likewise.
6468         (Parser::parse_decl_macro_def): Likewise.
6469         (Parser::parse_macro_match_fragment): Likewise.
6470         (Parser::parse_module): Likewise.
6471         (Parser::parse_use_tree): Likewise.
6472         (Parser::parse_function): Likewise.
6473         (Parser::parse_type_param): Likewise.
6474         (Parser::parse_type_alias): Likewise.
6475         (Parser::parse_struct): Likewise.
6476         (Parser::parse_struct_field): Likewise.
6477         (Parser::parse_enum): Likewise.
6478         (Parser::parse_enum_item): Likewise.
6479         (Parser::parse_union): Likewise.
6480         (Parser::parse_static_item): Likewise.
6481         (Parser::parse_trait): Likewise.
6482         (Parser::parse_trait_item): Likewise.
6483         (Parser::parse_trait_type): Likewise.
6484         (Parser::parse_trait_const): Likewise.
6485         (Parser::parse_external_item): Likewise.
6486         (Parser::parse_generic_args_binding): Likewise.
6487         (Parser::parse_method): Likewise.
6488         (Parser::parse_maybe_named_param): Likewise.
6489         (Parser::parse_identifier_pattern): Likewise.
6490         (Parser::parse_struct_expr_field): Likewise.
6491         (ResolveItem::visit): Likewise.
6492         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit):Add comments
6493         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
6494         * checks/lints/rust-lint-scan-deadcode.h: Fix error location
6496 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6498         * backend/rust-compile-base.cc
6499         (HIRCompileBase::address_expression): Remove gcc_location method call.
6500         (HIRCompileBase::indirect_expression): Likewise.
6501         (HIRCompileBase::compile_constant_item): Likewise.
6502         (HIRCompileBase::named_constant_expression): Likewise.
6503         * backend/rust-compile-expr.cc
6504         (CompileExpr::visit): Remove gcc_location method call, use UNKNOWN_LOCATION to initialize.
6505         (CompileExpr::get_fn_addr_from_dyn): Remove gcc_location method call.
6506         (CompileExpr::type_cast_expression): Likewise.
6507         * backend/rust-compile-intrinsic.cc
6508         (transmute_handler): Replace "Location ().gcc_location ()" with UNKNOWN_LOCATION.
6509         (copy_nonoverlapping_handler): Likewise.
6510         (prefetch_data_handler): Likewise.
6511         (atomic_store_handler_inner): Likewise.
6512         (atomic_load_handler_inner): Likewise.
6513         * resolve/rust-ast-resolve-expr.cc
6514         (ResolveExpr::visit): Remove gcc_location method call.
6515         * rust-diagnostics.cc
6516         (rust_be_error_at): Likewise.
6517         (rust_be_warning_at): Likewise.
6518         (rust_be_fatal_error): Likewise.
6519         (rust_be_inform): Likewise.
6520         * rust-diagnostics.h
6521         (rust_sorry_at): Likewise.
6522         * rust-gcc.cc
6523         (Bvariable::get_tree): Likewise.
6524         (Gcc_backend::fill_in_fields): Likewise.
6525         (Gcc_backend::named_type): Likewise.
6526         (Gcc_backend::real_part_expression): Likewise.
6527         (Gcc_backend::imag_part_expression): Likewise.
6528         (Gcc_backend::complex_expression): Likewise.
6529         (Gcc_backend::convert_expression): Likewise.
6530         (Gcc_backend::struct_field_expression): Likewise.
6531         (Gcc_backend::compound_expression): Likewise.
6532         (Gcc_backend::conditional_expression): Likewise.
6533         (Gcc_backend::negation_expression): Likewise.
6534         (Gcc_backend::arithmetic_or_logical_expression): Likewise.
6535         (Gcc_backend::arithmetic_or_logical_expression_checked): Likewise.
6536         (Gcc_backend::comparison_expression): Likewise.
6537         (Gcc_backend::lazy_boolean_expression): Likewise.
6538         (Gcc_backend::constructor_expression): Likewise.
6539         (Gcc_backend::array_constructor_expression): Likewise.
6540         (Gcc_backend::array_initializer): Likewise.
6541         (Gcc_backend::array_index_expression): Likewise.
6542         (Gcc_backend::call_expression): Likewise.
6543         (Gcc_backend::assignment_statement): Likewise.
6544         (Gcc_backend::return_statement): Likewise.
6545         (Gcc_backend::exception_handler_statement): Likewise.
6546         (Gcc_backend::if_statement): Likewise.
6547         (Gcc_backend::loop_expression): Likewise.
6548         (Gcc_backend::exit_expression): Likewise.
6549         (Gcc_backend::block): Likewise.
6550         (Gcc_backend::convert_tree): Likewise.
6551         (Gcc_backend::global_variable): Likewise.
6552         (Gcc_backend::local_variable): Likewise.
6553         (Gcc_backend::parameter_variable): Likewise.
6554         (Gcc_backend::static_chain_variable): Likewise.
6555         (Gcc_backend::temporary_variable): Likewise.
6556         (Gcc_backend::label): Likewise.
6557         (Gcc_backend::goto_statement): Likewise.
6558         (Gcc_backend::label_address): Likewise.
6559         (Gcc_backend::function): Likewise.
6560         * rust-linemap.cc
6561         (Gcc_linemap::to_string): Likewise.
6562         (Gcc_linemap::location_file): Likewise.
6563         (Gcc_linemap::location_line): Likewise.
6564         (Gcc_linemap::location_column): Likewise.
6565         (Gcc_linemap::is_predeclared): Likewise.
6566         (Gcc_linemap::is_unknown): Likewise.
6567         (RichLocation::RichLocation): Likewise.
6568         (RichLocation::add_range): Likewise.
6569         (RichLocation::add_fixit_insert_before): Likewise.
6570         (RichLocation::add_fixit_insert_after): Likewise.
6571         * rust-location.h
6572         (class Location): Replace with typedef.
6573         (operator<): Remove.
6574         (operator==): Remove.
6575         (operator+): Remove.
6576         (operator-): Remove.
6577         * typecheck/rust-hir-trait-resolve.cc
6578         (AssociatedImplTrait::setup_associated_types): Initialize Location with UNKNOWN_LOCATION.
6579         * typecheck/rust-hir-type-check-stmt.cc
6580         (TypeCheckStmt::visit): Likewise.
6581         * util/rust-token-converter.cc
6582         (convert): Remove gcc_location method call.
6584 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6586         * hir/tree/rust-hir-expr.h (BorrowExpr::is_double_borrow): New.
6587         (ArrayElemsCopied::get_elem_to_copy)
6588         (ArrayElemsCopied::get_num_copies_expr): Return unique_ptr.
6589         (CallExpr::get_fnexpr): Likewise.
6590         (ReturnExpr::get_expr): Likewise.
6591         (StructExprStructFields::get_struct_base): New.
6592         (MethodCallExpr::has_params): New.
6593         (ClosureExpr::has_params): New.
6594         (BlockExpr::get_inner_attrs): New.
6595         (WhileLoopExpr::get_patterns): New.
6596         (ForLoopExpr::get_pattern): New.
6597         (IfLetExpr::get_if_block): Return ref to unique_ptr.
6598         (IfLetExprConseqElse::get_else_block): Likewise.
6599         (MatchExpr::get_inner_attrs): New.
6600         * hir/tree/rust-hir-item.h (Module::get_module_name): New.
6601         (ExternCrate::get_referenced_crate)
6602         (ExternCrate::get_as_clause_name): New.
6603         (UseTreeGlob::get_glob_type, UseTreeGlob::get_path): New.
6604         (UseTreeList::get_path_type, UseTreeList::get_path)
6605         (UseTreeList::get_trees): New.
6606         (TraitItemKind::get_expr): Remove assert. unique_ptr can
6607         be "empty". Must be checked in caller.
6608         * hir/tree/rust-hir-pattern.h (IdentifierPattern::get_is_ref)
6609         (IdentifierPattern::get_to_bind): New.
6610         (RangePatternBoundType::get_has_minus): New.
6611         (RangePattern::get_has_ellipsis_syntax): New.
6612         (StructPatternField::get_outer_attrs): New.
6613         (StructPatternFieldTuplePat::get_index)
6614         (StructPatternFieldTuplePat::get_tuple_pattern): New.
6615         (StructPatternFieldIdent::get_has_ref): New.
6616         * hir/tree/rust-hir-stmt.h (LetStmt::get_outer_attrs): New.
6617         (LetStmt::get_type)
6618         (LetStmt::get_init_expr, LetStmt::get_pattern): Return unique_ptr.
6619         (ExprStmt::get_expr): Likewise.
6620         * hir/tree/rust-hir-type.h (TraitBound::get_for_lifetimes): New.
6621         (TraitBound::get_in_params): New.
6622         (TraitBound::get_opening_question_mark): New.
6623         (ImplTraitType::get_type_param_bounds): New.
6624         (TraitObjectType::get_has_dyn): New.
6625         (TraitBound::get_type_in_parens): New.
6626         (ImplTraitTypeOneBound::get_trait_bound): New.
6627         (BareFunctionType::get_for_lifetimes)
6628         (BareFunctionType::get_is_variadic)
6629         (BareFunctionType::get_function_qualifiers): New.
6630         * hir/tree/rust-hir.h (class Expr): Virtual inherit from FullVisitable.
6631         (class Pattern): Likewise.
6632         (ConstGenericParam::get_name): New.
6633         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adjust call.
6634         (TypeCheckExpr::resolve_fn_trait_call): Likewise.
6635         * backend/rust-compile-expr.cc (CompileExpr::visit): Adjust call.
6636         (CompileExpr::array_copied_expr): Likewise.
6637         (CompileExpr::generate_possible_fn_trait_call): Likewise.
6638         * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
6639         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
6640         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
6641         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
6642         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
6643         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
6645 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6647         * typecheck/rust-hir-path-probe.h: called error function
6649 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6651         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args):
6652         called error function
6654 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6656         * hir/tree/rust-hir-expr.h (class ArrayElems): Inherit from FullVisitable.
6657         (class StructExprField): Likewise.
6658         * hir/tree/rust-hir-item.h (class WhereClauseItem): Likewise.
6659         (class UseTree): Likewise.
6660         (UseTreeRebind::get_path, UseTreeRebind::get_identifier)
6661         (UseTreeRebind::get_bind_type): New.
6662         (UseDeclaration::get_use_tree): New.
6663         (struct TraitFunctionDecl): Change struct to ...
6664         (class TraitFunctionDecl): ... class.
6665         (TraitFunctionDecl::get_where_clause): New.
6666         (StructField::get_outer_attrs): New.
6667         (struct TupleField): Change struct to ...
6668         (class TupleField): ... class.
6669         (TupleField::get_visibility, TupleField::get_outer_attrs): New.
6670         * hir/tree/rust-hir-pattern.h (class TupleStructItems): Inherit
6671         from FullVisitable.
6673 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
6675         * lex/rust-lex.cc (Lexer::build_token): Replace function call.
6676         (Lexer::parse_string): Likewise.
6677         (Lexer::parse_identifier_or_keyword): Likewise.
6678         (Lexer::parse_raw_string): Likewise.
6679         (Lexer::parse_char_or_lifetime): Likewise.
6680         (Lexer::get_input_codepoint_length): Deleted.
6681         (Lexer::peek_codepoint_input): Deleted.
6682         (Lexer::skip_codepoint_input): Deleted.
6683         * lex/rust-lex.h: Remove some methods and fields
6685 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
6687         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): track output
6688         * util/rust-hir-map.cc (Mappings::lookup_trait_item_lang_item): new helper
6689         * util/rust-hir-map.h: add prototype for helper
6691 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
6693         * backend/rust-compile-expr.cc (CompileExpr::generate_possible_fn_trait_call): use fnexpr
6694         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_fn_trait_call): likewise
6696 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6698         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
6700 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6702         * hir/tree/rust-hir.h (struct Crate): Rename struct into ...
6703         (class Crate): ... class, and add get_items.
6704         * backend/rust-compile.cc (CompileCrate::go): Adapt to visibility change of items.
6705         * checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve): Likewise.
6706         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::go): Likewise.
6707         * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::go): Likewise.
6708         * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::go): Likewise.
6709         * checks/errors/rust-const-checker.cc (ConstChecker::go): Likewise.
6710         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::go): Likewise.
6711         * checks/lints/rust-lint-marklive.cc (FindEntryPoint::find): Likewise.
6712         * checks/lints/rust-lint-scan-deadcode.h (ScanDeadCode::Scan): Likewise.
6713         * metadata/rust-export-metadata.cc (PublicInterface::gather_export_data): Likewise.
6714         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
6715         * hir/rust-hir-dump.cc (CompileCrate::go): Likewise.
6717 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6719         * hir/tree/rust-hir-expr.h (AwaitExpr::get_awaited_expr): New.
6720         (AsyncBlockExpr::get_has_move, AsyncBlockExpr::get_block_expr): New.
6721         * hir/tree/rust-hir-item.h (Enum::get_where_clause): New.
6722         (Trait::get_where_clause, Trait::is_unsafe): New.
6723         (ExternalItem::get_visibility): New.
6725 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6727         * hir/tree/rust-hir.h (class FullVisitable): New.
6728         (class Stmt): Adjust with new class.
6729         (class Expr): Likewise.
6730         (class Pattern): Likewise.
6731         (class Type): Likewise.
6732         (class TypeParamBound): Likewise.
6733         (class GenericParam): Likewise.
6734         (class TraitItem): Likewise.
6735         (class ImplItem): Likewise.
6737 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6739         * hir/tree/rust-hir.h (class WithInnerAttrs): New.
6740         (class Item): Adjust to new WithInnerAttrs class.
6741         (struct Crate): Likewise.
6742         * hir/rust-hir-dump.cc (Dump::go): Likewise.
6743         (Dump::visit): Likewise.
6744         * hir/tree/rust-hir-expr.h (class GroupedExpr): Likewise.
6745         (class ArrayExpr): Likewise.
6746         (class TupleExpr): Likewise.
6747         (class StructExprStruct): Likewise.
6748         (class BlockExpr): Likewise.
6749         (class MatchExpr): Likewise.
6750         * hir/tree/rust-hir-item.h (TypeParam::get_outer_attribute): New.
6751         (class Module): Adjust to new  WithInnerAttrs class.
6752         (struct StructField): change struct to...
6753         (class StructField): ... a class.
6754         (class ImplBlock): Adjust to new  WithInnerAttrs class.
6755         (class ExternBlock): Likewise.
6757 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
6759         * hir/tree/rust-hir-type.h (ArrayType::get_element_type): Returns
6760         unique_ptr.
6761         * hir/tree/rust-hir-expr.h (ArithmeticOrLogicalExpr::get_lhs)
6762         (ArithmeticOrLogicalExpr::get_rhs): Likewise.
6763         (ComparisonExpr::get_lhs, ComparisonExpr::get_rhs): Likewise.
6764         (LazyBooleanExpr::get_lhs, LazyBooleanExpr::get_rhs): Likewise.
6765         (AssignmentExpr::get_lhs, AssignmentExpr::get_rhs): Likewise.
6766         (ArrayExpr::get_internal_elements): Likewise.
6767         (ArrayIndexExpr::get_index_expr, ArrayIndexExpr::get_array_expr):
6768         Likewise.
6769         (StructExprFieldWithVal::get_value): Likewise.
6770         (IfExpr::get_if_condition, IfExpr::get_if_block): Likewise.
6771         (ExprWithBlock::get_else_block): Likewise.
6772         * hir/tree/rust-hir-item.h (FunctionParam::get_param_name)
6773         (FunctionParam::get_type): Likewise.
6774         (ConstantItem::get_type, ConstantItem::get_expr): Likewise.
6775         (StaticItem::get_expr, StaticItem::get_type): Likewise.
6776         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
6777         Adjust for previous change.
6778         * backend/rust-compile-block.cc (CompileConditionalBlocks::visit):
6779         Likewise.
6780         * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
6781         * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
6782         * backend/rust-compile-struct-field-expr.cc
6783         (CompileStructExprField::visit): Likewise.
6784         * checks/errors/privacy/rust-privacy-reporter.cc
6785         (PrivacyReporter::visit): Likewise.
6786         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
6787         Likewise.
6788         * typecheck/rust-hir-type-check-implitem.cc
6789         (TypeCheckImplItem::visit): Likewise.
6790         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
6791         Likewise.
6792         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit):
6793         Likewise.
6794         * typecheck/rust-hir-type-check-struct.cc
6795         (TypeCheckStructExpr::visit): Likewise.
6796         * typecheck/rust-hir-type-check.cc
6797         (TraitItemReference::get_type_from_fn): Likewise.
6799 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6801         * ast/rust-pattern.h: Change constructor to accept new parameter
6802         instead of defaulting on string type.
6803         * parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern):
6804         Propagate type hint.
6805         (Parser::parse_pattern_no_alt): Likewise.
6807 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
6809         * lex/rust-lex.cc (Lexer::parse_byte_char):add check for range of codepoint
6811 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
6813         * typecheck/rust-hir-type-check-pattern.cc (emit_invalid_field_error): Refactored Field
6814         Error Function
6815         (TypeCheckPattern::visit): called emit_invalid_field_error function
6817 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
6819         * expand/rust-macro-expand.cc
6820         (MacroExpander::match_matcher): Remove append_fragment inside repetitions.
6821         (MacroExpander::match_n_matches): Use sub_stack push/pop to handle repetitions.
6822         (MatchedFragmentContainer::add_fragment): Add MatchedFragmentContainer accepting version.
6823         * expand/rust-macro-expand.h
6824         (MatchedFragmentContainer::add_fragment): Likewise.
6825         (MatchedFragmentContainerRepetition::add_fragment): Likewise.
6826         (SubstititionScope::append_fragment): Likewise.
6828 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
6830         * typecheck/rust-casts.cc (TypeCastRules::check): apply new argument
6831         * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): track if this is a cast site
6832         (TypeCoercionRules::TryCoerce): update ctor
6833         (TypeCoercionRules::TypeCoercionRules): cleanup error handling
6834         (TypeCoercionRules::do_coercion): likewise
6835         (TypeCoercionRules::coerce_unsafe_ptr): only infer in try mode
6836         (TypeCoercionRules::coerce_borrowed_pointer): cleanup
6837         * typecheck/rust-coercion.h: update header
6839 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
6841         * typecheck/rust-hir-trait-reference.h: update prototype
6842         * typecheck/rust-hir-trait-resolve.cc: add generic args as an out param
6843         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): use the generics
6845 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6847         * ast/rust-ast-collector.cc (TokenCollector::visit): Add comment
6848         after tail expressions.
6849         * ast/rust-ast-dump.cc (Dump::require_spacing): Check for
6850         missing previous token.
6851         * ast/rust-ast-dump.h: Output formatting characters.
6853 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6855         * ast/rust-ast-collector.cc (TokenCollector::collect): Collect
6856         CollectItems once done.
6857         (TokenCollector::newline): Add newline formatting
6858         implementation.
6859         (TokenCollector::indentation): Add indentation implementation.
6860         (TokenCollector::increment_indentation): Add indentation
6861         increment.
6862         (TokenCollector::comment): Add new comment formatting option.
6863         * ast/rust-ast-collector.h: Update prototypes.
6865 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6867         * ast/rust-ast-collector.cc (TokenCollector::collect_tokens):
6868         Filter tokens.
6869         (TokenCollector::visit_items_joined_by_separator): Change store
6870         call.
6871         (TokenCollector::visit_as_line): Likewise.
6872         (TokenCollector::visit_items_as_block): Likewise.
6873         (TokenCollector::trailing_comma): Likewise.
6874         (TokenCollector::visit): Likewise.
6875         (TokenCollector::visit_closure_common): Likewise.
6876         (TokenCollector::visit_function_common): Likewise.
6877         * ast/rust-ast-collector.h (class CollectItem): Add class to
6878         differentiate between formatting and raw data (tokens).
6880 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6882         * ast/rust-ast-collector.cc (TokenCollector::TokenCollector):
6883         Remove constructor, changing it to an implicit default
6884         constructor.
6885         * ast/rust-ast-collector.h: Change from container reference to
6886         direct container.
6887         * ast/rust-ast-dump.h: Change call to constructor.
6888         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
6890 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6892         * ast/rust-ast-dump.cc (Dump::require_spacing): Add a function
6893         to determine wether a space shall output.
6894         * ast/rust-ast-dump.h: Add function prototype as well as
6895         condition.
6897 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6899         * ast/rust-ast-collector.cc (TokenCollector::visit): Add a visit
6900         function for visitable abstract class so we can call a dump on
6901         any visitable item.
6902         * ast/rust-ast-collector.h: Add new visit function prototype.
6903         * ast/rust-ast-dump.cc (Dump::go): Add call to process function.
6904         (Dump::visit): Remove functions.
6905         (Dump::visit_items_joined_by_separator): Likewise.
6906         (Dump::visit_as_line): Likewise.
6907         (Dump::visit_items_as_lines): Likewise.
6908         (Dump::visit_items_as_block): Likewise.
6909         (Dump::visit_function_common): Likewise.
6910         (get_delimiters): Likewise.
6911         (Dump::debug): Update with call to tokencollector.
6912         * ast/rust-ast-dump.h (RUST_AST_DUMP_H): Move include
6913         directives.
6914         (class Dump): Remove multiple prototypes and add generic process
6915         function.
6917 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6919         * ast/rust-ast-collector.cc (TokenCollector::visit): Add
6920         semicolon in extern blocks.
6922 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6924         * rust-session-manager.cc (Session::enable_dump): Remove
6925         tokenstream dump.
6926         (Session::compile_crate): Likewise.
6927         (Session::dump_tokenstream): Likewise.
6928         * rust-session-manager.h (struct CompileOptions): Likewise.
6930 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
6932         * lex/rust-lex.cc (Lexer::build_token):add check for all kinds of whitespaces
6934 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6936         * ast/rust-ast.h: Add default constructors.
6938 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
6940         * ast/rust-ast-collector.cc (TokenCollector::visit): Change with
6941         call to getter.
6942         * ast/rust-ast.cc (Module::as_string): Likewise.
6943         (StaticItem::as_string): Likewise.
6944         (TupleStruct::as_string): Likewise.
6945         (Method::as_string): Likewise.
6946         (StructStruct::as_string): Likewise.
6947         (UseTreeRebind::as_string): Likewise.
6948         (Enum::as_string): Likewise.
6949         (Trait::as_string): Likewise.
6950         (Union::as_string): Likewise.
6951         (Function::as_string): Likewise.
6952         (TypeAlias::as_string): Likewise.
6953         (MacroRulesDefinition::as_string): Likewise.
6954         (FieldAccessExpr::as_string): Likewise.
6955         (MacroMatchFragment::as_string): Likewise.
6956         (TypeParam::as_string): Likewise.
6957         (StructExprFieldIdentifierValue::as_string): Likewise.
6958         (EnumItem::as_string): Likewise.
6959         (StructField::as_string): Likewise.
6960         (ExternalTypeItem::as_string): Likewise.
6961         (ExternalStaticItem::as_string): Likewise.
6962         (ExternalFunctionItem::as_string): Likewise.
6963         (TraitFunctionDecl::as_string): Likewise.
6964         (TraitMethodDecl::as_string): Likewise.
6965         (TraitItemConst::as_string): Likewise.
6966         (TraitItemType::as_string): Likewise.
6967         (MaybeNamedParam::as_string): Likewise.
6968         (MetaListPaths::as_string): Likewise.
6969         (MetaListNameValueStr::as_string): Likewise.
6970         (Module::process_file_path): Likewise.
6971         (MetaListNameValueStr::check_cfg_predicate): Likewise.
6972         (MetaListPaths::check_cfg_predicate): Likewise.
6973         (MetaWord::check_cfg_predicate): Likewise.
6974         (MetaNameValueStr::check_cfg_predicate): Likewise.
6975         (MetaNameValueStr::to_attribute): Likewise.
6976         (MetaWord::to_attribute): Likewise.
6977         (MetaListPaths::to_attribute): Likewise.
6978         (MetaListNameValueStr::to_attribute): Likewise.
6979         (operator<<): Change Identifier class <<
6980         operator overload for standard output stream.
6981         * ast/rust-ast.h (class Identifier): Change typedef to proper
6982         class definition.
6983         (operator<<): Add prototype for operator overload.
6984         (class Token): Change getter identifier.
6985         (class MetaListNameValueStr): Likewise.
6986         (class PathExpr): Likewise.
6987         * ast/rust-expr.h: Likewise.
6988         * ast/rust-item.h: Likewise.
6989         * ast/rust-macro.h: Likewise.
6990         * ast/rust-path.cc (GenericArg::disambiguate_to_type): Likewise.
6991         (GenericArgsBinding::as_string): Likewise.
6992         (ConstGenericParam::as_string): Likewise.
6993         * ast/rust-path.h: Likewise.
6994         * ast/rust-pattern.cc (IdentifierPattern::as_string): Likewise.
6995         (StructPatternFieldIdentPat::as_string): Likewise.
6996         (StructPatternFieldIdent::as_string): Likewise.
6997         * ast/rust-type.h: Likewise.
6998         * backend/rust-compile-base.cc: Likewise.
6999         * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
7000         * backend/rust-compile-extern.h: Likewise.
7001         * backend/rust-compile-fnparam.cc (CompileFnParam::visit):
7002         Likewise.
7003         * backend/rust-compile-implitem.cc (CompileTraitItem::visit):
7004         Likewise.
7005         * backend/rust-compile-item.cc (CompileItem::visit): Likewise.
7006         * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): Likewise.
7007         * backend/rust-compile-struct-field-expr.cc (CompileStructExprField::visit):
7008         Likewise.
7009         * backend/rust-compile-var-decl.h: Likewise.
7010         * backend/rust-compile.cc: Likewise.
7011         * checks/errors/rust-unsafe-checker.cc (check_extern_call):
7012         Likewise.
7013         * checks/lints/rust-lint-marklive.cc (MarkLive::visit):
7014         Likewise.
7015         * checks/lints/rust-lint-scan-deadcode.h: Likewise.
7016         * expand/rust-derive-clone.cc (DeriveClone::clone_fn): Likewise.
7017         (DeriveClone::visit_tuple): Likewise.
7018         (DeriveClone::visit_struct): Likewise.
7019         (DeriveClone::visit_union): Likewise.
7020         * expand/rust-derive-copy.cc (DeriveCopy::visit_struct):
7021         Likewise.
7022         (DeriveCopy::visit_tuple): Likewise.
7023         (DeriveCopy::visit_enum): Likewise.
7024         (DeriveCopy::visit_union): Likewise.
7025         * expand/rust-macro-expand.cc (MacroExpander::match_matcher):
7026         Likewise.
7027         (MacroExpander::match_n_matches): Likewise.
7028         (MacroExpander::match_repetition): Likewise.
7029         (MacroExpander::match_repetition_skipped_metavars): Likewise.
7030         * hir/rust-ast-lower-base.cc (struct_field_name_exists):
7031         Likewise.
7032         * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
7033         * hir/rust-ast-lower-type.cc (ASTLowerGenericParam::visit):
7034         Likewise.
7035         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
7036         * hir/tree/rust-hir-expr.h: Likewise.
7037         * hir/tree/rust-hir-item.h: Likewise.
7038         * hir/tree/rust-hir-path.h: Likewise.
7039         * hir/tree/rust-hir-type.h: Likewise.
7040         * hir/tree/rust-hir.cc (Module::as_string): Likewise.
7041         (StaticItem::as_string): Likewise.
7042         (TupleStruct::as_string): Likewise.
7043         (ConstantItem::as_string): Likewise.
7044         (StructStruct::as_string): Likewise.
7045         (UseTreeRebind::as_string): Likewise.
7046         (Enum::as_string): Likewise.
7047         (Trait::as_string): Likewise.
7048         (Union::as_string): Likewise.
7049         (Function::as_string): Likewise.
7050         (TypeAlias::as_string): Likewise.
7051         (FieldAccessExpr::as_string): Likewise.
7052         (TypeParam::as_string): Likewise.
7053         (GenericArgsBinding::as_string): Likewise.
7054         (StructPatternFieldIdent::as_string): Likewise.
7055         (StructPatternFieldIdentPat::as_string): Likewise.
7056         (IdentifierPattern::as_string): Likewise.
7057         (StructExprFieldIdentifierValue::as_string): Likewise.
7058         (EnumItem::as_string): Likewise.
7059         (StructField::as_string): Likewise.
7060         (ExternalStaticItem::as_string): Likewise.
7061         (ExternalFunctionItem::as_string): Likewise.
7062         (NamedFunctionParam::as_string): Likewise.
7063         (TraitFunctionDecl::as_string): Likewise.
7064         (TraitItemConst::as_string): Likewise.
7065         (TraitItemType::as_string): Likewise.
7066         (MaybeNamedParam::as_string): Likewise.
7067         * hir/tree/rust-hir.h: Likewise.
7068         * parse/rust-parse-impl.h (Parser::parse_macro_match_fragment):
7069         Likewise.
7070         (Parser::parse_module): Likewise.
7071         (Parser::parse_use_tree): Likewise.
7072         (Parser::parse_maybe_named_param): Likewise.
7073         * resolve/rust-ast-resolve-implitem.h: Likewise.
7074         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
7075         Likewise.
7076         (ResolveItem::visit): Likewise.
7077         (flatten_rebind): Likewise.
7078         (ResolveExternItem::visit): Likewise.
7079         (rust_flatten_rebind): Likewise.
7080         (rust_flatten_rebind_nested): Likewise.
7081         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
7082         Likewise.
7083         (PatternDeclaration::visit): Likewise.
7084         (PatternDeclaration::add_new_binding): Likewise.
7085         * resolve/rust-ast-resolve-stmt.h: Likewise.
7086         * resolve/rust-ast-resolve-toplevel.h: Likewise.
7087         * resolve/rust-ast-resolve-type.h: Likewise.
7088         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
7089         * typecheck/rust-autoderef.cc: Likewise.
7090         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
7091         Likewise.
7092         * typecheck/rust-hir-path-probe.cc (PathProbeType::visit):
7093         Likewise.
7094         * typecheck/rust-hir-trait-reference.cc (TraitReference::get_name): Likewise.
7095         * typecheck/rust-hir-trait-resolve.cc (ResolveTraitItemToRef::visit): Likewise.
7096         (TraitResolver::resolve_trait): Likewise.
7097         (TraitItemReference::resolve_item): Likewise.
7098         (AssociatedImplTrait::setup_raw_associated_types): Likewise.
7099         * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
7100         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
7101         Likewise.
7102         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise.
7103         (TypeCheckImplItem::visit): Likewise.
7104         (TypeCheckImplItemWithTrait::visit): Likewise.
7105         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
7106         Likewise.
7107         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
7108         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
7109         * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise.
7110         * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise.
7111         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): Likewise.
7112         * util/rust-attributes.cc (check_doc_attribute): Likewise.
7113         * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
7115 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
7117         * lex/rust-lex.cc (is_float_digit):Change types of param to `uint32_t`
7118         (is_x_digit):Likewise
7119         (is_octal_digit):Likewise
7120         (is_bin_digit):Likewise
7121         (check_valid_float_dot_end):Likewise
7122         (is_whitespace):Likewise
7123         (is_non_decimal_int_literal_separator):Likewise
7124         (is_identifier_start):Likewise
7125         (is_identifier_continue):Likewise
7126         (Lexer::skip_broken_string_input):Likewise
7127         (Lexer::build_token):Remove handling BOM
7128         (Lexer::parse_in_type_suffix):Modify use of `current_char`
7129         (Lexer::parse_in_decimal):Likewise
7130         (Lexer::parse_escape):Likewise
7131         (Lexer::parse_utf8_escape):Likewise
7132         (Lexer::parse_partial_string_continue):Likewise
7133         (Lexer::parse_partial_hex_escape):Likewise
7134         (Lexer::parse_partial_unicode_escape):Likewise
7135         (Lexer::parse_byte_char):Likewise
7136         (Lexer::parse_byte_string):Likewise
7137         (Lexer::parse_raw_byte_string):Likewise
7138         (Lexer::parse_raw_identifier):Likewise
7139         (Lexer::parse_non_decimal_int_literal):Likewise
7140         (Lexer::parse_decimal_int_or_float):Likewise
7141         (Lexer::peek_input):Change return type to `Codepoint`
7142         (Lexer::get_input_codepoint_length):Change to return 1
7143         (Lexer::peek_codepoint_input):Change to be wrapper of `peek_input`
7144         (Lexer::skip_codepoint_input):Change to be wrapper of `skip_input`
7145         (Lexer::test_get_input_codepoint_n_length):Deleted
7146         (Lexer::split_current_token):Deleted
7147         (Lexer::test_peek_codepoint_input):Deleted
7148         (Lexer::start_line):Move backwards
7149         (assert_source_content):New helper function for selftest
7150         (test_buffer_input_source):New helper function for selftest
7151         (test_file_input_source):Likewise
7152         (rust_input_source_test):New test
7153         * lex/rust-lex.h (rust_input_source_test):New test
7154         * rust-lang.cc (run_rust_tests):Add selftest
7156 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7158         * expand/rust-macro-expand.cc
7159         (MacroExpander::match_repetition_skipped_metavars): New.
7160         (MacroExpander::match_repetition): Use new method.
7161         * expand/rust-macro-expand.h
7162         (MacroExpander::match_repetition_skipped_metavars): New.
7164 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
7166         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
7168 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
7170         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): called rust_error_at
7172 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7174         * expand/rust-macro-expand.cc
7175         (MacroExpander::match_token): Match token instead of token id.
7176         * parse/rust-parse-impl.h
7177         (Parser::skip_token): Add token-skipping variant.
7178         (Parser::expect_token): Likewise.
7179         * parse/rust-parse.h
7180         (Parser::skip_token): Likewise.
7181         (Parser::expect_token): Likewise.
7183 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7185         * lang.opt: Add -frust-name-resolution-2.0 option
7187 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7189         * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): add check for pointers
7191 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7193         * typecheck/rust-autoderef.cc: use new selection filter
7194         * typecheck/rust-hir-dot-operator.cc (MethodResolver::Select): new slection Filter
7195         * typecheck/rust-hir-dot-operator.h: New select prototype
7196         * typecheck/rust-hir-type-check-expr.cc: call select
7197         * typecheck/rust-type-util.cc (try_coercion): new helper
7198         * typecheck/rust-type-util.h (try_coercion): helper prototype
7200 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
7202         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): passed "E0277"
7203         * typecheck/rust-tyty.cc (BaseType::bounds_compatible): passed "E0277"
7205 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
7207         * expand/rust-expand-visitor.cc (ExpandVisitor::visit):
7208         Expand expressions in more contexts.
7209         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
7210         Visit enum variants.
7212 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7214         * ast/rust-ast.cc (BlockExpr::normalize_tail_expr): Refactor
7215         code and warn about dangling reference.
7216         * expand/rust-expand-visitor.cc (expand_stmt_attribute):
7217         Document function and change argument names to make those
7218         clearer.
7220 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7222         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_inner_stmts):
7223         Remove second argument.
7224         (ExpandVisitor::visit): Remove argument from function call.
7225         * expand/rust-expand-visitor.h: Update function prototype.
7227 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7229         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Change
7230         call to expand_inner_stmts.
7231         (expand_tail_expr): Change argument name and try to expand the
7232         last statement as a tail expression once all statements have
7233         been expanded.
7234         * expand/rust-expand-visitor.h: Change prototype to accept
7235         parent class.
7236         * ast/rust-expr.h: Add try_convert_last_stmt function prototype.
7238 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7240         * ast/rust-expr.h: Add a function to take tail expr as well
7241         as a function to set a tail expression.
7242         * expand/rust-expand-visitor.cc (expand_tail_expr): Add tail
7243         expression expansion function.
7244         (ExpandVisitor::visit): Add call to tail expr expansion in for
7245         BlockExpr.
7247 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7248             Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7250         * expand/rust-expand-visitor.cc : Change type from pointer to
7251         reference and expand statements from statements.
7252         * ast/rust-macro.h: Return macro kind.
7253         * ast/rust-ast.h: Add Statement kind.
7254         * ast/rust-item.h: Change module.
7255         * ast/rust-stmt.h: Return kind.
7257 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7259         * expand/rust-macro-expand.cc
7260         (MacroExpander::expand_decl_macro):
7261         Use pointers/smart pointers to refer to MatchedFragmentContainer instances.
7262         (MacroExpander::transcribe_rule): Likewise.
7263         (MatchedFragmentContainer::get_single_fragment): New implementation.
7264         (MatchedFragmentContainer::get_fragments): Likewise.
7265         (MatchedFragmentContainer::add_fragment): Likewise.
7266         (MatchedFragmentContainer::zero): Likewise.
7267         (MatchedFragmentContainer::metavar): Likewise.
7268         * expand/rust-macro-expand.h
7269         (class MatchedFragmentContainer): Make abstract.
7270         (class MatchedFragmentContainerMetaVar): New.
7271         (class MatchedFragmentContainerRepetition): New.
7272         (class SubstitutionScope):
7273         Use pointers/smart pointers to refer to MatchedFragmentContainer instances.
7274         (MacroExpander::transcribe_rule): Likewise.
7275         * expand/rust-macro-substitute-ctx.cc
7276         (SubstituteCtx::substitute_metavar): Likewise.
7277         (SubstituteCtx::check_repetition_amount): Likewise.
7278         (SubstituteCtx::substitute_repetition): Likewise.
7279         * expand/rust-macro-substitute-ctx.h
7280         (class SubstituteCtx): Likewise.
7282 2024-01-16  Muhammad Mahad  <mahadtxt@gmail.com>
7284         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): called rust_error_at
7285         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): called rust_error_at
7287 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7289         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
7290         arguments mappings as an out parameter and apply them to the bounds
7291         * typecheck/rust-hir-type-check-item.h: update the prototype
7292         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
7293         apply the arguments to the segment type
7295 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7297         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
7298         simplify lookup of the respective predicate
7299         * typecheck/rust-tyty-subst.cc (SubstitutionArg::SubstitutionArg): track original parameter
7300         (SubstitutionArg::operator=): update copy ctor
7301         (SubstitutionArg::get_param_ty): use original param
7302         (SubstitutionArg::as_string): update as_string
7303         * typecheck/rust-tyty-subst.h: add new private field
7305 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7307         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
7308         New helper utility to infer non concrete types and handle the case where its not a
7309         binding generic type (which inherits SubstitutionRef)
7310         * typecheck/rust-hir-type-check-item.h: new helper prototype
7311         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): use this helper
7313 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7315         * typecheck/rust-hir-trait-resolve.cc: use lookup_predicate (DefID)
7316         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): fix formatting
7318 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
7320         * ast/rust-ast.h (MacroInvocation::add_semicolon): New method.
7321         (Expr::to_stmt): Remove method.
7322         * ast/rust-macro.h (MacroInvocation::add_semicolon): Add override.
7323         (MacroInvocation::to_stmt): Remove override.
7324         * ast/rust-stmt.h: Remove use of Expr::to_stmt.
7325         (ExprStmt::add_semicolon): Add override.
7326         * expand/rust-macro-expand.h (struct MacroExpander):
7327         Add EXPR/STMT and remove BLOCK from ContextType.
7328         * expand/rust-expand-visitor.cc (ExpandVisitor::maybe_expand_expr): Use EXPR context.
7329         (ExpandVisitor::expand_inner_stmts): Use STMT context.
7330         (ExpandVisitor::visitor): Remove use of BLOCK context.
7331         * expand/rust-macro-expand.cc (parse_many): Pass enum by value.
7332         (transcribe_on_delimiter): Remove function.
7333         (transcribe_context): Use EXPR/STMT contexts.
7334         (MacroExpander::parse_proc_macro_output): Use EXPR/STMT contexts.
7335         (transcribe_many_stmts): Parse statements with semicolons.
7336         * parse/rust-parse-impl.h (Parser::parse_stmt):
7337         Delegate macro parsing to parse_expr_stmt, check for ! after macro_rules.
7338         (Parser::parse_let_stmt): Work around lack of NT tokens.
7339         (Parser::parse_expr_stmt): Handle statements at end of macro expansions.
7340         (Parser::parse_expr_stmt): Parse macro statements/expression statements
7341         starting with a macro.
7342         (Parser::parse_match_expr): Don't modify flag unnecessarily.
7343         (Parser::parse_stmt_or_expr):
7344         Parse macro statements/expression statements starting with a macro.
7345         (Parser::parse_path_based_stmt_or_expr): Remove method.
7346         (Parser::parse_macro_invocation_maybe_semi): Remove method.
7347         (Parser::parse_expr): Move code into left_denotations.
7348         (Parser::left_denotations): New method.
7349         (Parser::null_denotation): Split out methods for cases with and without paths.
7350         (Parser::null_denotation_path): New method.
7351         (Parser::null_denotation_not_path): New method.
7352         (Parser::parse_macro_invocation_partial): Don't check for semicolon here.
7353         * parse/rust-parse.h: Update declarations.
7354         (struct ParseRestrictions): Additional flag.
7356 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
7358         * ast/rust-ast.cc (BlockExpr::strip_tail_expr):
7359         Don't normalize tail expression in this method.
7360         (BlockExpr::normalize_tail_expr): New method that only does the normalization.
7361         * ast/rust-expr.h: Declare new method.
7362         * hir/rust-ast-lower-block.h: Normalize tail expressions on blocks before lowering.
7364 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
7366         * ast/rust-ast-dump.cc (Dump::visit): Print macro invocations.
7368 2024-01-16  Raiki Tamura  <tamaron1203@gmail.com>
7370         * lex/rust-lex.cc (is_whitespace):add all lacked codepoints valid as whitespaces
7371         (is_identifier_start):new function to check XID_Start and underscore
7372         (is_identifier_continue):new function to check XID_Continue
7373         (Lexer::build_token):tokenize Unicode identifiers
7374         (Lexer::parse_partial_string_continue):add comments
7375         (Lexer::parse_partial_unicode_escape):add comments
7376         (Lexer::parse_raw_identifier):change to use `is_identifier_scontinue`
7377         (Lexer::parse_identifier_or_keyword):change to use `is_identifier_continue`
7378         (Lexer::parse_char_or_lifetime):change to use `is_identifier_start/continue`
7379         (Lexer::skip_codepoint_input):do not attempt to skip input when bumping EOF
7380         * lex/rust-lex.h:add `current_char32` field
7382 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7384         * lex/rust-lex.cc
7385         (Lexer::classify_keyword): Check if iterator is valid before dereferencing.
7387 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7389         * expand/rust-macro-expand.cc
7390         (MacroExpander::match_repetition): Remove redundant rust_error_at call.
7392 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7394         * typecheck/rust-unify.cc (UnifyRules::go): dont check bounds on placeholders
7396 2024-01-16  tieway59  <tieway59@foxmail.com>
7398         * typecheck/rust-tycheck-dump.h: Delete this file
7399         * rust-session-manager.cc: Remove `Session::dump_type_resolution`
7400         and `TYPE_RESOLUTION_DUMP`
7401         * rust-session-manager.h: Likewise
7403 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7405         * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
7406         match the fntype to the candidate
7408 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7410         * expand/rust-derive.h: Store AstBuilder and location.
7411         * expand/rust-derive.cc (DeriveVisitor::DeriveVisitor): Update constructor.
7412         * expand/rust-derive-clone.h: Remove members now stored in `DeriveVisitor`.
7413         * expand/rust-derive-copy.h: Likewise.
7414         * expand/rust-derive-clone.cc (DeriveClone::DeriveClone): Update constructor.
7415         * expand/rust-derive-copy.cc (DeriveCopy::DeriveCopy): Likewise.
7417 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7419         * backend/rust-compile-item.cc (CompileItem::visit): ensure assoicated types are setup
7420         * typecheck/rust-hir-trait-reference.h: new interface for concrete impl block
7421         * typecheck/rust-hir-trait-resolve.cc (AssociatedImplTrait::setup_raw_associated_types):
7422         ensure we setup assoicated types for this impl block
7424 2024-01-16  Dave Evans  <dave@dmetwo.org>
7426         * backend/rust-compile-expr.cc (check_match_scrutinee): Add REF type to rust_assert.
7427         (CompileExpr::visit): Add REF type for scrutinee_kind in MatchExpr visitor.
7429 2024-01-16  TieWay59  <tieway59@foxmail.com>
7431         * typecheck/rust-hir-type-check-expr.cc: Remove obsolete error diagnostic
7433 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7435         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItemWithTrait::visit):
7436         use new interface
7437         * typecheck/rust-type-util.cc (types_compatable): implementation of new interface
7438         * typecheck/rust-type-util.h (types_compatable): prototype
7439         * typecheck/rust-unify.cc (UnifyRules::expect_placeholder):
7440         It is allow for unification against placeholders
7442 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7444         * expand/rust-expand-visitor.cc (derive_item): Add const
7445         attribute to the trait name argument.
7446         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
7448 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7450         * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
7451         assertion to allow empty derive directives.
7453 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7455         * expand/rust-expand-visitor.cc (expand_attribute): Add function
7456         to expand a given attribute on a given item.
7457         * expand/rust-macro-expand.h (struct MacroExpander): Change
7458         return type to ast fragment.
7460 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7462         * expand/rust-expand-visitor.cc (get_traits_to_derive): Change
7463         the function to get traits in a given attribute instead of an
7464         attribute vector.
7465         (ExpandVisitor::expand_struct_fields): Remove call in visitor.
7466         (ExpandVisitor::expand_function_params): Likewise.
7467         (ExpandVisitor::expand_closure_params): Likewise.
7468         (ExpandVisitor::visit): Likewise.
7469         (ExpandVisitor::expand_outer_attribute): Remove function.
7470         (ExpandVisitor::visit_outer_attrs): Remove function.
7471         * expand/rust-expand-visitor.h: Remove function prototypes.
7472         (ExpandVisitor::visit_outer_attrs): Remove function.
7474 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7476         * expand/rust-expand-visitor.h: Remove fragment collection fro
7477         procedural macros.
7478         * expand/rust-macro-expand.h (struct MacroExpander): Remove
7479         procedural macro fragment from expander.
7481 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7483         * ast/rust-ast-fragment.cc (Fragment::Fragment): Remove
7484         overwrite member in constructor.
7485         (Fragment::operator=): Removal of overwrite member in copy.
7486         (Fragment::should_overwrite): Remove overwrite getter.
7487         * ast/rust-ast-fragment.h: Remove overwrite boolean member.
7488         * expand/rust-expand-visitor.cc (derive_item): Add a function to
7489         derive items using the expander for now.
7490         (builtin_derive_item): Rename from derive_item to
7491         builtin_derive_item.
7492         (ExpandVisitor::visit): Remove visit to derive attributes.
7493         (ExpandVisitor::expand_derive): Remove derive attribute visitor.
7494         (ExpandVisitor::visit_attrs_with_derive): Likewise.
7495         * expand/rust-expand-visitor.h: Update insertion of other kind
7496         of proc macros. We no longer have an overwrite attribute in the
7497         fragment.
7498         * expand/rust-macro-expand.cc (MacroExpander::parse_procmacro_output):
7499         Return the fragment instead of inserting it.
7500         * expand/rust-macro-expand.h (struct MacroExpander): Return
7501         fragment.
7503 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7505         * ast/rust-ast-collector.h: Update enum name to match
7506         definition.
7507         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_derive):
7508         Add call to expander.
7509         (ExpandVisitor::expand_outer_attribute):
7510         Change call to macro expander.
7511         (ExpandVisitor::expand_inner_attribute): Likewise.
7512         * expand/rust-expand-visitor.h: Remove const attribute to match
7513         visitor declaration. Attach result to the AST. Add condition for
7514         item erasure.
7515         * expand/rust-proc-macro.h: Add token collector and expansion
7516         call. Add lexers and parsers for each proc macro type and uses
7517         them to parse macro output.
7518         * expand/rust-macro-expand.h (struct MacroExpander): Add
7519         functions.
7520         * expand/rust-proc-macro.cc (ProcMacroExpander::import_proc_macros):
7521         Moved from here...
7522         * expand/rust-macro-expand.cc (MacroExpander::import_proc_macros):
7523         ... to here. Unify procedural macro parsing under one function.
7524         Add a flag to determine whether it originate from a derive
7525         macro.
7526         (MacroExpander::parse_procmacro_output):
7527         Parse macro output to statements. Store an error on parsing
7528         failure.
7529         * Make-lang.in: Add const_TokenPtr specific lexer.
7530         * expand/rust-proc-macro-invoc-lexer.cc: New file.
7531         * expand/rust-proc-macro-invoc-lexer.h: New file.
7532         * rust-session-manager.cc (Session::expansion): Remove
7533         ProcMacroExpander declaration.
7534         * ast/rust-ast-fragment.cc (Fragment::Fragment): Add overwrite
7535         flag.
7536         (Fragment::should_overwrite): Add a getter to determine whether
7537         the fragment shall overwrite it's parent or be appended after.
7538         * ast/rust-ast-fragment.h: Add flag to declaration.
7540 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7542         * util/rust-hir-map.cc (Mappings::insert_bang_proc_macro):
7543         Add a function to insert a new bang proc macro.
7544         (Mappings::lookup_bang_proc_macro): Add a function to lookup a
7545         bang procedural macro.
7546         (Mappings::insert_derive_proc_macro): Add a function to insert a
7547         derive procedural macro.
7548         (Mappings::lookup_derive_proc_macro): Add a function to lookup a
7549         derive procedural macro.
7550         (Mappings::insert_attribute_proc_macro): Add a function to
7551         insert an attribute procedural macro.
7552         (Mappings::lookup_attribute_proc_macro): Add a function to
7553         lookup an attribute procedural macro.
7554         * util/rust-hir-map.h: Add function prototypes.
7555         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_outer_attribute):
7556         Implement expansion of outer attributes.
7557         (ExpandVisitor::expand_inner_attribute):
7558         Add call for inner attribute expansion.
7559         * expand/rust-expand-visitor.h:
7560         Add new procedural macro expander attribute.
7561         * expand/rust-proc-macro.cc (load_macros_array): Add a function
7562         to load the proc macro array from a given shared object.
7563         (load_macros): Add a function to retrieve procedural macro
7564         vector from a given shared object.
7565         (ProcMacroExpander::import_proc_macros): Add a function to load
7566         procedural macros from a given extern crate name.
7567         * expand/rust-proc-macro.h (RUST_PROC_MACRO_H): Add new
7568         proc-macro file.
7569         (class ProcMacroExpander): Add new ProcMacroExpander class.
7570         * rust-session-manager.cc (Session::expansion): Create new macro
7571         expander and feed it to the expand visitor.
7572         * util/rust-attributes.cc: Add macro_export builtin attribute.
7574 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7576         * ast/rust-ast-collector.cc (TokenCollector::visit): Fix
7577         attribute collection.
7579 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7581         * ast/rust-ast-collector.h: Make trivial visitors public.
7583 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7585         * Make-lang.in: Add rust-proc-macro object to list.
7586         * expand/rust-proc-macro.cc: New file.
7587         * expand/rust-proc-macro.h: New file.
7589 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7591         * util/rust-attributes.cc: Add attribute to the table.
7593 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7595         * ast/rust-ast-collector.cc (TokenCollector::visit): Move
7596         implementation from here...
7597         * ast/rust-ast-collector.h: ... to here.
7599 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7601         * Make-lang.in: Add "rust-dir-owner.o".
7602         * ast/rust-ast.cc: Include "rust-dir-owner.h".
7603         (Module::process_file_path):
7604         Handle non-mod-rs external file modules properly.
7605         * parse/rust-parse-impl.h: Include "rust-dir-owner.h".
7606         (Parser::parse_module):
7607         Handle non-mod-rs external file modules properly.
7608         * util/rust-dir-owner.cc: New file.
7609         * util/rust-dir-owner.h: New file.
7611 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7613         * expand/rust-macro-builtins.cc: Fix comments.
7614         (MacroBuiltin::proc_macro_builtin): Add error message.
7615         * expand/rust-macro-builtins.h: Fix comments.
7617 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7619         * typecheck/rust-hir-trait-resolve.cc: when the bound is concrete keep the mapping
7620         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): add missing call
7621         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): make this the same as paths
7623 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7625         * util/rust-optional.h
7626         (class Optional): Add volatile field to union.
7628 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7630         * expand/rust-macro-substitute-ctx.cc
7631         (SubstituteCtx::substitute_metavar): Substitute crate metavar.
7633 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7635         * parse/rust-parse-impl.h
7636         (Parser::null_denotation): Allow struct expression referencing.
7638 2024-01-16  Charalampos Mitrodimas  <charmitro@gmail.com>
7640         * ast/rust-ast-dump.cc (Dump::visit):
7641         print literals based on their type.
7643 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7645         * expand/rust-macro-builtins.cc (MacroBuiltin::dummy): New function.
7646         * expand/rust-macro-builtins.h: Declare it.
7648 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7650         * ast/rust-ast-builder.cc (AstBuilder::struct_expr_struct): New function.
7651         (AstBuilder::let): Likewise.
7652         (AstBuilder::struct_expr): Likewise.
7653         (AstBuilder::struct_expr_field): Likewise.
7654         (AstBuilder::field_access): Likewise.
7655         (AstBuilder::wildcard): Likewise.
7656         * ast/rust-ast-builder.h: Likewise.
7657         * expand/rust-derive-clone.cc (DeriveClone::visit_union): Implement
7658         properly.
7660 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7662         * Make-lang.in: Add new files.
7663         * expand/rust-derive.cc (DeriveVisitor::derive): Call into DeriveCopy.
7664         * expand/rust-derive-copy.cc: New file.
7665         * expand/rust-derive-copy.h: New file.
7667 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7669         * expand/rust-derive-clone.cc (DeriveClone::visit_struct): Implement proper
7670         cloning for structs with fields.
7671         * ast/rust-ast-builder.cc (AstBuilder::struct_expr): New function.
7672         (AstBuilder::struct_expr_field): Likewise.
7673         (AstBuilder::field_access): Likewise.
7674         (AstBuilder::let): Likewise.
7675         * ast/rust-ast-builder.h: Declare new functions.
7677 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7679         * util/rust-token-converter.cc (convert): Use a variable instead
7680         of multiple nested calls.
7682 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7684         * lex/rust-lex.h: Make build_token method public.
7685         * lex/rust-token.h: Add a setter for a token location.
7686         * util/rust-token-converter.cc (convert): Add the function to
7687         convert from a Span to a Location.
7688         (from_ident): Convert Ident span to a Location.
7689         (from_literal): Convert Literal span to a Location.
7690         (from_punct): Convert Punct span to a Location.
7691         (from_group): Convert Group span to a Location.
7693 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7695         * util/rust-token-converter.cc (convert): Add implementation.
7697 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7699         * util/rust-token-converter.cc (convert): Update call to
7700         constructors with location information.
7701         (handle_suffix): Convert token locus to a Span and use it in the
7702         literal.
7704 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7706         * expand/rust-macro-expand.cc
7707         (MacroExpander::try_match_rule): Don't match delimiters for root matcher.
7708         (MacroExpander::match_matcher): Add option to match delimiters.
7709         * expand/rust-macro-expand.h
7710         (MacroExpander::match_matcher): Likewise.
7711         * parse/rust-parse-impl.h
7712         (Parser::skip_token): Add zero argument method.
7713         * parse/rust-parse.h:
7714         (Parser::skip_token): Likewise.
7716 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7718         * Make-lang.in: remove files
7719         * backend/rust-compile-block.h: fix headers
7720         * backend/rust-compile-expr.h: likewise
7721         * backend/rust-compile-fnparam.h: likewise
7722         * backend/rust-compile-item.h: likewise
7723         * backend/rust-compile-pattern.h: likewise
7724         * backend/rust-compile-resolve-path.h: likewise
7725         * backend/rust-compile-stmt.h: likewise
7726         * typecheck/rust-autoderef.cc: likewise
7727         * typecheck/rust-hir-path-probe.cc: likewise
7728         * typecheck/rust-hir-path-probe.h: likewise
7729         * typecheck/rust-hir-trait-reference.h: likewise
7730         * typecheck/rust-hir-trait-resolve.cc: use a for loop instead
7731         * typecheck/rust-hir-trait-resolve.h: fix headers
7732         * typecheck/rust-hir-type-check-expr.h: likewise
7733         * typecheck/rust-hir-type-check-implitem.h: likewise
7734         * typecheck/rust-hir-type-check-item.h: likewise
7735         * typecheck/rust-hir-type-check-path.cc: likewise
7736         * typecheck/rust-hir-type-check-pattern.h: likewise
7737         * typecheck/rust-hir-type-check-stmt.h: likewise
7738         * typecheck/rust-hir-type-check-type.h: likewise
7739         * typecheck/rust-hir-type-check-util.cc: Removed.
7740         * typecheck/rust-hir-type-check-util.h: Removed.
7742 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7744         * Make-lang.in: Add new object files to Makefile.
7745         * expand/rust-expand-visitor.cc (is_derive): Move function.
7746         (is_builtin): Likewise.
7747         (get_traits_to_derive): New function.
7748         (derive_item): Likewise.
7749         (ExpandVisitor::visit): Visit item/statements containers.
7750         (ExpandVisitor::visit_outer_attrs): Take a reference on the attribute
7751         instead of a copy.
7752         (ExpandVisitor::is_derive): Deleted function.
7753         (ExpandVisitor::is_builtin): Likewise.
7754         * expand/rust-expand-visitor.h (RUST_EXPAND_VISITOR_H): Add missing #ifdef
7755         guards.
7756         (is_derive): Declare function.
7757         (is_builtin): Likewise.
7758         * expand/rust-macro-builtins.cc (builtin_macro_from_string): Use new
7759         MacroBuiltin::builtins map.
7760         (make_macro_path_str): Likewise.
7761         * expand/rust-macro-builtins.h (enum class): Add builtin derive macros.
7762         * expand/rust-derive-clone.cc: New file.
7763         * expand/rust-derive-clone.h: New file.
7764         * expand/rust-derive.cc: New file.
7765         * expand/rust-derive.h: New file.
7766         * util/rust-hir-map.cc (Mappings::insert_macro_def): Fix logic for
7767         setting builtin macro transcribers.
7769 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7771         * ast/rust-ast-builder.cc: New file.
7772         * ast/rust-ast-builder.h: New file.
7774 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7776         * expand/rust-macro-invoc-lexer.cc: Add missing copyright header.
7777         * expand/rust-macro-substitute-ctx.cc: Likewise.
7779 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7781         * rust-session-manager.h:
7782         Include "rust-optional.h".
7783         (struct TargetOptions):
7784         Store values in config key/value pairs as Optional<std::string> rather than std::string.
7785         * rust-session-manager.cc
7786         (TargetOptions::dump_target_options):
7787         Handle Optional<std::string> values.
7789 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7791         * typecheck/rust-casts.cc (TypeCastRules::check): do coercion
7792         (TypeCastRules::emit_cast_error): clang-format
7794 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7796         * resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): add name resolution
7797         * resolve/rust-ast-resolve-stmt.h: likewise
7798         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): insert resolved node
7800 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7802         * resolve/rust-ast-resolve-pattern.cc: remove unused
7804 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7806         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): fix missing pop
7808 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7810         * backend/rust-compile-expr.cc (CompileExpr::visit): remove unused
7812 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7814         * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::translate): hir lowering
7815         (ASTLoweringStmt::visit): likewise
7816         * hir/rust-ast-lower-stmt.h: likewise
7818 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7820         * expand/rust-macro-substitute-ctx.cc
7821         (SubstituteCtx::substitute_metavar): Allow substitution failure.
7822         (SubstituteCtx::substitute_token):
7823         Handle substitution failure, include dollar sign in count of tokens to substitute.
7824         (SubstituteCtx::substitute_tokens):
7825         Include dollar sign in count of tokens to substitute.
7826         * expand/rust-macro-substitute-ctx.h
7827         (SubstituteCtx::substitute_metavar):
7828         Adjust signature and document new substitution failure handling.
7830 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7832         * expand/rust-macro-substitute-ctx.cc
7833         (SubstituteCtx::check_repetition_amount):
7834         Ignore single fragments while checking repetition amount.
7836 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7838         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): stop if error
7839         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): fix sized options
7840         * typecheck/rust-tyty.cc (BaseType::satisfies_bound): its ok if its an ?T
7841         (BaseType::bounds_compatible): likewise
7842         * typecheck/rust-tyty.h: update prototype
7843         * typecheck/rust-unify.cc (UnifyRules::go): check both sides bounds
7845 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7847         * backend/rust-compile-expr.cc (HIRCompileBase::resolve_deref_adjustment):
7848         reuse op overload code
7849         * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): update
7850         (Adjuster::try_raw_deref_type): likewise
7851         * typecheck/rust-autoderef.h: likewise
7852         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
7853         improve debug loging
7855 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
7857         * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): refactor
7858         * backend/rust-compile-base.h: likewise
7859         * backend/rust-compile-expr.cc (CompileExpr::visit): likewise
7860         * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): likewise
7862 2024-01-16  David Malcolm  <dmalcolm@redhat.com>
7864         * typecheck/rust-hir-trait-reference.cc (TraitItemReference::is_optional): Remove
7865         stray semicolon.
7867 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7869         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::go): Cleanup
7870         order of calls when accumulating #[macro_use] macros.
7871         (EarlyNameResolver::visit): Likewise.
7873 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
7875         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::accumulate_escaped_macros):
7876         Remove unnecessary visit.
7878 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
7880         * ast/rust-ast.cc (Attribute::check_cfg_predicate):
7881         Only check first item as a predicate.
7883 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7885         * util/rust-optional.h
7886         (operator==): New for Optional<T> == Optional<U>.
7888 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7890         * parse/rust-parse-impl.h
7891         (Parser::parse_attr_input): Parse AttrInputMacro.
7893 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7895         * ast/rust-ast-collector.cc (TokenCollector::visit): Propagate
7896         coretype hint.
7898 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7900         * util/rust-optional.h
7901         (class Optional<T>): Improve inner state.
7903 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7905         * expand/rust-macro-substitute-ctx.cc
7906         (SubstituteCtx::check_repetition_amount): Handle keywords.
7907         (SubstituteCtx::substitute_token): Likewise.
7908         * lex/rust-token.cc
7909         (Token::get_str): Likewise.
7910         * parse/rust-parse-impl.h
7911         (Parser::parse_macro_match_fragment): Likewise.
7913 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
7915         * ast/rust-ast.h: Add `outer_attrs` to Item.
7916         * ast/rust-expr.h: Make use of new inheritance methods.
7917         * ast/rust-item.h: Likewise.
7918         * ast/rust-macro.h: Likewise.
7920 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7922         * util/rust-token-converter.cc (dispatch_float_literals): Remove
7923         function.
7924         (handle_suffix): Rename old dispatch and add one LitKind
7925         argument.
7926         (dispatch_integer_literals): Remove function.
7927         (convert): Change call from dispatch to suffix handler.
7929 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
7931         * lex/rust-token.h: Implement hash for token id enumeration.
7932         * util/rust-token-converter.cc (dispatch_float_literals): Update
7933         to new internals.
7934         (dispatch_integer_literals): Likewise.
7935         (convert): Likewise.
7936         (string_literal): Remove function.
7937         (byte_string_literal): Likewise.
7938         (unsigned_literal): Likewise.
7939         (signed_literal): Likewise.
7940         (from_literal): Update with new internals.
7942 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7944         * ast/rust-ast-dump.cc
7945         (Dump::visit): Add AttrInputMacro visitor.
7946         * ast/rust-ast-dump.h:
7947         (Dump::visit): Likewise.
7948         * ast/rust-ast-full-decls.h
7949         (class AttrInputMacro): New.
7950         * ast/rust-ast-collector.cc
7951         (TokenCollector::visit):
7952         Add and call out to AttrInputMacro visitor.
7953         * ast/rust-ast-collector.h:
7954         (TokenCollector::visit): Add AttrInputMacro visitor.
7955         * ast/rust-ast-visitor.h:
7956         (ASTVisitor::visit): Likewise.
7957         * ast/rust-ast.cc
7958         (AttrInputMacro::accept_vis): New.
7959         (AttrInputMacro::as_string): New.
7960         (AttrInputMacro::AttrInputMacro): New.
7961         (AttrInputMacro::operator=): New.
7962         * ast/rust-ast.h:
7963         (AttrInput::AttrInputType::MACRO): New.
7964         * ast/rust-expr.h
7965         (class AttrInputMacro): New.
7966         * checks/errors/rust-feature-gate.h:
7967         (FeatureGate::visit): Add AttrInputMacro visitor.
7968         * expand/rust-cfg-strip.cc
7969         (CfgStrip::visit): Likewise.
7970         * expand/rust-cfg-strip.h:
7971         (CfgStrip::visit): Likewise.
7972         * expand/rust-expand-visitor.cc
7973         (ExpandVisitor::visit): Likewise.
7974         * expand/rust-expand-visitor.h:
7975         (ExpandVisitor::visit): Likewise.
7976         * hir/rust-ast-lower-base.cc
7977         (ASTLoweringBase::visit): Likewise.
7978         * hir/rust-ast-lower-base.h:
7979         (ASTLoweringBase::visit): Likewise.
7980         * resolve/rust-ast-resolve-base.cc
7981         (ResolverBase::visit): Likewise.
7982         * resolve/rust-ast-resolve-base.h:
7983         (ResolverBase::visit): Likewise.
7984         * resolve/rust-early-name-resolver.cc
7985         (EarlyNameResolver::visit): Likewise.
7986         * resolve/rust-early-name-resolver.h:
7987         (EarlyNameResolver::visit): Likewise.
7988         * util/rust-attributes.cc
7989         (AttributeChecker::visit): Likewise.
7990         (check_doc_attribute): Handle AttrInputType::MACRO.
7991         * util/rust-attributes.h:
7992         (AttributeChecker::visit): Add AttrInputMacro visitor.
7994 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
7996         * ast/rust-macro.h
7997         (MacroInvocation::clone_macro_invocation_impl): Make public.
7999 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8001         * util/rust-optional.h
8002         (struct std::hash<Optional<T>>): New.
8004 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8006         * util/rust-optional.h
8007         (class Optional<T&>): Use pointers internally.
8009 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8011         * ast/rust-ast-dump.cc (Dump::visit): Implement dump for
8012         `TupleIndexExpr`.
8014 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8016         * lex/rust-token.cc
8017         (token_id_keyword_string): Return std::string reference.
8018         * lex/rust-token.h
8019         (token_id_keyword_string): Return std::string reference.
8021 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
8023         * ast/rust-ast.h (Expr::as_expr_without_block): Remove.
8024         (Expr::set_outer_attrs): Make public in base class.
8025         * expand/rust-macro-expand.cc:
8026         Add fixme comment for pre-existing bug.
8027         * hir/tree/rust-hir.h: Remove Expr::as_expr_without_block.
8028         * parse/rust-parse-impl.h (Parser::parse_lifetime): Use lifetime_from_token.
8029         (Parser::lifetime_from_token): New method.
8030         (Parser::null_denotation): Handle labelled loop expressions and for loop expressions.
8031         (Parser::parse_loop_label): Make initial token a parameter.
8032         (Parser::parse_labelled_loop_expr): Likewise.
8033         (Parser::parse_for_loop_expr): Allow FOR token to already be skipped.
8034         (Parser::parse_expr): Handle expr_can_be_stmt.
8035         (Parser::parse_expr_with_block): Remove.
8036         (Parser::parse_expr_stmt_with_block): Remove.
8037         (Parser::parse_expr_stmt_without_block): Remove.
8038         (Parser::parse_expr_without_block): Remove.
8039         (Parser::parse_stmt_or_expr_with_block): Remove.
8040         (Parser::parse_expr_stmt): Use parse_expr directly.
8041         (Parser::parse_match_expr): Likewise.
8042         (Parser::parse_stmt): Use parse_expr_stmt in more cases.
8043         (Parser::parse_stmt_or_expr):
8044         Rename from parse_stmt_or_expr_without_block, use parse_expr directly.
8045         (Parser::parse_block_expr): Update error message.
8046         * parse/rust-parse.h: Update declarations.
8048 2024-01-16  Matthew Jasper  <mjjasper1@gmail.com>
8050         * ast/rust-ast-full-decls.h (class ExprStmtWithoutBlock): Remove.
8051         (class ExprStmtWithBlock): Remove.
8052         * ast/rust-stmt.h (class ExprStmtWithoutBlock): Remove.
8053         (class ExprStmtWithBlock): Remove.
8054         (class ExprStmt):
8055         Make non-abstract, add common functionality from removed base classes.
8056         * ast/rust-ast.h: Move to_stmt to base class.
8057         * ast/rust-ast.cc (ExprStmtWithBlock::as_string): Remove.
8058         * ast/rust-macro.h: Use new signature for to_stmt.
8059         (ExprStmt::as_string): New method.
8060         (ExprStmtWithoutBlock::as_string): Remove.
8061         (BlockExpr::strip_tail_expr): Update for removed classes.
8062         (ExprStmtWithoutBlock::accept_vis): Remove.
8063         (ExprStmtWithBlock::accept_vis): Remove.
8064         (ExprStmt::accept_vis): New method.
8065         * ast/rust-ast-dump.cc (Dump::visit): Update for removed classes.
8066         * ast/rust-ast-dump.h: Likewise.
8067         * ast/rust-ast-collector.h: Likewise.
8068         * ast/rust-ast-collector.cc (TokenStream::visit): Likewise.
8069         * ast/rust-ast-visitor.h: Likewise.
8070         * checks/errors/rust-feature-gate.h: Likewise.
8071         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise.
8072         * expand/rust-expand-visitor.h: Likewise.
8073         * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise.
8074         * expand/rust-cfg-strip.h: Likewise.
8075         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
8076         * hir/rust-ast-lower-base.h: Likewise.
8077         * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
8078         * hir/rust-ast-lower-stmt.h: Likewise.
8079         * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
8080         * util/rust-attributes.h: Likewise.
8081         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
8082         * resolve/rust-ast-resolve-base.h: Likewise.
8083         * resolve/rust-ast-resolve-stmt.h: Likewise.
8084         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
8085         Likewise.
8086         * resolve/rust-early-name-resolver.h: Likewise.
8087         * parse/rust-parse-impl.h (Parser::parse_match_expr): Likewise.
8088         (Parser::parse_stmt_or_expr_without_block): Likewise.
8089         * parse/rust-parse.h: Likewise.
8091 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8093         * lex/rust-token.cc
8094         (token_id_is_keyword): New.
8095         (token_id_keyword_string): New.
8096         * lex/rust-token.h
8097         (token_id_is_keyword): New.
8098         (token_id_keyword_string): New.
8099         * expand/rust-macro-expand.cc
8100         (MacroExpander::match_fragment): Match keywords for ident fragment.
8101         * parse/rust-parse-impl.h
8102         (Parser::parse_identifier_or_keyword_token): Add.
8103         * parse/rust-parse.h
8104         (Parser::parse_identifier_or_keyword_token): Add.
8106 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8108         * util/rust-token-converter.cc (dispatch_float_literals): Invert
8109         suffix condition.
8110         (dispatch_integer_literals): Likewise.
8112 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8114         * util/rust-token-converter.cc (convert): Fix style.
8115         (from_ident): Likewise.
8117 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8119         * util/rust-token-converter.cc (dispatch_float_literals): Make
8120         input immutable.
8121         (dispatch_integer_literals): Likewise.
8122         (convert): Likewise.
8123         * util/rust-token-converter.h (convert): Likewise.
8125 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8127         * util/rust-token-converter.cc (from_tokenstream): Add
8128         conversion of Ident structures.
8129         (from_ident): Likewise.
8131 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8133         * util/rust-token-converter.cc (from_literal): Add function
8134         implementation.
8135         (string_literal): String literal specific handler.
8136         (byte_string_literal): Byte string specific handler.
8137         (unsigned_literal): Unsigned literal specific handler.
8138         (signed_literal): Signed literal specific handler.
8140 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8142         * util/rust-token-converter.cc (from_punct): Add conversion
8143         implementation.
8145 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8147         * util/rust-token-converter.cc (dispatch_float_literals): Accept
8148         const_TokenPtr instead of TokenPtr.
8149         (dispatch_integer_literals): Likewise.
8150         (convert): Accept vector of const_TokenPtr instead of a vector
8151         of TokenPtr.
8152         * util/rust-token-converter.h (convert): Likewise.
8154 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8156         * util/rust-token-converter.cc (from_tokenstream): Add vector
8157         for joined punct accumulation.
8158         (from_ident): Accept const pointer vector.
8159         (from_literal): Likewise.
8160         (from_punct): Likewise.
8161         (from_group): Likewise.
8162         (from_tokentree): Likewise.
8163         (convert): Likewise.
8164         * util/rust-token-converter.h (convert): Likewise.
8166 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8168         * util/rust-token-converter.cc (from_tokenstream): Add call to
8169         from_tokentree.
8170         (from_tokentree): Add implementation, from the from_tokenstream
8171         function.
8173 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8175         * util/rust-token-converter.cc (from_punct): Add group
8176         conversion.
8177         (from_group): Likewise.
8179 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8181         * util/rust-token-converter.cc (to_tokenstream): Change function
8182         name from to_tokenstream to convert.
8183         (convert): Likewise.
8184         (from_tokenstream): Add tokenstream handler.
8185         (from_ident): Add empty function.
8186         (from_literal): Likewise.
8187         (from_punct): Likewise.
8188         (from_group): Likewise.
8189         * util/rust-token-converter.h (to_tokenstream): Change function
8190         name from to_tokenstream to convert.
8191         (convert): Likewise.
8193 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8195         * util/rust-token-converter.cc (dispatch_float_literals): Remove
8196         suffixed temporary variable.
8197         (dispatch_integer_literals): Likewise.
8199 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8201         * Make-lang.in: Add new rust-token-converter file.
8202         * ast/rust-ast-collector.cc (pop_group): Function moved from
8203         TokenCollector.
8204         (dispatch_float_literals): Likewise.
8205         (dispatch_integer_literals): Likewise.
8206         (TokenCollector::collect): Removed function.
8207         * ast/rust-ast-collector.h: Removed function prototype.
8208         * util/rust-token-converter.cc: New file.
8209         * util/rust-token-converter.h: New file.
8211 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8213         * ast/rust-ast-collector.h (RUST_AST_TOKENSTREAM_H): Rename
8214         headerguard from RUST_AST_TOKENSTREAM_H ...
8215         (RUST_AST_COLLECTOR_H): ... to RUST_AST_COLLECTOR_H.
8217 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8219         * Make-lang.in: Change file name.
8220         * ast/rust-ast-tokenstream.cc: Moved to...
8221         * ast/rust-ast-collector.cc: ...here.
8222         * ast/rust-ast-tokenstream.h: Moved to...
8223         * ast/rust-ast-collector.h: ...here.
8224         * rust-session-manager.cc: Change header name.
8226 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8228         * ast/rust-ast-tokenstream.cc (TokenStream::TokenStream): Rename
8229         TokenStream to TokenCollector.
8230         (TokenCollector::TokenCollector): Likewise.
8231         (TokenStream::collect_tokens): Likewise.
8232         (TokenCollector::collect_tokens): Likewise.
8233         (TokenStream::collect): Likewise.
8234         (TokenCollector::collect): Likewise.
8235         (TokenStream::visit): Likewise.
8236         (TokenCollector::visit): Likewise.
8237         (TokenStream::visit_items_joined_by_separator): Likewise.
8238         (TokenCollector::visit_items_joined_by_separator): Likewise.
8239         (TokenStream::visit_as_line): Likewise.
8240         (TokenCollector::visit_as_line): Likewise.
8241         (TokenStream::visit_items_as_lines): Likewise.
8242         (TokenCollector::visit_items_as_lines): Likewise.
8243         (TokenStream::visit_items_as_block): Likewise.
8244         (TokenCollector::visit_items_as_block): Likewise.
8245         (TokenStream::trailing_comma): Likewise.
8246         (TokenCollector::trailing_comma): Likewise.
8247         (TokenStream::newline): Likewise.
8248         (TokenCollector::newline): Likewise.
8249         (TokenStream::indentation): Likewise.
8250         (TokenCollector::indentation): Likewise.
8251         (TokenStream::increment_indentation): Likewise.
8252         (TokenCollector::increment_indentation): Likewise.
8253         (TokenStream::decrement_indentation): Likewise.
8254         (TokenCollector::decrement_indentation): Likewise.
8255         (TokenStream::visit_closure_common): Likewise.
8256         (TokenCollector::visit_closure_common): Likewise.
8257         (TokenStream::visit_loop_common): Likewise.
8258         (TokenCollector::visit_loop_common): Likewise.
8259         (TokenStream::visit_function_common): Likewise.
8260         (TokenCollector::visit_function_common): Likewise.
8261         * ast/rust-ast-tokenstream.h (class TokenStream): Likewise.
8262         (class TokenCollector): Likewise.
8263         * rust-session-manager.cc (Session::dump_tokenstream): Rename
8264         token vector for clearer intent.
8266 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8268         * ast/rust-ast-tokenstream.cc (dispatch_float_literals): Add
8269         dispatch function for floating point literals.
8270         (TokenStream::collect): Add call to dispatcher.
8272 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8274         * ast/rust-ast-tokenstream.cc (dispatch_integer_literals):
8275         Add a static function to dispatch depending on the core type.
8276         (TokenStream::collect): Add call to dispatch function.
8278 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8280         * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add
8281         conversion for byte string and string.
8283 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8285         * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add Ident
8286         conversion.
8288 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8290         * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add joint
8291         punct token conversion.
8293 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8295         * ast/rust-ast-tokenstream.cc (TokenStream::collect): Add
8296         conversion for single punctuation tokens.
8298 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8300         * ast/rust-ast-tokenstream.cc (pop_group): Add a function to
8301         easily collect a group from a given stack at the end of it.
8302         (TokenStream::collect): Collect tokens as a rust compatible
8303         Tokenstream type.
8304         * ast/rust-ast-tokenstream.h (RUST_AST_TOKENSTREAM_H): Move
8305         includes to stay constrained by guards.
8307 2024-01-16  M V V S Manoj Kumar  <mvvsmanojkumar@gmail.com>
8309         * ast/rust-ast-full-decls.h (enum class): Added declaration.
8310         (struct AnonConst): Added declaration.
8311         (struct InlineAsmRegOrRegClass): Added declaration.
8312         (struct InlineAsmOperand): Added declaration.
8313         (struct InlineAsmPlaceHolder): Added declaration.
8314         (struct InlineAsmTemplatePiece): Added declaration.
8315         (struct TupleClobber): Added declaration.
8316         (struct TupleTemplateStr): Added declaration.
8317         * ast/rust-expr.h (class InlineAsm): Defined all it's data members outside.
8318         (enum class InlineAsmOptions): Converted this to a enum class so we could use it in the HIR.
8319         (struct AnonConst): Defined it independent of the AST::InlineAsm node.
8320         (struct InlineAsmRegOrRegClass): Defined it independent of the AST::InlineAsm node.
8321         (struct InlineAsmOperand): Defined it independent of the AST::InlineAsm node.
8322         (struct InlineAsmPlaceHolder): Defined it independent of the AST::InlineAsm node.
8323         (struct InlineAsmTemplatePiece): Defined it independent of the AST::InlineAsm node.
8324         (struct TupleClobber): Defined it independent of the AST::InlineAsm node.
8325         (struct TupleTemplateStr): Defined it independent of the AST::InlineAsm node.
8326         * hir/tree/rust-hir-expr.h (class InlineAsmReg): Added defination.
8327         (class InlineAsmRegClass): Added defination.
8328         (struct InlineAsmRegOrRegClass): Added defination.
8329         (class InlineAsm): Added defination.
8330         * hir/tree/rust-hir-full-decls.h (class InlineAsmReg): Added declaration.
8331         (class InlineAsmRegClass): Added declaration.
8332         (struct InlineAsmRegOrRegClass): Added declaration.
8333         (class InlineAsm): Added declaration.
8335 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8337         * backend/rust-compile-base.cc: track return type in fncontext
8338         * backend/rust-compile-context.h (struct fncontext): likewise
8339         * backend/rust-compile-expr.cc (CompileExpr::visit): apply coercion site
8340         (CompileExpr::generate_closure_function): update push_context
8341         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
8343 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8345         * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body):
8346         add missing coercion_site codegen
8348 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8350         * backend/rust-compile-expr.cc (CompileExpr::visit): refactr
8351         (CompileExpr::get_fn_addr_from_dyn): likewise
8352         (CompileExpr::get_receiver_from_dyn): likewise
8353         (CompileExpr::type_cast_expression): likewise
8354         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): likewise
8355         (TyTyResolveCompile::create_dyn_obj_record): likewise
8356         (TyTyResolveCompile::create_slice_type_record): likewise
8357         (TyTyResolveCompile::create_str_type_record): likewise
8358         * backend/rust-compile-type.h: likewise
8359         * backend/rust-compile.cc (HIRCompileBase::coercion_site1): likewise
8360         (HIRCompileBase::coerce_to_dyn_object): refactor
8361         * backend/rust-tree.h (SLICE_FLAG): removed
8362         (SLICE_TYPE_P): removed
8363         (RS_DST_FLAG): new flag
8364         (RS_DST_FLAG_P): new predicate
8365         * typecheck/rust-tyty.cc (ReferenceType::is_dyn_object): new helper
8366         (ReferenceType::is_dyn_obj_type): likewise
8367         (PointerType::is_dyn_object): likewise
8368         (PointerType::is_dyn_obj_type): likewise
8369         * typecheck/rust-tyty.h (class DynamicObjectType): moved up
8371 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8373         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): add filter
8375 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8377         * backend/rust-compile-base.cc (HIRCompileBase::compile_function_body): use unit_expression
8378         (HIRCompileBase::unit_expression): new helper
8379         * backend/rust-compile-base.h: update prototype
8380         * backend/rust-compile-block.cc (CompileBlock::visit): use unit_expression
8381         * backend/rust-compile-expr.cc (CompileExpr::visit): likewise
8382         (CompileExpr::generate_closure_function): likewise
8383         * backend/rust-compile-implitem.cc (CompileTraitItem::visit): cleanup
8384         * backend/rust-compile-item.cc (CompileItem::visit): likewise
8385         * backend/rust-compile-pattern.cc (CompilePatternLet::visit): likewise
8386         * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): likewise
8387         * backend/rust-compile-type.cc (TyTyResolveCompile::get_unit_type): new helper
8388         (TyTyResolveCompile::visit): use new unit_type helper
8389         * backend/rust-compile-type.h: likewise
8390         * rust-backend.h: simplify the return_expression
8391         * rust-gcc.cc (Gcc_backend::function_type): likewise
8392         (Gcc_backend::return_statement): likewise
8393         * backend/rust-constexpr.cc (eval_constant_expression): remove bad assertion
8395 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8397         * checks/lints/rust-lint-unused-var.cc (UnusedVariables::Lint): use the decl not the expr
8399 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8401         * parse/rust-parse-impl.h
8402         (Parser::parse_trait_impl_function_or_method):
8403         Parse function/method qualifiers after "default".
8405 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8407         * backend/rust-compile-base.cc: add missing compile_locals call
8409 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8411         * ast/rust-ast.h (class AttrInputMetaItemContainer): Run clang-format.
8412         (class DelimTokenTree): Likewise.
8414 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8416         * resolve/rust-early-name-resolver.cc (is_macro_use_module): New function.
8417         (EarlyNameResolver::accumulate_escaped_macros): New function.
8418         (EarlyNameResolver::go): Use `accumulate_escaped_macros`.
8419         (EarlyNameResolver::visit): Likewise.
8420         * resolve/rust-early-name-resolver.h: Declare `accumulate_escaped_macros`.
8422 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8424         * ast/rust-ast.h: Add take_items() and set_items() method to Crate.
8425         * ast/rust-item.h: Add take_items() and set_items() method to Module.
8427 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8429         * ast/rust-ast.h (enum Kind): Add MODULE variant.
8430         * ast/rust-item.h: Return Kind::MODULE in AST::Module::get_kind().
8432 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8434         * ast/rust-macro.cc (builtin_macro_from_string): Move function.
8435         * ast/rust-macro.h (enum class): Move enum.
8436         (builtin_macro_from_string): Move function.
8437         * expand/rust-macro-builtins.cc (builtin_macro_from_string): New function.
8438         (make_macro_path_str): Use new bi-map.
8439         (parse_single_string_literal): Use new `BuiltinMacro` enum.
8440         (MacroBuiltin::include_bytes_handler): Likewise.
8441         (MacroBuiltin::include_str_handler): Likewise.
8442         (MacroBuiltin::compile_error_handler): Likewise.
8443         (MacroBuiltin::concat_handler): Likewise.
8444         (MacroBuiltin::env_handler): Likewise.
8445         (MacroBuiltin::include_handler): Likewise.
8446         (MacroBuiltin::sorry): New function.
8447         * expand/rust-macro-builtins.h (enum class): Move enum here.
8448         (builtin_macro_from_string): New function declaration.
8449         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Use
8450         new function.
8451         * util/rust-hir-map.cc (Mappings::insert_macro_def): Remove old
8452         builtin macro map.
8454 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8456         * expand/rust-macro-builtins.cc: Include bidirectional map.
8457         * util/bi-map.h: New file.
8459 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8461         * ast/rust-ast.cc
8462         (BlockExpr::strip_tail_expr):
8463         Try to take new tail expression from statements list.
8464         * ast/rust-expr.h
8465         (BlockExpr::strip_tail_expr):
8466         Replace definition with only declaration.
8468 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8470         * ast/rust-ast.h
8471         (Stmt::is_expr): New.
8472         * ast/rust-stmt.h
8473         (ExprStmt::is_expr): New.
8475 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8477         * expand/rust-macro-substitute-ctx.cc
8478         (SubstituteCtx::substitute_repetition): Fix out-of-bounds.
8480 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8482         * Make-lang.in: Link against the static libproc_macro.
8484 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8486         * lang.opt: Add frust-extern option.
8487         * rust-session-manager.cc (Session::handle_extern_option): Add
8488         frust-extern option handler.
8489         * rust-session-manager.h (struct Session): Add an unordered map
8490         to store library name and locations.
8492 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8494         * parse/rust-parse-impl.h
8495         (Parser::parse_generic_params):
8496         Handle parameter parsing error.
8498 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8500         * typecheck/rust-hir-type-check-expr.cc: update for op overload
8502 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8504         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): use the predicate
8505         (TypeCheckExpr::resolve_segments): cleanup
8507 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8509         * typecheck/rust-hir-trait-reference.cc (AssociatedImplTrait::AssociatedImplTrait):
8510         bind the predicate
8511         (AssociatedImplTrait::get_trait): remove
8512         (AssociatedImplTrait::get_predicate): new getter
8513         * typecheck/rust-hir-trait-reference.h: bind predicate
8514         * typecheck/rust-hir-type-check-item.cc: update ctor
8515         * typecheck/rust-type-util.cc (lookup_associated_impl_block): new function
8516         * typecheck/rust-type-util.h (class BaseType): remove unused forward decl
8517         (lookup_associated_impl_block): new helper
8518         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::is_equal): new
8519         * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl): use new helper
8520         (SubstitutionRef::monomorphize): update usage/error handling
8521         * typecheck/rust-tyty-subst.h: remove old prototype
8522         * typecheck/rust-tyty.h: add is_equal decl
8524 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8526         * typecheck/rust-hir-type-check-pattern.cc
8527         (TypeCheckPattern::visit): Type check StructPatternFieldIdentPat.
8529 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8531         * hir/rust-ast-lower-pattern.cc
8532         (ASTLoweringPattern::visit): Lower StructPatternFieldIdentPat.
8534 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8536         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_fn_trait_call):
8537         return the assoicated predicate
8538         * typecheck/rust-hir-type-check-expr.h: update prototype
8540 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8542         * hir/rust-ast-lower-implitem.h: add missing where clause lowering
8544 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8546         * hir/tree/rust-hir-item.h: add get_locus() const
8548 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8550         * hir/tree/rust-hir-pattern.h
8551         (StructPatternFieldIdentPat::get_identifier): New.
8552         (StructPatternFieldIdentPat::get_pattern): New.
8554 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
8556         * ast/rust-ast-dump.cc (Dump::visit): print parentheses around
8557         unique expression operand.
8559 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8561         * rust-session-manager.cc
8562         (Session::enable_dump): Fix error messages.
8564 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8566         * typecheck/rust-unify.cc (UnifyRules::emit_abi_mismatch): new error method
8567         (UnifyRules::expect_fndef): add ABI check
8568         * typecheck/rust-unify.h: prototype for new error method
8570 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8572         * util/rust-abi.cc (get_abi_from_string): add ABI mapping
8574 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8576         * hir/tree/rust-hir-pattern.h: add missing get_mutability
8577         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
8578         use new ClosureParamInfer on untyped parameters
8579         * typecheck/rust-hir-type-check-pattern.cc (ClosureParamInfer::Resolve): interface
8580         (ClosureParamInfer::ClosureParamInfer): constructor
8581         (ClosureParamInfer::visit): visitors for each pattern
8582         * typecheck/rust-hir-type-check-pattern.h (class ClosureParamInfer): new visitor
8584 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8586         * typecheck/rust-hir-type-check-pattern.h: cleanup
8588 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8590         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
8591         return so we dont hit undefined behaviour
8593 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8595         * backend/rust-compile-implitem.h: remove includes
8597 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8599         * backend/rust-compile-item.cc (CompileItem::visit): remove bad checks
8601 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8603         * lang.opt: add lang option flag
8604         * rust-lang.cc (grs_langhook_init_options_struct): enable by default
8606 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8608         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::operator=):
8609         we are done if other is in an error state
8611 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8613         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): verify it is a method
8615 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8617         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): use new interface
8618         * typecheck/rust-hir-type-check-base.h: update prototype to include Self
8619         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): lifewise
8620         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
8621         likewise
8622         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): likewise
8623         (TypeCheckExpr::resolve_segments): likewise
8624         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
8625         (TypeResolveGenericParam::visit): likewise
8626         (ResolveWhereClauseItem::visit): likewise
8627         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
8628         (TypeBoundPredicate::apply_generic_arguments): likewise
8629         (TypeBoundsMappings::lookup_predicate): likewise
8630         * typecheck/rust-tyty-bounds.h: likewise
8631         * typecheck/rust-tyty.h:likewise
8633 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8635         * typecheck/rust-hir-type-check.h: New error state and missing copy implementations
8636         * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::TypeCheckContextItem):
8637         missing copy ctor
8638         (TypeCheckContextItem::operator=): missing copy implementation
8639         (TypeCheckContextItem::get_error): new static function
8640         (TypeCheckContextItem::is_error): new method
8641         (TypeCheckContextItem::get_context_type): handle error state
8642         (TypeCheckContextItem::get_defid): handle error state
8644 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8646         * typecheck/rust-hir-type-check.h: new helper
8647         * typecheck/rust-typecheck-context.cc (TypeCheckContext::have_function_context):
8648         implementation
8650 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8652         * typecheck/rust-hir-type-check.h: Add prototype
8653         * typecheck/rust-typecheck-context.cc (TypeCheckContextItem::get_defid): implementation
8655 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8657         * typecheck/rust-hir-type-check-expr.cc: refactor
8659 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
8661         * typecheck/rust-autoderef.cc: don't take a reference
8662         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
8663         * typecheck/rust-hir-type-check.h: remove reference
8664         * typecheck/rust-typecheck-context.cc (TypeCheckContext::pop_return_type): likewise
8666 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8668         * resolve/rust-ast-resolve-pattern.cc
8669         (PatternDeclaration::visit): Handle StructPatternFieldIdentPat.
8671 2024-01-16  TieWay59  <tieway59@foxmail.com>
8673         PR translation/108890
8674         * lang.opt: Fix translation mistakes 2023 in
8675         GCC/Rust [PR108890]
8676         (line 67): change the inconsistent tab to spaces
8677         (line 75): wrap bare placeholder `integer`
8678         (line 79): remove redundant text of `Choose which`
8679         (line 96): remove redundant text of `Choose which`
8680         (line 112): remove redundant `Flag to`
8681         (line 124): correct the exclusive term `When to stop`
8682         (line 124): correct typo of `copimlation`
8684 2024-01-16  M V V S Manoj Kumar  <mvvsmanojkumar@gmail.com>
8686         * parse/rust-parse-impl.h (Parser::debug_dump_ast_output): Removed this funtion.
8687         * rust-session-manager.cc (Session::enable_dump): Removed else if (arg == "parse").
8688         (Session::compile_crate): Removed calls of dump_ast and dump_ast_expanded.
8689         (Session::dump_ast): Removed this function.
8690         (Session::dump_ast_expanded): Removed this function.
8691         * rust-session-manager.h (struct CompileOptions): Removed the PARSER_AST_DUMP option.
8693 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
8695         * parse/rust-parse-impl.h (Parser::parse_reference_pattern): Do not
8696         call into `parse_pattern` anymore.
8698 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8700         * hir/rust-ast-lower-pattern.cc
8701         (ASTLoweringPattern::translate): Add is_let_top_level parameter.
8702         (ASTLoweringPattern::visit): Handle is_let_top_level.
8703         * hir/rust-ast-lower-pattern.h
8704         (class ASTLoweringPattern): Add is_let_top_level.
8705         * hir/rust-ast-lower-stmt.cc
8706         (ASTLoweringStmt::visit): Set is_let_top_level.
8708 2024-01-16  Zheyuan Chen  <sephirotheca17@gmail.com>
8710         * ast/rust-ast-dump.cc: fix bad formatting for associated type.
8712 2024-01-16  Sergey Bugaev  <bugaevc@gmail.com>
8714         * hir/rust-ast-lower-expr.h, hir/rust-ast-lower-expr.cc:
8715         Lower AST::ErrorPropagationExpr to HIR::ErrorPropagationExpr
8717 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8719         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix scope
8720         resolution token output.
8722 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8724         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Keep
8725         associated type.
8727 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8729         * ast/rust-ast-tokenstream.cc (TokenStream::visit_function_common):
8730         Fix function body output.
8732 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8734         * parse/rust-parse-impl.h (Parser::parse_outer_attribute): Fix
8735         attribute status.
8737 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8739         * lex/rust-token.cc (Token::as_string): Fix lifetime string
8740         representation.
8742 2024-01-16  Sergey Bugaev  <bugaevc@gmail.com>
8744         * resolve/rust-ast-resolve-expr.cc: Add "break rust" Easter egg
8746 2024-01-16  Sergey Bugaev  <bugaevc@gmail.com>
8748         * resolve/rust-ast-resolve-expr.h,
8749         resolve/rust-ast-resolve-expr.cc: Add ResolveExpr::funny_error
8751 2024-01-16  Sergey Bugaev  <bugaevc@gmail.com>
8753         * ast/rust-ast.h: Add AST::Kind::IDENTIFIER
8755 2024-01-16  Sergey Bugaev  <bugaevc@gmail.com>
8757         * ast/rust-ast.h (Kind): Convert into a C++ enum class
8758         * expand/rust-macro-builtins.cc: Adapt to the change
8760 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8762         * typecheck/rust-hir-type-check-expr.cc
8763         (TypeCheckExpr::visit): Add implementation for IfLetExprConseqElse.
8764         * typecheck/rust-hir-type-check-expr.h:
8765         (TypeCheckExpr::visit): Remove stub implementation for IfLetExprConseqElse.
8766         * hir/rust-ast-lower-expr.cc
8767         (ASTLoweringExpr::visit): Lower IfLetExpr{,ConseqElse}.
8768         * hir/rust-ast-lower-expr.h:
8769         (ASTLoweringExpr::visit): Likewise.
8770         * hir/rust-ast-lower-block.h
8771         (ASTLoweringIfLetBlock::visit): Lower IfLetExprConseqElse.
8772         (ASTLoweringExprWithBlock::visit): Likewise.
8773         * hir/rust-ast-lower.cc
8774         (ASTLoweringIfLetBlock::visit): Lower IfLetExprConseqElse.
8775         * hir/tree/rust-hir-expr.h
8776         (IfLetExprConseqElse::IfLetExprConseqElse): Make constructor more general.
8777         (IfLetExprConseqElse::vis_else_block): Add.
8778         (IfLetExprConseqElse::get_else_block): Add.
8779         * resolve/rust-ast-resolve-expr.cc
8780         (ResolveExpr::visit): Add IfLetExprConseqElse visitor.
8781         * resolve/rust-ast-resolve-expr.h
8782         (ResolveExpr::visit): Add IfLetExprConseqElse visitor.
8784 2024-01-16  Sebastian Kirmayer  <gnu@kirmayer.eu>
8786         * parse/rust-parse-impl.h
8787         (Parser<ManagedTokenSource>::parse_macro_match_repetition):
8788         reject separator in `?` repetition
8790 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8792         * ast/rust-expr.h
8793         (class IfLetExprConseqElse): Make else_block ExprWithBlock.
8794         (class IfLetExprConseqIf): Remove.
8795         (class IfLetExprConseqIfLet): Remove.
8796         * ast/rust-ast-full-decls.h
8797         (class IfLetExprConseqIf): Remove.
8798         (class IfLetExprConseqIfLet): Remove.
8799         * ast/rust-ast.cc
8800         (IfLetExprConseqElse::as_string): Adjust output.
8801         (IfLetExprConseqIf::as_string): Remove.
8802         (IfLetExprConseqIfLet::as_string): Remove.
8803         (IfLetExprConseqIf::accept_vis): Remove.
8804         (IfLetExprConseqIfLet::accept_vis): Remove.
8805         * ast/rust-ast-visitor.h
8806         (ASTVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
8807         * ast/rust-ast-dump.cc
8808         (Dump::visit): Likewise.
8809         * ast/rust-ast-dump.h:
8810         (Dump::visit): Likewise.
8811         * ast/rust-ast-tokenstream.cc
8812         (TokenStream::visit): Likewise.
8813         * ast/rust-ast-tokenstream.h
8814         (TokenStream::visit): Likewise.
8815         * util/rust-attributes.cc
8816         (AttributeChecker::visit): Likewise.
8817         * util/rust-attributes.h:
8818         (AttributeChecker::visit): Likewise.
8819         * resolve/rust-early-name-resolver.cc
8820         (EarlyNameResolver::visit): Likewise.
8821         * resolve/rust-early-name-resolver.h
8822         (EarlyNameResolver::visit): Likewise.
8823         * resolve/rust-ast-resolve-base.h
8824         (ResolverBase::visit): Likewise.
8825         * resolve/rust-ast-resolve-base.cc
8826         (ResolverBase::visit): Likewise.
8827         * checks/errors/rust-feature-gate.h
8828         (FeatureGate::visit): Likewise.
8829         * expand/rust-cfg-strip.cc
8830         (CfgStrip::visit): Likewise.
8831         * expand/rust-cfg-strip.h:
8832         (CfgStrip::visit): Likewise.
8833         * expand/rust-expand-visitor.cc
8834         (ExpandVisitor::visit): Likewise.
8835         * expand/rust-expand-visitor.h
8836         (ExpandVisitor::visit): Likewise.
8837         * hir/rust-ast-lower-base.cc
8838         (ASTLoweringBase::visit): Likewise.
8839         * hir/rust-ast-lower-base.h:
8840         (ASTLoweringBase::visit): Likewise.
8841         * parse/rust-parse-impl.h
8842         (Parser::parse_if_let_expr): Replace IfLetExprConseqIf{,Let} with IfLetExprConseqElse.
8844 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
8846         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add struct
8847         name and curly braces to output tokenstream.
8849 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8851         * parse/rust-parse-impl.h
8852         (Parser::parse_macro_match): Handle underscore.
8854 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8856         * hir/tree/rust-hir-full-decls.h
8857         (class ExprStmtWithoutBlock): Remove.
8858         (class ExprStmtWithBlock): Remove.
8859         * hir/tree/rust-hir-stmt.h
8860         (class ExprStmt):
8861         Add remaining ExprStmtWith{,out}Block functionality.
8862         (class ExprStmtWithoutBlock): Remove.
8863         (class ExprStmtWithBlock): Remove.
8864         * hir/rust-ast-lower-stmt.cc
8865         (ASTLoweringStmt::visit):
8866         Lower to HIR::ExprStmt instead of deriving class.
8868 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8870         * backend/rust-compile-stmt.cc
8871         (CompileStmt::visit): Unify ExprStmtWith{,out}Block visitors.
8872         * backend/rust-compile-stmt.h
8873         (CompileStmt::visit): Likewise.
8874         * backend/rust-compile-item.h
8875         (CompileItem::visit): Likewise.
8876         * hir/rust-hir-dump.cc
8877         (Dump::visit): Likewise.
8878         * hir/rust-hir-dump.h
8879         (Dump::visit): Likewise.
8880         * hir/tree/rust-hir-stmt.h
8881         (ExprStmt::accept_vis): Add.
8882         (ExprStmtWithoutBlock::accept_vis): Remove.
8883         (ExprStmtWithBlock::accept_vis): Remove.
8884         * hir/tree/rust-hir.cc
8885         (ExprStmt::accept_vis): Add.
8886         (ExprStmtWithoutBlock::accept_vis): Remove.
8887         (ExprStmtWithBlock::accept_vis): Remove.
8888         * hir/tree/rust-hir-visitor.h
8889         (HIRFullVisitor::visit): Likewise.
8890         (HIRFullVisitorBase::visit): Likewise.
8891         (HIRStmtVisitor::visit): Likewise.
8892         * checks/errors/rust-const-checker.cc
8893         (ConstChecker::visit): Likewise.
8894         * checks/errors/rust-const-checker.h
8895         (ConstChecker::visit): Likewise.
8896         * checks/errors/rust-unsafe-checker.cc
8897         (UnsafeChecker::visit): Likewise.
8898         * checks/errors/rust-unsafe-checker.h
8899         (UnsafeChecker::visit): Likewise.
8900         * checks/errors/privacy/rust-privacy-reporter.cc
8901         (PrivacyReporter::visit): Likewise.
8902         * checks/errors/privacy/rust-privacy-reporter.h
8903         (PrivacyReporter::visit): Likewise.
8904         * checks/lints/rust-lint-marklive.h
8905         (MarkLive::visit): Likewise.
8906         * typecheck/rust-hir-type-check-stmt.cc
8907         (TypeCheckStmt::visit): Likewise.
8908         * typecheck/rust-hir-type-check-stmt.h
8909         (TypeCheckStmt::visit): Likewise.
8910         * typecheck/rust-tycheck-dump.h
8911         (TypeResolverDump::visit): Likewise.
8913 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8915         * hir/tree/rust-hir-stmt.h
8916         (ExprStmt::expr): Add field.
8917         (ExprStmt::get_expr): Add method.
8918         (ExprStmt::ExprStmt): Add copy/move constructors, modify existing constructor.
8919         (ExprStmt::operator=): Add assignment operator.
8920         (ExprStmtWithoutBlock::expr): Remove field.
8921         (ExprStmtWithoutBlock::get_expr): Remove method.
8922         (ExprStmtWithoutBlock::ExprStmt):
8923         Remove copy/move constructors, modify existing constructor.
8924         (ExprStmtWithoutBlock::operator=): Remove assignment operator.
8925         (ExprStmtWithBlock::expr): Remove field.
8926         (ExprStmtWithBlock::get_expr): Remove method.
8927         (ExprStmtWithBlock::ExprStmt): Remove copy/move constructors, modify existing constructor.
8928         (ExprStmtWithBlock::operator=): Remove assignment operator.
8929         (ExprStmt::as_string): Add method.
8930         (ExprStmtWithBlock::as_string): Remove method.
8931         (ExprStmtWithoutBlock::as_string): Remove method.
8932         * hir/tree/rust-hir.cc
8933         (ExprStmt::as_string): Add method.
8934         (ExprStmtWithBlock::as_string): Remove method.
8935         (ExprStmtWithoutBlock::as_string): Remove method.
8937 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
8939         * ast/rust-expr.h
8940         (class IfExprConseqElse): Make else_block ExprWithBlock.
8941         (class IfExprConseqIf): Remove.
8942         (class IfExprConseqIfLet): Remove.
8943         * ast/rust-ast-full-decls.h
8944         (class IfExprConseqIf): Remove.
8945         (class IfExprConseqIfLet): Remove.
8946         * ast/rust-ast.cc
8947         (IfExprConseqElse::as_string): Adjust output.
8948         (IfExprConseqIf::as_string): Remove.
8949         (IfExprConseqIfLet::as_string): Remove.
8950         (IfExprConseqIf::accept_vis): Remove.
8951         (IfExprConseqIfLet::accept_vis): Remove.
8952         * ast/rust-ast-visitor.h
8953         (ASTVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
8954         * ast/rust-ast-tokenstream.cc
8955         (TokenStream::visit): Likewise.
8956         * ast/rust-ast-tokenstream.h
8957         (TokenStream::visit): Likewise.
8958         * ast/rust-ast-dump.cc
8959         (Dump::visit): Likewise.
8960         * ast/rust-ast-dump.h
8961         (Dump::visit): Likewise.
8962         * checks/errors/rust-feature-gate.h
8963         (FeatureGate::visit): Likewise.
8964         * util/rust-attributes.cc
8965         (AttributeChecker::visit): Likewise.
8966         * util/rust-attributes.h
8967         (AttributeChecker::visit): Likewise.
8968         * resolve/rust-early-name-resolver.cc
8969         (EarlyNameResolver::visit): Likewise.
8970         * resolve/rust-early-name-resolver.h
8971         (EarlyNameResolver::visit): Likewise.
8972         * resolve/rust-ast-resolve-base.h
8973         (ResolverBase::visit): Likewise.
8974         * resolve/rust-ast-resolve-base.cc
8975         (ResolverBase::visit): Likewise.
8976         * resolve/rust-ast-resolve-expr.h
8977         (ResolveExpr::visit): Remove IfExprConseqIf visitor.
8978         * resolve/rust-ast-resolve-expr.cc
8979         (ResolveExpr::visit): Likewise.
8980         * expand/rust-cfg-strip.cc
8981         (CfgStrip::visit): Remove IfExprConseqIf{,Let} visitors.
8982         * expand/rust-cfg-strip.h
8983         (CfgStrip::visit): Likewise.
8984         * expand/rust-expand-visitor.cc
8985         (ExpandVisitor::visit): Likewise.
8986         * expand/rust-expand-visitor.h
8987         (ExpandVisitor::visit): Likewise.
8988         * hir/rust-ast-lower-base.cc
8989         (ASTLoweringBase::visit): Likewise.
8990         * hir/rust-ast-lower-base.h
8991         (ASTLoweringBase::visit): Likewise.
8992         * hir/rust-ast-lower-block.h
8993         (ASTLoweringIfBlock::visit): Remove IfExprConseqIf visitor.
8994         (ASTLoweringExprWithBlock::visit): Likewise.
8995         * hir/rust-ast-lower.cc
8996         (ASTLoweringIfBlock::visit):
8997         Remove IfExprConseqIf visitor, adjust IfExprConseqElse lowering.
8998         * hir/rust-ast-lower-expr.h
8999         (ASTLoweringExpr::visit): Remove IfExprConseqIf visitor.
9000         * hir/rust-ast-lower-expr.cc
9001         (ASTLoweringExpr::visit): Likewise.
9002         * parse/rust-parse-impl.h
9003         (Parser::parse_if_expr): Replace IfExprConseqIf{,Let} with IfExprConseqElse.
9005 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9007         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix inner
9008         attribute tokenstream output.
9010 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
9012         * ast/rust-ast-dump.cc (Dump::debug): New.
9013         * ast/rust-ast-dump.h (Dump::debug): Untemplate it.
9014         (debug): New.
9015         * ast/rust-ast.h (class Visitable): New.
9016         (class TokenTree): Inherit from Visitable.
9017         (class MacroMatch): Likewise.
9018         (class AttrInput): Likewise.
9019         (class MetaItemInner): Likewise.
9020         (class Pattern): Likewise.
9021         (classTypeParamBound): Likewise.
9022         (class GenericParam): Likewise.
9023         (class TraitItem): Likewise.
9024         (classInherentImplItem): Likewise.
9025         (class TraitImplItem): Likewise.
9026         (class ExternalItem): Likewise.
9027         (class SingleASTNode): Likewise.
9029 2024-01-16  Thomas Schwinge  <thomas@codesourcery.com>
9031         * rust-lang.cc (grs_langhook_type_for_mode): Placate clang-format.
9033 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9035         * ast/rust-ast.h: Add boolean for differenciation.
9036         * parse/rust-parse-impl.h (Parser::parse_doc_comment): Change
9037         function interface to make code cleaner. It should return a body
9038         instead of the whole attribute.
9039         (Parser::parse_inner_attribute): Specify the inner status of the
9040         node.
9041         (Parser::parse_attribute_body): Change function interface to
9042         make the code cleaner much like parse_doc_comment.
9043         (Parser::parse_outer_attribute): Specify outer status of the
9044         node.
9045         * parse/rust-parse.h: Update functions prototypes.
9047 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9049         * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
9050         reuse resolve_method_address to monomorphize the call if required
9051         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
9052         allow matching against unimplemented trait item bounds
9054 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9056         * typecheck/rust-hir-path-probe.cc: dont subst with a dynamic object
9058 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9060         * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): moved here
9061         * backend/rust-compile-base.h: refactored prototype
9062         * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): refactor
9063         * backend/rust-compile-expr.h: likewise
9065 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9067         * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): remove unused
9069 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9071         * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): call destructure
9073 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9075         * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
9076         call path probe impl trait
9078 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9080         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
9081         to attribute expansion function.
9083 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9085         * expand/rust-expand-visitor.cc (ExpandVisitor::visit_outer_attrs):
9086         Change condition order.
9087         (ExpandVisitor::visit_inner_using_attrs): Likewise.
9088         (ExpandVisitor::visit_attrs_with_derive): Likewise.
9089         (ExpandVisitor::is_builtin): Add builtin identification
9090         function.
9091         * expand/rust-expand-visitor.h: Add function prototype.
9092         * util/rust-attributes.cc: Add missing rustc_builtin_macro
9093         attribute.
9095 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9097         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_struct_fields):
9098         Add call to expand structu fields.
9099         (ExpandVisitor::expand_function_params): Add call to expand
9100         function parameters.
9101         (ExpandVisitor::expand_closure_params): Add call to expand
9102         closure parameters.
9103         (ExpandVisitor::visit): Add calls for item outer attribute
9104         expansions.
9106 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9108         * expand/rust-expand-visitor.cc (ExpandVisitor::expand_outer_attribute):
9109         Stub for a single attribute expansion.
9110         (ExpandVisitor::visit_outer_attrs): Visit the attributes to
9111         expand on a given item.
9112         * expand/rust-expand-visitor.h: Add function prototypes.
9114 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9116         * ast/rust-ast.h: Add getter to Expr class.
9117         * ast/rust-expr.h: Add override attribute to existing getters.
9118         Also implement it for RangeExpr, attempting to retrieve outer
9119         attributes on those types will crash the compiler.
9120         * ast/rust-macro.h: Add override attribute to existing getters.
9121         * ast/rust-path.h: Likewise.
9123 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9125         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
9126         to inner attribute stub.
9127         (ExpandVisitor::expand_inner_attribute): Expand one single
9128         attribute.
9129         (ExpandVisitor::visit_inner_using_attrs): Expand a given item
9130         using a vector of attributes.
9131         (ExpandVisitor::visit_inner_attrs): Visit inner attributes of a
9132         given item.
9133         * expand/rust-expand-visitor.h: Add function prototypes.
9135 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9137         * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Add call
9138         to derive expander.
9139         (ExpandVisitor::expand_derive): Expand a single derive.
9140         (ExpandVisitor::visit_attrs_with_derive): Visit an item with
9141         derive attributes.
9142         (ExpandVisitor::is_derive): Identify a derive attribute.
9143         * expand/rust-expand-visitor.h: Add function prototypes.
9145 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9147         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix ICE.
9149 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9151         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
9152         default separator.
9154 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9156         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Visit inner
9157         attributes.
9159 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9161         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Change token
9162         type.
9164 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9166         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix existing
9167         and implement remaining attribute visitors.
9169 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9171         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor
9172         to the union's outer attributes.
9174 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9176         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add call to
9177         inner attribute visitor.
9179 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9181         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix ICE.
9183 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9185         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Make comma
9186         mandatory.
9188 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9190         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
9191         additional semicolon output.
9192         * ast/rust-ast-tokenstream.h: Change block visitor prototype
9193         with a default value for trailing tokens.
9195 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9197         * Make-lang.in: Add two new files to the list of sources.
9198         * ast/rust-ast-full.h: Add new ast formatting header.
9199         * ast/rust-ast.cc (enum indent_mode): Move formatting function
9200         to it's own file.
9201         (indent_spaces): Likewise.
9202         (get_string_in_delims): Likewise.
9203         (enum AttrMode): Likewise.
9204         (get_mode_dump_desc): Likewise.
9205         (append_attributes): Likewise.
9206         (unquote_string): Likewise.
9207         (GroupedExpr::as_string): Move pattern implementation to it's
9208         own file.
9209         (RangePattern::as_string): Likewise.
9210         (RangePatternBoundLiteral::as_string): Likewise.
9211         (SlicePattern::as_string): Likewise.
9212         (AltPattern::as_string): Likewise.
9213         (TuplePatternItemsMultiple::as_string): Likewise.
9214         (TuplePatternItemsRanged::as_string): Likewise.
9215         (TuplePattern::as_string): Likewise.
9216         (StructPatternField::as_string): Likewise.
9217         (StructPatternFieldIdent::as_string): Likewise.
9218         (StructPatternFieldTuplePat::as_string): Likewise.
9219         (StructPatternFieldIdentPat::as_string): Likewise.
9220         (StructPatternElements::as_string): Likewise.
9221         (StructPattern::as_string): Likewise.
9222         (LiteralPattern::as_string): Likewise.
9223         (ReferencePattern::as_string): Likewise.
9224         (IdentifierPattern::as_string): Likewise.
9225         (TupleStructItemsNoRange::as_string): Likewise.
9226         (TupleStructItemsRange::as_string): Likewise.
9227         (TupleStructPattern::as_string): Likewise.
9228         (GroupedExpr::accept_vis): Likewise.
9229         (LiteralPattern::accept_vis): Likewise.
9230         (IdentifierPattern::accept_vis): Likewise.
9231         (WildcardPattern::accept_vis): Likewise.
9232         (RestPattern::accept_vis): Likewise.
9233         (RangePatternBoundLiteral::accept_vis): Likewise.
9234         (RangePatternBoundPath::accept_vis): Likewise.
9235         (RangePatternBoundQualPath::accept_vis): Likewise.
9236         (RangePattern::accept_vis): Likewise.
9237         (ReferencePattern::accept_vis): Likewise.
9238         (StructPatternFieldTuplePat::accept_vis): Likewise.
9239         (StructPatternFieldIdentPat::accept_vis): Likewise.
9240         (StructPatternFieldIdent::accept_vis): Likewise.
9241         (StructPattern::accept_vis): Likewise.
9242         (TupleStructItemsNoRange::accept_vis): Likewise.
9243         (TupleStructItemsRange::accept_vis): Likewise.
9244         (TupleStructPattern::accept_vis): Likewise.
9245         (TuplePatternItemsMultiple::accept_vis): Likewise.
9246         (TuplePatternItemsRanged::accept_vis): Likewise.
9247         (TuplePattern::accept_vis): Likewise.
9248         (GroupedPattern::accept_vis): Likewise.
9249         (SlicePattern::accept_vis): Likewise.
9250         (AltPattern::accept_vis): Likewise.
9251         * ast/rust-ast-formatting.cc: New file.
9252         * ast/rust-ast-formatting.h: New file.
9253         * ast/rust-pattern.cc: New file.
9255 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9257         * Make-lang.in: Add new file for rust-path implementation.
9258         * ast/rust-ast.cc (PathInExpression::as_string): Move function
9259         to the new file.
9260         (PathPattern::as_string): Likewise.
9261         (QualifiedPathInExpression::as_string): Likewise.
9262         (ConstGenericParam::as_string): Likewise.
9263         (QualifiedPathInType::as_string): Likewise.
9264         (TypePath::as_string): Likewise.
9265         (PathPattern::convert_to_simple_path): Likewise.
9266         (TypePath::as_simple_path): Likewise.
9267         (PathExprSegment::as_string): Likewise.
9268         (GenericArgs::as_string): Likewise.
9269         (GenericArgsBinding::as_string): Likewise.
9270         (TypePath::to_trait_bound): Likewise.
9271         (TypePathSegmentGeneric::as_string): Likewise.
9272         (TypePathFunction::as_string): Likewise.
9273         (TypePathSegmentFunction::as_string): Likewise.
9274         (ConstGenericParam::accept_vis): Likewise.
9275         (PathInExpression::accept_vis): Likewise.
9276         (TypePathSegment::accept_vis): Likewise.
9277         (TypePathSegmentGeneric::accept_vis): Likewise.
9278         (TypePathSegmentFunction::accept_vis): Likewise.
9279         (TypePath::accept_vis): Likewise.
9280         (QualifiedPathInExpression::accept_vis): Likewise.
9281         (QualifiedPathInType::accept_vis): Likewise.
9282         (GenericArg::disambiguate_to_const): Likewise.
9283         (GenericArg::disambiguate_to_type): Likewise.
9284         * ast/rust-path.cc: New file.
9286 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9288         * backend/rust-compile-item.cc (CompileItem::visit): unwrap the constant expression
9290 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
9292         * util/rust-lang-item.h
9293         (RustLangItem::ItemType::FN): Add.
9294         (RustLangItem::ItemType::FN_MUT): Add.
9295         (RustLangItem::Parse): Handle FN and FN_MUT.
9296         (RustLangItem::ToString): Handle FN and FN_MUT.
9298 2024-01-16  Emanuele Micheletti  <micheletti.emanuele@hotmail.com>
9300         * typecheck/rust-casts.cc (TypeCastRules::cast_rules):
9301         case INTEGRAL handles TypeKind::CHAR
9303 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9305         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
9306         add check for reference marker and type's in self params
9307         (ResolveItem::visit): likewise
9308         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
9309         remove bad generics check
9310         (TypeCheckExpr::resolve_segments): likewise
9311         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): likewise
9313 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9315         * resolve/rust-ast-resolve-item.cc
9316         (ResolveTraitItems::visit): add name resolution self param
9317         (ResolveItem::visit): likewise
9319 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9321         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::TypeBoundPredicate): this is an empty
9322         (TypeBoundPredicate::operator=): likewise
9323         * typecheck/rust-tyty-subst.cc (SubstitutionArgumentMappings::empty): new interface
9324         (SubstitutionArgumentMappings::is_error): this marks it as an error
9325         * typecheck/rust-tyty-subst.h: update prototypes
9327 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9329         * checks/errors/privacy/rust-privacy-reporter.cc
9330         (PrivacyReporter::check_base_type_privacy): allow error types to be permissive
9332 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9334         * ast/rust-ast-tokenstream.cc (TokenStream::visit_items_as_lines):
9335         Handle trailing chars.
9336         (TokenStream::visit_items_as_block): Likewise.
9337         (TokenStream::visit): Fix visitor.
9339 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9341         * lex/rust-token.cc (Token::as_string): Add type hint output.
9343 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9345         * rust-session-manager.cc (Session::enable_dump): Enable new
9346         dump.
9347         (Session::compile_crate): CLI argument parsing.
9348         (Session::dump_tokenstream): Dump the tokenstream as a string in
9349         the specified file.
9350         * rust-session-manager.h (struct CompileOptions): Add
9351         tokenstream dump option.
9353 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9355         * lex/rust-token.cc (Token::as_string): Add as_string
9356         implementation.
9357         * lex/rust-token.h: Add as_string prototype.
9359 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9361         * ast/rust-ast-tokenstream.cc (TokenStream::TokenStream): Add
9362         constructor.
9364 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9366         * ast/rust-ast-tokenstream.cc (TokenStream::collect_tokens): Add
9367         getter.
9368         (TokenStream::go): Rename function.
9369         (TokenStream::visit): Likewise.
9370         * ast/rust-ast-tokenstream.h: Add collect prototype.
9372 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9374         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Change
9375         getter name.
9376         * ast/rust-ast.cc (SimplePath::as_string): Change attribute
9377         name.
9378         * ast/rust-ast.h (class SimplePath): Refactor attribute name and
9379         change getter name.
9381 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9383         * ast/rust-ast-tokenstream.cc (TokenStream::visit_as_line): Add
9384         formatting calls.
9385         (TokenStream::visit_items_as_block): Likewise.
9386         (TokenStream::newline): Add stub.
9387         (TokenStream::indentation): Add stub.
9388         (TokenStream::increment_indentation): Add stub.
9389         (TokenStream::decrement_indentation): Add stub.
9390         (TokenStream::visit): Add formatting calls.
9391         (TokenStream::visit_function_common): Likewise.
9392         * ast/rust-ast-tokenstream.h: Add stub prototypes.
9394 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9396         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
9398 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9400         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor
9401         implementation.
9402         * ast/rust-ast-tokenstream.h: Add additional function prototype.
9403         * ast/rust-item.h: Add some getters.
9404         * ast/rust-macro.h: Likewise.
9406 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9408         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
9409         * ast/rust-item.h: Add missing getters.
9411 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9413         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add visitor.
9415 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9417         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add
9418         visitors.
9419         (TokenStream::visit_closure_common): Merge common code for
9420         closure visitors.
9421         * ast/rust-ast-tokenstream.h: Add function prototype.
9422         * ast/rust-expr.h: Add missing move attribute getter.
9424 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9426         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Add
9427         visitors.
9428         (TokenStream::visit_loop_common): Merge common loop code.
9429         * ast/rust-ast-tokenstream.h: Add function prototypes.
9431 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9433         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
9434         visitor.
9435         * ast/rust-ast-tokenstream.h: Add function prototype for missing
9436         component.
9438 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9440         * ast/rust-ast-tokenstream.cc (TokenStream::trailing_comma):
9441         Output a trailing comma to the token stream according to the
9442         configuration.
9443         * ast/rust-ast-tokenstream.h: Add function prototype.
9445 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9447         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
9448         visitors.
9450 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9452         * ast/rust-ast-tokenstream.cc (TokenStream::visit): Implement
9453         visitors.
9454         * ast/rust-ast-tokenstream.h: Add function prototypes.
9455         * ast/rust-ast.h: Add missing getters.
9456         * ast/rust-expr.h: Likewise.
9458 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
9460         * Make-lang.in: Add rust-as-tokenstream to compile list.
9461         * ast/rust-item.h: Add missing getter for location.
9462         * ast/rust-ast-tokenstream.cc: Add ast visitor implementation.
9463         * ast/rust-ast-tokenstream.h: New file.
9464         * ast/rust-pattern.h: Add getter.
9466 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9468         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
9469         Add implicit unit type as the return type when not specified
9471 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9473         * util/rust-attributes.cc: Add stable to the table of known attributes
9475 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9477         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): return early on bad type
9478         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::TypeCheckPattern):
9479         remove assertion in favor of check
9480         (TypeCheckPattern::visit): likewise
9482 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9484         * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
9485         when its not a block we dont have any ribs to generate locals from
9487 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
9489         * parse/rust-parse-impl.h
9490         (Parser<ManagedTokenSource>::parse_expr_without_block):
9491         Remove direct array expression handling.
9493 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9495         * ast/rust-item.h: Fix `Visibility::has_path()` implementation.
9496         * checks/errors/privacy/rust-visibility-resolver.cc
9497         (VisibilityResolver::resolve_module_path): Check if we are dealing with pub(crate) properly.
9499 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9501         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Set
9502         resolved_node_id when visiting root segment of SimplePath.
9504 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9506         * ast/rust-ast.h: Call SimplePath constructor differently in
9507         SimplePath::from_str
9509 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9511         * hir/rust-ast-lower-type.h: Move all remaining definitions to source file.
9512         * hir/rust-ast-lower-type.cc (ASTLoweringType::translate): Moved to source file.
9513         (ASTLoweringType::visit): Likewise.
9514         (ASTLowerGenericParam::translate): Likewise.
9515         (ASTLowerGenericParam::visit): Likewise.
9516         (ASTLoweringTypeBounds::translate): Likewise.
9517         (ASTLoweringTypeBounds::visit): Likewise.
9518         (ASTLowerWhereClauseItem::translate): Likewise.
9519         (ASTLowerWhereClauseItem::visit): Likewise.
9521 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
9523         * ast/rust-pattern.h: Remove commented out code.
9525 2024-01-16  emanuele-em  <micheletti.emanuele@hotmail.com>
9527         * typecheck/rust-casts.cc (TypeCastRules::cast_rules): BOOL removed from switch cases
9529 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9531         * Make-lang.in: Rename rust-asttribute-visitor.o -> rust-cfg-strip.o
9532         * expand/rust-attribute-visitor.cc: Moved to...
9533         * expand/rust-cfg-strip.cc: ...here.
9534         * expand/rust-attribute-visitor.h: Moved to...
9535         * expand/rust-cfg-strip.h: ...here.
9536         * expand/rust-macro-expand.cc: Fix include of rust-attribute-visitor.h
9537         * expand/rust-macro-builtins.cc: Likewise.
9538         * rust-session-manager.cc (Session::expansion): Call CfgStrip instead of
9539         AttrVisitor.
9541 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9543         * Make-lang.in: Add new object file.
9544         * expand/rust-attribute-visitor.cc (AttrVisitor::go): Visit all items of a
9545         crate.
9546         (AttrVisitor::expand_struct_fields): Do not perform macro expansion anymore.
9547         (AttrVisitor::expand_function_params): Likewise.
9548         (AttrVisitor::expand_generic_args): Likewise.
9549         (AttrVisitor::expand_qualified_path_type): Likewise.
9550         (AttrVisitor::expand_self_param): Likewise.
9551         (AttrVisitor::expand_trait_function_decl): Likewise.
9552         (AttrVisitor::expand_trait_method_decl): Likewise.
9553         (AttrVisitor::visit): Likewise.
9554         (AttrVisitor::maybe_expand_expr): Remove function.
9555         (AttrVisitor::maybe_expand_type): Likewise.
9556         * expand/rust-attribute-visitor.h: Do not keep MacroExpander inside AttrVisitor
9557         anymore.
9558         * expand/rust-macro-expand.h (struct MacroExpander): Turn ContextType into an
9559         enum class for more type safety.
9560         * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Use new ContextType
9561         API.
9562         * rust-session-manager.cc (Session::expansion): Call into ExpandVisitor.
9563         * expand/rust-expand-visitor.cc: New file.
9564         * expand/rust-expand-visitor.h: New file.
9566 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9568         * expand/rust-macro-expand.cc (MacroExpander::expand_crate): Do not cfg-attr
9569         strip in MacroExpander
9570         (MacroExpander::fails_cfg): Function moved...
9571         (MacroExpander::fails_cfg_with_expand): Function moved...
9572         (MacroExpander::expand_cfg_attrs): Function moved...
9573         * expand/rust-attribute-visitor.cc (fails_cfg): ...here.
9574         (fails_cfg_with_expand): ...here.
9575         (expand_cfg_attrs): ...here.
9576         (AttrVisitor::expand_struct_fields): Use new functions.
9577         (AttrVisitor::expand_tuple_fields): Likewise.
9578         (AttrVisitor::expand_function_params): Likewise.
9579         (AttrVisitor::visit): Likewise.
9580         (AttrVisitor::go): New function.
9581         * expand/rust-attribute-visitor.h: Declare AttrVisitor::go.
9582         * expand/rust-macro-expand.h (struct MacroExpander): Remove cfg-attr related
9583         functions.
9585 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9587         * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_macro_definition):
9588         New function.
9589         * hir/rust-ast-lower-base.h: Declare `lower_macro_definition`.
9590         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Lower public
9591         macro definitions.
9592         * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
9593         * hir/rust-ast-lower-stmt.h: Add visitor for `AST::MacroRulesDefinition`.
9594         * hir/rust-ast-lower.cc (ASTLowering::go): Formatting.
9595         (ASTLoweringBlock::visit): Visit `AST::MacroRulesDefinition`
9596         (ASTLoweringIfLetBlock::visit): Formatting.
9597         (ASTLoweringExprWithBlock::visit): Formatting.
9599 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9601         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Add new visitor
9602         for AST::MacroRulesDefinition.
9603         * hir/rust-ast-lower-item.h: Declare above mentioned visitor.
9604         * metadata/rust-export-metadata.cc (ExportContext::emit_macro): New function.
9605         * metadata/rust-export-metadata.h: Declare it.
9606         (PublicInterface::gather_export_data): Go through each exported macro.
9607         * util/rust-hir-map.cc (Mappings::insert_exported_macro): New function.
9608         (Mappings::get_exported_macros): New function.
9609         * util/rust-hir-map.h: Add new mappings for exported macros.
9611 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9613         * backend/rust-compile-item.h: Revert 1c946687239b86a92839d57dfbc928ad7ce35eae.
9614         * backend/rust-compile-stmt.h: Likewise.
9615         * checks/errors/privacy/rust-privacy-reporter.cc
9616         (PrivacyReporter::visit): Likewise.
9617         * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
9618         * checks/errors/privacy/rust-pub-restricted-visitor.cc
9619         (PubRestrictedVisitor::visit): Likewise.
9620         * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
9621         * checks/errors/privacy/rust-reachability.cc
9622         (ReachabilityVisitor::visit): Likewise.
9623         * checks/errors/privacy/rust-reachability.h: Likewise.
9624         * checks/errors/privacy/rust-visibility-resolver.cc
9625         (VisibilityResolver::visit): Likewise.
9626         * checks/errors/privacy/rust-visibility-resolver.h: Likewise.
9627         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
9628         * checks/errors/rust-const-checker.h: Likewise.
9629         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
9630         * checks/errors/rust-unsafe-checker.h: Likewise.
9631         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
9632         * hir/rust-ast-lower-item.h: Likewise.
9633         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
9634         * hir/rust-hir-dump.h: Likewise.
9635         * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Likewise.
9636         * hir/tree/rust-hir-item.h (class ExportedMacro): Likewise.
9637         * hir/tree/rust-hir-visitor.h: Likewise.
9638         * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): Likewise.
9639         (ExportedMacro::get_locus): Likewise.
9640         (ExportedMacro::get_item_kind): Likewise.
9641         (ExportedMacro::clone_item_impl): Likewise.
9642         * hir/tree/rust-hir.h: Likewise.
9643         * metadata/rust-export-metadata.cc: Likewise.
9644         * typecheck/rust-hir-type-check-item.h: Likewise.
9645         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
9646         * typecheck/rust-hir-type-check-stmt.h: Likewise.
9647         * typecheck/rust-tycheck-dump.h: Likewise.
9648         * util/rust-attributes.cc: Likewise.
9650 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9652         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): return a TraitObject
9654 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9656         * typecheck/rust-hir-trait-resolve.cc: don't inject extra inference variables
9658 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9660         * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous semicolon when
9661         dumping macro rules.
9663 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
9665         * metadata/rust-imports.cc (add_search_path): Change `Go` -> `Rust`.
9666         (Import::try_package_in_directory): Likewise.
9667         (Import::find_export_data): Likewise.
9669 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
9671         * hir/rust-ast-lower-pattern.cc
9672         (ASTLoweringPattern::visit): Lower AltPattern.
9673         * hir/rust-ast-lower-pattern.h:
9674         (ASTLoweringPattern::visit): Add AltPattern visitor.
9676 2024-01-16  Xiao Ma  <turingki@yeah.net>
9677             Thomas Schwinge  <thomas@codesourcery.com>
9679         * checks/errors/rust-feature-gate.cc: Adjust 'ld'->'u'.
9680         * checks/errors/rust-feature.h: Adjust
9681         the type of `m_issue`: 'uint64_t' -> 'unsigned'.
9683 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9685         * ast/rust-ast.h: add const get_final_segment helper
9686         * hir/rust-ast-lower-enumitem.h: dont add an item mapping for enumitems
9687         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): add enum to enum-items mappings
9688         * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): likewise
9689         * hir/tree/rust-hir-item.h: add non const helper to get variants
9690         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): resolve the use declaration
9691         * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): handle self
9692         * resolve/rust-ast-resolve-toplevel.h: add enum item mappings to module mappings
9693         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): ensure variant
9694         (TypeCheckExpr::resolve_segments): likewise
9695         * typecheck/rust-type-util.cc (query_type): lookup enum's
9696         * util/rust-hir-map.cc (Mappings::insert_hir_enumitem): enum item mappings
9697         (Mappings::lookup_hir_enumitem): likewise
9698         * util/rust-hir-map.h: likewise
9700 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9702         * resolve/rust-ast-resolve-path.cc (ResolvePath::ResolvePath): return NodeId
9703         (ResolvePath::go): update signiture
9704         (ResolvePath::resolve_path): return resolved_node_id
9705         * resolve/rust-ast-resolve-path.h: update prototypes
9707 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
9709         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit):
9710         Add lowering for SlicePattern.
9711         * hir/rust-ast-lower-pattern.h: Likewise.
9712         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit):
9713         Add name resolution visit for SlicePattern.
9714         * resolve/rust-ast-resolve-pattern.h: Likewise.
9716 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9718         * hir/rust-ast-lower-implitem.h (RUST_AST_LOWER_IMPLITEM_H): cleanup header usage
9719         * hir/rust-ast-lower-item.cc: likewise
9720         * hir/rust-ast-lower-item.h (RUST_AST_LOWER_ITEM): likewise
9721         * hir/rust-ast-lower-stmt.cc: likewise
9722         * hir/rust-ast-lower-stmt.h (RUST_AST_LOWER_STMT): likewise
9723         * hir/rust-ast-lower-type.h: likewise
9724         * hir/rust-ast-lower.cc: likewise
9725         * hir/rust-ast-lower.h: likewise
9726         * resolve/rust-ast-resolve-expr.h: likewise
9727         * resolve/rust-ast-resolve-item.cc: likewise
9728         * resolve/rust-ast-resolve-item.h: likewise
9729         * resolve/rust-ast-resolve-stmt.cc: likewise
9730         * resolve/rust-ast-resolve-stmt.h: likewise
9731         * resolve/rust-ast-resolve-struct-expr-field.h: likewise
9732         * resolve/rust-ast-resolve-toplevel.h: likewise
9733         * resolve/rust-ast-resolve-type.h: likewise
9734         * resolve/rust-ast-resolve.h: likewise
9736 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
9738         * resolve/rust-ast-resolve-pattern.h (class ResolvePattern): Removed.
9740 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9742         * backend/rust-compile-intrinsic.cc (move_val_init_handler): new intrinsice
9743         (uninit_handler): use a builtin memcpy
9745 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9747         * typecheck/rust-coercion.cc (TypeCoercionRules::select): use the result
9749 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9751         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): fix ctor
9752         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): likewise
9753         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
9754         * typecheck/rust-typecheck-context.cc (TypeCheckContext::push_new_loop_context): likewise
9755         * typecheck/rust-tyty-util.cc (TyVar::get_implicit_infer_var): likewise
9756         * typecheck/rust-tyty.cc (InferType::InferType): new ctor with type hint
9757         (InferType::clone): fix ctor
9758         (InferType::apply_primitive_type_hint): new function to apply possible hint
9759         * typecheck/rust-tyty.h: update prototypes
9760         * typecheck/rust-unify.cc (UnifyRules::expect_inference_variable): apply type hints
9761         (UnifyRules::expect_bool): likewise
9762         (UnifyRules::expect_char): likewise
9763         (UnifyRules::expect_int): likewise
9764         (UnifyRules::expect_uint): likewise
9765         (UnifyRules::expect_float): likewise
9766         (UnifyRules::expect_isize): likewise
9767         (UnifyRules::expect_usize): likewise
9769 2024-01-16  Jiakun Fan  <120090316@link.cuhk.edu.cn>
9771         * hir/rust-hir-dump.cc (Dump::go): fix format
9772         (Dump::visit): impl `visit (AST::Attribute &)`, dump inner attrs and
9773         `visit (Lifetime &)`
9774         * hir/rust-hir-dump.h:add `visit (AST::Attribute &)`
9776 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
9778         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
9779         Print out consistency errors.
9780         (PatternDeclaration::visit): Implement visit for AltPattern.
9781         (PatternDeclaration::add_new_binding): New helper function for
9782         adding a binding to identifier.
9783         * resolve/rust-ast-resolve-pattern.h (struct BindingInfo):
9784         New struct to facilitate checking for inconsistencies between bindings.
9786 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
9788         * backend/rust-compile-block.h
9789         (CompileConditionalBlocks::visit): Remove IfLetExprConseqIf{,Let} visitors.
9790         (CompileExprWithBlock::visit): Remove IfLetExprConseqIf{,Let} visitors.
9791         * backend/rust-compile-expr.h
9792         (CompileExpr::visit): Remove IfLetExprConseqIf{,Let} visitors.
9793         * checks/errors/rust-unsafe-checker.cc
9794         (UnsafeChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
9795         * checks/errors/rust-unsafe-checker.h
9796         (UnsafeChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
9797         * checks/errors/rust-const-checker.cc
9798         (ConstChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
9799         * checks/errors/rust-const-checker.h
9800         (ConstChecker::visit): Remove IfLetExprConseqIf{,Let} visitors.
9801         * checks/errors/privacy/rust-privacy-reporter.cc
9802         (PrivacyReporter::visit): Remove IfLetExprConseqIf{,Let} visitors.
9803         * checks/errors/privacy/rust-privacy-reporter.h
9804         (PrivacyReporter::visit): Remove IfLetExprConseqIf{,Let} visitors.
9805         * hir/tree/rust-hir-expr.h
9806         (class IfLetExprConseqElse): Make else_block ExprWithBlock.
9807         (class IfLetExprConseqIf): Remove.
9808         (class IfLetExprConseqIfLet): Remove.
9809         * hir/tree/rust-hir-full-decls.h
9810         (class IfLetExprConseqIf): Remove.
9811         (class IfLetExprConseqIfLet): Remove.
9812         * hir/tree/rust-hir.cc
9813         (IfLetExprConseqElse::as_string): Adjust output.
9814         (IfLetExprConseqIf::as_string): Remove.
9815         (IfLetExprConseqIfLet::as_string): Remove.
9816         (IfLetExprConseqIf::accept_vis): Remove.
9817         (IfLetExprConseqIfLet::accept_vis): Remove.
9818         * hir/tree/rust-hir-visitor.h
9819         (HIRFullVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
9820         (HIRFullVisitorBase::visit): Remove IfLetExprConseqIf{,Let} visitors.
9821         (HIRExpressionVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
9822         * hir/rust-hir-dump.cc
9823         (Dump::visit): Remove IfLetExprConseqIf{,Let} visitors.
9824         * hir/rust-hir-dump.h
9825         (Dump::visit): Remove IfLetExprConseqIf{,Let} visitors.
9826         * typecheck/rust-hir-type-check-expr.h
9827         (TypeCheckExpr::visit): Remove IfLetExprConseqIf{,Let} visitors.
9829 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
9831         * typecheck/rust-hir-type-check-expr.cc
9832         (TypeCheckExpr::visit): Remove IfExprConseqIf visitor.
9833         * typecheck/rust-hir-type-check-expr.h
9834         (TypeCheckExpr::visit): Remove IfExprConseqIf{,Let} visitor.
9835         * backend/rust-compile-block.cc
9836         (CompileConditionalBlocks::visit): Remove IfExprConseqIf visitor.
9837         * backend/rust-compile-block.h
9838         (CompileConditionalBlocks::visit): Remove IfExprConseqIf{,Let} visitors.
9839         (CompileExprWithBlock::visit):
9840         Remove IfExprConseqIf{,Let} visitors, implement BlockExpr visitor.
9841         * backend/rust-compile-expr.cc
9842         (CompileExpr::visit): Remove IfExprConseqIf visitor.
9843         * backend/rust-compile-expr.h
9844         (CompileExpr::visit): Remove IfExprConseqIf{,Let} visitors.
9845         * checks/lints/rust-lint-marklive.h
9846         (MarkLive::visit): Remove IfExprConseqIf visitor.
9847         * checks/errors/rust-const-checker.cc
9848         (ConstChecker::visit): Remove IfExprConseqIf{,Let} visitors.
9849         * checks/errors/rust-const-checker.h
9850         (ConstChecker::visit): Remove IfExprConseqIf{,Let} visitors.
9851         * checks/errors/rust-unsafe-checker.cc
9852         (UnsafeChecker::visit): Remove IfExprConseqIf{,Let} visitors.
9853         * checks/errors/rust-unsafe-checker.h
9854         (UnsafeChecker::visit): Remove IfExprConseqIf{,Let} visitors.
9855         * checks/errors/privacy/rust-privacy-reporter.cc
9856         (PrivacyReporter::visit): Remove IfExprConseqIf{,Let} visitors.
9857         * checks/errors/privacy/rust-privacy-reporter.h
9858         (PrivacyReporter::visit): Remove IfExprConseqIf{,Let} visitors.
9859         * hir/tree/rust-hir-expr.h
9860         (class IfExprConseqElse): Make else_block ExprWithBlock.
9861         (class IfExprConseqIf): Remove.
9862         (class IfExprConseqIfLet): Remove.
9863         * hir/tree/rust-hir-full-decls.h
9864         (class IfExprConseqIf): Remove.
9865         (class IfExprConseqIfLet): Remove.
9866         * hir/tree/rust-hir.cc
9867         (IfExprConseqElse::as_string): Adjust output.
9868         (IfExprConseqIf::as_string): Remove.
9869         (IfExprConseqIfLet::as_string): Remove.
9870         (IfExprConseqIf::accept_vis): Remove.
9871         (IfExprConseqIfLet::accept_vis): Remove.
9872         * hir/tree/rust-hir-visitor.h
9873         (HIRFullVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
9874         (HIRFullVisitorBase::visit): Remove IfExprConseqIf{,Let} visitors.
9875         (HIRExpressionVisitor::visit): Remove IfExprConseqIf{,Let} visitors.
9876         * hir/rust-hir-dump.cc
9877         (Dump::visit): Remove IfExprConseqIf{,Let} visitors.
9878         * hir/rust-hir-dump.h
9879         (Dump::visit): Remove IfExprConseqIf{,Let} visitors.
9880         * hir/rust-ast-lower.cc
9881         (ASTLoweringIfBlock::visit): Replace HIR::IfExprConseqIf with HIR::IfExprConseqElse.
9883 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
9885         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit):
9886         Push a Product context instead of an Or context.
9888 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9890         * typecheck/rust-hir-inherent-impl-overlap.h (class ImplItemToName): remove
9892 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9894         * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): remove unused code
9896 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9898         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): remove infer call
9899         (TypeCheckExpr::resolve_root_path): only infer when we need to
9901 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9903         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): add debug
9905 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9907         * backend/rust-compile.cc: use unify_and instead
9908         * typecheck/rust-tyty-subst.cc (SubstitutionRef::solve_missing_mappings_from_this): remove
9909         * typecheck/rust-tyty-subst.h: update header
9911 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9913         * typecheck/rust-coercion.cc (TypeCoercionRules::select): use new unify_and interface
9914         * typecheck/rust-hir-dot-operator.cc (MethodResolver::try_hook): grab bounds behind refs
9916 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9918         * backend/rust-compile-base.cc: fix headers
9919         * backend/rust-compile-base.h: likewise
9920         * backend/rust-compile-expr.cc: likewise
9921         * backend/rust-compile-extern.h: likewise
9922         * backend/rust-compile-pattern.cc: likewise
9923         * backend/rust-compile.cc: likewise
9924         * typecheck/rust-autoderef.cc: likewise
9925         * typecheck/rust-hir-dot-operator.cc: likewise
9926         * typecheck/rust-hir-inherent-impl-overlap.h: likewise
9927         * typecheck/rust-hir-path-probe.cc: likewise
9928         * typecheck/rust-hir-trait-resolve.cc: likewise
9929         * typecheck/rust-hir-type-check-base.cc: likewise
9930         * typecheck/rust-hir-type-check-base.h (RUST_HIR_TYPE_CHECK_BASE): likewise
9931         * typecheck/rust-hir-type-check-enumitem.cc: likewise
9932         * typecheck/rust-hir-type-check-expr.cc: likewise
9933         * typecheck/rust-hir-type-check-implitem.cc: likewise
9934         * typecheck/rust-hir-type-check-item.cc: likewise
9935         * typecheck/rust-hir-type-check-path.cc: likewise
9936         * typecheck/rust-hir-type-check-pattern.cc: likewise
9937         * typecheck/rust-hir-type-check-stmt.cc: likewise
9938         * typecheck/rust-hir-type-check-struct.cc: likewise
9939         * typecheck/rust-hir-type-check-type.cc: likewise
9940         * typecheck/rust-hir-type-check-type.h: likewise
9941         * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): likewise
9942         * typecheck/rust-tyty-bounds.cc: likewise
9943         * typecheck/rust-tyty-call.cc: likewise
9944         * typecheck/rust-tyty-subst.cc: likewise
9945         * typecheck/rust-tyty.cc: likewise
9947 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9949         * typecheck/rust-tyty.cc (BaseType::has_subsititions_defined): new implementation
9950         (BaseType::needs_generic_substitutions): likewise
9951         (ProjectionType::needs_generic_substitutions): remove
9952         (ProjectionType::has_subsititions_defined): remove
9953         * typecheck/rust-tyty.h: update header
9955 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9957         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): update to use new interface
9958         (TypeCheckExpr::resolve_root_path): likewise
9959         (TypeCheckExpr::resolve_segments): likewise
9960         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
9961         (TypeCheckType::resolve_root_path): likewise
9962         * typecheck/rust-tyty-subst.cc (SubstitutionRef::get_mappings_from_generic_args): likewise
9963         * typecheck/rust-tyty.cc (BaseType::supports_substitutions): likewise
9964         (BaseType::can_substitute): remove
9965         (BaseType::contains_type_parameters): remove
9966         (handle_substitions): cleanup
9967         (TupleType::handle_substitions): update
9968         (FnType::handle_substitions): update
9969         (ProjectionType::supports_substitutions): update
9970         * typecheck/rust-tyty.h: update header
9972 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9974         * typecheck/rust-tyty.h: cleanup ordering of header
9976 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
9978         * typecheck/rust-tyty.cc (BaseType::monomorphized_clone): new impl
9979         (InferType::monomorphized_clone): remove
9980         (ErrorType::monomorphized_clone): likewise
9981         (ADTType::monomorphized_clone): likewise
9982         (TupleType::monomorphized_clone): likewise
9983         (FnType::monomorphized_clone): likewise
9984         (FnPtr::monomorphized_clone): likewise
9985         (ClosureType::monomorphized_clone): likewise
9986         (ArrayType::clone): likewise
9987         (ArrayType::get_var_element_type): likewise
9988         (ArrayType::monomorphized_clone): likewise
9989         (SliceType::clone): likewise
9990         (SliceType::get_var_element_type): likewise
9991         (SliceType::monomorphized_clone): likewise
9992         (BoolType::monomorphized_clone): likewise
9993         (IntType::monomorphized_clone): likewise
9994         (UintType::monomorphized_clone): likewise
9995         (FloatType::monomorphized_clone): likewise
9996         (USizeType::monomorphized_clone): likewise
9997         (ISizeType::monomorphized_clone): likewise
9998         (CharType::monomorphized_clone): likewise
9999         (ReferenceType::clone): likewise
10000         (ReferenceType::get_var_element_type): likewise
10001         (ReferenceType::monomorphized_clone): likewise
10002         (PointerType::clone): likewise
10003         (PointerType::get_var_element_type): likewise
10004         (PointerType::monomorphized_clone): likewise
10005         (ParamType::monomorphized_clone): likewise
10006         (StrType::monomorphized_clone): likewise
10007         (NeverType::monomorphized_clone): likewise
10008         (PlaceholderType::monomorphized_clone): likewise
10009         (ProjectionType::monomorphized_clone): likewise
10010         (DynamicObjectType::monomorphized_clone): likewise
10011         * typecheck/rust-tyty.h: update header
10013 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10015         * typecheck/rust-tyty.cc (BaseType::is_unit): new implementation
10016         (ErrorType::is_unit): remove
10017         (TupleType::is_unit): likewise
10018         (NeverType::is_unit): likewise
10019         (PlaceholderType::is_unit): likewise
10020         (ProjectionType::is_unit): likewise
10021         * typecheck/rust-tyty.h: update header
10023 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10025         * typecheck/rust-tyty.cc (BaseType::is_concrete): new implementation
10026         (InferType::is_concrete): remove
10027         (ErrorType::is_concrete): likewise
10028         (StructFieldType::is_concrete): likewise
10029         (ADTType::is_concrete): likewise
10030         (TupleType::is_concrete): likewise
10031         (BoolType::is_concrete): likewise
10032         (IntType::is_concrete): likewise
10033         (UintType::is_concrete): likewise
10034         (FloatType::is_concrete): likewise
10035         (USizeType::is_concrete): likewise
10036         (ISizeType::is_concrete): likewise
10037         (CharType::is_concrete): likewise
10038         (ReferenceType::is_concrete): likewise
10039         (PointerType::is_concrete): likewise
10040         (ParamType::is_concrete): likewise
10041         (StrType::is_concrete): likewise
10042         (NeverType::is_concrete): likewise
10043         (PlaceholderType::is_concrete): likewise
10044         (ProjectionType::is_concrete): likewise
10045         (DynamicObjectType::is_concrete): likewise
10046         * typecheck/rust-tyty.h: update header
10048 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10050         * backend/rust-compile-type.cc (TyTyResolveCompile::TyTyResolveCompile): call destructure
10051         (TyTyResolveCompile::compile): use error_mark_node
10052         (TyTyResolveCompile::visit): use error_mark_node
10053         * backend/rust-compile-type.h: remove recursive ops
10055 2024-01-16  Tage Johansson  <frans.tage@gmail.com>
10057         * parse/rust-parse.cc: fix follow-sets
10059 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
10061         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit) :declare and
10062         pass bindings to PatternDeclaration::go.
10063         (ResolveExpr::resolve_closure_param): Likewise.
10064         * resolve/rust-ast-resolve-expr.h: Likewise.
10065         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
10066         (ResolveItem::visit): Likewise.
10067         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go): Likewise.
10068         (PatternDeclaration::visit): check for previous identifier bindings
10069         before inserting the new one.
10070         * resolve/rust-ast-resolve-pattern.h (enum PatternBoundCtx): New enum.
10071         * resolve/rust-ast-resolve-stmt.h: pass bindings to PatterDeclaration::go.
10073 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
10075         * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
10076         handle closure parameters pattern bindings using CompilePatternBindings visitor
10078 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10080         * README.md (process): Rename `rust1` to `crab1` in examples.
10081         * Make-lang.in: Rename `rust1` to `crab1`.
10082         * config-lang.in: Likewise.
10083         * lang-specs.h: Likewise.
10084         * rustspec.cc (lang_specific_driver): Likewise.
10086 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10088         * hir/tree/rust-hir-pattern.h
10089         (SlicePattern::get_items): Add.
10091 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10093         * hir/tree/rust-hir-full-decls.h
10094         (struct GenericArgsBinding): Convert to class.
10095         (class GenericArgsBinding): Convert from struct.
10096         (struct TypePathFunction): See above.
10097         (class TypePathFunction): See above.
10098         (struct QualifiedPathType): See above.
10099         (class QualifiedPathType): See above.
10100         * ast/rust-ast-full-decls.h
10101         (struct WhereClause): See above.
10102         (class WhereClause): See above.
10103         (struct SelfParam): See above.
10104         (class SelfParam): See above.
10105         (struct FunctionQualifiers): See above.
10106         (class FunctionQualifiers): See above.
10107         (struct FunctionParam): See above.
10108         (class FunctionParam): See above.
10109         (struct StructField): See above.
10110         (class StructField): See above.
10111         (struct TupleField): See above.
10112         (class TupleField): See above.
10113         (struct TraitFunctionDecl): See above.
10114         (class TraitFunctionDecl): See above.
10115         (struct TraitMethodDecl): See above.
10116         (class TraitMethodDecl): See above.
10117         (struct NamedFunctionParam): See above.
10118         (class NamedFunctionParam): See above.
10119         * hir/tree/rust-hir-path.h
10120         (struct GenericArgsBinding): See above.
10121         (class GenericArgsBinding): See above.
10122         (struct TypePathFunction): See above.
10123         (class TypePathFunction): See above.
10124         (struct QualifiedPathType): See above.
10125         (class QualifiedPathType): See above.
10126         * ast/rust-item.h
10127         (struct WhereClause): See above.
10128         (class WhereClause): See above.
10129         (struct SelfParam): See above.
10130         (class SelfParam): See above.
10131         (struct FunctionQualifiers): See above.
10132         (class FunctionQualifiers): See above.
10133         (struct FunctionParam): See above.
10134         (class FunctionParam): See above.
10135         (struct StructField): See above.
10136         (class StructField): See above.
10137         (struct TupleField): See above.
10138         (class TupleField): See above.
10139         (struct TraitFunctionDecl): See above.
10140         (class TraitFunctionDecl): See above.
10141         (struct TraitMethodDecl): See above.
10142         (class TraitMethodDecl): See above.
10143         (struct NamedFunctionParam): See above.
10144         (class NamedFunctionParam): See above.
10146 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10148         * hir/tree/rust-hir-pattern.h
10149         (class AltPattern): Remove duplicate access specifier.
10150         (AltPattern::get_alts): Add.
10151         * hir/tree/rust-hir.cc
10152         (AltPattern::as_string): Add.
10153         (AltPattern::accept_vis): Add.
10155 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10157         * hir/tree/rust-hir-item.h (class ExportedMacro): Add new ExportedMacro class.
10158         * hir/tree/rust-hir.cc (ExportedMacro::accept_vis): New function.
10159         (ExportedMacro::get_locus): Likewise.
10160         (ExportedMacro::get_item_kind): Likewise.
10161         (ExportedMacro::clone_item_impl): Likewise.
10162         * hir/tree/rust-hir-full-decls.h (class ExportedMacro): Forward declare class.
10163         * backend/rust-compile-item.h: Add visitor for ExportedMacro.
10164         * backend/rust-compile-stmt.h: Likewise.
10165         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
10166         * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
10167         * checks/errors/privacy/rust-pub-restricted-visitor.cc (PubRestrictedVisitor::visit):
10168         Likewise.
10169         * checks/errors/privacy/rust-pub-restricted-visitor.h: Likewise.
10170         * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
10171         * checks/errors/privacy/rust-reachability.h: Likewise.
10172         * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
10173         * checks/errors/privacy/rust-visibility-resolver.h: Likewise.
10174         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
10175         * checks/errors/rust-const-checker.h: Likewise.
10176         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
10177         * checks/errors/rust-unsafe-checker.h: Likewise.
10178         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Likewise.
10179         * hir/rust-ast-lower-item.h: Likewise.
10180         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
10181         * hir/rust-hir-dump.h: Likewise.
10182         * hir/tree/rust-hir-visitor.h: Likewise.
10183         * metadata/rust-export-metadata.cc: Likewise.
10184         * typecheck/rust-hir-type-check-item.h: Likewise.
10185         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
10186         * typecheck/rust-hir-type-check-stmt.h: Likewise.
10187         * typecheck/rust-tycheck-dump.h: Likewise.
10188         * hir/tree/rust-hir.h: Add new ItemKind::MacroExport variant.
10189         * util/rust-attributes.cc: Add #[macro_export] attribute.
10191 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
10193         * backend/rust-compile-fnparam.cc (CompileFnParam::visit):
10194         Added visit implementation for ReferencePattern.
10195         (CompileFnParam::create_tmp_param_var):
10196         Refactored duplicated code into a helper function.
10197         * backend/rust-compile-fnparam.h: Added visit implementation for
10198         ReferencePattern.
10199         * backend/rust-compile-pattern.cc (CompilePatternBindings::visit):
10200         Added visit implementation for ReferencePattern and
10201         IdentifierPattern.
10202         * backend/rust-compile-pattern.h: Added visit implementation for
10203         ReferencePattern and IdentifierPattern.
10205 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10207         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Move
10208         unloaded module item loading to...
10209         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): ...here.
10211 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
10213         * hir/rust-hir-dump.cc (Dump::visit): Simplify indentation dump to single line.
10215 2024-01-16  Jakub Dupak  <dev@jakubdupak.com>
10217         * ast/rust-ast-dump.cc (Indent::Indent): Move to separate file.
10218         (operator<<): Move to separate file.
10219         (Indent::increment): Move to separate file.
10220         (Indent::decrement): Move to separate file.
10221         * ast/rust-ast-dump.h (class Indent): Move to separate file.
10222         * hir/rust-hir-dump.cc (Dump::Dump): Use new indentation object.
10223         (Dump::go): Use new indentation object.
10224         (Dump::visit): Use new indention object.
10225         * hir/rust-hir-dump.h: Use new indentation object.
10226         * util/rust-dump.h: New file. Moved Indentation from rust-ast-dump.cc
10228 2024-01-16  Mahmoud Mohamed  <mahadelr19@gmail.com>
10230         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
10231         Add the missing infered type assignment
10233 2024-01-16  Marc Poulhiès  <dkm@kataplop.net>
10235         PR rust/108111
10236         * ast/rust-ast-full-decls.h (StructPatternElements): Declare as a
10237         class.
10238         * ast/rust-item.h (EnumItem): Mark several method as being
10239         overrides.
10240         * ast/rust-pattern.h (StructPattern::get_locus): Add override.
10241         * lex/rust-lex.h (BufferInputSource): Use reference_wrapper
10242         instead of bare reference.
10243         (TokenSource::get): Add method to implement the reference_wrapper
10244         interface.
10245         * typecheck/rust-tyty.h (TypeBoundPredicate): Add empty dtor.
10246         * util/rust-buffered-queue.h (peek): Source token stream is now
10247         using a reference_wrapper, use .get()
10249 2024-01-16  vincent  <jfan30@u.rochester.edu>
10251         * typecheck/rust-hir-type-check-pattern.cc
10252         (TypeCheckPattern::visit): rewrite part code to helper function
10253         (TypeCheckPattern::typecheck_range_pattern_bound): helper function
10254         * typecheck/rust-hir-type-check-pattern.h
10255         (TypeCheckPattern::typecheck_range_pattern_bound):
10256         change the parameter of the function
10258 2024-01-16  goar5670  <mahadelr19@gmail.com>
10260         * hir/tree/rust-hir-pattern.h (HIR::ReferencePattern):
10261         added get_referenced_pattern function.
10262         * resolve/rust-ast-resolve-pattern.h
10263         (Resolve::PatternDeclaration): add visit function for
10264         AST::ReferencePattern
10265         * typecheck/rust-hir-type-check-pattern.cc
10266         (Resolver::TypeCheckPattern): add visit function for
10267         HIR::ReferencePattern
10269 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10271         * util/rust-lang-item.h
10272         (RustLangItem::ItemType): New enumerators.
10273         (RustLangItem::Parse): Parse new enumerators.
10274         (RustLangItem::ToString): Handle new enumerators.
10276 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10278         * backend/rust-compile-fnparam.h:
10279         (CompileFnParam::visit): Add AltPattern visitor.
10280         * backend/rust-compile-pattern.h:
10281         (CompilePatternCaseLabelExpr::visit): Add AltPattern visitor.
10282         (CompilePatternBindings::visit): Add AltPattern visitor.
10283         (CompilePatternLet::visit): Add AltPattern visitor.
10284         * backend/rust-compile-resolve-path.h:
10285         (ResolvePathRef::visit): Add AltPattern visitor.
10286         * backend/rust-compile-var-decl.h:
10287         (CompileVarDecl::visit): Add AltPattern visitor.
10288         * checks/errors/rust-const-checker.cc
10289         (ConstChecker::visit): Add AltPattern visitor.
10290         * checks/errors/rust-const-checker.h:
10291         (ConstChecker::visit): Add AltPattern visitor.
10292         * checks/errors/rust-unsafe-checker.cc
10293         (UnsafeChecker::visit): Add AltPattern visitor.
10294         * checks/errors/rust-unsafe-checker.h:
10295         (UnsafeChecker::visit): Add AltPattern visitor.
10296         * hir/rust-hir-dump.cc
10297         (Dump::visit): Add AltPattern visitor.
10298         * hir/rust-hir-dump.h:
10299         (Dump::visit): Add AltPattern visitor.
10300         * hir/tree/rust-hir-full-decls.h
10301         (class AltPattern): Add forward declaration.
10302         * hir/tree/rust-hir-pattern.h
10303         (class AltPattern): New class.
10304         * hir/tree/rust-hir-visitor.h:
10305         (HIRFullVisitor::visit): Add AltPattern visitor.
10306         (HIRFullVisitorBase::visit): Add AltPattern visitor.
10307         (HIRPatternVisitor::visit): Add AltPattern visitor.
10308         * hir/tree/rust-hir.h:
10309         (Pattern::PatternType::ALT): New enumerator.
10310         * typecheck/rust-hir-type-check-pattern.cc
10311         (TypeCheckPattern::visit): Add AltPattern visitor.
10312         * typecheck/rust-hir-type-check-pattern.h:
10313         (TypeCheckPattern::visit): Add AltPattern visitor.
10315 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10317         * ast/rust-macro.cc (builtin_macro_from_string): Add identifier
10318         identification.
10319         * ast/rust-macro.h (enum class): Add Stringify builtin macro
10320         type.
10321         * expand/rust-macro-builtins.cc (make_macro_path_str): Add path
10322         for builtin stringify macro.
10323         (MacroBuiltin::stringify_handler): Add handler for builtin
10324         stringify macro.
10325         * expand/rust-macro-builtins.h: Add stringify handler's
10326         prototype.
10327         * util/rust-hir-map.cc (Mappings::insert_macro_def): Add
10328         stringify handler to builtin hir map.
10330 2024-01-16  Nikos Alexandris  <nikos-alexandris@protonmail.com>
10332         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
10333                 Add length checking for tuple patterns.
10334         (TypeCheckPattern::emit_pattern_size_error): New function.
10335         * typecheck/rust-hir-type-check-pattern.h: New function
10336                 emit_pattern_size_error.
10338 2024-01-16  goar5670  <mahadelr19@gmail.com>
10340         * parse/rust-parse-impl.h (Parser::parse_expr):
10341         split LEFT_SHIFT before null_denotation.
10343 2024-01-16  Parthib  <parthibdutta02@gmail.com>
10345         * rust-object-export.cc: Modified
10346         * hir/rust-ast-lower-type.cc (rust_fatal_error): Removed
10347                 (rust_assert): Added
10349 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10351         * resolve/rust-early-name-resolver.cc
10352         (EarlyNameResolver::visit):
10353         Check for closure parameter without given type.
10355 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10357         * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_resolved_predicate): remove
10359 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10361         * resolve/rust-ast-resolve-type.cc (ResolveRelativeQualTypePath::resolve_qual_seg): fix
10363 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10365         * ast/rust-path.h: add missing copy for node_id
10367 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10369         * rust-gcc.h: remove unused headers
10371 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10373         * ast/rust-ast.cc (QualifiedPathInType::as_string): add missing to string
10374         * ast/rust-path.h: add missing copy+move constructors and assignment overloads
10375         * hir/tree/rust-hir-path.h: likewise
10376         * hir/tree/rust-hir.cc (QualifiedPathInType::as_string): add missing to string
10378 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10380         * typecheck/rust-tyty.cc (ParamType::get_name): call destructure
10382 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10384         * typecheck/rust-hir-trait-resolve.cc: use unify_and infer
10386 2024-01-16  goar5670  <mahadelr19@gmail.com>
10388         * parse/rust-parse-impl.h (Parser::parse_closure_param):
10389         Replace parse_pattern with parse_pattern_no_alt.
10391 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10393         * parse/rust-parse-impl.h (Parser::parse_while_let_loop_expr):
10394         Prevent hard error on token skip.
10395         (Parser::null_denotation): Fix parser for while let expressions.
10397 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10399         * backend/rust-builtins.cc (BuiltinsContext::setup): add memset builtin to the map
10400         * backend/rust-compile-intrinsic.cc (uninit_handler): implement uninit intrinsic
10402 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10404         * parse/rust-parse-impl.h (Parser::parse_slice_pattern): Add
10405         closing square bracket check.
10407 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10409         * parse/rust-parse-impl.h (Parser::parse_external_type_item):
10410         Fix compilation error due to unnecessary move.
10412 2024-01-16  Abdul Rafey  <abdulrafeyq@gmail.com>
10414         * hir/rust-hir-dump.cc (Dump::go): support inner attrs, crate items and node mappings
10415         (Dump::visit): support functions, arith/logical exprs, let stmts and literals
10417 2024-01-16  Nikos Alexandris  <nikos-alexandris@protonmail.com>
10419         * expand/rust-macro-builtins.cc (load_file_bytes): Add location parameter.
10420         (MacroBuiltin::include_bytes_handler): Pass location to load_file_bytes.
10421         (MacroBuiltin::include_str_handler): Pass location to load_file_bytes.
10423 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10425         * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Handle
10426         RestPattern correctly.
10428 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10430         * ast/rust-pattern.h (class RestPattern): Add NodeId as well as
10431         the clone_impl function.
10433 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10435         * parse/rust-parse-impl.h (Parser::null_denotation): Fix if let
10436         parsing.
10438 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10440         * backend/rust-compile-intrinsic.cc (op_with_overflow_inner): wraps op_with_overflow
10441         (std::function<tree): likewise
10442         (op_with_overflow): generate the intrinsic based on the tree_code op
10444 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10446         * Make-lang.in: Add rust-ast-lower-stmt.o
10447         * hir/rust-ast-lower-stmt.h: Move definitions to...
10448         * hir/rust-ast-lower-stmt.cc: ...here.
10450 2024-01-16  mxlol233  <mxlol233@outlook.com>
10452         * checks/errors/rust-feature-gate.cc: Add definition
10453         for `extern_types`.
10454         * checks/errors/rust-feature-gate.h: Likewise.
10455         * checks/errors/rust-feature.cc: Likewise.
10456         * checks/errors/rust-feature.h: Likewise.
10458 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10460         * ast/rust-pattern.h
10461         (StructPatternElements::operator=): Clear vector before inserting.
10462         (TupleStructItemsNoRange::operator=): Clear vector before inserting.
10463         (TupleStructItemsRange::operator=): Clear vectors before inserting.
10464         (TuplePatternItemsMultiple::operator=): Clear vector before inserting.
10465         (TuplePatternItemsRanged::operator=): Clear vectors before inserting.
10466         (SlicePattern::operator=): Clear vector before inserting.
10467         (AltPattern::operator=): Clear vector before inserting.
10468         * hir/tree/rust-hir-pattern.h
10469         (StructPatternElements::operator=): Clear vector before inserting.
10470         (TupleStructItemsNoRange::operator=): Clear vector before inserting.
10471         (TupleStructItemsRange::operator=): Clear vectors before inserting.
10472         (TuplePatternItemsMultiple::operator=): Clear vector before inserting.
10473         (TuplePatternItemsRanged::operator=): Clear vectors before inserting.
10474         (SlicePattern::operator=): Clear vector before inserting.
10476 2024-01-16  bl7awy  <mahadelr19@gmail.com>
10478         * typecheck/rust-casts.cc (TypeCastRules::cast_rules): Perform destructure on `from` type.
10480 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10482         * ast/rust-pattern.h
10483         (struct StructPatternElements): Change to class.
10484         (class StructPatternElements): Change from struct.
10485         * hir/tree/rust-hir-pattern.h
10486         (struct StructPatternElements): Change to class.
10487         (class StructPatternElements): Change from struct.
10489 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10491         * typecheck/rust-hir-type-check-pattern.cc
10492         (TypeCheckPattern::visit): Improve error messages.
10494 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10496         * hir/tree/rust-hir-pattern.h
10497         (class TupleStructItemsNoRange): Fix formatting.
10498         (class TupleStructItemsRange): Fix formatting.
10499         (class TuplePatternItemsMultiple): Fix formatting.
10500         (class TuplePatternItemsRanged): Fix formatting.
10501         (class SlicePattern): Fix formatting.
10503 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10505         * ast/rust-ast-dump.cc (Dump::visit): Add visitor.
10506         * ast/rust-ast-dump.h: Add visitor prototype.
10507         * ast/rust-ast-full-decls.h (class RestPattern): Add forward
10508         declaration for class RestPattern.
10509         * ast/rust-ast-visitor.h: Add visitor prototype.
10510         * ast/rust-ast.cc (RestPattern::accept_vis): Add function to
10511         accept a foreign visitor.
10512         * ast/rust-pattern.h (class RestPattern): Add class RestPattern.
10513         * checks/errors/rust-feature-gate.h: Add visitor prototype.
10514         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Add
10515         visitor implementation.
10516         * expand/rust-attribute-visitor.h: Add visitor prototype.
10517         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add
10518         visitor implementation.
10519         * hir/rust-ast-lower-base.h: Add visitor prototype.
10520         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add
10521         visitor implementation.
10522         * resolve/rust-ast-resolve-base.h: Add visitor prototype.
10523         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
10524         Add visitor implementation.
10525         * resolve/rust-early-name-resolver.h: Add visitor prototype.
10526         * util/rust-attributes.cc (AttributeChecker::visit): Add visitor
10527         implementation.
10528         * util/rust-attributes.h: Add visitor prototype.
10530 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10532         * typecheck/rust-tyty-cmp.h: remove
10533         * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): likewise
10534         (reset_cmp_autoderef_mode): likewise
10535         * typecheck/rust-tyty.h (set_cmp_autoderef_mode): likewise
10536         (reset_cmp_autoderef_mode): likewise
10538 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10540         * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): Add new try_flag
10541         (TypeCoercionRules::TypeCoercionRules): set new try flag
10542         (TypeCoercionRules::do_coercion): default to a final unify_and in the else case
10543         (TypeCoercionRules::coerce_unsafe_ptr): cannot coerce to a ptr from ref during autoderef
10544         (TypeCoercionRules::coerce_borrowed_pointer): respect coerceable mutability
10545         * typecheck/rust-coercion.h: update header
10546         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): use new TryCoerce interface
10547         (MethodResolver::append_adjustments): ensure we maintain adjustment mappings
10548         * typecheck/rust-hir-dot-operator.h: add new method append_adjustments
10549         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): extra logging
10551 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10553         * typecheck/rust-unify.cc (UnifyRules::go): fix inference check
10555 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10557         * backend/rust-compile-base.h: unconsify
10558         * backend/rust-compile.cc (HIRCompileBase::coercion_site): likewise
10559         (HIRCompileBase::coercion_site1): likewise
10560         * typecheck/rust-autoderef.cc (Adjuster::try_deref_type): likewise
10561         (Adjuster::try_raw_deref_type): likewise
10562         (Adjuster::try_unsize_type): likewise
10563         (AutoderefCycle::cycle): likewise
10564         (AutoderefCycle::try_autoderefed): likewise
10565         * typecheck/rust-autoderef.h: likewise
10566         * typecheck/rust-coercion.cc (TypeCoercionRules::select): likewise
10567         * typecheck/rust-coercion.h: likewise
10568         * typecheck/rust-hir-dot-operator.cc (MethodResolver::Probe): likewise
10569         (MethodResolver::select): likewise
10570         * typecheck/rust-hir-dot-operator.h: likewise
10572 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10574         * typecheck/rust-unify.cc (UnifyRules::go): respect the emit_errors flag
10576 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10578         * typecheck/rust-casts.cc (TypeCastRules::check): update to new interface
10579         * typecheck/rust-coercion.cc (TypeCoercionRules::Coerce): likewise
10580         (TypeCoercionRules::TryCoerce): likewise
10581         (TypeCoercionRules::TypeCoercionRules): likewise
10582         * typecheck/rust-coercion.h: likewise
10583         * typecheck/rust-type-util.cc (coercion_site): likewise
10585 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10587         * typecheck/rust-unify.cc (UnifyRules::go): allow lhs infer vars
10589 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10591         * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): update to new inteface
10592         * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_unsafe_ptr): likewise
10593         (TypeCoercionRules::coerce_borrowed_pointer): likewise
10594         * typecheck/rust-hir-type-check.h: likewise
10595         * typecheck/rust-type-util.cc (unify_site_and): new interface to allow for infer and commit
10596         * typecheck/rust-type-util.h (unify_site_and): likewise
10597         * typecheck/rust-typecheck-context.cc (TypeCheckContext::clear_type): new interface
10598         * typecheck/rust-unify.cc (UnifyRules::UnifyRules): update
10599         (UnifyRules::Resolve): new optional flags for commit and infer
10600         (UnifyRules::go): likewise
10601         (UnifyRules::expect_adt): refactor to use new interface
10602         (UnifyRules::expect_reference): likewise
10603         (UnifyRules::expect_pointer): likewise
10604         (UnifyRules::expect_array): likewise
10605         (UnifyRules::expect_slice): likewise
10606         (UnifyRules::expect_fndef): likewise
10607         (UnifyRules::expect_fnptr): likewise
10608         (UnifyRules::expect_tuple): likewise
10609         (UnifyRules::expect_closure): likewise
10610         * typecheck/rust-unify.h: refactor interface
10612 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10614         * typecheck/rust-unify.cc (UnifyRules::Resolve): refactor
10615         (UnifyRules::commit): refactor
10616         * typecheck/rust-unify.h: likewise
10618 2024-01-16  Philip Herron  <herron.philip@googlemail.com>
10620         * typecheck/rust-tyty.cc (ADTType::is_concrete):  need to consider if is a num_variant
10621         * typecheck/rust-tyty.h: refactor to cc file
10623 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10625         * parse/rust-parse-impl.h (Parser::parse_external_type_item):
10626         Add function to parser an external type item.
10627         (Parser::parse_external_item):
10628         Add identification and parsing for external type items.
10629         * parse/rust-parse.h:
10630         Add parser_external_type_item prototype.
10632 2024-01-16  omkar-mohanty  <franzohouser@gmail.com>
10634         * expand/rust-macro-builtins.cc
10635         (MacroBuiltin::include_str_handler): eager expansion
10636         (make_macro_path_str): macto to string
10637         (parse_single_string_literal): check for eager invocation
10638         (MacroBuiltin::assert_handler): eager expansion
10639         (MacroBuiltin::include_bytes_handler): eager expansion
10640         (MacroBuiltin::include_str_handler): eager expansion
10641         (MacroBuiltin::compile_error_handler): eager expansion
10642         (MacroBuiltin::include_handler): eager expansion
10644 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10646         * ast/rust-item.h (class Method): Add `is_default` field.
10647         (class Function): Likewise.
10648         * parse/rust-parse-impl.h (Parser::parse_item): Add nice error when
10649         parsing `default` outside of an `impl` block
10650         (Parser::parse_trait_impl_item): Allow parsing functions
10651         or methods when seeing `default`.
10653 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10655         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::cast_site):
10656         Remove cast_site.
10657         * typecheck/rust-hir-type-check-base.h: Remove cast_site
10658         prototype.
10659         * typecheck/rust-type-util.cc (cast_site): Add cast_site.
10660         * typecheck/rust-type-util.h (cast_site): Add cast_site
10661         prototype.
10663 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10665         * ast/rust-item.h: Add non-const `get_visibility` to ExternalTypeItem.
10666         * ast/rust-ast-dump.cc (Dump::visit): Add implementation for ExternalTypeItem.
10667         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Likewise.
10669 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10671         * ast/rust-item.h (class ExternalTypeItem): New class.
10672         * ast/rust-ast.cc (ExternalTypeItem::as_string): New function.
10673         (ExternalTypeItem::accept_vis): Likewise.
10674         * ast/rust-ast-full-decls.h (class ExternalTypeItem): Declare class.
10675         * ast/rust-ast-dump.cc (Dump::visit): Add base visitor for ExternalTypeItem.
10676         * ast/rust-ast-dump.h: Likewise.
10677         * ast/rust-ast-visitor.h: Likewise.
10678         * checks/errors/rust-feature-gate.h: Likewise.
10679         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Likewise.
10680         * expand/rust-attribute-visitor.h: Likewise.
10681         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
10682         * hir/rust-ast-lower-base.h: Likewise.
10683         * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
10684         * resolve/rust-ast-resolve-base.h: Likewise.
10685         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
10686         * resolve/rust-early-name-resolver.h: Likewise.
10687         * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
10688         * util/rust-attributes.h: Likewise.
10690 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10692         * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::split_current_token):
10693         Add proper implementation.
10695 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10697         * ast/rust-item.h (class Trait): Add `has_auto` field.
10698         * checks/errors/rust-feature.cc: Add handling for `feature(optin_builtin_traits)`
10699         * checks/errors/rust-feature.h: Likewise.
10700         * lex/rust-lex.cc: Fix keyword classification using hashmap.
10701         * lex/rust-token.h: Add `auto` keyword token.
10702         * parse/rust-parse-impl.h (Parser::parse_vis_item): Parse auto traits
10703         on `auto` keyword.
10705 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10707         * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
10708         Remove TypeCheckBase namespace qualifier.
10709         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::coercion_site):
10710         Remove coercion_site function.
10711         * typecheck/rust-hir-type-check-base.h: Remove coercion_site
10712         prototype.
10713         * typecheck/rust-type-util.cc (coercion_site): Add coercion_site
10714         function.
10715         * typecheck/rust-type-util.h (coercion_site): Add coercion_site
10716         prototype.
10717         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
10718         Remove TypeCheckBase namespace qualifier.
10719         (TypeCheckMethodCallExpr::check): Remove TypeCheckBase namespace
10720         qualifier.
10722 2024-01-16  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10724         * typecheck/rust-autoderef.cc: Remove TypeCheckBase qualifier.
10725         * typecheck/rust-hir-trait-resolve.cc: Remove TypeCheckBase
10726         qualifier.
10727         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site):
10728         Remove unify_site.
10729         * typecheck/rust-hir-type-check-base.h: Remove unify_site
10730         header.
10731         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve):
10732         Remove TypeCheckBase qualifier.
10733         * typecheck/rust-type-util.cc (unify_site): Add unify_site
10734         function.
10735         * typecheck/rust-type-util.h (unify_site): Add unify_site
10736         prototype.
10737         * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::check):
10738         Remove TypeCheckBase qualifier.
10740 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10742         * parse/rust-parse-impl.h (Parser::parse_type): Allow LEFT_SHIFT to
10743         start a type and then split it in `parse_qualified_path_type`
10745 2024-01-16  Arthur Cohen  <arthur.cohen@embecosm.com>
10747         * parse/rust-parse-impl.h (Parser::parse_path_generic_args): Split leading
10748         `LEFT_SHIFT` token into two `LEFT_ANGLE` tokens when parsing generic arguments.
10749         (Parser::parse_type_path_segment): Allow `LEFT_ANGLE` as starting token for
10750         parsing generic arguments.
10752 2024-01-16  mxlol233  <mxlol233@outlook.com>
10754         * checks/errors/rust-feature-gate.cc: Add implementations
10755         for `rustc_attri`.
10756         * checks/errors/rust-feature-gate.h: Likewise.
10758 2024-01-16  Owen Avery  <powerboat9.gamer@gmail.com>
10760         * parse/rust-parse-impl.h
10761         (Parser::parse_pattern): Add.
10762         (Parser::parse_pattern_no_alt): Rename.
10763         * parse/rust-parse.h:
10764         (Parser::parse_pattern): Add.
10765         (Parser::parse_pattern_no_alt): Rename.
10767 2024-01-04  David Malcolm  <dmalcolm@redhat.com>
10769         * lang.opt.urls: New file, autogenerated by
10770         regenerate-opt-urls.py.
10772 2023-12-14  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
10773             Thomas Schwinge  <thomas@codesourcery.com>
10775         * config-lang.in: Add libgrust as a target module for the rust
10776         language.
10778 2023-11-19  David Malcolm  <dmalcolm@redhat.com>
10780         * rust-location.h: Include "rich-location.h".
10782 2023-10-20  Patrick Palka  <ppalka@redhat.com>
10784         PR rust/111899
10785         * backend/rust-constexpr.cc (potential_constant_expression_1):
10786         Remove NON_DEPENDENT_EXPR handling.
10787         * backend/rust-tree.cc (mark_exp_read): Likewise.
10788         (mark_use): Likewise.
10789         (lvalue_kind): Likewise.
10791 2023-09-28  Richard Sandiford  <richard.sandiford@arm.com>
10793         * backend/rust-constexpr.cc (rs_fold_indirect_ref): Remove unused
10794         variables.
10796 2023-09-21  Iain Buclaw  <ibuclaw@gdcproject.org>
10798         * rust-session-manager.cc (Session::init): Call
10799         targetrustm.rust_os_info.
10800         * rust-target.def (rust_os_info): New hook.
10802 2023-09-21  Iain Buclaw  <ibuclaw@gdcproject.org>
10804         * rust-lang.cc (rust_add_target_info): Remove sorry.
10805         * rust-session-manager.cc: Replace include of target.h with
10806         include of tm.h and rust-target.h.
10807         (Session::init): Call targetrustm.rust_cpu_info.
10808         * rust-target.def (rust_cpu_info): New hook.
10809         * rust-target.h (rust_add_target_info): Declare.
10811 2023-09-21  Iain Buclaw  <ibuclaw@gdcproject.org>
10813         * rust-target-def.h: New file.
10814         * rust-target.def: New file.
10815         * rust-target.h: New file.
10817 2023-09-11  Parthib  <94271200+Parthib314@users.noreply.github.com>
10819         * Make-lang.in: Removed rust-gcc-diagnostics object file.
10820         * rust-diagnostics.cc (rust_be_get_quotechars): Added from original file.
10821                 (rust_be_internal_error_at): Likewise.
10822                 (rust_be_error_at): Likewise.
10823                 (class rust_error_code_rule): Likewise.
10824                 (rust_be_warning_at): Likewise.
10825                 (rust_be_fatal_error): Likewise.
10826                 (rust_be_inform): Likewise.
10827                 (rust_be_debug_p): Likewise.
10828         * rust-gcc-diagnostics.cc: Removed.
10830 2023-09-07  David Malcolm  <dmalcolm@redhat.com>
10832         * rust-diagnostics.cc (rust_error_at): New overload.
10833         * rust-diagnostics.h (struct ErrorCode): New struct.
10834         (rust_error_at): New.
10835         (rust_be_error_at): Likewise.
10836         * rust-gcc-diagnostics.cc (class rust_error_code_rule): New class.
10837         (rust_be_error_at): New function.
10838         * typecheck/rust-casts.cc (TypeCastRules::emit_cast_error): Emit E0054
10839         when reporting invalid cast error.
10841 2023-07-05  Robin Dapp  <rdapp@ventanamicro.com>
10842             Juzhe-Zhong  <juzhe.zhong@rivai.ai>
10844         * backend/rust-tree.cc (c_common_type_for_mode): Ditto.
10846 2023-06-22  Paul E. Murphy  <murphyp@linux.ibm.com>
10848         * rust-object-export.cc [TARGET_AIX]: Rename and update usage to
10849         TARGET_AIX_OS.
10851 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10853         * parse/rust-parse-impl.h
10854         (Parser::parse_stmt): Handle unsafe expression statements.
10856 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10858         * parse/rust-parse-impl.h
10859         (Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling.
10861 2023-04-06  M V V S Manoj Kumar  <mvvsmanojkumar@gmail.com>
10863         * ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.
10864         * ast/rust-expr.h (class InlineAsm):Added class definition.
10866 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
10868         * rust-diagnostics.h (struct Error): Add new Kind enum and various new
10869         static constructors to allow for hints as well.
10870         * rust-diagnostics.cc (Error::Error): Use new `kind` field properly.
10871         * checks/errors/privacy/rust-visibility-resolver.cc
10872         (VisibilityResolver::resolve_module_path): Use new Error API.
10873         * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise.
10874         * expand/rust-macro-expand.cc (parse_many): Likewise.
10875         (transcribe_type): Likewise.
10876         * parse/rust-parse-impl.h (Parser::parse_crate): Likewise.
10877         * rust-session-manager.cc (Session::handle_crate_name): Likewise.
10878         * ast/rust-ast.cc (Module::load_items): Likewise.
10880 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
10882         * ast/rust-ast.h: Keep location in TraitItem base class
10883         * ast/rust-item.h (class TraitItemFunc): Use base class location instead.
10884         (class TraitItemMethod): Likewise.
10885         (class TraitItemConst): Likewise.
10886         (class TraitItemType): Likewise.
10887         * ast/rust-macro.h: Likewise.
10889 2023-04-06  SainiAditya1  <Adityasaini10012001@outlook.com>
10891         * hir/tree/rust-hir-full-test.cc: Moved to...
10892         * hir/tree/rust-hir.cc: ...here.
10893         * Make-lang.in: Rename rust-hir-full-test.
10895 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10897         * ast/rust-ast-dump.cc
10898         (Dump::visit): Add AltPattern visitor.
10899         * ast/rust-ast-dump.h:
10900         (Dump::visit): Add AltPattern visitor.
10901         * ast/rust-ast-full-decls.h
10902         (class AltPattern): Add declaration.
10903         * ast/rust-ast-visitor.h:
10904         (ASTVisitor::visit): Add AltPattern visitor.
10905         * ast/rust-ast.cc
10906         (AltPattern::as_string): Add definition.
10907         (AltPattern::accept_vis): Add definition.
10908         * ast/rust-pattern.h
10909         (class AltPattern): Add declaration.
10910         * checks/errors/rust-feature-gate.h:
10911         (FeatureGate::visit) Add AltPattern visitor
10912         * expand/rust-attribute-visitor.cc
10913         (AttrVisitor::visit): Add AltPattern visitor.
10914         * expand/rust-attribute-visitor.h:
10915         (AttrVisitor::visit): Add AltPattern visitor.
10916         * hir/rust-ast-lower-base.cc
10917         (ASTLoweringBase::visit): Add AltPattern visitor.
10918         * hir/rust-ast-lower-base.h:
10919         (ASTLoweringBase::visit): Add AltPattern visitor.
10920         * resolve/rust-ast-resolve-base.cc
10921         (ResolverBase::visit): Add AltPattern visitor.
10922         * resolve/rust-ast-resolve-base.h:
10923         (ResolverBase::visit): Add AltPattern visitor.
10924         * resolve/rust-early-name-resolver.cc
10925         (EarlyNameResolver::visit): Add AltPattern visitor.
10926         * resolve/rust-early-name-resolver.h:
10927         (EarlyNameResolver::visit): Add AltPattern visitor.
10928         * util/rust-attributes.cc
10929         (AttributeChecker::visit): Add AltPattern visitor.
10930         * util/rust-attributes.h:
10931         (AttributeChecker::visit): Add AltPattern visitor.
10933 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10935         * ast/rust-pattern.h: Fix formatting.
10937 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
10939         * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not
10940         return nullptr token in expansion of `include!()`
10942 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10944         * checks/errors/rust-feature-gate.h: Add trailing newline before EOF.
10946 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
10948         * typecheck/rust-hir-trait-reference.cc (TraitReference::clear_associated_types): make const
10949         (TraitReference::clear_associated_type_projections): new interface
10950         * typecheck/rust-hir-trait-reference.h:
10951         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): refactor
10952         (TraitItemReference::associated_type_reset): reset projections
10953         * typecheck/rust-hir-type-bounds.h:
10954         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): fix bounds
10955         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): refactor into cc file
10956         (TypeBoundsProbe::Probe): refactor
10957         (TypeBoundsProbe::is_bound_satisfied_for_type): likewise
10958         (TypeBoundsProbe::assemble_sized_builtin): add builtin for Sized
10959         (TypeCheckBase::get_predicate_from_bound): refactor
10960         (TypeBoundPredicate::lookup_associated_type): refactor
10961         * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl)
10962         (SubstitutionRef::prepare_higher_ranked_bounds): new interface to clear hanging bounds
10963         (SubstitutionRef::monomorphize): refactor
10964         * typecheck/rust-tyty-subst.h:
10965         * typecheck/rust-tyty.cc (BaseType::get_locus): helper
10966         (BaseType::satisfies_bound): ensure bounds are satisfied and assoicated types
10967         (ParamType::ParamType): new field in constructor
10968         (ParamType::clone): update clone
10969         (ParamType::set_implicit_self_trait): new interface
10970         (ParamType::is_implicit_self_trait): likewise
10971         * typecheck/rust-tyty.h: cleanup
10972         * util/rust-hir-map.cc (Mappings::Mappings): builtin marker
10973         (Mappings::~Mappings): delete marker
10974         (Mappings::lookup_builtin_marker): lookup
10975         * util/rust-hir-map.h: update header
10977 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
10979         * hir/tree/rust-hir-item.h: implement virtual function
10980         * hir/tree/rust-hir.h: add virtual function
10982 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
10984         * Make-lang.in: add new dependancy
10985         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor
10986         * typecheck/rust-hir-type-check-base.h: refactor
10987         * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): refactor
10988         * typecheck/rust-type-util.cc: New file.
10989         * typecheck/rust-type-util.h: New file.
10991 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10993         * expand/rust-macro-builtins.cc
10994         (MacroBuiltin::include_str_handler): Add check for valid UTF-8.
10996 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
10998         * parse/rust-parse-impl.h
10999         (Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns.
11001 2023-04-06  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
11003         * lex/rust-lex.h: Add file type check.
11005 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11007         * backend/rust-compile-pattern.cc
11008         (CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements.
11009         * backend/rust-compile-var-decl.h:
11010         (CompileVarDecl::visit): Remove variable declaration for WildcardPattern.
11011         * resolve/rust-ast-resolve-pattern.h:
11012         (PatternDeclaration::visit): Remove name resolution for WildcardPattern.
11014 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11016         * typecheck/rust-tyty-call.cc
11017         (TypeCheckCallExpr::visit): Add variadic argument type checking.
11018         (TypeCheckCallExpr::visit): Fix comment spelling ("varadic").
11020 2023-04-06  mxlol233  <mxlol233@outlook.com>
11022         * checks/errors/rust-feature-gate.cc: Add implementation for
11023         `void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature`
11024         construction process in `FeatureGate::check`.
11025         * checks/errors/rust-feature-gate.h: Add declaration for
11026         `void FeatureGate::visit (AST::ExternBlock &block)`. Add private
11027         variable `valid_feature`.
11028         * checks/errors/rust-feature.h: Change `issue` to `m_issue`.
11030 2023-04-06  Thomas Schwinge  <thomas@codesourcery.com>
11032         * ast/rust-ast-fragment.cc: Update copyright years.
11033         * ast/rust-ast-fragment.h: Likewise.
11034         * ast/rust-macro.cc: Likewise.
11035         * checks/errors/rust-feature-gate.cc: Likewise.
11036         * checks/errors/rust-feature-gate.h: Likewise.
11037         * checks/errors/rust-feature.cc: Likewise.
11038         * checks/errors/rust-feature.h: Likewise.
11039         * hir/rust-ast-lower-expr.cc: Likewise.
11040         * hir/rust-ast-lower-type.cc: Likewise.
11041         * resolve/rust-early-name-resolver.cc: Likewise.
11042         * resolve/rust-early-name-resolver.h: Likewise.
11043         * rust-gcc.h: Likewise.
11044         * typecheck/rust-hir-path-probe.cc: Likewise.
11045         * typecheck/rust-hir-trait-reference.cc: Likewise.
11046         * typecheck/rust-tyty-bounds.h: Likewise.
11047         * typecheck/rust-tyty-subst.cc: Likewise.
11048         * typecheck/rust-tyty-subst.h: Likewise.
11049         * typecheck/rust-tyty-util.cc: Likewise.
11050         * typecheck/rust-tyty-util.h: Likewise.
11051         * typecheck/rust-unify.cc: Likewise.
11052         * typecheck/rust-unify.h: Likewise.
11053         * util/rust-inline-visitor.h: Likewise.
11055 2023-04-06  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
11057         * rust-session-manager.cc (Session::compile_crate): Update the
11058         environment variable name.
11060 2023-04-06  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
11062         * Make-lang.in: Add `rust-hir-trait-reference.o`.
11063         * typecheck/rust-hir-trait-reference.h: Remove multiple function body.
11064         * typecheck/rust-hir-trait-reference.cc: Add multiple function body.
11066 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11068         * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
11069         Add documentation explaining the algorithm.
11071 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11073         * ast/rust-macro.cc: New file.
11074         * Make-lang.in: Add `rust-macro.o` object
11075         * ast/rust-ast-fragment.cc (Fragment::Fragment): Change API around
11076         the construction of AST fragments.
11077         (Fragment::operator=): Correct `Fragment::operator=` to take into
11078         account the fragment tokens.
11079         (Fragment::create_error): Use new constructor.
11080         (Fragment::complete): Remove in favor of new constructor.
11081         (Fragment::unexpanded): Remove as that Fragment type is no longer used
11082         or possible.
11083         (Fragment::get_tokens): Add helper to access a fragment's tokens.
11084         * ast/rust-ast-fragment.h (enum class): Remove `FragmentKind::Unused`
11085         * ast/rust-ast.cc (MacroInvocation::as_string): Display
11086         builtin macro invocations properly.
11087         * ast/rust-ast.h: Fix `DelimTokenTree` class copy constructors and
11088         handling of its token vector.
11089         * ast/rust-macro.h (class MacroMatcher): Format.
11090         (class MetaItemSeq): Likewise.
11091         (builtin_macro_from_string): Get a `BuiltinMacroKind` from a given
11092         string, i.e the name of the macro (`assert!`, `cfg!` and so on).
11093         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Do not expand
11094         macros recursively anymore.
11095         (AttrVisitor::maybe_expand_expr): Likewise.
11096         (AttrVisitor::maybe_expand_type): Likewise.
11097         * expand/rust-attribute-visitor.h: Likewise, and remove
11098         `expand_macro_fragment_recursively` function.
11099         * expand/rust-macro-builtins.cc (make_token): Add shorthand for
11100         returning `std::unique_ptr<AST::Token>`s.
11101         (make_macro_invocation): Add shorthand for returning fragments
11102         containing builtin macro invocations.
11103         (try_expand_macro_expression): Do not expand macros recursively.
11104         (try_expand_single_string_literal): Likewise.
11105         (try_expand_many_expr): Likewise.
11106         (parse_single_string_literal): Error out more appropriately.
11107         (MacroBuiltin::compile_error_handler): Add explanation for eager
11108         invocation
11109         (MacroBuiltin::file_handler): Return the proper tokens associated with
11110         macro invocation, and builtin macros in the case of necessary eager
11111         expansion.
11112         (MacroBuiltin::column_handler): Likewise.
11113         (MacroBuiltin::include_bytes_handler): Likewise.
11114         (MacroBuiltin::include_str_handler): Likewise.
11115         (MacroBuiltin::concat_handler): Likewise.
11116         (MacroBuiltin::env_handler): Likewise.
11117         (MacroBuiltin::cfg_handler): Likewise.
11118         (MacroBuiltin::include_handler): Likewise.
11119         (MacroBuiltin::line_handler): Likewise.
11120         * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
11121         Add function to expand eager invocations *once* in the fixed point
11122         pipeline.
11123         (MacroExpander::expand_invoc): Call into `expand_eager_invocations` for
11124         builtin macro invocations.
11125         (MacroExpander::expand_crate): Use new `AttrVisitor` API.
11126         (parse_many): Return tokens in `AST::Fragment`.
11127         (transcribe_expression): Likewise.
11128         (transcribe_type): Likewise.
11129         * expand/rust-macro-expand.h (struct MacroExpander): Add `has_changed`
11130         flag for fixed point checking.
11131         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver):
11132         Keep track of the current macro scope.
11133         (EarlyNameResolver::go): Use `scoped` API.
11134         (EarlyNameResolver::visit): Likewise.
11135         * resolve/rust-early-name-resolver.h: Add `scoped` API.
11136         * rust-session-manager.cc (Session::expansion): Perform macro expansion
11137         in a fixed-point fashion.
11139 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11141         * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::get_token_slice):
11142         Add API to retrieve token slices when lexing macro expansions.
11143         * expand/rust-macro-invoc-lexer.h: Declare `get_token_slice`.
11145 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11147         * parse/rust-parse.h: Move `parse_macro_invocation` to public API.
11149 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11151         * ast/rust-item.h (class BlockExpr): Remove forward declaration of
11152         class `BlockExpr`.
11154 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11156         * hir/tree/rust-hir-pattern.h
11157         (TuplePatternItemsRanged::get_lower_patterns): Add method.
11158         (TuplePatternItemsRanged::get_upper_patterns): Add method.
11159         * backend/rust-compile-pattern.cc
11160         (CompilePatternLet::visit): Implement TuplePattern visitor.
11161         * backend/rust-compile-pattern.h
11162         (CompilePatternLet::visit): Move TuplePattern visitor out of header file.
11164 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11166         * typecheck/rust-unify.cc (UnifyRules::go): ensure the bounds are checked
11168 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11170         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove error message
11172 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11174         * typecheck/rust-hir-trait-reference.h: add const infterface
11175         * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): make const
11176         (SubstitutionRef::monomorphize): fix issue
11177         * typecheck/rust-tyty-subst.h: constify interface
11179 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11181         * util/rust-lang-item.h:
11183 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11185         * typecheck/rust-tyty-subst.cc (SubstitutionArg::is_conrete): fix check
11187 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11189         * Make-lang.in: update names
11190         * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
11191         update to use new interface
11192         * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_borrowed_pointer): likewise
11193         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): likewise
11194         * typecheck/rust-tyty.cc (BaseType::destructure): likewise
11195         (InferType::unify): removed old unify interface
11196         (ErrorType::unify): likewise
11197         (ADTType::unify): likewise
11198         (TupleType::unify): likewise
11199         (FnType::unify): likewise
11200         (FnPtr::unify): likewise
11201         (ClosureType::unify): likewise
11202         (ArrayType::unify): likewise
11203         (SliceType::unify): likewise
11204         (BoolType::unify): likewise
11205         (IntType::unify): likewise
11206         (UintType::unify): likewise
11207         (FloatType::unify): likewise
11208         (USizeType::unify): likewise
11209         (ISizeType::unify): likewise
11210         (CharType::unify): likewise
11211         (ReferenceType::unify): likewise
11212         (PointerType::unify): likewise
11213         (ParamType::unify): likewise
11214         (StrType::unify): likewise
11215         (NeverType::unify): likewise
11216         (PlaceholderType::unify): likewise
11217         (ProjectionType::unify): likewise
11218         (DynamicObjectType::unify): likewise
11219         * typecheck/rust-tyty.h: update destructure interface
11220         * typecheck/rust-tyty-rules.h: Removed.
11221         * typecheck/rust-unify.cc: New file.
11222         * typecheck/rust-unify.h: New file.
11224 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11226         * typecheck/rust-hir-trait-reference.h: change interface to return self
11227         * typecheck/rust-hir-trait-resolve.cc: likewise
11228         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): likewise
11229         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove monomorphization hack
11231 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11233         * typecheck/rust-tyty-subst.cc: add missing callback
11235 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11237         * typecheck/rust-tyty-subst.cc: update copy constructors
11239 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11241         * typecheck/rust-tyty-bounds.cc: refactor to take a reference
11242         * typecheck/rust-tyty-subst.cc: likewise
11243         (SubstitutionRef::get_substitution_arguments): likewise
11244         (SubstitutionRef::infer_substitions): likewise
11245         * typecheck/rust-tyty-subst.h: likewise
11246         * typecheck/rust-tyty.cc (ADTType::handle_substitions): likewise
11247         (TupleType::handle_substitions): likewise
11248         (FnType::handle_substitions): likewise
11249         (ClosureType::handle_substitions): likewise
11250         (ArrayType::handle_substitions): likewise
11251         (SliceType::handle_substitions): likewise
11252         (ReferenceType::handle_substitions): likewise
11253         (PointerType::handle_substitions): likewise
11254         (ParamType::handle_substitions): likewise
11255         (ProjectionType::handle_substitions): likewise
11256         * typecheck/rust-tyty.h: likewise
11258 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11260         * typecheck/rust-hir-trait-ref.h: Moved to...
11261         * typecheck/rust-hir-trait-reference.h: ...here.
11262         * typecheck/rust-hir-trait-resolve.cc: refactor
11263         * typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRAIT_RESOLVE_H): likewise
11264         * typecheck/rust-hir-type-check.h: likewise
11265         * typecheck/rust-tyty.cc: likewise
11267 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11269         * Make-lang.in: update name
11270         * typecheck/rust-tyctx.cc: Moved to...
11271         * typecheck/rust-typecheck-context.cc: ...here.
11273 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11275         * typecheck/rust-hir-type-check.h: refactor
11276         * typecheck/rust-tyctx.cc (TypeCheckContext::iterate): refactor
11277         (TypeCheckContext::have_loop_context): likewise
11278         (TypeCheckContext::push_new_loop_context): likewise
11279         (TypeCheckContext::push_new_while_loop_context): likewise
11280         (TypeCheckContext::peek_loop_context): likewise
11281         (TypeCheckContext::pop_loop_context): likewise
11282         (TypeCheckContext::swap_head_loop_context): likewise
11283         (TypeCheckContext::insert_trait_reference): likewise
11284         (TypeCheckContext::lookup_trait_reference): likewise
11285         (TypeCheckContext::insert_receiver): likewise
11286         (TypeCheckContext::lookup_receiver): likewise
11287         (TypeCheckContext::insert_associated_type_mapping): likewise
11288         (TypeCheckContext::clear_associated_type_mapping): likewise
11289         (TypeCheckContext::lookup_associated_type_mapping): likewise
11290         (TypeCheckContext::insert_variant_definition): likewise
11291         (TypeCheckContext::lookup_variant_definition): likewise
11292         (TypeCheckContext::insert_operator_overload): likewise
11293         (TypeCheckContext::lookup_operator_overload): likewise
11294         (TypeCheckContext::insert_unconstrained_check_marker): likewise
11295         (TypeCheckContext::have_checked_for_unconstrained): likewise
11296         (TypeCheckContext::insert_resolved_predicate): likewise
11297         (TypeCheckContext::lookup_predicate): likewise
11298         (TypeCheckContext::insert_query): likewise
11299         (TypeCheckContext::query_completed): likewise
11300         (TypeCheckContext::query_in_progress): likewise
11301         (TypeCheckContext::insert_trait_query): likewise
11302         (TypeCheckContext::trait_query_completed): likewise
11303         (TypeCheckContext::trait_query_in_progress): likewise
11304         (TypeCheckContextItem::Item::Item): likewise
11305         (TypeCheckContextItem::TypeCheckContextItem): likewise
11306         (TypeCheckContextItem::get_item): likewise
11307         (TypeCheckContextItem::get_impl_item): likewise
11308         (TypeCheckContextItem::get_trait_item): likewise
11309         (TypeCheckContextItem::get_type): likewise
11310         * typecheck/rust-tyty.cc (StructFieldType::StructFieldType): likewise
11311         (StructFieldType::get_ref): likewise
11312         (StructFieldType::get_name): likewise
11313         (StructFieldType::get_field_type): likewise
11314         (StructFieldType::set_field_type): likewise
11315         (StructFieldType::is_concrete): likewise
11316         (StructFieldType::debug): likewise
11317         (StructFieldType::get_locus): likewise
11318         (VariantDef::variant_type_string): likewise
11319         (VariantDef::VariantDef): likewise
11320         (VariantDef::operator=): likewise
11321         (VariantDef::get_error_node): likewise
11322         (VariantDef::is_error): likewise
11323         (VariantDef::get_id): likewise
11324         (VariantDef::get_defid): likewise
11325         (VariantDef::get_variant_type): likewise
11326         (VariantDef::is_data_variant): likewise
11327         (VariantDef::is_dataless_variant): likewise
11328         (VariantDef::get_identifier): likewise
11329         (VariantDef::num_fields): likewise
11330         (VariantDef::get_field_at_index): likewise
11331         (VariantDef::get_fields): likewise
11332         (VariantDef::lookup_field): likewise
11333         (VariantDef::get_discriminant): likewise
11334         (VariantDef::as_string): likewise
11335         (VariantDef::is_equal): likewise
11336         (VariantDef::clone): likewise
11337         (VariantDef::monomorphized_clone): likewise
11338         (VariantDef::get_ident): likewise
11339         (TupleType::TupleType): likewise
11340         (TupleType::get_unit_type): likewise
11341         (TupleType::is_unit): likewise
11342         (TupleType::num_fields): likewise
11343         (TupleType::is_concrete): likewise
11344         (TupleType::get_fields): likewise
11345         (BoolType::BoolType): likewise
11346         (BoolType::get_name): likewise
11347         (BoolType::is_concrete): likewise
11348         (IntType::IntType): likewise
11349         (IntType::get_name): likewise
11350         (IntType::get_int_kind): likewise
11351         (IntType::is_concrete): likewise
11352         (UintType::UintType): likewise
11353         (UintType::get_name): likewise
11354         (UintType::get_uint_kind): likewise
11355         (UintType::is_concrete): likewise
11356         (FloatType::FloatType): likewise
11357         (FloatType::get_name): likewise
11358         (FloatType::get_float_kind): likewise
11359         (FloatType::is_concrete): likewise
11360         (USizeType::USizeType): likewise
11361         (USizeType::get_name): likewise
11362         (USizeType::is_concrete): likewise
11363         (ISizeType::ISizeType): likewise
11364         (ISizeType::get_name): likewise
11365         (ISizeType::is_concrete): likewise
11366         (CharType::CharType): likewise
11367         (CharType::is_concrete): likewise
11368         (CharType::get_name): likewise
11369         (ReferenceType::ReferenceType): likewise
11370         (ReferenceType::is_concrete): likewise
11371         (ReferenceType::mutability): likewise
11372         (ReferenceType::is_mutable): likewise
11373         (ReferenceType::is_dyn_object): likewise
11374         (ReferenceType::is_dyn_slice_type): likewise
11375         (ReferenceType::is_dyn_str_type): likewise
11376         (PointerType::PointerType): likewise
11377         (PointerType::is_concrete): likewise
11378         (PointerType::mutability): likewise
11379         (PointerType::is_mutable): likewise
11380         (PointerType::is_const): likewise
11381         (PointerType::is_dyn_object): likewise
11382         (PointerType::is_dyn_slice_type): likewise
11383         (PointerType::is_dyn_str_type): likewise
11384         (ParamType::ParamType): likewise
11385         (ParamType::get_generic_param): likewise
11386         (ParamType::can_resolve): likewise
11387         (ParamType::is_concrete): likewise
11388         (StrType::StrType): likewise
11389         (StrType::get_name): likewise
11390         (StrType::is_concrete): likewise
11391         (NeverType::NeverType): likewise
11392         (NeverType::get_name): likewise
11393         (NeverType::is_unit): likewise
11394         (NeverType::is_concrete): likewise
11395         (PlaceholderType::PlaceholderType): likewise
11396         (PlaceholderType::get_name): likewise
11397         (PlaceholderType::is_unit): likewise
11398         (PlaceholderType::get_symbol): likewise
11399         (PlaceholderType::is_concrete): likewise
11400         (ProjectionType::is_unit): likewise
11401         (ProjectionType::get_name): likewise
11402         (ProjectionType::needs_generic_substitutions): likewise
11403         (ProjectionType::supports_substitutions): likewise
11404         (ProjectionType::has_subsititions_defined): likewise
11405         (ProjectionType::get): likewise
11406         (ProjectionType::is_concrete): likewise
11407         (DynamicObjectType::is_concrete): likewise
11408         * typecheck/rust-tyty.h: likewise
11410 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11412         * typecheck/rust-hir-path-probe.cc (PathProbeCandidate::Candidate::Candidate): refactor
11413         (PathProbeCandidate::PathProbeCandidate): likewise
11414         (PathProbeCandidate::as_string): likewise
11415         (PathProbeCandidate::is_enum_candidate): likewise
11416         (PathProbeCandidate::is_impl_candidate): likewise
11417         (PathProbeCandidate::is_trait_candidate): likewise
11418         (PathProbeCandidate::is_full_trait_item_candidate): likewise
11419         (PathProbeCandidate::get_error): likewise
11420         (PathProbeCandidate::is_error): likewise
11421         (PathProbeCandidate::get_defid): likewise
11422         (PathProbeCandidate::operator<): likewise
11423         * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
11425 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11427         * typecheck/rust-hir-path-probe.cc (PathProbeType::PathProbeType): refactor
11428         (PathProbeType::Probe): likewise
11429         (PathProbeType::visit): likewise
11430         (PathProbeType::process_enum_item_for_candiates): likewise
11431         (PathProbeType::process_impl_items_for_candidates): likewise
11432         (PathProbeType::is_reciever_generic): likewise
11433         (PathProbeImplTrait::PathProbeImplTrait): likewise
11434         (PathProbeImplTrait::Probe): likewise
11435         (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
11436         * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
11437         * typecheck/rust-hir-trait-resolve.cc
11438         (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
11440 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11442         * typecheck/rust-tyty.cc (BaseType::BaseType): refactor
11443         (BaseType::~BaseType): likewise
11444         (BaseType::get_ref): likewise
11445         (BaseType::set_ref): likewise
11446         (BaseType::get_ty_ref): likewise
11447         (BaseType::set_ty_ref): likewise
11448         (BaseType::is_equal): likewise
11449         (BaseType::is_unit): likewise
11450         (BaseType::get_kind): likewise
11451         (BaseType::get_combined_refs): likewise
11452         (BaseType::append_reference): likewise
11453         (BaseType::supports_substitutions): likewise
11454         (BaseType::has_subsititions_defined): likewise
11455         (BaseType::can_substitute): likewise
11456         (BaseType::needs_generic_substitutions): likewise
11457         (BaseType::contains_type_parameters): likewise
11458         (BaseType::get_ident): likewise
11459         (BaseType::get_locus): likewise
11460         (InferType::InferType): likewise
11461         (InferType::get_infer_kind): likewise
11462         (InferType::get_name): likewise
11463         (InferType::is_concrete): likewise
11464         (ErrorType::ErrorType): likewise
11465         (ErrorType::is_unit): likewise
11466         (ErrorType::is_concrete): likewise
11467         (ErrorType::get_name): likewise
11468         (ErrorType::monomorphized_clone): likewise
11469         * typecheck/rust-tyty.h (class SubstitutionArgumentMappings): likewise
11471 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11473         * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): refactor
11474         (SubstMapper::Resolve): likewise
11475         (SubstMapper::InferSubst): likewise
11476         (SubstMapper::have_generic_args): likewise
11477         (SubstMapper::visit): likewise
11478         (SubstMapperInternal::visit): likewise
11479         (SubstMapperFromExisting::SubstMapperFromExisting): likewise
11480         (SubstMapperFromExisting::Resolve): likewise
11481         (SubstMapperFromExisting::visit): likewise
11482         (GetUsedSubstArgs::GetUsedSubstArgs): likewise
11483         (GetUsedSubstArgs::From): likewise
11484         (GetUsedSubstArgs::visit): likewise
11485         * typecheck/rust-substitution-mapper.h: refactor
11486         * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): likewise
11488 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11490         * Make-lang.in: update the makefile
11491         * typecheck/rust-tyty.cc (SubstitutionParamMapping::need_substitution): likewise
11492         (SubstitutionParamMapping::override_context): likewise
11493         (SubstitutionRef::get_mappings_from_generic_args): likewise
11494         (SubstitutionRef::infer_substitions): likewise
11495         (SubstitutionRef::are_mappings_bound): likewise
11496         (SubstitutionRef::solve_missing_mappings_from_this): likewise
11497         (SubstitutionRef::monomorphize): likewise
11498         * typecheck/rust-tyty.h (class SubstitutionParamMapping): likewise
11499         (class SubstitutionArg): likewise
11500         (std::function<void): likewise
11501         (class SubstitutionArgumentMappings): likewise
11502         (class SubstitutionRef): likewise
11503         * typecheck/rust-tyty-subst.cc: New file.
11504         * typecheck/rust-tyty-subst.h: New file.
11506 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11508         * Make-lang.in: update makefile
11509         * typecheck/rust-tyty.cc (TyVar::TyVar): move to new file
11510         (TyVar::get_tyty): likewise
11511         (TyVar::get_implicit_infer_var): likewise
11512         (TyVar::subst_covariant_var): likewise
11513         (TyVar::clone): likewise
11514         (TyVar::monomorphized_clone): likewise
11515         (TyWithLocation::TyWithLocation): likewise
11516         * typecheck/rust-tyty.h (class BaseType): cleanup
11517         (class TypeBoundPredicate): move to its own file
11518         (class TypeBoundPredicateItem): likewise
11519         (class TypeBoundsMappings): likewise
11520         (class TyVar): likewise
11521         (class TyWithLocation): likewise
11522         * typecheck/rust-tyty-bounds.h: New file.
11523         * typecheck/rust-tyty-util.cc: New file.
11524         * typecheck/rust-tyty-util.h: New file.
11526 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11528         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicateItem::error): refactor
11529         (TypeBoundPredicateItem::is_error): likewise
11530         (TypeBoundPredicateItem::get_parent): likewise
11531         * typecheck/rust-tyty.h: Move the implementation for the above
11533 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11535         * backend/rust-compile-expr.cc (CompileExpr::visit): Removed copy-pasted comment.
11537 2023-04-06  mxlol233  <mxlol233@outlook.com>
11539         * Make-lang.in: Add object files: `rust-feature.o` and `rust-feature-gate.o`
11540         * checks/errors/rust-feature-gate.cc: New file.
11541         * checks/errors/rust-feature-gate.h: New file.
11542         * checks/errors/rust-feature.cc: New file.
11543         * checks/errors/rust-feature.h: New file.
11544         * rust-session-manager.cc: Add FeatureGate check.
11546 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11548         * parse/rust-parse-impl.h (Parser::parse_closure_expr): Advance tokens
11549         properly when parsing closure param list.
11551 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11553         * parse/rust-parse-impl.h (Parser::parse_generic_arg): Handle type
11554         paths and nested generics properly.
11556 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11558         * ast/rust-pattern.h:
11559         (ReferencePattern::is_double_reference): Add method.
11560         (ReferencePattern::get_is_mut): Add method.
11561         * hir/rust-ast-lower-pattern.cc
11562         (ASTLoweringPattern::visit): Add ReferencePattern visitor.
11563         * hir/rust-ast-lower-pattern.h:
11564         (ASTLoweringPattern::visit): Add ReferencePattern visitor.
11566 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11568         * hir/tree/rust-hir-pattern.h
11569         (class ReferencePattern): Remove has_two_amps field.
11570         * hir/tree/rust-hir-full-test.cc
11571         (ReferencePattern::as_string): Remove usage of ReferencePattern::has_two_amps.
11573 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11575         * backend/rust-compile-fnparam.h
11576         (CompileFnParam::visit): Remove HIR::GroupedPattern visitor.
11577         * backend/rust-compile-pattern.cc
11578         (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
11579         (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
11580         * backend/rust-compile-pattern.h
11581         (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
11582         (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
11583         (CompilePatternLet::visit): Remove HIR::GroupedPattern visitor.
11584         * backend/rust-compile-resolve-path.h
11585         (ResolvePathRef::visit): Remove HIR::GroupedPattern visitor.
11586         * backend/rust-compile-var-decl.h
11587         (CompileVarDecl::visit): Remove HIR::GroupedPattern visitor.
11588         * checks/errors/rust-const-checker.cc
11589         (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
11590         * checks/errors/rust-const-checker.h
11591         (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
11592         * checks/errors/rust-unsafe-checker.cc
11593         (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
11594         * checks/errors/rust-unsafe-checker.h
11595         (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
11596         * hir/rust-hir-dump.cc (Dump::visit): Remove HIR::GroupedPattern visitor.
11597         * hir/rust-hir-dump.h (Dump::visit): Remove HIR::GroupedPattern visitor.
11598         * hir/tree/rust-hir-full-decls.h (class GroupedPattern): Remove class.
11599         * hir/tree/rust-hir-full-test.cc (GroupedPattern::accept_vis): Remove method.
11600         * hir/tree/rust-hir-pattern.h (class GroupedPattern): Remove class.
11601         * hir/tree/rust-hir-visitor.h
11602         (HIRFullVisitor::visit): Remove HIR::GroupedPattern visitor.
11603         (HIRFullVisitorBase::visit): Remove HIR::GroupedPattern visitor.
11604         (HIRPatternVisitor::visit): Remove HIR::GroupedPattern visitor.
11605         * typecheck/rust-hir-type-check-pattern.cc
11606         (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
11607         * typecheck/rust-hir-type-check-pattern.h
11608         (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
11610 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11612         * hir/rust-ast-lower-pattern.cc
11613         (ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern.
11615 2023-04-06  MAHAD  <mahadtxt@gmail.com>
11617         * rust-buffered-queue.h: Moved to...
11618         * util/rust-buffered-queue.h: ...here.
11620 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11622         * parse/rust-parse-impl.h (Parser::parse_type): Handle double ampersan
11623         properly
11624         (Parser::parse_reference_type): Call into `parse_reference_type_inner`
11625         and wrap double reference types in another `AST::ReferenceType` node
11626         (Parser::parse_reference_type_inner): Add parsing implementation
11627         which does not care about the leading token (& or  &&)
11628         (Parser::parse_type_no_bounds): Handle double ampersand properly
11629         * parse/rust-parse.h: Declare `parse_reference_type_inner`
11631 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11633         * backend/rust-compile-pattern.cc (CompilePatternLet::visit): New function.
11634         * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
11635         * backend/rust-compile-pattern.h (class CompilePatternLet): New visitor.
11637 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11639         * ast/rust-macro.h (enum class): Add `BuiltinMacro` enum class.
11640         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Mention
11641         switching on `macro.kind` once builtin macro invocations are properly
11642         handled.
11643         * parse/rust-parse-impl.h (Parser::parse_macro_invocation): Switch to new MacroInvocation
11644         API.
11645         (Parser::parse_type): Likewise.
11646         (Parser::parse_type_no_bounds): Likewise.
11648 2023-04-06  Abdul Rafey  <abdulrafeyq@gmail.com>
11650         * ast/rust-ast-dump.cc (Dump::visit): removed extra indentations in trait ast dump
11652 2023-04-06  Abdul Rafey  <abdulrafeyq@gmail.com>
11654         * parse/rust-parse-impl.h (Parser::null_denotation): Add proper error
11655         when seeing wildcard var on right side of assignment.
11657 2023-04-06  Abdul Rafey  <abdulrafeyq@gmail.com>
11659         * ast/rust-ast.cc: Fix include list.
11660         * ast/rust-expr.h: Likewise.
11661         * hir/tree/rust-hir-expr.h: Likewise.
11662         * rust-backend.h: Likewise.
11663         * util/rust-lang-item.h: Likewise.
11664         * operator.h: Moved to...
11665         * util/rust-operators.h: ...here.
11667 2023-04-06  Parthib  <parthibdutta02@gmail.com>
11669         * Make-lang.in: Rename object file.
11670         * ast/rust-ast-full-test.cc: Moved to...
11671         * ast/rust-ast.cc: ...here.
11673 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11675         * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Add proper
11676         visitor.
11677         (CompilePatternBindings::visit): Likewise.
11678         * backend/rust-compile-pattern.h: Declare them.
11680 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11682         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add proper
11683         visitor.
11685 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11687         * hir/tree/rust-hir-pattern.h: Add get_item method.
11689 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11691         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Add proper visitor.
11692         * hir/rust-ast-lower-pattern.h: Declare it.
11694 2023-04-06  Lyra  <teromene@teromene.fr>
11696         * expand/rust-macro-expand.cc (transcribe_expression): Fix ICE when expanding
11697         empty macros.
11699 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11701         * resolve/rust-ast-resolve-pattern.h: Support GroupedPattern properly.
11703 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11705         * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block):
11706         Allow patterns to declare zero or multiple variables.
11707         * backend/rust-compile-var-decl.h: Change function declaration.
11709 2023-04-06  mxlol233  <mxlol233@outlook.com>
11711         * lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token.
11712         (Lexer::parse_byte_char): Likewise.
11713         (Lexer::parse_byte_string): Likewise.
11714         (Lexer::parse_raw_byte_string): Likewise.
11715         (Lexer::parse_raw_identifier): Likewise.
11716         (Lexer::parse_string): Likewise.
11717         (Lexer::parse_identifier_or_keyword): Likewise.
11718         (Lexer::parse_raw_string): Likewise.
11719         (Lexer::parse_non_decimal_int_literal): Likewise.
11720         (Lexer::parse_decimal_int_or_float): Likewise.
11721         (Lexer::parse_char_or_lifetime): Likewise.
11723 2023-04-06  mxlol233  <mxlol233@outlook.com>
11725         * ast/rust-ast.h: Add get_locus method.
11726         * ast/rust-expr.h: Likewise.
11727         * ast/rust-macro.h: Likewise.
11729 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
11731         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Cleanup LetStmt
11732         type checking.
11734 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11736         * hir/tree/rust-hir-path.h: Add const get_identifier and get_type method.
11737         * typecheck/rust-hir-path-probe.h: Use new SubstitutionArgumentMappings constructor.
11738         * typecheck/rust-hir-trait-resolve.cc: Likewise.
11739         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
11740         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
11741         Do not assert failure on size mismatch anymore.
11742         (TypeBoundPredicate::TypeBoundPredicate): Use new SubstitutionArgumentMappings constructor.
11743         (TypeBoundPredicate::operator=): Likewise.
11744         (TypeBoundPredicate::apply_generic_arguments): Likewise.
11745         (TypeBoundPredicateItem::get_tyty_for_receiver): Likewise.
11746         (TypeBoundPredicate::get_num_associated_bindings): Likewise.
11747         (TypeBoundPredicate::lookup_associated_type): Fix implementation for new system.
11748         (TypeBoundPredicate::get_associated_type_items): Likewise.
11749         * typecheck/rust-tyty.cc (SubstitutionRef::get_mappings_from_generic_args): Add new
11750         behavior.
11751         (SubstitutionRef::infer_substitions): Use new constructor and add comment.
11752         (SubstitutionRef::solve_missing_mappings_from_this): Use new constructor.
11753         * typecheck/rust-tyty.h: Define new constructors.
11755 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
11757         * resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to
11758         Trait items.
11760 2023-04-06  Raiki Tamura  <tamaron1203@gmail.com>
11762         * ast/rust-ast-full-decls.h (class MacroItem): Remove forward declaration.
11763         * ast/rust-ast-full-test.cc (MacroRulesDefinition):
11764         Rework MacroRulesDefinition class
11765         * ast/rust-ast.h (class MacroItem): Remove abstract class.
11766         * ast/rust-item.h (class MacroItem): Remove forward declaration.
11767         * ast/rust-macro.h (class MacroItem): Likewise.
11768         (class MacroRulesDefinition): Add MacroKind enum.
11769         (class MacroInvocation): Fix inheritance.
11770         * lex/rust-token.h: Token "macro" is now used.
11771         * parse/rust-parse-impl.h (Parser::parse_item): Add handling for MACRO.
11772         (Parser::parse_vis_item): Call into parse_decl_macro_def.
11773         (Parser::parse_macro_item): Delete function.
11774         (Parser::parse_macro_rules_def): Return MBE macros only.
11775         (Parser::parse_decl_macro_def): New function.
11776         (Parser::parse_stmt): Handle MACRO token.
11777         (Parser::parse_stmt_or_expr_without_block): Call into parse_macro_rules_def.
11778         * parse/rust-parse.h: Declare new function.
11780 2023-04-06  mxlol233  <mxlol233@outlook.com>
11782         * parse/rust-parse-impl.h (Parser::parse_generic_arg): Add proper bound parsing.
11784 2023-04-06  Dave  <dme2223@gmail.com>
11786         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Use StackedContext
11787         class.
11789 2023-04-06  Prajwal S N  <prajwalnadig21@gmail.com>
11791         * checks/errors/rust-unsafe-checker.cc (check_target_attr): New function.
11792         (UnsafeChecker::check_function_attr): Call into `check_target_attr`.
11793         (UnsafeChecker::visit): Check for target_feature attributes.
11794         * checks/errors/rust-unsafe-checker.h: Add declarations.
11795         * util/rust-attributes.cc: Add attribute.
11797 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
11799         * rust-session-manager.cc (Session::compile_crate): Fix typo.
11801 2023-02-22  Thomas Schwinge  <thomas@codesourcery.com>
11803         * rust-lang.cc (grs_langhook_type_for_mode): Also consider all
11804         'int_n' modes/types.
11806 2023-02-22  Thomas Schwinge  <thomas@codesourcery.com>
11808         * rust-lang.cc (grs_langhook_init): Do not initialize
11809         void_list_node.
11811 2023-02-22  Thomas Schwinge  <thomas@codesourcery.com>
11813         * config-lang.in (target_libs): Remove.
11815 2023-02-21  Raiki Tamura  <tamaron1203@gmail.com>
11817         * backend/rust-builtins.cc (BuiltinsContext::setup_math_fns): New functions.
11819 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
11821         * backend/rust-constexpr.cc (get_nth_callarg): Remove function.
11822         (rs_bind_parameters_in_call): Use CALL_EXPR_ARG instead.
11823         (potential_constant_expression_1): Likewise.
11825 2023-02-21  Thomas Schwinge  <thomas@codesourcery.com>
11827         * lang.opt: Fix ordering of file.
11829 2023-02-21  Philip Herron  <herron.philip@googlemail.com>
11831         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Remove unused parameters.
11832         * backend/rust-constexpr.cc (constant_value_1): Likewise.
11833         (fold_non_dependent_init): Likewise.
11834         * backend/rust-tree.cc (publicly_uniquely_derived_p): Likewise.
11835         (instantiation_dependent_expression_p): Likewise.
11836         (type_has_nontrivial_copy_init): Likewise.
11837         (is_normal_capture_proxy): Likewise.
11838         (resolve_nondeduced_context): Likewise.
11839         (undeduced_auto_decl): Likewise.
11840         (require_deduced_type): Likewise.
11841         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
11842         * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
11843         * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
11844         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
11845         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
11846         * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
11847         * checks/lints/rust-lint-unused-var.cc (unused_var_walk_fn): Likewise.
11848         * expand/rust-macro-builtins.cc (try_expand_single_string_literal): Likewise.
11849         (try_expand_many_expr): Likewise.
11850         (parse_single_string_literal): Likewise.
11851         (MacroBuiltin::assert_handler): Likewise.
11852         (MacroBuiltin::file_handler): Likewise.
11853         (MacroBuiltin::column_handler): Likewise.
11854         (MacroBuiltin::concat_handler): Likewise.
11855         (MacroBuiltin::env_handler): Likewise.
11856         (MacroBuiltin::line_handler): Likewise.
11857         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
11858         (ASTLoweringBase::handle_doc_item_attribute): Likewise.
11859         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
11860         * hir/tree/rust-hir-full-test.cc (ConstGenericParam::accept_vis): Likewise.
11861         * lex/rust-lex.cc (Lexer::parse_utf8_escape): Likewise.
11862         (Lexer::parse_string): Likewise.
11863         (Lexer::parse_char_or_lifetime): Likewise.
11864         * lex/rust-lex.h: Likewise.
11865         * metadata/rust-export-metadata.cc: Likewise.
11866         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
11867         * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
11868         (ResolveTypeToCanonicalPath::visit): Likewise.
11869         * resolve/rust-ast-verify-assignee.h: Likewise.
11870         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
11871         * typecheck/rust-hir-type-check-expr.h: Likewise.
11872         * typecheck/rust-hir-type-check-item.h: Likewise.
11873         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
11874         * typecheck/rust-tyty-rules.h: Likewise.
11875         * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
11877 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
11879         * hir/tree/rust-hir-expr.h: Add const `get_method_name`.
11880         * hir/tree/rust-hir-full-decls.h (struct GenericArgs): Move from `struct`...
11881         (class GenericArgs): ...to `class`.
11882         * hir/tree/rust-hir-path.h (struct GenericArgs): Likewise.
11883         (class GenericArgs): Clear `type_args` in copy constructor.
11884         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Reorder
11885         debug print.
11886         * typecheck/rust-tyty.h: Add default constructors for `SubstitutionArgumentMappings`.
11888 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
11890         * backend/rust-compile-context.cc (Context::push_closure_context): New function.
11891         (Context::pop_closure_context): Likewise.
11892         (Context::insert_closure_binding): Likewise.
11893         (Context::lookup_closure_binding): Likewise.
11894         * backend/rust-compile-context.h: Declare new functions and closure mappings.
11895         * backend/rust-compile-expr.cc (CompileExpr::visit): Visit captures properly.
11896         (CompileExpr::generate_closure_function): Compile captures properly.
11897         * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Check for
11898         closure bindings.
11899         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Compile capture list's
11900         types as well.
11902 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
11904         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Pass captures
11905         properly to `TyTy::ClosureType` constructor.
11906         * typecheck/rust-tyty.cc (ClosureType::as_string): Fix string representation.
11907         (ClosureType::clone): Pass `captures` argument.
11908         * typecheck/rust-tyty.h: Add `captures` field.
11910 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
11912         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Use proper closure
11913         contexts.
11914         * resolve/rust-name-resolver.cc (Scope::lookup_decl_type): New function.
11915         (Scope::lookup_rib_for_decl): Likewise.
11916         (Resolver::insert_resolved_name): Insert captured items.
11917         (Resolver::push_closure_context): New function.
11918         (Resolver::pop_closure_context): Likewise.
11919         (Resolver::insert_captured_item): Likewise.
11920         (Resolver::decl_needs_capture): Likewise.
11921         (Resolver::get_captures): Likewise.
11922         * resolve/rust-name-resolver.h: Declare new functions.
11924 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
11926         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add Rib argument.
11927         (ResolveExpr::resolve_closure_param): Likewise.
11928         * resolve/rust-ast-resolve-implitem.h: Likewise.
11929         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
11930         (ResolveItem::visit): Likewise.
11931         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
11932         * resolve/rust-ast-resolve-pattern.h: Likewise.
11933         * resolve/rust-ast-resolve-stmt.h: Likewise.
11934         * resolve/rust-ast-resolve-toplevel.h: Likewise.
11935         * resolve/rust-ast-resolve-type.h: Likewise.
11936         * resolve/rust-name-resolver.cc (Rib::lookup_decl_type): Likewise.
11937         (Scope::insert): Likewise.
11938         (Resolver::insert_builtin_types): Likewise.
11939         * resolve/rust-name-resolver.h: Likewise.
11941 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
11943         * resolve/rust-name-resolver.cc (MKBUILTIN_TYPE): Remove macro.
11944         (Rib::Rib): Remove `mappings` field.
11945         (Resolver::generate_builtins): Use `setup_builtin` instead of macro.
11946         (Resolver::setup_builtin): New function.
11947         * resolve/rust-name-resolver.h: Declare `setup_builtin`, add FIXME
11948         comment.
11950 2023-02-21  Raiki Tamura  <tamaron1203@gmail.com>
11952         * lex/rust-lex.cc (Lexer::Lexer): Add `dump_lex` boolean flag.
11953         (Lexer::skip_token): Dump tokens if flag is enabled.
11954         (Lexer::dump_and_skip): New function.
11955         * lex/rust-lex.h: Include optional.h and declare functions.
11956         * parse/rust-parse-impl.h (Parser::debug_dump_lex_output): Remove old
11957         unused function.
11958         * parse/rust-parse.h: Likewise.
11959         * rust-session-manager.cc (Session::compile_crate): Pass lexer dump
11960         option to lexer.
11961         (Session::dump_lex): New function.
11962         * util/rust-optional.h: Add missing constructor.
11964 2023-02-21  Dave  <dme2223@gmail.com>
11966         * ast/rust-item.h: Remoe default location for Visibility class.
11967         * parse/rust-parse-impl.h (Parser::parse_visibility): Pass proper location
11968         when instantiating visibilities.
11970 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11972         * ast/rust-ast-dump.cc (Dump::visit): Fix dumping of fn params.
11974 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11976         * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous string when
11977         dumping statements.
11979 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11981         * ast/rust-ast-dump.cc: Remove unused include.
11983 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11985         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
11986         * ast/rust-ast-dump.h: Likewise.
11988 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11990         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
11992 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11994         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
11996 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
11998         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
12000 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12002         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
12004 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12006         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
12008 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12010         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
12012 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12014         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
12015         * ast/rust-ast-dump.h: Add missing getter declaration.
12016         * ast/rust-ast-full-test.cc (BareFunctionType::as_string): Fix bare function
12017         string representation.
12018         * ast/rust-type.h (class BareFunctionType): Declare said getter.
12020 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12022         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
12024 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12026         * ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor.
12028 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12030         * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor.
12032 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12034         * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor.
12036 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12038         * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor
12040 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12042         * ast/rust-ast-dump.cc (Dump::visit): Add missing slice visitor.
12044 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12046         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors.
12047         * ast/rust-ast-dump.h: Likewise.
12048         * ast/rust-ast.h: Add `get_lifetime_bounds` method.
12049         * ast/rust-item.h: Add missing getter for lifetimes.
12050         * ast/rust-type.h: Likewise.
12052 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12054         * ast/rust-ast-dump.cc (Dump::visit): Add new reference visitor wrapper.
12055         * ast/rust-ast-dump.h: Declare it.
12056         * ast/rust-item.h: Add mutable visibility getters.
12058 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12060         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call
12061         to `delete`.
12063 2023-02-21  Dave  <dme2223@gmail.com>
12065         * ast/rust-item.h: Add location member.
12066         * hir/rust-ast-lower.cc (translate_visibility): Pass location argument.
12067         * hir/tree/rust-hir-item.h: Fix constructor to accept Location argument.
12069 2023-02-21  Raiki Tamura  <tamaron1203@gmail.com>
12071         * util/rust-lang-item.h: Add handling for `phantom_data` lang item.
12073 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12075         * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures.
12077 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12079         * ast/rust-ast-dump.h: Fix documentation.
12081 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12083         * ast/rust-ast-dump.cc (Dump::go): Use new API.
12084         (Dump::format_function_param): Refactor.
12085         (Dump::visit_items_joined_by_separator): New function.
12086         (Dump::emit_attrib): Refactor.
12087         (Dump::visit_as_line): New function.
12088         (Dump::visit_items_as_lines): Likewise.
12089         (Dump::visit_items_as_block): Likewise.
12090         (Dump::visit): Use new API.
12091         (Dump::emit_visibility): Likewise.
12092         (Dump::emit_indented_string): Likewise.
12093         (Dump::emit_generic_params): Likewise.
12094         (Dump::format_tuple_field): Likewise.
12095         (Dump::format_struct_field): Likewise.
12096         (Dump::format_function_common): Likewise.
12097         (Dump::visit_function_common): Likewise.
12098         * ast/rust-ast-dump.h: Declare new functions and add documentation.
12100 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12102         * ast/rust-ast-dump.cc (Dump::visit): Add new visit function for overloading.
12103         * ast/rust-ast-dump.h: Add documentation for layer.
12105 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12107         * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): Declare atomic
12108         load intrinsics.
12109         * backend/rust-compile-intrinsic.cc (atomic_load_handler_inner): New handler.
12110         (atomic_load_handler): Likewise.
12111         (unchecked_op_handler): Remove `static` function qualifier.
12112         (build_atomic_builtin_name): Handle load intrinsics.
12113         (atomic_store_handler_inner): New handler.
12115 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12117         * backend/rust-compile-intrinsic.cc (check_for_basic_integer_type): New function.
12118         (build_atomic_builtin_name): Use HIR Type instead of `tree`.
12119         (atomic_store_handler_inner): Cleanup error handling.
12120         (unchecked_op_inner): Likewise.
12122 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12124         * backend/rust-compile-intrinsic.cc (wrapping_op_handler): Refactor to return
12125         an `std::function`.
12126         (wrapping_op_handler_inner): Rename.
12127         (wrapping_add_handler): Remove function.
12128         (wrapping_sub_handler): Likewise.
12129         (wrapping_mul_handler): Likewise.
12131 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12133         * backend/rust-compile-intrinsic.cc (is_basic_integer_type): New function.
12134         (unchecked_op_inner): New handler.
12135         (unchecked_op_handler): New handler.
12137 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12139         * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): New function.
12140         (BuiltinsContext::setup): Call `setup_atomic_fns`.
12141         * backend/rust-builtins.h: Declare `setup_atomic_fns`.
12142         * backend/rust-compile-intrinsic.cc (atomic_store_handler_inner): New function.
12143         (atomic_store_handler): New handler.
12144         (make_unsigned_long_tree): Add helper around making unsigned long trees.
12145         (prefetch_data_handler): Use `make_unsigned_long_tree`.
12146         (build_atomic_builtin_name): New function.
12148 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12150         * backend/rust-constexpr.cc (build_anon_member_initialization): Workaround uninitialized
12151         values.
12152         (build_data_member_initialization): Likewise.
12154 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12156         * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler.
12158 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12160         * expand/rust-macro-builtins.cc (MacroBuiltin::assert): Rename to...
12161         (MacroBuiltin::assert_handler): ..this.
12162         (MacroBuiltin::file): Rename to...
12163         (MacroBuiltin::file_handler): ..this.
12164         (MacroBuiltin::column): Rename to...
12165         (MacroBuiltin::column_handler): ..this.
12166         (MacroBuiltin::include_bytes): Rename to...
12167         (MacroBuiltin::include_bytes_handler): ..this.
12168         (MacroBuiltin::include_str): Rename to...
12169         (MacroBuiltin::include_str_handler): ..this.
12170         (MacroBuiltin::compile_error): Rename to...
12171         (MacroBuiltin::compile_error_handler): ..this.
12172         (MacroBuiltin::concat): Rename to...
12173         (MacroBuiltin::concat_handler): ..this.
12174         (MacroBuiltin::env): Rename to...
12175         (MacroBuiltin::env_handler): ..this.
12176         (MacroBuiltin::cfg): Rename to...
12177         (MacroBuiltin::cfg_handler): ..this.
12178         (MacroBuiltin::include): Rename to...
12179         (MacroBuiltin::include_handler): ..this.
12180         (MacroBuiltin::line): Rename to...
12181         (MacroBuiltin::line_handler): ..this.
12182         * expand/rust-macro-builtins.h: Rename all handlers.
12183         * util/rust-hir-map.cc (Mappings::insert_macro_def): Use new handler
12184         names.
12186 2023-02-21  Simon Cook  <simon.cook@embecosm.com>
12188         * util/rust-inline-visitor.h: Remove some offending system includes.
12190 2023-02-21  YizhePKU  <yizhe@pku.edu.cn>
12192         * util/rust-inline-visitor.h: New file.
12194 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12196         * backend/rust-compile-expr.cc (CompileExpr::visit): Refactor checking of closures.
12197         (CompileExpr::generate_possible_fn_trait_call): New function.
12198         * backend/rust-compile-expr.h: Declare `generate_possible_fn_trait_call`.
12200 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12202         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Add missing
12203         implementation.
12205 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12207         * Make-lang.in: Compile rust-ast-lower-type.cc.
12208         * ast/rust-path.h: Add `get_locus` method to `TypePathFunction`.
12209         * hir/rust-ast-lower-base.cc (ASTLowerTypePath::visit): Move implementation to
12210         rust-ast-lower-type.cc.
12211         (ASTLowerQualifiedPathInType::visit): Likewise.
12212         (ASTLoweringType::visit): Likewise.
12213         * hir/rust-ast-lower-type.h: Move implementations to source file.
12214         * hir/tree/rust-hir-path.h: Likewise.
12215         * hir/rust-ast-lower-type.cc: New file.
12217 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12219         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of
12220         function case.
12222 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12224         * backend/rust-compile-context.h: Add new functions: `insert_closure_decl` and
12225         `lookup_closure_decl`.
12226         * backend/rust-compile-expr.cc (CompileExpr::visit): Start compiling Closures properly.
12227         (CompileExpr::generate_closure_function): New function.
12228         (CompileExpr::generate_closure_fntype): Likewise.
12229         * backend/rust-compile-expr.h: Declare `generate_closure_function` and
12230         `generate_closure_fntype`.
12231         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Visit closure types properly.
12232         * backend/rust-mangle.cc (legacy_mangle_name): Add support for closures.
12233         * backend/rust-tree.h (RS_CLOSURE_FLAG): Add new tree macro.
12234         (RS_CLOSURE_TYPE_P): And checking for it on tree nodes.
12235         * typecheck/rust-tyty.cc (ClosureType::is_equal): Add implementation.
12237 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12239         * hir/tree/rust-hir-expr.h: Add `get_params` method.
12240         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Typecheck closure nodes.
12241         (TypeCheckExpr::resolve_fn_trait_call): New function.
12242         * typecheck/rust-hir-type-check-expr.h: Declare `resolve_fn_trait_call` and
12243         `resolve_possible_fn_trait_call_method_name`.
12244         * typecheck/rust-hir-type-check.h: Declare `get_context_type`.
12245         * typecheck/rust-tyctx.cc (TypeCheckContextItem::get_context_type): New function.
12246         * typecheck/rust-tyty-cmp.h: Visit closures properly.
12247         * typecheck/rust-tyty-rules.h: Likewise.
12248         * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Add commented out assertin.
12249         (ClosureType::as_string): Implement it.
12250         (ClosureType::clone): Fix closure cloning.
12251         (ClosureType::setup_fn_once_output): New function.
12252         * typecheck/rust-tyty.h: Improve `ClosureType` class and declare `setup_fn_once_output`.
12254 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12256         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Visit closures properly.
12257         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
12258         * checks/lints/rust-lint-marklive.h: Likewise.
12260 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12262         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Simplify method
12263         call type checking      by removing visitor and instead using one static cast. Use the
12264         new interface.
12265         * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
12266         (TypeCheckMethodCallExpr::go): Likewise.
12267         (TypeCheckMethodCallExpr::check): Likewise.
12268         * typecheck/rust-tyty-call.h (class TypeCheckMethodCallExpr): Likewise.
12269         (class Argument): Likewise.
12271 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12273         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Visit closure properly when
12274         name resolving.
12275         (ResolveExpr::resolve_closure_param): Implement closure name resolving.
12276         * resolve/rust-ast-resolve-expr.h: Declare visitors for closure types.
12278 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12280         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::ASTLoweringPattern):
12281         Improve formatting.
12282         (ASTLoweringPattern::translate): Likewise.
12283         * hir/rust-ast-lower-pattern.h: Likewise.
12284         * resolve/rust-ast-resolve-expr.h: Likewise.
12286 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12288         * Make-lang.in: Add new object file for expression lowering.
12289         * ast/rust-expr.h: Move implementation of expr lowering to source file.
12290         * backend/rust-compile-block.h: Likewise.
12291         * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
12292         * backend/rust-compile-expr.h: Likewise.
12293         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
12294         * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
12295         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
12296         * checks/errors/rust-const-checker.h: Likewise.
12297         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
12298         * checks/errors/rust-unsafe-checker.h: Likewise.
12299         * hir/rust-ast-lower-base.h: Likewise.
12300         * hir/rust-ast-lower-expr.h (RUST_AST_LOWER_EXPR): Likewise.
12301         * hir/rust-ast-lower.cc (ASTLoweringBase::lower_closure_param): Likewise.
12302         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
12303         * hir/rust-hir-dump.h: Likewise.
12304         * hir/tree/rust-hir-expr.h (class ClosureExpr): Likewise.
12305         (class ClosureExprInner): Likewise.
12306         (class ClosureExprInnerTyped): Likewise.
12307         * hir/tree/rust-hir-full-decls.h (class ClosureExprInner): Likewise.
12308         (class ClosureExprInnerTyped): Likewise.
12309         * hir/tree/rust-hir-full-test.cc (ClosureExprInnerTyped::as_string): Likewise.
12310         (ClosureExprInner::as_string): Likewise.
12311         (ClosureExprInner::accept_vis): Likewise.
12312         (ClosureExpr::accept_vis): Likewise.
12313         (ClosureExprInnerTyped::accept_vis): Likewise.
12314         * hir/tree/rust-hir-visitor.h: Likewise.
12315         * hir/tree/rust-hir.h (class Expr): Likewise.
12316         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
12317         * typecheck/rust-hir-type-check-expr.h: Likewise.
12318         * hir/rust-ast-lower-expr.cc: New file.
12320 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12322         * util/rust-lang-item.h: Add handling for `fn_once_output`.
12324 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12326         * ast/rust-ast-fragment.cc (Fragment::Fragment): Add better APIs.
12327         (Fragment::complete): New function.
12328         (Fragment::unexpanded): New function.
12329         * ast/rust-ast-fragment.h: Declare new APIs and add documentation.
12330         * expand/rust-attribute-visitor.h: Use new Fragment API.
12331         * expand/rust-macro-builtins.cc (MacroBuiltin::file): Likewise.
12332         (MacroBuiltin::column): Likewise.
12333         (MacroBuiltin::include_bytes): Likewise.
12334         (MacroBuiltin::include_str): Likewise.
12335         (MacroBuiltin::concat): Likewise.
12336         (MacroBuiltin::env): Likewise.
12337         (MacroBuiltin::cfg): Likewise.
12338         (MacroBuiltin::include): Likewise.
12339         (MacroBuiltin::line): Likewise.
12340         * expand/rust-macro-expand.cc (parse_many): Likewise.
12341         (transcribe_expression): Likewise.
12342         (transcribe_type): Likewise.
12343         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
12345 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12347         * ast/rust-ast.h (class ASTFragment): Remove old ASTFragment class.
12348         * ast/rust-macro.h (class MacroRulesDefinition): Use new Fragment API.
12349         * expand/rust-attribute-visitor.h: Likewise.
12350         * expand/rust-macro-builtins.cc (macro_end_token): Likewise.
12351         (MacroBuiltin::assert): Likewise.
12352         (MacroBuiltin::file): Likewise.
12353         (MacroBuiltin::column): Likewise.
12354         (MacroBuiltin::include_bytes): Likewise.
12355         (MacroBuiltin::include_str): Likewise.
12356         (MacroBuiltin::compile_error): Likewise.
12357         (MacroBuiltin::concat): Likewise.
12358         (MacroBuiltin::env): Likewise.
12359         (MacroBuiltin::cfg): Likewise.
12360         (MacroBuiltin::include): Likewise.
12361         (MacroBuiltin::line): Likewise.
12362         * expand/rust-macro-builtins.h: Likewise.
12363         * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
12364         (MacroExpander::expand_invoc): Likewise.
12365         (MacroExpander::match_repetition): Likewise.
12366         (parse_many): Likewise.
12367         (transcribe_many_items): Likewise.
12368         (transcribe_many_ext): Likewise.
12369         (transcribe_many_trait_items): Likewise.
12370         (transcribe_many_impl_items): Likewise.
12371         (transcribe_many_trait_impl_items): Likewise.
12372         (transcribe_expression): Likewise.
12373         (transcribe_type): Likewise.
12374         (transcribe_on_delimiter): Likewise.
12375         (tokens_to_str): Likewise.
12376         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
12377         * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
12379 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12381         * Make-lang.in: Add `rust-ast-fragment.o` object file.
12382         * ast/rust-ast-fragment.cc: New file.
12383         * ast/rust-ast-fragment.h: New file.
12385 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12387         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): Check if a
12388         trait query is currently in progress.
12389         * typecheck/rust-hir-type-check.h (class TraitQueryGuard): Add helpers around
12390         checking for trait queries and inserting them.
12392 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12394         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors for macro definition dumping.
12395         (get_delimiters): New function.
12396         * ast/rust-ast-dump.h: Declare `get_delimiters` and add documentation.
12397         * ast/rust-macro.h: Add `get_token_tree` method.
12399 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12401         * ast/rust-ast-dump.cc (Dump::visit): Properly handle unloaded modules.
12403 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12405         * ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules.
12407 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12409         * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly.
12411 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12413         * ast/rust-ast-dump.cc: Emit visibility when dumping items.
12415 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12417         * hir/rust-ast-lower-base.h (class ItemWrapper): New class.
12418         * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Use
12419         `ItemWrapper` class.
12420         (ASTLoweringBase::handle_doc_item_attribute): Likewise.
12421         (ASTLoweringBase::handle_lang_item_attribute): Likewise.
12422         * hir/rust-ast-lower-implitem.h: Check outer attributes on items.
12423         * hir/tree/rust-hir-item.h: Add `get_trait_locus` methods.
12424         * hir/tree/rust-hir.h: Likewise.
12425         * util/rust-hir-map.h: Add defId mappings and associated functions.
12426         * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Implement insertion to said
12427         mappings.
12428         (Mappings::lookup_trait_item_defid): And looking up said mappings.
12430 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
12432         * ast/rust-ast-dump.cc (Dump::visit): Add code for dumping type aliases.
12434 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12436         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::TraitResolver): Do not nullptr init
12437         `resolved_trait_reference` anymore.
12438         (TraitResolver::resolve_path): Simplify function and rename to...
12439         (TraitResolver::resolve_path_to_trait): ...this.
12440         (TraitResolver::lookup_path): Use new interface.
12441         * typecheck/rust-hir-trait-resolve.h (class TraitResolver): Do not inherit `HIRFullVisitor`
12442         class anymore.
12444 2023-02-21  David Faust  <david.faust@oracle.com>
12446         * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs.
12448 2023-02-21  David Faust  <david.faust@oracle.com>
12450         * ast/rust-ast-dump.cc (Dump::visit): Add dump for, BorrowExpr, DereferenceExpr,
12451         ErrorPropagationExpr, NegationExpr, TypeCastExpr and GroupedExpr.
12453 2023-02-21  David Faust  <david.faust@oracle.com>
12455         * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr.
12457 2023-02-21  David Faust  <david.faust@oracle.com>
12459         * ast/rust-ast-dump.cc (Dump::visit): Add dumps for ComparisonExpr and
12460         LazyBooleanExpr.
12462 2023-02-21  David Faust  <david.faust@oracle.com>
12464         * ast/rust-ast-dump.cc (Dump::visit): Fix IfExpr formatting.
12466 2023-02-21  David Faust  <david.faust@oracle.com>
12468         * ast/rust-ast-dump.cc (Dump::visit): Fix block formatting.
12470 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12472         * typecheck/rust-autoderef.cc: Add support for multiple resolution candidates.
12473         * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver): Edit
12474         `try_result` field and change constructor.
12475         (MethodResolver::Probe): Return set of candidates instead of singular candidate.
12476         (MethodResolver::select): Add better implementation to account for multiple
12477         candidates.
12478         * typecheck/rust-hir-dot-operator.h (struct MethodCandidate): Overload comparison
12479         operator in order to store them in `std::set`.
12480         * typecheck/rust-hir-inherent-impl-overlap.h: Do not fail assertion on missing type.
12481         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adapt code to use
12482         multiple candidates.
12483         * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): Add code to handle automatic
12484         derefs properly.
12485         (reset_cmp_autoderef_mode): Add helper function to reset said mode.
12486         * typecheck/rust-tyty.h (set_cmp_autoderef_mode): Declare function.
12487         (reset_cmp_autoderef_mode): Likewise.
12488         * typecheck/rust-tyty-cmp.h: Add handling of `autoderef_cmp_flag`
12490 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12492         * util/rust-abi.cc (get_abi_from_string): Add missing "rust-call"
12493         possibility for ABI variant.
12495 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12497         * util/rust-lang-item.h: Add `fn_once` lang item.
12499 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12501         * backend/rust-compile.cc: Add note about missing support for super
12502         traits.
12503         * typecheck/rust-tyty.cc (BaseType::satisfies_bound): New function.
12504         (BaseType::bounds_compatible): New function.
12505         (DynamicObjectType::get_object_items): New function.
12506         * typecheck/rust-hir-trait-ref.h: Use new API to perform type resolution
12507         on dyn objects.
12509 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12511         * Make-lang.in: Compile early name resolver.
12512         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Move macro
12513         name resolution.
12514         * expand/rust-macro-builtins.cc (try_expand_macro_expression): Run ENR
12515         when recursively expanding macros.
12516         * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): No longer
12517         perform name resolution in `expand_invoc`.
12518         * expand/rust-macro-expand.h (struct MacroExpander): Keep ENR within
12519         MacroExpander.
12520         * rust-session-manager.cc (Session::expansion): Run ENR.
12521         * resolve/rust-early-name-resolver.cc: New file.
12522         * resolve/rust-early-name-resolver.h: New file.
12524 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12526         * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class.
12528 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12530         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for
12531         glob import resolving.
12533 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12535         * util/rust-hir-map.h: Add new mappings.
12536         * util/rust-hir-map.cc (Mappings::insert_macro_invocation): Add insertion
12537         function into mappings.
12538         (Mappings::lookup_macro_invocation): Add lookup function for mappings.
12540 2023-02-21  Marc Poulhiès  <dkm@kataplop.net>
12542         * parse/rust-parse-impl.h (Parser::parse_stmt_or_expr_without_block):
12543         Check if `expr` is valid after parsing it.
12545 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12547         * backend/rust-builtins.cc (BuiltinsContext::setup): Declare prefetch
12548         intrinsics.
12549         * backend/rust-compile-intrinsic.cc (enum class Prefetch): Add kinds of
12550         prefetch intrinsics.
12551         (prefetch_data_handler): New function.
12552         (prefetch_read_data): Likewise.
12553         (prefetch_write_data): Likewise.
12555 2023-02-21  David Faust  <david.faust@oracle.com>
12557         * ast/rust-ast-dump.cc (Dump::visit): Fill empty functions for
12558         structs, enums and unions.
12560 2023-02-21  David Faust  <david.faust@oracle.com>
12562         * ast/rust-ast-dump.cc (Dump::format_tuple_field): New.
12563         (Dump::format_struct_field): New.
12564         * ast/rust-ast-dump.h (format_tuple_field): New.
12565         (format_struct_field): New.
12567 2023-02-21  David Faust  <david.faust@oracle.com>
12569         * ast/rust-ast-dump.cc (Dump::visit): move generic params dump ...
12570         (Dump::emit_generic_params): ... here.
12571         * ast/rust-ast-dump.h (emit_generic_params): New.
12573 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12575         * typecheck/rust-hir-trait-ref.h (lookup_trait_item): Add lookup
12576         in super_trait.
12578 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12580         * backend/rust-compile-expr.cc
12581         (CompileExpr::resolve_method_address): Use auto and minor change
12582         in candidate init.
12583         * typecheck/rust-hir-type-check-path.cc
12584         (TypeCheckExpr::resolve_segments): Likewise.
12585         * typecheck/rust-hir-type-check-type.cc: Likewise.
12586         * backend/rust-compile-resolve-path.cc
12587         (HIRCompileBase::query_compile): Likewise. Removecall to
12588         set_ty_ref.
12589         * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): Add
12590         locus initializer in ctor, implement get_defid.
12591         (class PathProbeType::Probe): return a set instead of vector.
12592         Adjust class impl.
12593         (class ReportMultipleCandidateError): Do not inherit from
12594         HIRImplVisitor anymore and remove corresponding impl. Adjust for
12595         change in Probe. Simplify Report handling.
12596         (class PathProbeImplTrait::Probe): Adjust return type.
12598 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12600         * typecheck/rust-hir-type-check-enumitem.cc
12601         (TypeCheckEnumItem::visit): Adjust VariantDef ctor calls with
12602         DefID.
12603         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
12604         Likewise.
12605         * typecheck/rust-tyty.h (VariantDef): Add defid parameter to ctor.
12607 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12609         * Make-lang.in: Add `rust-builtins.o` as target
12610         * backend/rust-builtins.h: Refactor to new file.
12611         * backend/rust-builtins.cc: New file.
12613 2023-02-21  David Faust  <david.faust@oracle.com>
12615         * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for If
12616         expressions.
12618 2023-02-21  David Faust  <david.faust@oracle.com>
12620         * ast/rust-ast-dump.cc (Dump::visit): Dump assignment and compound
12621         assignment expressions.
12623 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12625         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type):
12626         Check for recursive queries.
12627         * typecheck/rust-hir-type-check.h: New functions: `query_completed`,
12628         `query_in_progress`, `insert_query`.
12629         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Use `query_type` API.
12631 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12633         * ast/rust-ast-dump.cc (Dump::emit_visibility): New function.
12634         (Dump::visit): Call into `emit_visibility`.
12635         (Dump::format_function_common): Likewise.
12636         * ast/rust-ast-dump.h: Declare `emit_visibility`.
12638 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
12640         * ast/rust-item.h: Rename get_public_vis_type.
12641         * hir/rust-ast-lower.cc (translate_visibility): Use new name.
12643 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
12645         * resolve/rust-name-resolver.h: Add miscellenaous item mappings.
12646         * resolve/rust-name-resolver.cc (Resolver::insert_resolved_misc): Use
12647         new mappings.
12648         (Resolver::lookup_resolved_misc): Likewise.
12649         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
12650         Adapt function to insert into miscelleanous mappings.
12651         * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
12652         Allow lookup in miscelleanous mappings in mark-live phase.
12654 2023-02-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
12656         * backend/rust-tree.cc: Include memmodel.h.
12658 2023-02-17  Thomas Schwinge  <thomas@codesourcery.com>
12660         * backend/rust-tree.cc: '#include "tm_p.h"'.
12662 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12664         * Make-lang.in: Remove `rust-hir-typecheck-toplevel` object and add
12665         `rust-hir-path-probe` one.
12666         * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver):
12667         Remove no longer used `context` and `mapping` fields, and use new
12668         `query_type` API.
12669         (MethodResolver::MethodResolver): Likewise.
12670         (MethodResolver::select): Use new `query_type` API.
12671         * typecheck/rust-hir-path-probe.h: New header.
12672         * typecheck/rust-hir-path-probe.cc: New file.
12673         * typecheck/rust-hir-dot-operator.h (class MethodResolver): Remove no
12674         longer used `context` and `mapping` fields, and use new `query_type` API.
12675         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): New function.
12676         * typecheck/rust-hir-type-check-base.h: Declare `query_type` function.
12677         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add debug print.
12678         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::Resolve):
12679         Refactor and make use of new query system.
12680         (TypeCheckTopLevelExternItem::Resolve): Likewise.
12681         (TypeCheckTopLevelExternItem::visit): Likewise.
12682         (TypeCheckTopLevelImplItem::visit): Likewise.
12683         (TypeCheckImplItem::visit): Likewise.
12684         (TypeCheckImplItem::TypeCheckImplItem): Likewise.
12685         (TypeCheckImplItem::Resolve): Likewise.
12686         (TypeCheckImplItemWithTrait::visit): Likewise.
12687         * typecheck/rust-hir-type-check-implitem.h (class TypeCheckTopLevelImplItem): Likewise.
12688         (class TypeCheckImplItemWithTrait): Likewise.
12689         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::TypeCheckItem): Likewise.
12690         (TypeCheckItem::Resolve): Likewise.
12691         (TypeCheckItem::ResolveImplItem): Likewise.
12692         (TypeCheckItem::ResolveImplBlockSelf): Likewise.
12693         (TypeCheckItem::visit): Likewise.
12694         (TypeCheckItem::resolve_impl_item): Likewise.
12695         (TypeCheckItem::resolve_impl_block_substitutions): Likewise.
12696         (TypeCheckItem::resolve_impl_block_self): Likewise.
12697         * typecheck/rust-hir-type-check-item.h: Likewise.
12698         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise.
12699         (TypeCheckExpr::resolve_segments): Likewise.
12700         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
12701         * typecheck/rust-hir-type-check-stmt.h: Likewise.
12702         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::Resolve): Likewise.
12703         (TypeCheckType::visit): Likewise.
12704         (TypeCheckType::resolve_root_path): Likewise.
12705         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
12706         * typecheck/rust-hir-type-check.h: Likewise.
12707         * typecheck/rust-substitution-mapper.h: Likewise.
12708         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
12709         (TypeCheckBase::get_predicate_from_bound): Likewise.
12710         (TypeBoundsMappings::add_bound): Likewise.
12711         * typecheck/rust-tyty-cmp.h: Likewise.
12712         * typecheck/rust-tyty.h: Likewise.
12713         * typecheck/rust-tyty.cc (SubstitutionRef::infer_substitions): Likewise.
12714         (ParamType::resolve): Do not infinite loop anymore.
12715         * util/rust-hir-map.h: Add new `hirImplBlockTypeMappings` and
12716         declare `lookup_impl_block_type`.
12717         * util/rust-hir-map.cc (Mappings::insert_hir_impl_block): Use new
12718         `hirImplBlockTypeMappings`
12719         (Mappings::lookup_impl_block_type): New function.
12721 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12723         * backend/rust-compile-context.h: Add new optional `asm_name` string
12724         argument to `lookup_function_decl`.
12725         * backend/rust-compile-item.cc (CompileItem::visit): Compute assembly
12726         name and pass it to `lookup_function_decl` when calling it.
12728 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12730         * backend/rust-constexpr.cc (eval_store_expression): Remove invalid
12731         assertion on constexpr constructors.
12733 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12735         * backend/rust-compile-expr.h: Formatting.
12737 2023-01-31  liushuyu  <liushuyu011@gmail.com>
12739         * ast/rust-ast.h (class MacroInvocData): Store expander as
12740         member of the class.
12741         (class Expr): Add `is_literal` virtual method
12742         * ast/rust-expr.h: Override `is_literal` for `LiteralExpr`s.
12743         * expand/rust-macro-builtins.cc (try_expand_macro_expression): New function.
12744         (try_extract_string_literal_from_fragment): Likewise.
12745         (try_expand_single_string_literal): Likewise.
12746         (try_expand_many_expr): Likewise.
12747         (parse_single_string_literal): Add macro expander as argument.
12748         (MacroBuiltin::include_bytes): Pass expander as argument to
12749         `parse_single_string_literal`.
12750         (MacroBuiltin::include_str): Likewise.
12751         (MacroBuiltin::compile_error): Likewise.
12752         (MacroBuiltin::include): Likewise.
12753         (MacroBuiltin::concat): Likewise and add better error handling.
12754         (MacroBuiltin::env): Likewise.
12755         * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Expand
12756         invocations recursively.
12758 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12760         * lang.opt: Add new ``-frust-compile-until` option.
12761         * rust-session-manager.cc (Session::compile_crate): Add stops around
12762         various compilation steps in the pipeline.
12763         * rust-session-manager.h (struct CompileOptions): Add `CompileStep` enum
12764         and field.
12766 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12768         * backend/rust-tree.cc (rs_type_quals): Comment out bad assertion
12770 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12772         * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit):
12773         Make static items behave more similarly to const items.
12775 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12777         * backend/rust-compile-item.cc (CompileItem::visit): Const evaluate
12778         static item expressions.
12780 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12782         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Do not lower
12783         null items within modules.
12785 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12787         * util/rust-attributes.cc: Add `macro_use` to list of builtin
12788         attributes.
12790 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12792         * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Allow
12793         getting an error string from a specific constant context.
12794         (ConstChecker::ctx_allows_default): New function, check if a context
12795         allows default values for Const generics.
12796         (ConstChecker::visit): Call into `ctx_allows_default`.
12797         * checks/errors/rust-const-checker.h: Declare `ctx_allows_default`.
12799 2023-01-31  liushuyu  <liushuyu011@gmail.com>
12801         * backend/rust-compile-expr.cc (CompileExpr::visit): Properly formulate
12802         exit condition when compiling while loops.
12804 2023-01-31  Faisal Abbas  <90.abbasfaisal@gmail.com>
12806         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Turn
12807         constant item typechecking into a coercion site instead of a unify
12808         site.
12810 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12812         * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with
12813         substitutions.
12815 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12817         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::contains_associated_types):
12818         Check if a type bound predicate contains assocated types.
12819         * typecheck/rust-tyty.h: Declare the above mentioned function.
12820         * typecheck/rust-hir-trait-resolve.cc: Use `contains_associated_types`
12821         function.
12823 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12825         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add
12826         more calls to `rust_debug` for development.
12828 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12830         * backend/rust-compile-base.cc: Improve compilation pipeline and simplify
12831         function.
12833 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12835         * backend/rust-tree.cc (comptypes): Remove some C++ specific checks in
12836         Rust const folder for now.
12838 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12840         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): Add
12841         better unification function with debug calls.
12842         * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): Add more debug
12843         calls and use new unify API.
12844         * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion): Likewise.
12845         (TypeCoercionRules::coerce_borrowed_pointer): Likewise.
12846         (TypeCoercionRules::select): Likewise.
12847         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Likewise.
12848         * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item): Likewise.
12849         (TypeCheckBase::coercion_site): Likewise.
12850         (TypeCheckBase::cast_site): Likewise.
12851         * typecheck/rust-hir-type-check-base.h: Likewise.
12852         * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
12853         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
12854         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelImplItem::visit): Likewise.
12855         (TypeCheckImplItem::visit): Likewise.
12856         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
12857         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): Likewise.
12858         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
12859         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
12860         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): Likewise.
12861         * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
12862         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
12863         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
12864         * typecheck/rust-tyctx.cc (TypeCheckContext::peek_return_type): Likewise.
12865         * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
12866         * typecheck/rust-tyty-cmp.h: Likewise.
12867         * typecheck/rust-tyty-rules.h: Likewise.
12868         * typecheck/rust-tyty.cc (BaseType::mappings_str): Likewise.
12869         (BaseType::debug): Print type name more clearly.
12870         (BaseType::debug_str): Add new function to print type pointer and name.
12871         (TupleType::get_name): Improve type name fetching function.
12872         (ReferenceType::get_name): Likewise.
12873         (PointerType::get_name): Likewise.
12874         * typecheck/rust-tyty.h: Refactor definitions outside of the header.
12876 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12878         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase):
12879         Remove constructor.
12880         (TypeCheckBase::coercion_site): Add `Location` argument to function.
12881         * typecheck/rust-hir-type-check-base.h: Use `TypeCheckBase::coercion_site`
12882         function with location argument.
12883         * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
12884         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
12885         * typecheck/rust-hir-type-check-expr.h (class TypeCheckExpr): Likewise.
12886         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
12887         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
12888         * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
12889         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
12890         (TypeCheckMethodCallExpr::visit): Likewise.
12891         * typecheck/rust-tyty.h: Add missing locus field.
12892         * typecheck/rust-tyty.cc (StructFieldType::clone): Use locus field.
12893         (StructFieldType::monomorphized_clone): Likewise.
12895 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12897         * typecheck/rust-tyctx.cc (TypeCheckContext::pop_return_type): Add
12898         guards around `std::vector<T>.pop_back()`.
12899         (TypeCheckContext::peek_context): Likewise for `std::vector<T>.back()`.
12901 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12902             philberty  <philip.herron@embecosm.com>
12904         * ast/rust-ast.h: Improve assertions within ASTFragment API.
12906 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12908         * ast/rust-ast.h: Add assertions and accessors for fragment nodes.
12909         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion
12910         context typo when visiting `InherentImpl` items.
12911         (AttrVisitor::maybe_expand_expr): Use new Fragment accessor to fetch
12912         properly typed node.
12913         (AttrVisitor::maybe_expand_type): Likewise.
12914         * expand/rust-macro-expand.cc (transcribe_type): Emit parse errors
12915         when trying to parse a type.
12917 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12919         * ast/rust-ast-dump.h: Add shorthand `AST::Dump::debug` function to
12920         dump an AST node on `stderr`.
12922 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12923             philberty  <philip.herron@embecosm.com>
12925         * expand/rust-macro-expand.cc (parse_many): Return early from parsing
12926         loop if we encounter an error, and emit that error in the meantime.
12928 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12930         * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle
12931         fragments differently based on whether or not we are currently trying
12932         to match a matcher in a repetition context.
12933         (MacroExpander::match_n_matches): Use new `in_repetition` argument
12934         properly when calling `match_matcher`.
12935         * expand/rust-macro-expand.h (MacroExpander::match_matcher): Allow
12936         passing extra `in_repetition` bool argument
12938 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12940         * parse/rust-parse-impl.h: Allow parsing full range expressions without
12941         erroring out.
12943 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12945         * checks/lints/rust-lint-scan-deadcode.h: Do not report public items
12946         as dead code.
12948 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12950         * util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list
12951         of builtin attributes.
12953 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12955         * backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow
12956         checks logic.
12957         (CompileExpr::array_copied_expr): Insert overflow checks logic.
12958         * backend/rust-compile-item.cc (CompileItem::visit): Insert overflow
12959         checks logic.
12960         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Insert
12961         overflow checks logic.
12962         * rust-gcc.cc (Gcc_backend::arithmetic_or_logical_expression): Differentiate
12963         existing function from `arithmetic_or_logical_expression_checked`.
12964         This function does insert perform overflow checks.
12965         (Gcc_backend::arithmetic_or_logical_expression_checked): New
12966         function.
12967         (is_overflowing_expr): New function. Check if an expression is an
12968         overflowing one (ADD, SUB, MUL).
12969         (fetch_overflow_builtins): New function.
12970         * rust-backend.h: Declare `arithmetic_or_logical_expression_checked` in
12971         abstract `Backend` class.
12973 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12975         * backend/rust-builtins.h: Refactor builtin context class and add
12976         overflow builtins.
12978 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
12980         * rust-gcc.cc (class Bvariable): Move class to `rust-gcc.h` header.
12981         * rust-gcc.h: New file.
12983 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
12985         * hir/rust-ast-lower-expr.h: Lower double borrow expressions to two
12986         `HIR::BorrowExpr`s.
12987         * hir/tree/rust-hir-expr.h: Remove `is_double_borrow` field from
12988         `HIR::BorrowExpr`.
12989         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Remove
12990         call to `gcc_unreachable` on double borrow expressions.
12992 2023-01-31  Faisal Abbas  <90.abbasfaisal@gmail.com>
12994         * backend/rust-tree.cc : Add new includes.
12995         (scope_chain): New.
12996         (maybe_add_global): New.
12997         (init_modules): New (copied from cp)
12998         (var_in_constexpr_fn): Likewise.
12999         (member_vec_linear_search): Likewise.
13000         (member_vec_binary_search): Likewise.
13001         (is_overloaded_fn): Likewise.
13002         (ovl_make): Likewise.
13003         (lookup_add): Likewise.
13004         (type_memfn_quals): Likewise.
13005         (struct find_parameter_pack_data): Likewise.
13006         (struct conv_type_hasher): Likewise.
13007         (make_conv_op_name): Likewise.
13008         (builtin_pack_fn_p): Likewise.
13009         (builtin_pack_call_p): Likewise.
13010         (has_extra_args_mechanism_p): Likewise.
13011         (find_parameter_packs_r): Likewise.
13012         (WALK_SUBTREE): Likewise.
13013         (type_memfn_rqual): Likewise.
13014         (maybe_add_lang_type_raw): Likewise.
13015         (struct c_fileinfo): Likewise.
13016         (get_fileinfo): Likewise.
13017         (cxx_make_type): Likewise.
13018         (build_min_array_type): Likewise.
13019         (fields_linear_search): Likewise.
13020         (nothrow_spec_p): Likewise.
13021         (maybe_get_fns): Likewise.
13022         (get_fns): Likewise.
13023         (get_first_fn): Likewise.
13024         (dependent_name): Likewise.
13025         (called_fns_equal): Likewise.
13026         (canonical_eh_spec): Likewise.
13027         (rs_tree_code_length): Likewise.
13028         (rs_tree_operand_length): Likewise.
13029         (rs_tree_equal): Likewise.
13030         (publicly_uniquely_derived_p): Likewise.
13031         (comp_except_types): Likewise.
13032         (comp_except_specs): Likewise.
13033         (compparms): Likewise.
13034         (set_array_type_canon): Likewise.
13035         (struct cplus_array_info): Likewise.
13036         (struct cplus_array_hasher): Likewise.
13037         (cplus_array_hasher::hash): Likewise.
13038         (cplus_array_hasher::equal): Likewise.
13039         (is_byte_access_type): Likewise.
13040         (build_cplus_array_type): Likewise.
13041         (rs_build_qualified_type_real): Likewise.
13042         (vector_targets_convertible_p): Likewise.
13043         (comp_array_types): Likewise.
13044         (same_type_ignoring_top_level_qualifiers_p): Likewise.
13045         (comp_ptr_ttypes_const): Likewise.
13046         (similar_type_p): Likewise.
13047         (structural_comptypes): Likewise.
13048         (comptypes): Likewise.
13049         (next_initializable_field): Likewise.
13050         (sufficient_parms_p): Likewise.
13051         (default_ctor_p): Likewise.
13052         (user_provided_p): Likewise.
13053         (type_has_non_user_provided_default_constructor): Likewise.
13054         (default_init_uninitialized_part): Likewise.
13055         (extract_conversion_operator): Likewise.
13056         (get_class_binding_direct): Likewise.
13057         (lang_check_failed): Likewise.
13058         (skip_artificial_parms_for): Likewise.
13059         (in_class_defaulted_default_constructor): Likewise.
13060         (is_instantiation_of_constexpr): Likewise.
13061         (check_for_uninitialized_const_var): Likewise.
13062         (cv_unqualified): Likewise.
13063         (make_tree_vector): Likewise.
13064         (release_tree_vector): Likewise.
13065         (instantiation_dependent_expression_p): Likewise.
13066         (cp_get_callee): Likewise.
13067         (build_nop): Likewise.
13068         (scalarish_type_p): Likewise.
13069         (type_has_nontrivial_copy_init): Likewise.
13070         (build_local_temp): Likewise.
13071         (is_normal_capture_proxy): Likewise.
13072         (reject_gcc_builtin): Likewise.
13073         (is_bitfield_expr_with_lowered_type): Likewise.
13074         (maybe_undo_parenthesized_ref): Likewise.
13075         (fold_offsetof): Likewise.
13076         (char_type_p): Likewise.
13077         (resolve_nondeduced_context): Likewise.
13078         (instantiate_non_dependent_or_null): Likewise.
13079         (resolve_nondeduced_context_or_error): Likewise.
13080         (really_overloaded_fn): Likewise.
13081         (invalid_nonstatic_memfn_p): Likewise.
13082         (strip_top_quals): Likewise.
13083         (cxx_incomplete_type_inform): Likewise.
13084         (cxx_incomplete_type_diagnostic): Likewise.
13085         (decl_constant_var_p): Likewise.
13086         (undeduced_auto_decl): Likewise.
13087         (require_deduced_type): Likewise.
13088         * backend/rust-tree.h (enum c_tree_index): Likewise.
13089         (GTY): Likewise.
13090         (enum cp_tree_index): Likewise.
13091         (wchar_decl_node): Likewise.
13092         (vtable_entry_type): Likewise.
13093         (delta_type_node): Likewise.
13094         (vtable_index_type): Likewise.
13095         (class_type_node): Likewise.
13096         (unknown_type_node): Likewise.
13097         (init_list_type_node): Likewise.
13098         (explicit_void_list_node): Likewise.
13099         (vtbl_type_node): Likewise.
13100         (vtbl_ptr_type_node): Likewise.
13101         (std_node): Likewise.
13102         (abi_node): Likewise.
13103         (global_namespace): Likewise.
13104         (const_type_info_type_node): Likewise.
13105         (conv_op_marker): Likewise.
13106         (abort_fndecl): Likewise.
13107         (current_aggr): Likewise.
13108         (nullptr_node): Likewise.
13109         (nullptr_type_node): Likewise.
13110         (align_type_node): Likewise.
13111         (char8_type_node): Likewise.
13112         (char16_type_node): Likewise.
13113         (char32_type_node): Likewise.
13114         (wchar_type_node): Likewise.
13115         (underlying_wchar_type_node): Likewise.
13116         (wint_type_node): Likewise.
13117         (signed_size_type_node): Likewise.
13118         (unsigned_ptrdiff_type_node): Likewise.
13119         (intmax_type_node): Likewise.
13120         (uintmax_type_node): Likewise.
13121         (widest_integer_literal_type_node): Likewise.
13122         (widest_unsigned_literal_type_node): Likewise.
13123         (sig_atomic_type_node): Likewise.
13124         (int8_type_node): Likewise.
13125         (int16_type_node): Likewise.
13126         (int32_type_node): Likewise.
13127         (int64_type_node): Likewise.
13128         (uint8_type_node): Likewise.
13129         (c_uint16_type_node): Likewise.
13130         (c_uint32_type_node): Likewise.
13131         (c_uint64_type_node): Likewise.
13132         (int_least8_type_node): Likewise.
13133         (int_least16_type_node): Likewise.
13134         (int_least32_type_node): Likewise.
13135         (int_least64_type_node): Likewise.
13136         (uint_least8_type_node): Likewise.
13137         (uint_least16_type_node): Likewise.
13138         (uint_least32_type_node): Likewise.
13139         (uint_least64_type_node): Likewise.
13140         (int_fast8_type_node): Likewise.
13141         (int_fast16_type_node): Likewise.
13142         (int_fast32_type_node): Likewise.
13143         (int_fast64_type_node): Likewise.
13144         (uint_fast8_type_node): Likewise.
13145         (uint_fast16_type_node): Likewise.
13146         (uint_fast32_type_node): Likewise.
13147         (uint_fast64_type_node): Likewise.
13148         (intptr_type_node): Likewise.
13149         (uintptr_type_node): Likewise.
13150         (truthvalue_type_node): Likewise.
13151         (truthvalue_true_node): Likewise.
13152         (truthvalue_false_node): Likewise.
13153         (char_array_type_node): Likewise.
13154         (char8_array_type_node): Likewise.
13155         (char16_array_type_node): Likewise.
13156         (char32_array_type_node): Likewise.
13157         (wchar_array_type_node): Likewise.
13158         (string_type_node): Likewise.
13159         (const_string_type_node): Likewise.
13160         (default_function_type): Likewise.
13161         (function_name_decl_node): Likewise.
13162         (pretty_function_name_decl_node): Likewise.
13163         (c99_function_name_decl_node): Likewise.
13164         (saved_function_name_decls): Likewise.
13165         (null_node): Likewise.
13166         (ctor_identifier): Likewise.
13167         (complete_ctor_identifier): Likewise.
13168         (base_ctor_identifier): Likewise.
13169         (dtor_identifier): Likewise.
13170         (complete_dtor_identifier): Likewise.
13171         (base_dtor_identifier): Likewise.
13172         (deleting_dtor_identifier): Likewise.
13173         (conv_op_identifier): Likewise.
13174         (delta_identifier): Likewise.
13175         (in_charge_identifier): Likewise.
13176         (vtt_parm_identifier): Likewise.
13177         (as_base_identifier): Likewise.
13178         (this_identifier): Likewise.
13179         (pfn_identifier): Likewise.
13180         (vptr_identifier): Likewise.
13181         (global_identifier): Likewise.
13182         (anon_identifier): Likewise.
13183         (auto_identifier): Likewise.
13184         (decltype_auto_identifier): Likewise.
13185         (init_list_identifier): Likewise.
13186         (for_range__identifier): Likewise.
13187         (for_begin__identifier): Likewise.
13188         (for_end__identifier): Likewise.
13189         (for_range_identifier): Likewise.
13190         (for_begin_identifier): Likewise.
13191         (for_end_identifier): Likewise.
13192         (abi_tag_identifier): Likewise.
13193         (aligned_identifier): Likewise.
13194         (begin_identifier): Likewise.
13195         (end_identifier): Likewise.
13196         (get__identifier): Likewise.
13197         (gnu_identifier): Likewise.
13198         (tuple_element_identifier): Likewise.
13199         (tuple_size_identifier): Likewise.
13200         (type_identifier): Likewise.
13201         (value_identifier): Likewise.
13202         (fun_identifier): Likewise.
13203         (closure_identifier): Likewise.
13204         (heap_uninit_identifier): Likewise.
13205         (heap_identifier): Likewise.
13206         (heap_deleted_identifier): Likewise.
13207         (heap_vec_uninit_identifier): Likewise.
13208         (heap_vec_identifier): Likewise.
13209         (omp_identifier): Likewise.
13210         (lang_name_c): Likewise.
13211         (lang_name_cplusplus): Likewise.
13212         (empty_except_spec): Likewise.
13213         (noexcept_true_spec): Likewise.
13214         (noexcept_false_spec): Likewise.
13215         (noexcept_deferred_spec): Likewise.
13216         (terminate_fn): Likewise.
13217         (call_unexpected_fn): Likewise.
13218         (get_exception_ptr_fn): Likewise.
13219         (begin_catch_fn): Likewise.
13220         (end_catch_fn): Likewise.
13221         (allocate_exception_fn): Likewise.
13222         (free_exception_fn): Likewise.
13223         (throw_fn): Likewise.
13224         (rethrow_fn): Likewise.
13225         (atexit_fn_ptr_type_node): Likewise.
13226         (atexit_node): Likewise.
13227         (dso_handle_node): Likewise.
13228         (dynamic_cast_node): Likewise.
13229         (cleanup_type): Likewise.
13230         (vtt_parm_type): Likewise.
13231         (any_targ_node): Likewise.
13232         (source_location_impl): Likewise.
13233         (OVL_FUNCTION): Likewise.
13234         (OVL_CHAIN): Likewise.
13235         (OVL_DEDUP_P): Likewise.
13236         (OVL_USING_P): Likewise.
13237         (OVL_HIDDEN_P): Likewise.
13238         (OVL_NESTED_P): Likewise.
13239         (OVL_LOOKUP_P): Likewise.
13240         (OVL_EXPORT_P): Likewise.
13241         (OVL_FIRST): Likewise.
13242         (OVL_NAME): Likewise.
13243         (OVL_P): Likewise.
13244         (OVL_SINGLE_P): Likewise.
13245         (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise.
13246         (CLASSTYPE_LAZY_DEFAULT_CTOR): Likewise.
13247         (CLASSTYPE_CONSTRUCTORS): Likewise.
13248         (ATTR_IS_DEPENDENT): Likewise.
13249         (ABI_TAG_IMPLICIT): Likewise.
13250         (PARENTHESIZED_LIST_P): Likewise.
13251         (DECL_DEPENDENT_P): Likewise.
13252         (USING_DECL_SCOPE): Likewise.
13253         (USING_DECL_DECLS): Likewise.
13254         (USING_DECL_TYPENAME_P): Likewise.
13255         (USING_DECL_UNRELATED_P): Likewise.
13256         (DECL_DECLARES_FUNCTION_P): Likewise.
13257         (DECL_DECLARES_TYPE_P): Likewise.
13258         (IDENTIFIER_KIND_BIT_0): Likewise.
13259         (IDENTIFIER_KIND_BIT_1): Likewise.
13260         (IDENTIFIER_KIND_BIT_2): Likewise.
13261         (IDENTIFIER_MARKED): Likewise.
13262         (IDENTIFIER_VIRTUAL_P): Likewise.
13263         (IDENTIFIER_KEYWORD_P): Likewise.
13264         (IDENTIFIER_CDTOR_P): Likewise.
13265         (IDENTIFIER_CTOR_P): Likewise.
13266         (IDENTIFIER_DTOR_P): Likewise.
13267         (IDENTIFIER_ANY_OP_P): Likewise.
13268         (IDENTIFIER_OVL_OP_P): Likewise.
13269         (IDENTIFIER_ASSIGN_OP_P): Likewise.
13270         (IDENTIFIER_CONV_OP_P): Likewise.
13271         (IDENTIFIER_NEWDEL_OP_P): Likewise.
13272         (IDENTIFIER_NEW_OP_P): Likewise.
13273         (CLASSTYPE_DIAMOND_SHAPED_P): Likewise.
13274         (CLASSTYPE_REPEATED_BASE_P): Likewise.
13275         (CLASSTYPE_KEY_METHOD): Likewise.
13276         (CLASSTYPE_MEMBER_VEC): Likewise.
13277         (CLASSTYPE_DECL_LIST): Likewise.
13278         (CLASSTYPE_DESTRUCTOR): Likewise.
13279         (CLASSTYPE_HAS_PRIMARY_BASE_P): Likewise.
13280         (CLASSTYPE_PRIMARY_BINFO): Likewise.
13281         (CLASSTYPE_VBASECLASSES): Likewise.
13282         (CLASSTYPE_AS_BASE): Likewise.
13283         (DECL_CONV_FN_P): Likewise.
13284         (DECL_CONV_FN_TYPE): Likewise.
13285         (same_type_p): Likewise.
13286         (WILDCARD_TYPE_P): Likewise.
13287         (MAYBE_CLASS_TYPE_P): Likewise.
13288         (FUNCTION_REF_QUALIFIED): Likewise.
13289         (FUNCTION_RVALUE_QUALIFIED): Likewise.
13290         (TYPE_PTRMEMFUNC_FN_TYPE): Likewise.
13291         (TYPE_PTRMEMFUNC_FN_TYPE_RAW): Likewise.
13292         (TYPE_DEPENDENT_P): Likewise.
13293         (TYPE_DEPENDENT_P_VALID): Likewise.
13294         (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise.
13295         (TYPE_RAISES_EXCEPTIONS): Likewise.
13296         (IDENTIFIER_BINDING): Likewise.
13297         (LANG_IDENTIFIER_CAST): Likewise.
13298         (IF_COND): Likewise.
13299         (THEN_CLAUSE): Likewise.
13300         (ELSE_CLAUSE): Likewise.
13301         (IF_SCOPE): Likewise.
13302         (IF_STMT_CONSTEXPR_P): Likewise.
13303         (IF_STMT_CONSTEVAL_P): Likewise.
13304         (DECLTYPE_TYPE_EXPR): Likewise.
13305         (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise.
13306         (CLASSTYPE_INTERFACE_ONLY): Likewise.
13307         (TYPE_NAME_STRING): Likewise.
13308         (TYPE_NAME_LENGTH): Likewise.
13309         (CONSTRAINT_VAR_P): Likewise.
13310         (KOENIG_LOOKUP_P): Likewise.
13311         (DECL_PARM_INDEX): Likewise.
13312         (DECL_PARM_LEVEL): Likewise.
13313         (CONV_IMPLICIT): Likewise.
13314         (CONV_STATIC): Likewise.
13315         (CONV_CONST): Likewise.
13316         (CONV_REINTERPRET): Likewise.
13317         (CONV_PRIVATE): Likewise.
13318         (CONV_FORCE_TEMP): Likewise.
13319         (CONV_FOLD): Likewise.
13320         (CONV_OLD_CONVERT): Likewise.
13321         (CONV_C_CAST): Likewise.
13322         (CONV_BACKEND_CONVERT): Likewise.
13323         (WANT_INT): Likewise.
13324         (WANT_FLOAT): Likewise.
13325         (WANT_ENUM): Likewise.
13326         (WANT_POINTER): Likewise.
13327         (WANT_NULL): Likewise.
13328         (WANT_VECTOR_OR_COMPLEX): Likewise.
13329         (WANT_ARITH): Likewise.
13330         (COMPARE_STRICT): Likewise.
13331         (COMPARE_BASE): Likewise.
13332         (COMPARE_DERIVED): Likewise.
13333         (COMPARE_REDECLARATION): Likewise.
13334         (COMPARE_STRUCTURAL): Likewise.
13335         (SF_DEFAULT): Likewise.
13336         (SF_PRE_PARSED): Likewise.
13337         (SF_INCLASS_INLINE): Likewise.
13338         (SD_UNINITIALIZED): Likewise.
13339         (SD_INITIALIZED): Likewise.
13340         (SD_DECOMPOSITION): Likewise.
13341         (SD_DEFAULTED): Likewise.
13342         (SD_DELETED): Likewise.
13343         (TYPE_PTRDATAMEM_P): Likewise.
13344         (RS_TYPE_CONST_P): Likewise.
13345         (TYPE_MAIN_DECL): Likewise.
13346         (DECL_NONTRIVIALLY_INITIALIZED_P): Likewise.
13347         (DECL_DEFAULTED_FN): Likewise.
13348         (TYPE_HAS_USER_CONSTRUCTOR): Likewise.
13349         (DECL_INITIALIZED_IN_CLASS_P): Likewise.
13350         (DECL_DEFAULTED_IN_CLASS_P): Likewise.
13351         (DECL_NONSTATIC_MEMBER_FUNCTION_P): Likewise.
13352         (DECL_HAS_IN_CHARGE_PARM_P): Likewise.
13353         (DECL_HAS_VTT_PARM_P): Likewise.
13354         (FUNCTION_FIRST_USER_PARMTYPE): Likewise.
13355         (FUNCTION_FIRST_USER_PARM): Likewise.
13356         (DECL_CONSTRUCTOR_P): Likewise.
13357         (DECL_DELETED_FN): Likewise.
13358         (BRACE_ENCLOSED_INITIALIZER_P): Likewise.
13359         (DECL_IMMEDIATE_FUNCTION_P): Likewise.
13360         (SET_DECL_IMMEDIATE_FUNCTION_P): Likewise.
13361         (CONSTRUCTOR_MUTABLE_POISON): Likewise.
13362         (PTRMEM_CST_MEMBER): Likewise.
13363         (REF_PARENTHESIZED_P): Likewise.
13364         (TYPE_PTRMEM_P): Likewise.
13365         (TYPE_PTR_OR_PTRMEM_P): Likewise.
13366         (DECL_DECOMPOSITION_P): Likewise.
13367         (DECL_DECOMP_BASE): Likewise.
13368         (DECL_MAYBE_IN_CHARGE_CDTOR_P): Likewise.
13369         (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
13370         (DECL_CLONED_FUNCTION_P): Likewise.
13371         (DECL_CLONED_FUNCTION): Likewise.
13372         (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
13373         (cp_function_chain): Likewise.
13374         (cdtor_label): Likewise.
13375         (current_class_ptr): Likewise.
13376         (current_class_ref): Likewise.
13377         (current_eh_spec_block): Likewise.
13378         (current_in_charge_parm): Likewise.
13379         (current_vtt_parm): Likewise.
13380         (current_retval_sentinel): Likewise.
13381         (current_function_returns_value): Likewise.
13382         (current_function_returns_null): Likewise.
13383         (current_function_returns_abnormally): Likewise.
13384         (current_function_infinite_loop): Likewise.
13385         (in_base_initializer): Likewise.
13386         (in_function_try_handler): Likewise.
13387         (current_function_return_value): Likewise.
13388         (current_class_type): Likewise.
13389         (TYPE_BEING_DEFINED): Likewise.
13390         (DECL_STATIC_FUNCTION_P): Likewise.
13391         (DECL_FUNCTION_MEMBER_P): Likewise.
13392         (LANG_DECL_MIN_CHECK): Likewise.
13393         (LANG_DECL_FN_CHECK): Likewise.
13394         (LANG_DECL_NS_CHECK): Likewise.
13395         (LANG_DECL_PARM_CHECK): Likewise.
13396         (LANG_DECL_DECOMP_CHECK): Likewise.
13397         (RS_INTEGRAL_TYPE_P): Likewise.
13398         (STAT_HACK_P): Likewise.
13399         (STAT_TYPE_VISIBLE_P): Likewise.
13400         (STAT_TYPE): Likewise.
13401         (STAT_DECL): Likewise.
13402         (STAT_VISIBLE): Likewise.
13403         (MAYBE_STAT_DECL): Likewise.
13404         (MAYBE_STAT_TYPE): Likewise.
13405         (STAT_TYPE_HIDDEN_P): Likewise.
13406         (STAT_DECL_HIDDEN_P): Likewise.
13407         (class warning_sentinel): Likewise.
13408         (struct uid_sensitive_constexpr_evaluation_checker): Likewise.
13409         (class iloc_sentinel): Likewise.
13410         (struct GTY): Likewise.
13411         (struct named_decl_hash): Likewise.
13412         (enum lang_decl_selector): Likewise.
13413         (LANG_DECL_HAS_MIN): Likewise.
13414         (struct named_label_entry): Likewise.
13415         (struct named_label_hash): Likewise.
13416         (enum ref_operator): Likewise.
13417         (struct c_fileinfo): Likewise.
13418         (class ovl_iterator): Likewise.
13419         (class lkp_iterator): Likewise.
13420         (enum rs_ref_qualifier): Likewise.
13421         (enum tsubst_flags): Likewise.
13422         (enum cp_identifier_kind): Likewise.
13423         (enum tag_types): Likewise.
13424         (enum compare_bounds_t): Likewise.
13425         (mark_rvalue_use): Likewise.
13426         (type_unknown_p): Likewise.
13427         (init_modules): Likewise.
13428         (var_in_constexpr_fn): Likewise.
13429         (ovl_first): Likewise.
13430         (lookup_add): Likewise.
13431         (ovl_make): Likewise.
13432         (is_overloaded_fn): Likewise.
13433         (maybe_add_lang_type_raw): Likewise.
13434         (type_memfn_rqual): Likewise.
13435         (builtin_pack_fn_p): Likewise.
13436         (make_conv_op_name): Likewise.
13437         (type_memfn_quals): Likewise.
13438         (get_fileinfo): Likewise.
13439         (cxx_make_type): Likewise.
13440         (build_cplus_array_type): Likewise.
13441         (is_byte_access_type): Likewise.
13442         (comptypes): Likewise.
13443         (canonical_eh_spec): Likewise.
13444         (cp_tree_operand_length): Likewise.
13445         (rs_tree_equal): Likewise.
13446         (compparms): Likewise.
13447         (rs_build_qualified_type_real): Likewise.
13448         (rs_build_qualified_type): Likewise.
13449         (cv_qualified_p): Likewise.
13450         (similar_type_p): Likewise.
13451         (vector_targets_convertible_p): Likewise.
13452         (same_type_ignoring_top_level_qualifiers_p): Likewise.
13453         (comp_ptr_ttypes_const): Likewise.
13454         (get_class_binding_direct): Likewise.
13455         (skip_artificial_parms_for): Likewise.
13456         (lang_check_failed): Likewise.
13457         (default_init_uninitialized_part): Likewise.
13458         (type_has_non_user_provided_default_constructor): Likewise.
13459         (default_ctor_p): Likewise.
13460         (user_provided_p): Likewise.
13461         (sufficient_parms_p): Likewise.
13462         (next_initializable_field): Likewise.
13463         (in_class_defaulted_default_constructor): Likewise.
13464         (is_instantiation_of_constexpr): Likewise.
13465         (check_for_uninitialized_const_var): Likewise.
13466         (reduced_constant_expression_p): Likewise.
13467         (cv_unqualified): Likewise.
13468         (cp_get_callee): Likewise.
13469         (cp_get_callee_fndecl_nofold): Likewise.
13470         (is_nondependent_static_init_expression): Likewise.
13471         (maybe_constant_init): Likewise.
13472         (build_nop): Likewise.
13473         (scalarish_type_p): Likewise.
13474         (is_bitfield_expr_with_lowered_type): Likewise.
13475         (convert_bitfield_to_declared_type): Likewise.
13476         (cp_fold_maybe_rvalue): Likewise.
13477         (maybe_undo_parenthesized_ref): Likewise.
13478         (fold_offsetof): Likewise.
13479         (cp_truthvalue_conversion): Likewise.
13480         (fold_non_dependent_expr): Likewise.
13481         (char_type_p): Likewise.
13482         (instantiation_dependent_expression_p): Likewise.
13483         (type_has_nontrivial_copy_init): Likewise.
13484         (build_local_temp): Likewise.
13485         (is_normal_capture_proxy): Likewise.
13486         (reject_gcc_builtin): Likewise.
13487         (resolve_nondeduced_context): Likewise.
13488         (cxx_incomplete_type_diagnostic): Likewise.
13489         (cxx_incomplete_type_error): Likewise.
13490         (invalid_nonstatic_memfn_p): Likewise.
13491         (really_overloaded_fn): Likewise.
13492         (resolve_nondeduced_context_or_error): Likewise.
13493         (instantiate_non_dependent_or_null): Likewise.
13494         (cxx_incomplete_type_inform): Likewise.
13495         (strip_top_quals): Likewise.
13496         (undeduced_auto_decl): Likewise.
13497         (require_deduced_type): Likewise.
13498         (decl_constant_var_p): Likewise.
13499         (type_of_this_parm): Likewise.
13500         (class_of_this_parm): Likewise.
13501         (identifier_p): Likewise.
13502         (gnu_vector_type_p): Likewise.
13503         (make_tree_vector): Likewise.
13504         (release_tree_vector): Likewise.
13505         (class releasing_vec): Likewise.
13506         (vec_safe_push): Likewise.
13507         (null_node_p): Likewise.
13508         * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Correctly
13509         set fndecl as constexpr from qualifiers.
13510         (HIRCompileBase::compile_function): Test if fndecl is constexpr.
13511         (HIRCompileBase::compile_constant_item): Set fndecl as constexpr.
13512         * backend/rust-compile-intrinsic.cc : Update include.
13513         (finalize_intrinsic_block): Set fndecl as constexpr.
13514         * backend/rust-constexpr.cc : Update include.
13515         (VERIFY_CONSTANT): New.
13516         (is_instantiation_of_constexpr): New.
13517         (literal_type_p): New.
13518         (verify_constant): New.
13519         (find_array_ctor_elt): New.
13520         (array_index_cmp): New.
13521         (potential_constant_expression_1): New.
13522         (get_nth_callarg): New.
13523         (unshare_constructor): New.
13524         (maybe_save_constexpr_fundef): New.
13525         (returns): New.
13526         (breaks): New.
13527         (continues): New.
13528         (switches): New.
13529         (struct constexpr_global_ctx): Add new fields.
13530         (constexpr_fundef): New.
13531         (struct constexpr_call): New.
13532         (constexpr_call_hasher : ggc_ptr_hash<constexpr_call>): New.
13533         (enum constexpr_switch_state): New.
13534         (struct constexpr_ctx): Add new fields.
13535         (struct constexpr_fundef_hasher): New.
13536         (constexpr_fundef_table): New.
13537         (constexpr_fundef_hasher::equal): New.
13538         (constexpr_fundef_hasher::hash): New.
13539         (retrieve_constexpr_fundef): New.
13540         (uid_sensitive_constexpr_evaluation_value): New.
13541         (uid_sensitive_constexpr_evaluation_true_counter): New.
13542         (uid_sensitive_constexpr_evaluation_p): New.
13543         (class temp_override): New.
13544         (struct uid_sensitive_constexpr_evaluation_sentinel): New.
13545         (struct uid_sensitive_constexpr_evaluation_checker): New.
13546         (::uid_sensitive_constexpr_evaluation_sentinel): New.
13547         (::uid_sensitive_constexpr_evaluation_checker): New.
13548         (uid_sensitive_constexpr_evaluation_checker::evaluation_restricted_p): New.
13549         (constexpr_call_table): New.
13550         (constexpr_call_hasher::hash): New.
13551         (constexpr_call_hasher::equal): New.
13552         (maybe_initialize_constexpr_call_table): New.
13553         (fundef_copies_table): New.
13554         (get_fundef_copy): New.
13555         (save_fundef_copy): New.
13556         (constexpr_expression): Refactor in ...
13557         (eval_constant_expression): ...this.
13558         (eval_store_expression): Add 3 bool params.
13559         (eval_call_expression): Likewise.
13560         (eval_binary_expression): Likewise.
13561         (eval_statement_list): New.
13562         (extract_string_elt): New.
13563         (eval_conditional_expression): New.
13564         (eval_bit_field_ref): New.
13565         (eval_loop_expr): New.
13566         (eval_switch_expr): New.
13567         (eval_unary_expression): New.
13568         (call_stack): New.
13569         (call_stack_tick): New.
13570         (last_cx_error_tick): New.
13571         (push_cx_call_context): New.
13572         (pop_cx_call_context): New.
13573         (cx_error_context): New.
13574         (fold_expr): Adjust call to eval_constant_expression.
13575         (same_type_ignoring_tlq_and_bounds_p): New.
13576         (union_active_member): Port more for cxx constexpr.
13577         (fold_indirect_ref_1): New.
13578         (rs_fold_indirect_ref): Likewise.
13579         (rs_eval_indirect_ref): New (from corresponding cxx FE file).
13580         (eval_logical_expression): Adjust parameter list.
13581         (lookup_placeholder): New (from corresponding cxx FE file).
13582         (constant_value_1): Remove.
13583         (inline_asm_in_constexpr_error): New (from corresponding cxx FE file).
13584         (verify_ctor_sanity): New.
13585         (get_callee): Remove.
13586         (initialized_type): New.
13587         (maybe_constexpr_fn): Remove.
13588         (init_subob_ctx): New.
13589         (base_field_constructor_elt): New.
13590         (get_or_insert_ctor_field): New.
13591         (eval_vector_conditional_expression): New (from correponding cxx FE file).
13592         (eval_bare_aggregate): New.
13593         (cxx_eval_trinary_expression): New.
13594         (reduced_constant_expression_p): New.
13595         (adjust_temp_type): New.
13596         (free_constructor): New.
13597         (eval_and_check_array_index): New.
13598         (eval_array_reference): New.
13599         (eval_component_reference): New.
13600         (label_matches): New.
13601         (eval_constant_expression): New.
13602         (modifying_const_object_error): New.
13603         (is_empty_field): New.
13604         (eval_store_expression): New.
13605         (eval_binary_expression): New.
13606         (addr_of_non_const_var): New.
13607         (rs_bind_parameters_in_call): New.
13608         (eval_builtin_function_call): New.
13609         (eval_call_expression): New.
13610         (build_anon_member_initialization): New.
13611         (build_data_member_initialization): New.
13612         (constexpr_fn_retval): New.
13613         (constant_value_1): New.
13614         (decl_constant_value): New.
13615         (non_const_var_error): New.
13616         (get_callee): New.
13617         (get_function_named_in_call): New.
13618         (maybe_constexpr_fn): New.
13619         (get_nth_callarg): New.
13620         (var_in_maybe_constexpr_fn): New.
13621         (instantiate_cx_fn_r): New.
13622         (instantiate_constexpr_fns): New.
13623         (array_index_cmp): New.
13624         (unshare_constructor): New.
13625         (find_array_ctor_elt): New.
13626         (verify_constant): New.
13627         (find_heap_var_refs): New.
13628         (find_immediate_fndecl): New.
13629         (diag_array_subscript): New.
13630         (get_array_or_vector_nelts): New.
13631         (eval_and_check_array_index): New.
13632         (extract_string_elt): New.
13633         (is_valid_constexpr_fn): New.
13634         (explain_invalid_constexpr_fn): New.
13635         (register_constexpr_fundef): New.
13636         (maybe_save_constexpr_fundef): New.
13637         (eval_statement_list): New.
13638         (eval_conditional_expression): New.
13639         (eval_bit_field_ref): New.
13640         (returns): New.
13641         (breaks): New.
13642         (continues): New.
13643         (switches): New.
13644         (eval_loop_expr): New.
13645         (eval_switch_expr): New.
13646         (eval_unary_expression): New.
13647         (cxx_eval_outermost_constant_expr): New.
13648         (is_static_init_expression): New.
13649         (is_constant_expression): New.
13650         (is_nondependent_static_init_expression): New.
13651         (maybe_constant_init_1): New.
13652         (maybe_constant_init): New.
13653         (is_nondependent_constant_expression): New.
13654         (cv_cache): New.
13655         (maybe_constant_value): New.
13656         (potential_constant_expression): New.
13657         (struct check_for_return_continue_data): New.
13658         (check_for_return_continue): New.
13659         (decl_namespace_context): New.
13660         (decl_in_std_namespace_p): New.
13661         (is_std_construct_at): New.
13662         (cxx_dynamic_cast_fn_p): New.
13663         (is_std_allocator_allocate): New.
13664         (is_std_allocator_allocate): New.
13665         (potential_constant_expression_1): New.
13666         (potential_constant_expression_1): New.
13667         (fold_non_dependent_init): New.
13668         * backend/rust-constexpr.h (maybe_save_constexpr_fundef): New.
13670 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
13672         * rust-session-manager.cc (Session::compile_crate): Allow the dump of prettified AST
13673         (Session::dump_ast_pretty): New
13674         * rust-session-manager.h: Add new output file for pretty AST dump
13676 2023-01-05  David Malcolm  <dmalcolm@redhat.com>
13678         * resolve/rust-ast-resolve-item.cc (selftest::rust_flatten_list):
13679         Remove output to stderr.
13681 2023-01-05  David Malcolm  <dmalcolm@redhat.com>
13683         * Make-lang.in (selftest-rust-gdb): New.
13684         (selftest-rust-valgrind): New.
13686 2022-12-20  Marc Poulhiès  <dkm@kataplop.net>
13688         PR rust/108113
13689         * Make-lang.in (rust.serial): New variable.
13690         (rust1$(exeext)): Depend on $(rust.prev). Call LINK_PROGRESS.
13692 2022-12-14  Jakub Jelinek  <jakub@redhat.com>
13694         PR rust/106072
13695         * parse/rust-parse-impl.h (parse_closure_param): Store
13696         pattern->get_locus () in a temporary before std::move (pattern) is
13697         invoked.
13699 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13701         * CONTRIBUTING.md: New.
13702         * README.md: New.
13703         * logo.png: New.
13705 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13707         * config-lang.in: New.
13709 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13711         * lang.opt (-frust-incomplete-and-experimental-compiler-do-not-use):
13712         New.
13713         * rust-session-manager.cc (Session::compile_crate): Check it.
13714         * Make-lang.in (RUST_SELFTEST_FLAGS): Add it.
13716 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13718         * Make-lang.in: New.
13720 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13722         * lang.opt: New.
13724 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13726         * lang-specs.h: New.
13728 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13730         * rust-lang.cc: New.
13731         * rust-session-manager.cc: New.
13732         * rust-session-manager.h: New.
13734 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13736         * rustspec.cc: New.
13738 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13740         * rust-diagnostics.cc: New.
13741         * rust-diagnostics.h: New.
13742         * rust-gcc-diagnostics.cc: New.
13743         * rust-linemap.cc: New.
13744         * rust-linemap.h: New.
13745         * rust-location.h: New.
13746         * rust-system.h: New.
13748 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13749             David Faust  <david.faust@oracle.com>
13750             Faisal Abbas  <90.abbasfaisal@gmail.com>
13752         * backend/rust-compile-context.cc: New.
13753         * backend/rust-compile-context.h: New.
13754         * backend/rust-compile.cc: New.
13755         * backend/rust-compile.h: New.
13756         * backend/rust-constexpr.cc: New.
13757         * backend/rust-constexpr.h: New.
13759 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13760             David Faust  <david.faust@oracle.com>
13762         * backend/rust-compile-block.cc: New.
13763         * backend/rust-compile-block.h: New.
13764         * backend/rust-compile-expr.cc: New.
13765         * backend/rust-compile-expr.h: New.
13766         * backend/rust-compile-extern.h: New.
13767         * backend/rust-compile-fnparam.cc: New.
13768         * backend/rust-compile-fnparam.h: New.
13769         * backend/rust-compile-implitem.cc: New.
13770         * backend/rust-compile-implitem.h: New.
13771         * backend/rust-compile-intrinsic.cc: New.
13772         * backend/rust-compile-intrinsic.h: New.
13773         * backend/rust-compile-item.cc: New.
13774         * backend/rust-compile-item.h: New.
13775         * backend/rust-compile-pattern.cc: New.
13776         * backend/rust-compile-pattern.h: New.
13777         * backend/rust-compile-resolve-path.cc: New.
13778         * backend/rust-compile-resolve-path.h: New.
13779         * backend/rust-compile-stmt.cc: New.
13780         * backend/rust-compile-stmt.h: New.
13781         * backend/rust-compile-struct-field-expr.cc: New.
13782         * backend/rust-compile-struct-field-expr.h: New.
13783         * backend/rust-compile-type.cc: New.
13784         * backend/rust-compile-type.h: New.
13785         * backend/rust-compile-var-decl.h: New.
13787 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13788             David Faust  <david.faust@oracle.com>
13790         * backend/rust-builtins.h: New.
13791         * backend/rust-compile-base.cc: New.
13792         * backend/rust-compile-base.h: New.
13793         * backend/rust-mangle.cc: New.
13794         * backend/rust-mangle.h: New.
13795         * backend/rust-tree.cc: New.
13796         * backend/rust-tree.h: New.
13797         * rust-backend.h: New.
13798         * rust-gcc.cc: New.
13800 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13802         * metadata/rust-export-metadata.cc: New.
13803         * metadata/rust-export-metadata.h: New.
13804         * metadata/rust-extern-crate.cc: New.
13805         * metadata/rust-extern-crate.h: New.
13806         * metadata/rust-import-archive.cc: New.
13807         * metadata/rust-imports.cc: New.
13808         * metadata/rust-imports.h: New.
13809         * rust-object-export.cc: New.
13810         * rust-object-export.h: New.
13812 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13814         * checks/lints/rust-lint-unused-var.cc: New.
13815         * checks/lints/rust-lint-unused-var.h: New.
13817 2022-12-13  Thomas Young  <wenzhang5800@gmail.com>
13819         * checks/lints/rust-lint-marklive-base.h: New.
13820         * checks/lints/rust-lint-marklive.cc: New.
13821         * checks/lints/rust-lint-marklive.h: New.
13822         * checks/lints/rust-lint-scan-deadcode.h: New.
13824 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13826         * checks/errors/privacy/rust-privacy-check.cc: New.
13827         * checks/errors/privacy/rust-privacy-check.h: New.
13828         * checks/errors/privacy/rust-privacy-common.h: New.
13829         * checks/errors/privacy/rust-privacy-ctx.cc: New.
13830         * checks/errors/privacy/rust-privacy-ctx.h: New.
13831         * checks/errors/privacy/rust-privacy-reporter.cc: New.
13832         * checks/errors/privacy/rust-privacy-reporter.h: New.
13833         * checks/errors/privacy/rust-pub-restricted-visitor.cc: New.
13834         * checks/errors/privacy/rust-pub-restricted-visitor.h: New.
13835         * checks/errors/privacy/rust-reachability.cc: New.
13836         * checks/errors/privacy/rust-reachability.h: New.
13837         * checks/errors/privacy/rust-visibility-resolver.cc: New.
13838         * checks/errors/privacy/rust-visibility-resolver.h: New.
13840 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13842         * checks/errors/rust-const-checker.cc: New.
13843         * checks/errors/rust-const-checker.h: New.
13845 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13847         * checks/errors/rust-unsafe-checker.cc: New.
13848         * checks/errors/rust-unsafe-checker.h: New.
13850 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13852         * typecheck/rust-autoderef.cc: New.
13853         * typecheck/rust-autoderef.h: New.
13854         * typecheck/rust-casts.cc: New.
13855         * typecheck/rust-casts.h: New.
13856         * typecheck/rust-coercion.cc: New.
13857         * typecheck/rust-coercion.h: New.
13858         * typecheck/rust-hir-dot-operator.cc: New.
13859         * typecheck/rust-hir-dot-operator.h: New.
13860         * typecheck/rust-hir-inherent-impl-overlap.h: New.
13861         * typecheck/rust-hir-path-probe.h: New.
13862         * typecheck/rust-hir-trait-ref.h: New.
13863         * typecheck/rust-hir-type-bounds.h: New.
13864         * typecheck/rust-substitution-mapper.cc: New.
13865         * typecheck/rust-substitution-mapper.h: New.
13866         * typecheck/rust-tycheck-dump.h: New.
13867         * typecheck/rust-tyctx.cc: New.
13868         * typecheck/rust-tyty-bounds.cc: New.
13869         * typecheck/rust-tyty-call.cc: New.
13870         * typecheck/rust-tyty-call.h: New.
13871         * typecheck/rust-tyty-cmp.h: New.
13872         * typecheck/rust-tyty-rules.h: New.
13874 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13876         * typecheck/rust-tyty.cc: New.
13877         * typecheck/rust-tyty.h: New.
13879 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13881         * typecheck/rust-hir-trait-resolve.cc: New.
13882         * typecheck/rust-hir-trait-resolve.h: New.
13883         * typecheck/rust-hir-type-check-base.cc: New.
13884         * typecheck/rust-hir-type-check-base.h: New.
13885         * typecheck/rust-hir-type-check-enumitem.cc: New.
13886         * typecheck/rust-hir-type-check-enumitem.h: New.
13887         * typecheck/rust-hir-type-check-expr.cc: New.
13888         * typecheck/rust-hir-type-check-expr.h: New.
13889         * typecheck/rust-hir-type-check-implitem.cc: New.
13890         * typecheck/rust-hir-type-check-implitem.h: New.
13891         * typecheck/rust-hir-type-check-item.cc: New.
13892         * typecheck/rust-hir-type-check-item.h: New.
13893         * typecheck/rust-hir-type-check-path.cc: New.
13894         * typecheck/rust-hir-type-check-pattern.cc: New.
13895         * typecheck/rust-hir-type-check-pattern.h: New.
13896         * typecheck/rust-hir-type-check-stmt.cc: New.
13897         * typecheck/rust-hir-type-check-stmt.h: New.
13898         * typecheck/rust-hir-type-check-struct-field.h: New.
13899         * typecheck/rust-hir-type-check-struct.cc: New.
13900         * typecheck/rust-hir-type-check-toplevel.cc: New.
13901         * typecheck/rust-hir-type-check-toplevel.h: New.
13902         * typecheck/rust-hir-type-check-type.cc: New.
13903         * typecheck/rust-hir-type-check-type.h: New.
13904         * typecheck/rust-hir-type-check-util.cc: New.
13905         * typecheck/rust-hir-type-check-util.h: New.
13906         * typecheck/rust-hir-type-check.cc: New.
13907         * typecheck/rust-hir-type-check.h: New.
13908         * typecheck/rust-tyty-visitor.h: New.
13910 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13912         * util/rust-canonical-path.h: New.
13913         * util/rust-common.h: New.
13914         * util/rust-hir-map.cc: New.
13915         * util/rust-hir-map.h: New.
13916         * util/rust-identifier.h: New.
13917         * util/rust-lang-item.h: New.
13918         * util/rust-mapping-common.h: New.
13919         * util/rust-stacked-contexts.h: New.
13921 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13923         * util/rust-attributes.cc: New.
13924         * util/rust-attributes.h: New.
13926 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13928         * util/rust-optional-test.cc: New.
13929         * util/rust-optional.h: New.
13931 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
13933         * util/rust-base62.cc: New.
13934         * util/rust-base62.h: New.
13936 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13938         * util/rust-abi.cc: New.
13939         * util/rust-abi.h: New.
13941 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13943         * util/fnv-hash.h: New.
13945 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13947         * util/rust-make-unique.h: New.
13949 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13951         * hir/rust-ast-lower-base.cc: New.
13952         * hir/rust-ast-lower-base.h: New.
13953         * hir/rust-ast-lower-block.h: New.
13954         * hir/rust-ast-lower-enumitem.h: New.
13955         * hir/rust-ast-lower-expr.h: New.
13956         * hir/rust-ast-lower-extern.h: New.
13957         * hir/rust-ast-lower-implitem.h: New.
13958         * hir/rust-ast-lower-item.cc: New.
13959         * hir/rust-ast-lower-item.h: New.
13960         * hir/rust-ast-lower-pattern.cc: New.
13961         * hir/rust-ast-lower-pattern.h: New.
13962         * hir/rust-ast-lower-stmt.h: New.
13963         * hir/rust-ast-lower-struct-field-expr.h: New.
13964         * hir/rust-ast-lower-type.h: New.
13965         * hir/rust-ast-lower.cc: New.
13966         * hir/rust-ast-lower.h: New.
13967         * hir/rust-hir-dump.cc: New.
13968         * hir/rust-hir-dump.h: New.
13970 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13972         * hir/tree/rust-hir-full-decls.h: New.
13973         * hir/tree/rust-hir-full-test.cc: New.
13974         * hir/tree/rust-hir-full.h: New.
13975         * hir/tree/rust-hir-visitor.h: New.
13976         * hir/tree/rust-hir.h: New.
13978 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13980         * hir/tree/rust-hir-expr.h: New.
13981         * hir/tree/rust-hir-item.h: New.
13982         * hir/tree/rust-hir-path.h: New.
13983         * hir/tree/rust-hir-pattern.h: New.
13984         * hir/tree/rust-hir-stmt.h: New.
13985         * hir/tree/rust-hir-type.h: New.
13987 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
13989         * resolve/rust-ast-resolve-base.cc: New.
13990         * resolve/rust-ast-resolve-base.h: New.
13991         * resolve/rust-ast-resolve-expr.cc: New.
13992         * resolve/rust-ast-resolve-expr.h: New.
13993         * resolve/rust-ast-resolve-implitem.h: New.
13994         * resolve/rust-ast-resolve-item.cc: New.
13995         * resolve/rust-ast-resolve-item.h: New.
13996         * resolve/rust-ast-resolve-path.cc: New.
13997         * resolve/rust-ast-resolve-path.h: New.
13998         * resolve/rust-ast-resolve-pattern.cc: New.
13999         * resolve/rust-ast-resolve-pattern.h: New.
14000         * resolve/rust-ast-resolve-stmt.cc: New.
14001         * resolve/rust-ast-resolve-stmt.h: New.
14002         * resolve/rust-ast-resolve-struct-expr-field.cc: New.
14003         * resolve/rust-ast-resolve-struct-expr-field.h: New.
14004         * resolve/rust-ast-resolve-toplevel.h: New.
14005         * resolve/rust-ast-resolve-type.cc: New.
14006         * resolve/rust-ast-resolve-type.h: New.
14007         * resolve/rust-ast-resolve.cc: New.
14008         * resolve/rust-ast-resolve.h: New.
14009         * resolve/rust-ast-verify-assignee.h: New.
14010         * resolve/rust-name-resolver.cc: New.
14011         * resolve/rust-name-resolver.h: New.
14013 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
14014             Philip Herron  <philip.herron@embecosm.com>
14015             Joel Phillips  <simplytheother@gmail.com>
14017         * expand/rust-attribute-visitor.cc: New.
14018         * expand/rust-attribute-visitor.h: New.
14019         * expand/rust-macro-builtins.cc: New.
14020         * expand/rust-macro-builtins.h: New.
14021         * expand/rust-macro-expand.cc: New.
14022         * expand/rust-macro-expand.h: New.
14023         * expand/rust-macro-invoc-lexer.cc: New.
14024         * expand/rust-macro-invoc-lexer.h: New.
14025         * expand/rust-macro-substitute-ctx.cc: New.
14026         * expand/rust-macro-substitute-ctx.h: New.
14028 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14029             Philip Herron  <philip.herron@embecosm.com>
14030             Arthur Cohen  <arthur.cohen@embecosm.com>
14032         * parse/rust-parse-impl.h: New, second half.
14034 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14035             Philip Herron  <philip.herron@embecosm.com>
14036             Arthur Cohen  <arthur.cohen@embecosm.com>
14038         * parse/rust-cfg-parser.cc: New.
14039         * parse/rust-cfg-parser.h: New.
14040         * parse/rust-parse-impl.h: New.
14041         * parse/rust-parse.cc: New.
14042         * parse/rust-parse.h: New.
14044 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14045             Philip Herron  <philip.herron@embecosm.com>
14046             Arthur Cohen  <arthur.cohen@embecosm.com>
14047             Mark Wielaard  <mark@klomp.org>
14049         * lex/rust-codepoint.h: New.
14050         * lex/rust-lex.cc: New.
14051         * lex/rust-lex.h: New.
14052         * lex/rust-token.cc: New.
14053         * lex/rust-token.h: New.
14054         * rust-buffered-queue.h: New.
14056 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14057             Philip Herron  <philip.herron@embecosm.com>
14058             Arthur Cohen  <arthur.cohen@embecosm.com>
14060         * ast/rust-ast-dump.cc: New.
14061         * ast/rust-ast-dump.h: New.
14062         * ast/rust-ast-visitor.h: New.
14063         * ast/rust-cond-compilation.h: New.
14065 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14066             Philip Herron  <philip.herron@embecosm.com>
14068         * ast/rust-expr.h: New.
14069         * ast/rust-macro.h: New.
14070         * ast/rust-path.h: New.
14071         * ast/rust-pattern.h: New.
14072         * ast/rust-stmt.h: New.
14073         * ast/rust-type.h: New.
14075 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14076             Philip Herron  <philip.herron@embecosm.com>
14078         * ast/rust-item.h: New.
14080 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
14081             Philip Herron  <philip.herron@embecosm.com>
14082             Arthur Cohen  <arthur.cohen@embecosm.com>
14084         * ast/rust-ast-full-decls.h: New.
14085         * ast/rust-ast-full-test.cc: New.
14086         * ast/rust-ast-full.h: New.
14087         * ast/rust-ast.h: New.
14088         * operator.h: New.
14091 Copyright (C) 2022-2024 Free Software Foundation, Inc.
14093 Copying and distribution of this file, with or without modification,
14094 are permitted in any medium without royalty provided the copyright
14095 notice and this notice are preserved.