Update ChangeLog and version files for release
[official-gcc.git] / gcc / rust / ChangeLog
blob6d16f49fbf92029a0be2ced1053e8b53a27f198d
1 2024-05-21  Release Manager
3         * GCC 13.3.0 released.
5 2023-07-27  Release Manager
7         * GCC 13.2.0 released.
9 2023-06-28  Paul E. Murphy  <murphyp@linux.ibm.com>
11         Backported from master:
12         2023-06-22  Paul E. Murphy  <murphyp@linux.ibm.com>
14         * rust-object-export.cc [TARGET_AIX]: Rename and update usage to
15         TARGET_AIX_OS.
17 2023-04-26  Release Manager
19         * GCC 13.1.0 released.
21 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
23         * parse/rust-parse-impl.h
24         (Parser::parse_stmt): Handle unsafe expression statements.
26 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
28         * parse/rust-parse-impl.h
29         (Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling.
31 2023-04-06  M V V S Manoj Kumar  <mvvsmanojkumar@gmail.com>
33         * ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.
34         * ast/rust-expr.h (class InlineAsm):Added class definition.
36 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
38         * rust-diagnostics.h (struct Error): Add new Kind enum and various new
39         static constructors to allow for hints as well.
40         * rust-diagnostics.cc (Error::Error): Use new `kind` field properly.
41         * checks/errors/privacy/rust-visibility-resolver.cc
42         (VisibilityResolver::resolve_module_path): Use new Error API.
43         * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise.
44         * expand/rust-macro-expand.cc (parse_many): Likewise.
45         (transcribe_type): Likewise.
46         * parse/rust-parse-impl.h (Parser::parse_crate): Likewise.
47         * rust-session-manager.cc (Session::handle_crate_name): Likewise.
48         * ast/rust-ast.cc (Module::load_items): Likewise.
50 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
52         * ast/rust-ast.h: Keep location in TraitItem base class
53         * ast/rust-item.h (class TraitItemFunc): Use base class location instead.
54         (class TraitItemMethod): Likewise.
55         (class TraitItemConst): Likewise.
56         (class TraitItemType): Likewise.
57         * ast/rust-macro.h: Likewise.
59 2023-04-06  SainiAditya1  <Adityasaini10012001@outlook.com>
61         * hir/tree/rust-hir-full-test.cc: Moved to...
62         * hir/tree/rust-hir.cc: ...here.
63         * Make-lang.in: Rename rust-hir-full-test.
65 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
67         * ast/rust-ast-dump.cc
68         (Dump::visit): Add AltPattern visitor.
69         * ast/rust-ast-dump.h:
70         (Dump::visit): Add AltPattern visitor.
71         * ast/rust-ast-full-decls.h
72         (class AltPattern): Add declaration.
73         * ast/rust-ast-visitor.h:
74         (ASTVisitor::visit): Add AltPattern visitor.
75         * ast/rust-ast.cc
76         (AltPattern::as_string): Add definition.
77         (AltPattern::accept_vis): Add definition.
78         * ast/rust-pattern.h
79         (class AltPattern): Add declaration.
80         * checks/errors/rust-feature-gate.h:
81         (FeatureGate::visit) Add AltPattern visitor
82         * expand/rust-attribute-visitor.cc
83         (AttrVisitor::visit): Add AltPattern visitor.
84         * expand/rust-attribute-visitor.h:
85         (AttrVisitor::visit): Add AltPattern visitor.
86         * hir/rust-ast-lower-base.cc
87         (ASTLoweringBase::visit): Add AltPattern visitor.
88         * hir/rust-ast-lower-base.h:
89         (ASTLoweringBase::visit): Add AltPattern visitor.
90         * resolve/rust-ast-resolve-base.cc
91         (ResolverBase::visit): Add AltPattern visitor.
92         * resolve/rust-ast-resolve-base.h:
93         (ResolverBase::visit): Add AltPattern visitor.
94         * resolve/rust-early-name-resolver.cc
95         (EarlyNameResolver::visit): Add AltPattern visitor.
96         * resolve/rust-early-name-resolver.h:
97         (EarlyNameResolver::visit): Add AltPattern visitor.
98         * util/rust-attributes.cc
99         (AttributeChecker::visit): Add AltPattern visitor.
100         * util/rust-attributes.h:
101         (AttributeChecker::visit): Add AltPattern visitor.
103 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
105         * ast/rust-pattern.h: Fix formatting.
107 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
109         * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not
110         return nullptr token in expansion of `include!()`
112 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
114         * checks/errors/rust-feature-gate.h: Add trailing newline before EOF.
116 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
118         * typecheck/rust-hir-trait-reference.cc (TraitReference::clear_associated_types): make const
119         (TraitReference::clear_associated_type_projections): new interface
120         * typecheck/rust-hir-trait-reference.h:
121         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): refactor
122         (TraitItemReference::associated_type_reset): reset projections
123         * typecheck/rust-hir-type-bounds.h:
124         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): fix bounds
125         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): refactor into cc file
126         (TypeBoundsProbe::Probe): refactor
127         (TypeBoundsProbe::is_bound_satisfied_for_type): likewise
128         (TypeBoundsProbe::assemble_sized_builtin): add builtin for Sized
129         (TypeCheckBase::get_predicate_from_bound): refactor
130         (TypeBoundPredicate::lookup_associated_type): refactor
131         * typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl)
132         (SubstitutionRef::prepare_higher_ranked_bounds): new interface to clear hanging bounds
133         (SubstitutionRef::monomorphize): refactor
134         * typecheck/rust-tyty-subst.h:
135         * typecheck/rust-tyty.cc (BaseType::get_locus): helper
136         (BaseType::satisfies_bound): ensure bounds are satisfied and assoicated types
137         (ParamType::ParamType): new field in constructor
138         (ParamType::clone): update clone
139         (ParamType::set_implicit_self_trait): new interface
140         (ParamType::is_implicit_self_trait): likewise
141         * typecheck/rust-tyty.h: cleanup
142         * util/rust-hir-map.cc (Mappings::Mappings): builtin marker
143         (Mappings::~Mappings): delete marker
144         (Mappings::lookup_builtin_marker): lookup
145         * util/rust-hir-map.h: update header
147 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
149         * hir/tree/rust-hir-item.h: implement virtual function
150         * hir/tree/rust-hir.h: add virtual function
152 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
154         * Make-lang.in: add new dependancy
155         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor
156         * typecheck/rust-hir-type-check-base.h: refactor
157         * typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): refactor
158         * typecheck/rust-type-util.cc: New file.
159         * typecheck/rust-type-util.h: New file.
161 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
163         * expand/rust-macro-builtins.cc
164         (MacroBuiltin::include_str_handler): Add check for valid UTF-8.
166 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
168         * parse/rust-parse-impl.h
169         (Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns.
171 2023-04-06  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
173         * lex/rust-lex.h: Add file type check.
175 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
177         * backend/rust-compile-pattern.cc
178         (CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements.
179         * backend/rust-compile-var-decl.h:
180         (CompileVarDecl::visit): Remove variable declaration for WildcardPattern.
181         * resolve/rust-ast-resolve-pattern.h:
182         (PatternDeclaration::visit): Remove name resolution for WildcardPattern.
184 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
186         * typecheck/rust-tyty-call.cc
187         (TypeCheckCallExpr::visit): Add variadic argument type checking.
188         (TypeCheckCallExpr::visit): Fix comment spelling ("varadic").
190 2023-04-06  mxlol233  <mxlol233@outlook.com>
192         * checks/errors/rust-feature-gate.cc: Add implementation for
193         `void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature`
194         construction process in `FeatureGate::check`.
195         * checks/errors/rust-feature-gate.h: Add declaration for
196         `void FeatureGate::visit (AST::ExternBlock &block)`. Add private
197         variable `valid_feature`.
198         * checks/errors/rust-feature.h: Change `issue` to `m_issue`.
200 2023-04-06  Thomas Schwinge  <thomas@codesourcery.com>
202         * ast/rust-ast-fragment.cc: Update copyright years.
203         * ast/rust-ast-fragment.h: Likewise.
204         * ast/rust-macro.cc: Likewise.
205         * checks/errors/rust-feature-gate.cc: Likewise.
206         * checks/errors/rust-feature-gate.h: Likewise.
207         * checks/errors/rust-feature.cc: Likewise.
208         * checks/errors/rust-feature.h: Likewise.
209         * hir/rust-ast-lower-expr.cc: Likewise.
210         * hir/rust-ast-lower-type.cc: Likewise.
211         * resolve/rust-early-name-resolver.cc: Likewise.
212         * resolve/rust-early-name-resolver.h: Likewise.
213         * rust-gcc.h: Likewise.
214         * typecheck/rust-hir-path-probe.cc: Likewise.
215         * typecheck/rust-hir-trait-reference.cc: Likewise.
216         * typecheck/rust-tyty-bounds.h: Likewise.
217         * typecheck/rust-tyty-subst.cc: Likewise.
218         * typecheck/rust-tyty-subst.h: Likewise.
219         * typecheck/rust-tyty-util.cc: Likewise.
220         * typecheck/rust-tyty-util.h: Likewise.
221         * typecheck/rust-unify.cc: Likewise.
222         * typecheck/rust-unify.h: Likewise.
223         * util/rust-inline-visitor.h: Likewise.
225 2023-04-06  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
227         * rust-session-manager.cc (Session::compile_crate): Update the
228         environment variable name.
230 2023-04-06  Pierre-Emmanuel Patry  <pierre-emmanuel.patry@embecosm.com>
232         * Make-lang.in: Add `rust-hir-trait-reference.o`.
233         * typecheck/rust-hir-trait-reference.h: Remove multiple function body.
234         * typecheck/rust-hir-trait-reference.cc: Add multiple function body.
236 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
238         * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
239         Add documentation explaining the algorithm.
241 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
243         * ast/rust-macro.cc: New file.
244         * Make-lang.in: Add `rust-macro.o` object
245         * ast/rust-ast-fragment.cc (Fragment::Fragment): Change API around
246         the construction of AST fragments.
247         (Fragment::operator=): Correct `Fragment::operator=` to take into
248         account the fragment tokens.
249         (Fragment::create_error): Use new constructor.
250         (Fragment::complete): Remove in favor of new constructor.
251         (Fragment::unexpanded): Remove as that Fragment type is no longer used
252         or possible.
253         (Fragment::get_tokens): Add helper to access a fragment's tokens.
254         * ast/rust-ast-fragment.h (enum class): Remove `FragmentKind::Unused`
255         * ast/rust-ast.cc (MacroInvocation::as_string): Display
256         builtin macro invocations properly.
257         * ast/rust-ast.h: Fix `DelimTokenTree` class copy constructors and
258         handling of its token vector.
259         * ast/rust-macro.h (class MacroMatcher): Format.
260         (class MetaItemSeq): Likewise.
261         (builtin_macro_from_string): Get a `BuiltinMacroKind` from a given
262         string, i.e the name of the macro (`assert!`, `cfg!` and so on).
263         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Do not expand
264         macros recursively anymore.
265         (AttrVisitor::maybe_expand_expr): Likewise.
266         (AttrVisitor::maybe_expand_type): Likewise.
267         * expand/rust-attribute-visitor.h: Likewise, and remove
268         `expand_macro_fragment_recursively` function.
269         * expand/rust-macro-builtins.cc (make_token): Add shorthand for
270         returning `std::unique_ptr<AST::Token>`s.
271         (make_macro_invocation): Add shorthand for returning fragments
272         containing builtin macro invocations.
273         (try_expand_macro_expression): Do not expand macros recursively.
274         (try_expand_single_string_literal): Likewise.
275         (try_expand_many_expr): Likewise.
276         (parse_single_string_literal): Error out more appropriately.
277         (MacroBuiltin::compile_error_handler): Add explanation for eager
278         invocation
279         (MacroBuiltin::file_handler): Return the proper tokens associated with
280         macro invocation, and builtin macros in the case of necessary eager
281         expansion.
282         (MacroBuiltin::column_handler): Likewise.
283         (MacroBuiltin::include_bytes_handler): Likewise.
284         (MacroBuiltin::include_str_handler): Likewise.
285         (MacroBuiltin::concat_handler): Likewise.
286         (MacroBuiltin::env_handler): Likewise.
287         (MacroBuiltin::cfg_handler): Likewise.
288         (MacroBuiltin::include_handler): Likewise.
289         (MacroBuiltin::line_handler): Likewise.
290         * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations):
291         Add function to expand eager invocations *once* in the fixed point
292         pipeline.
293         (MacroExpander::expand_invoc): Call into `expand_eager_invocations` for
294         builtin macro invocations.
295         (MacroExpander::expand_crate): Use new `AttrVisitor` API.
296         (parse_many): Return tokens in `AST::Fragment`.
297         (transcribe_expression): Likewise.
298         (transcribe_type): Likewise.
299         * expand/rust-macro-expand.h (struct MacroExpander): Add `has_changed`
300         flag for fixed point checking.
301         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver):
302         Keep track of the current macro scope.
303         (EarlyNameResolver::go): Use `scoped` API.
304         (EarlyNameResolver::visit): Likewise.
305         * resolve/rust-early-name-resolver.h: Add `scoped` API.
306         * rust-session-manager.cc (Session::expansion): Perform macro expansion
307         in a fixed-point fashion.
309 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
311         * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::get_token_slice):
312         Add API to retrieve token slices when lexing macro expansions.
313         * expand/rust-macro-invoc-lexer.h: Declare `get_token_slice`.
315 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
317         * parse/rust-parse.h: Move `parse_macro_invocation` to public API.
319 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
321         * ast/rust-item.h (class BlockExpr): Remove forward declaration of
322         class `BlockExpr`.
324 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
326         * hir/tree/rust-hir-pattern.h
327         (TuplePatternItemsRanged::get_lower_patterns): Add method.
328         (TuplePatternItemsRanged::get_upper_patterns): Add method.
329         * backend/rust-compile-pattern.cc
330         (CompilePatternLet::visit): Implement TuplePattern visitor.
331         * backend/rust-compile-pattern.h
332         (CompilePatternLet::visit): Move TuplePattern visitor out of header file.
334 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
336         * typecheck/rust-unify.cc (UnifyRules::go): ensure the bounds are checked
338 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
340         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove error message
342 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
344         * typecheck/rust-hir-trait-reference.h: add const infterface
345         * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): make const
346         (SubstitutionRef::monomorphize): fix issue
347         * typecheck/rust-tyty-subst.h: constify interface
349 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
351         * util/rust-lang-item.h:
353 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
355         * typecheck/rust-tyty-subst.cc (SubstitutionArg::is_conrete): fix check
357 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
359         * Make-lang.in: update names
360         * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
361         update to use new interface
362         * typecheck/rust-coercion.cc (TypeCoercionRules::coerce_borrowed_pointer): likewise
363         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): likewise
364         * typecheck/rust-tyty.cc (BaseType::destructure): likewise
365         (InferType::unify): removed old unify interface
366         (ErrorType::unify): likewise
367         (ADTType::unify): likewise
368         (TupleType::unify): likewise
369         (FnType::unify): likewise
370         (FnPtr::unify): likewise
371         (ClosureType::unify): likewise
372         (ArrayType::unify): likewise
373         (SliceType::unify): likewise
374         (BoolType::unify): likewise
375         (IntType::unify): likewise
376         (UintType::unify): likewise
377         (FloatType::unify): likewise
378         (USizeType::unify): likewise
379         (ISizeType::unify): likewise
380         (CharType::unify): likewise
381         (ReferenceType::unify): likewise
382         (PointerType::unify): likewise
383         (ParamType::unify): likewise
384         (StrType::unify): likewise
385         (NeverType::unify): likewise
386         (PlaceholderType::unify): likewise
387         (ProjectionType::unify): likewise
388         (DynamicObjectType::unify): likewise
389         * typecheck/rust-tyty.h: update destructure interface
390         * typecheck/rust-tyty-rules.h: Removed.
391         * typecheck/rust-unify.cc: New file.
392         * typecheck/rust-unify.h: New file.
394 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
396         * typecheck/rust-hir-trait-reference.h: change interface to return self
397         * typecheck/rust-hir-trait-resolve.cc: likewise
398         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): likewise
399         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove monomorphization hack
401 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
403         * typecheck/rust-tyty-subst.cc: add missing callback
405 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
407         * typecheck/rust-tyty-subst.cc: update copy constructors
409 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
411         * typecheck/rust-tyty-bounds.cc: refactor to take a reference
412         * typecheck/rust-tyty-subst.cc: likewise
413         (SubstitutionRef::get_substitution_arguments): likewise
414         (SubstitutionRef::infer_substitions): likewise
415         * typecheck/rust-tyty-subst.h: likewise
416         * typecheck/rust-tyty.cc (ADTType::handle_substitions): likewise
417         (TupleType::handle_substitions): likewise
418         (FnType::handle_substitions): likewise
419         (ClosureType::handle_substitions): likewise
420         (ArrayType::handle_substitions): likewise
421         (SliceType::handle_substitions): likewise
422         (ReferenceType::handle_substitions): likewise
423         (PointerType::handle_substitions): likewise
424         (ParamType::handle_substitions): likewise
425         (ProjectionType::handle_substitions): likewise
426         * typecheck/rust-tyty.h: likewise
428 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
430         * typecheck/rust-hir-trait-ref.h: Moved to...
431         * typecheck/rust-hir-trait-reference.h: ...here.
432         * typecheck/rust-hir-trait-resolve.cc: refactor
433         * typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRAIT_RESOLVE_H): likewise
434         * typecheck/rust-hir-type-check.h: likewise
435         * typecheck/rust-tyty.cc: likewise
437 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
439         * Make-lang.in: update name
440         * typecheck/rust-tyctx.cc: Moved to...
441         * typecheck/rust-typecheck-context.cc: ...here.
443 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
445         * typecheck/rust-hir-type-check.h: refactor
446         * typecheck/rust-tyctx.cc (TypeCheckContext::iterate): refactor
447         (TypeCheckContext::have_loop_context): likewise
448         (TypeCheckContext::push_new_loop_context): likewise
449         (TypeCheckContext::push_new_while_loop_context): likewise
450         (TypeCheckContext::peek_loop_context): likewise
451         (TypeCheckContext::pop_loop_context): likewise
452         (TypeCheckContext::swap_head_loop_context): likewise
453         (TypeCheckContext::insert_trait_reference): likewise
454         (TypeCheckContext::lookup_trait_reference): likewise
455         (TypeCheckContext::insert_receiver): likewise
456         (TypeCheckContext::lookup_receiver): likewise
457         (TypeCheckContext::insert_associated_type_mapping): likewise
458         (TypeCheckContext::clear_associated_type_mapping): likewise
459         (TypeCheckContext::lookup_associated_type_mapping): likewise
460         (TypeCheckContext::insert_variant_definition): likewise
461         (TypeCheckContext::lookup_variant_definition): likewise
462         (TypeCheckContext::insert_operator_overload): likewise
463         (TypeCheckContext::lookup_operator_overload): likewise
464         (TypeCheckContext::insert_unconstrained_check_marker): likewise
465         (TypeCheckContext::have_checked_for_unconstrained): likewise
466         (TypeCheckContext::insert_resolved_predicate): likewise
467         (TypeCheckContext::lookup_predicate): likewise
468         (TypeCheckContext::insert_query): likewise
469         (TypeCheckContext::query_completed): likewise
470         (TypeCheckContext::query_in_progress): likewise
471         (TypeCheckContext::insert_trait_query): likewise
472         (TypeCheckContext::trait_query_completed): likewise
473         (TypeCheckContext::trait_query_in_progress): likewise
474         (TypeCheckContextItem::Item::Item): likewise
475         (TypeCheckContextItem::TypeCheckContextItem): likewise
476         (TypeCheckContextItem::get_item): likewise
477         (TypeCheckContextItem::get_impl_item): likewise
478         (TypeCheckContextItem::get_trait_item): likewise
479         (TypeCheckContextItem::get_type): likewise
480         * typecheck/rust-tyty.cc (StructFieldType::StructFieldType): likewise
481         (StructFieldType::get_ref): likewise
482         (StructFieldType::get_name): likewise
483         (StructFieldType::get_field_type): likewise
484         (StructFieldType::set_field_type): likewise
485         (StructFieldType::is_concrete): likewise
486         (StructFieldType::debug): likewise
487         (StructFieldType::get_locus): likewise
488         (VariantDef::variant_type_string): likewise
489         (VariantDef::VariantDef): likewise
490         (VariantDef::operator=): likewise
491         (VariantDef::get_error_node): likewise
492         (VariantDef::is_error): likewise
493         (VariantDef::get_id): likewise
494         (VariantDef::get_defid): likewise
495         (VariantDef::get_variant_type): likewise
496         (VariantDef::is_data_variant): likewise
497         (VariantDef::is_dataless_variant): likewise
498         (VariantDef::get_identifier): likewise
499         (VariantDef::num_fields): likewise
500         (VariantDef::get_field_at_index): likewise
501         (VariantDef::get_fields): likewise
502         (VariantDef::lookup_field): likewise
503         (VariantDef::get_discriminant): likewise
504         (VariantDef::as_string): likewise
505         (VariantDef::is_equal): likewise
506         (VariantDef::clone): likewise
507         (VariantDef::monomorphized_clone): likewise
508         (VariantDef::get_ident): likewise
509         (TupleType::TupleType): likewise
510         (TupleType::get_unit_type): likewise
511         (TupleType::is_unit): likewise
512         (TupleType::num_fields): likewise
513         (TupleType::is_concrete): likewise
514         (TupleType::get_fields): likewise
515         (BoolType::BoolType): likewise
516         (BoolType::get_name): likewise
517         (BoolType::is_concrete): likewise
518         (IntType::IntType): likewise
519         (IntType::get_name): likewise
520         (IntType::get_int_kind): likewise
521         (IntType::is_concrete): likewise
522         (UintType::UintType): likewise
523         (UintType::get_name): likewise
524         (UintType::get_uint_kind): likewise
525         (UintType::is_concrete): likewise
526         (FloatType::FloatType): likewise
527         (FloatType::get_name): likewise
528         (FloatType::get_float_kind): likewise
529         (FloatType::is_concrete): likewise
530         (USizeType::USizeType): likewise
531         (USizeType::get_name): likewise
532         (USizeType::is_concrete): likewise
533         (ISizeType::ISizeType): likewise
534         (ISizeType::get_name): likewise
535         (ISizeType::is_concrete): likewise
536         (CharType::CharType): likewise
537         (CharType::is_concrete): likewise
538         (CharType::get_name): likewise
539         (ReferenceType::ReferenceType): likewise
540         (ReferenceType::is_concrete): likewise
541         (ReferenceType::mutability): likewise
542         (ReferenceType::is_mutable): likewise
543         (ReferenceType::is_dyn_object): likewise
544         (ReferenceType::is_dyn_slice_type): likewise
545         (ReferenceType::is_dyn_str_type): likewise
546         (PointerType::PointerType): likewise
547         (PointerType::is_concrete): likewise
548         (PointerType::mutability): likewise
549         (PointerType::is_mutable): likewise
550         (PointerType::is_const): likewise
551         (PointerType::is_dyn_object): likewise
552         (PointerType::is_dyn_slice_type): likewise
553         (PointerType::is_dyn_str_type): likewise
554         (ParamType::ParamType): likewise
555         (ParamType::get_generic_param): likewise
556         (ParamType::can_resolve): likewise
557         (ParamType::is_concrete): likewise
558         (StrType::StrType): likewise
559         (StrType::get_name): likewise
560         (StrType::is_concrete): likewise
561         (NeverType::NeverType): likewise
562         (NeverType::get_name): likewise
563         (NeverType::is_unit): likewise
564         (NeverType::is_concrete): likewise
565         (PlaceholderType::PlaceholderType): likewise
566         (PlaceholderType::get_name): likewise
567         (PlaceholderType::is_unit): likewise
568         (PlaceholderType::get_symbol): likewise
569         (PlaceholderType::is_concrete): likewise
570         (ProjectionType::is_unit): likewise
571         (ProjectionType::get_name): likewise
572         (ProjectionType::needs_generic_substitutions): likewise
573         (ProjectionType::supports_substitutions): likewise
574         (ProjectionType::has_subsititions_defined): likewise
575         (ProjectionType::get): likewise
576         (ProjectionType::is_concrete): likewise
577         (DynamicObjectType::is_concrete): likewise
578         * typecheck/rust-tyty.h: likewise
580 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
582         * typecheck/rust-hir-path-probe.cc (PathProbeCandidate::Candidate::Candidate): refactor
583         (PathProbeCandidate::PathProbeCandidate): likewise
584         (PathProbeCandidate::as_string): likewise
585         (PathProbeCandidate::is_enum_candidate): likewise
586         (PathProbeCandidate::is_impl_candidate): likewise
587         (PathProbeCandidate::is_trait_candidate): likewise
588         (PathProbeCandidate::is_full_trait_item_candidate): likewise
589         (PathProbeCandidate::get_error): likewise
590         (PathProbeCandidate::is_error): likewise
591         (PathProbeCandidate::get_defid): likewise
592         (PathProbeCandidate::operator<): likewise
593         * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
595 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
597         * typecheck/rust-hir-path-probe.cc (PathProbeType::PathProbeType): refactor
598         (PathProbeType::Probe): likewise
599         (PathProbeType::visit): likewise
600         (PathProbeType::process_enum_item_for_candiates): likewise
601         (PathProbeType::process_impl_items_for_candidates): likewise
602         (PathProbeType::is_reciever_generic): likewise
603         (PathProbeImplTrait::PathProbeImplTrait): likewise
604         (PathProbeImplTrait::Probe): likewise
605         (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
606         * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): likewise
607         * typecheck/rust-hir-trait-resolve.cc
608         (PathProbeImplTrait::process_trait_impl_items_for_candidates): likewise
610 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
612         * typecheck/rust-tyty.cc (BaseType::BaseType): refactor
613         (BaseType::~BaseType): likewise
614         (BaseType::get_ref): likewise
615         (BaseType::set_ref): likewise
616         (BaseType::get_ty_ref): likewise
617         (BaseType::set_ty_ref): likewise
618         (BaseType::is_equal): likewise
619         (BaseType::is_unit): likewise
620         (BaseType::get_kind): likewise
621         (BaseType::get_combined_refs): likewise
622         (BaseType::append_reference): likewise
623         (BaseType::supports_substitutions): likewise
624         (BaseType::has_subsititions_defined): likewise
625         (BaseType::can_substitute): likewise
626         (BaseType::needs_generic_substitutions): likewise
627         (BaseType::contains_type_parameters): likewise
628         (BaseType::get_ident): likewise
629         (BaseType::get_locus): likewise
630         (InferType::InferType): likewise
631         (InferType::get_infer_kind): likewise
632         (InferType::get_name): likewise
633         (InferType::is_concrete): likewise
634         (ErrorType::ErrorType): likewise
635         (ErrorType::is_unit): likewise
636         (ErrorType::is_concrete): likewise
637         (ErrorType::get_name): likewise
638         (ErrorType::monomorphized_clone): likewise
639         * typecheck/rust-tyty.h (class SubstitutionArgumentMappings): likewise
641 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
643         * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): refactor
644         (SubstMapper::Resolve): likewise
645         (SubstMapper::InferSubst): likewise
646         (SubstMapper::have_generic_args): likewise
647         (SubstMapper::visit): likewise
648         (SubstMapperInternal::visit): likewise
649         (SubstMapperFromExisting::SubstMapperFromExisting): likewise
650         (SubstMapperFromExisting::Resolve): likewise
651         (SubstMapperFromExisting::visit): likewise
652         (GetUsedSubstArgs::GetUsedSubstArgs): likewise
653         (GetUsedSubstArgs::From): likewise
654         (GetUsedSubstArgs::visit): likewise
655         * typecheck/rust-substitution-mapper.h: refactor
656         * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::get_generic_param): likewise
658 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
660         * Make-lang.in: update the makefile
661         * typecheck/rust-tyty.cc (SubstitutionParamMapping::need_substitution): likewise
662         (SubstitutionParamMapping::override_context): likewise
663         (SubstitutionRef::get_mappings_from_generic_args): likewise
664         (SubstitutionRef::infer_substitions): likewise
665         (SubstitutionRef::are_mappings_bound): likewise
666         (SubstitutionRef::solve_missing_mappings_from_this): likewise
667         (SubstitutionRef::monomorphize): likewise
668         * typecheck/rust-tyty.h (class SubstitutionParamMapping): likewise
669         (class SubstitutionArg): likewise
670         (std::function<void): likewise
671         (class SubstitutionArgumentMappings): likewise
672         (class SubstitutionRef): likewise
673         * typecheck/rust-tyty-subst.cc: New file.
674         * typecheck/rust-tyty-subst.h: New file.
676 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
678         * Make-lang.in: update makefile
679         * typecheck/rust-tyty.cc (TyVar::TyVar): move to new file
680         (TyVar::get_tyty): likewise
681         (TyVar::get_implicit_infer_var): likewise
682         (TyVar::subst_covariant_var): likewise
683         (TyVar::clone): likewise
684         (TyVar::monomorphized_clone): likewise
685         (TyWithLocation::TyWithLocation): likewise
686         * typecheck/rust-tyty.h (class BaseType): cleanup
687         (class TypeBoundPredicate): move to its own file
688         (class TypeBoundPredicateItem): likewise
689         (class TypeBoundsMappings): likewise
690         (class TyVar): likewise
691         (class TyWithLocation): likewise
692         * typecheck/rust-tyty-bounds.h: New file.
693         * typecheck/rust-tyty-util.cc: New file.
694         * typecheck/rust-tyty-util.h: New file.
696 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
698         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicateItem::error): refactor
699         (TypeBoundPredicateItem::is_error): likewise
700         (TypeBoundPredicateItem::get_parent): likewise
701         * typecheck/rust-tyty.h: Move the implementation for the above
703 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
705         * backend/rust-compile-expr.cc (CompileExpr::visit): Removed copy-pasted comment.
707 2023-04-06  mxlol233  <mxlol233@outlook.com>
709         * Make-lang.in: Add object files: `rust-feature.o` and `rust-feature-gate.o`
710         * checks/errors/rust-feature-gate.cc: New file.
711         * checks/errors/rust-feature-gate.h: New file.
712         * checks/errors/rust-feature.cc: New file.
713         * checks/errors/rust-feature.h: New file.
714         * rust-session-manager.cc: Add FeatureGate check.
716 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
718         * parse/rust-parse-impl.h (Parser::parse_closure_expr): Advance tokens
719         properly when parsing closure param list.
721 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
723         * parse/rust-parse-impl.h (Parser::parse_generic_arg): Handle type
724         paths and nested generics properly.
726 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
728         * ast/rust-pattern.h:
729         (ReferencePattern::is_double_reference): Add method.
730         (ReferencePattern::get_is_mut): Add method.
731         * hir/rust-ast-lower-pattern.cc
732         (ASTLoweringPattern::visit): Add ReferencePattern visitor.
733         * hir/rust-ast-lower-pattern.h:
734         (ASTLoweringPattern::visit): Add ReferencePattern visitor.
736 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
738         * hir/tree/rust-hir-pattern.h
739         (class ReferencePattern): Remove has_two_amps field.
740         * hir/tree/rust-hir-full-test.cc
741         (ReferencePattern::as_string): Remove usage of ReferencePattern::has_two_amps.
743 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
745         * backend/rust-compile-fnparam.h
746         (CompileFnParam::visit): Remove HIR::GroupedPattern visitor.
747         * backend/rust-compile-pattern.cc
748         (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
749         (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
750         * backend/rust-compile-pattern.h
751         (CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
752         (CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
753         (CompilePatternLet::visit): Remove HIR::GroupedPattern visitor.
754         * backend/rust-compile-resolve-path.h
755         (ResolvePathRef::visit): Remove HIR::GroupedPattern visitor.
756         * backend/rust-compile-var-decl.h
757         (CompileVarDecl::visit): Remove HIR::GroupedPattern visitor.
758         * checks/errors/rust-const-checker.cc
759         (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
760         * checks/errors/rust-const-checker.h
761         (ConstChecker::visit): Remove HIR::GroupedPattern visitor.
762         * checks/errors/rust-unsafe-checker.cc
763         (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
764         * checks/errors/rust-unsafe-checker.h
765         (UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
766         * hir/rust-hir-dump.cc (Dump::visit): Remove HIR::GroupedPattern visitor.
767         * hir/rust-hir-dump.h (Dump::visit): Remove HIR::GroupedPattern visitor.
768         * hir/tree/rust-hir-full-decls.h (class GroupedPattern): Remove class.
769         * hir/tree/rust-hir-full-test.cc (GroupedPattern::accept_vis): Remove method.
770         * hir/tree/rust-hir-pattern.h (class GroupedPattern): Remove class.
771         * hir/tree/rust-hir-visitor.h
772         (HIRFullVisitor::visit): Remove HIR::GroupedPattern visitor.
773         (HIRFullVisitorBase::visit): Remove HIR::GroupedPattern visitor.
774         (HIRPatternVisitor::visit): Remove HIR::GroupedPattern visitor.
775         * typecheck/rust-hir-type-check-pattern.cc
776         (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
777         * typecheck/rust-hir-type-check-pattern.h
778         (TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
780 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
782         * hir/rust-ast-lower-pattern.cc
783         (ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern.
785 2023-04-06  MAHAD  <mahadtxt@gmail.com>
787         * rust-buffered-queue.h: Moved to...
788         * util/rust-buffered-queue.h: ...here.
790 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
792         * parse/rust-parse-impl.h (Parser::parse_type): Handle double ampersan
793         properly
794         (Parser::parse_reference_type): Call into `parse_reference_type_inner`
795         and wrap double reference types in another `AST::ReferenceType` node
796         (Parser::parse_reference_type_inner): Add parsing implementation
797         which does not care about the leading token (& or  &&)
798         (Parser::parse_type_no_bounds): Handle double ampersand properly
799         * parse/rust-parse.h: Declare `parse_reference_type_inner`
801 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
803         * backend/rust-compile-pattern.cc (CompilePatternLet::visit): New function.
804         * backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
805         * backend/rust-compile-pattern.h (class CompilePatternLet): New visitor.
807 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
809         * ast/rust-macro.h (enum class): Add `BuiltinMacro` enum class.
810         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Mention
811         switching on `macro.kind` once builtin macro invocations are properly
812         handled.
813         * parse/rust-parse-impl.h (Parser::parse_macro_invocation): Switch to new MacroInvocation
814         API.
815         (Parser::parse_type): Likewise.
816         (Parser::parse_type_no_bounds): Likewise.
818 2023-04-06  Abdul Rafey  <abdulrafeyq@gmail.com>
820         * ast/rust-ast-dump.cc (Dump::visit): removed extra indentations in trait ast dump
822 2023-04-06  Abdul Rafey  <abdulrafeyq@gmail.com>
824         * parse/rust-parse-impl.h (Parser::null_denotation): Add proper error
825         when seeing wildcard var on right side of assignment.
827 2023-04-06  Abdul Rafey  <abdulrafeyq@gmail.com>
829         * ast/rust-ast.cc: Fix include list.
830         * ast/rust-expr.h: Likewise.
831         * hir/tree/rust-hir-expr.h: Likewise.
832         * rust-backend.h: Likewise.
833         * util/rust-lang-item.h: Likewise.
834         * operator.h: Moved to...
835         * util/rust-operators.h: ...here.
837 2023-04-06  Parthib  <parthibdutta02@gmail.com>
839         * Make-lang.in: Rename object file.
840         * ast/rust-ast-full-test.cc: Moved to...
841         * ast/rust-ast.cc: ...here.
843 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
845         * backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Add proper
846         visitor.
847         (CompilePatternBindings::visit): Likewise.
848         * backend/rust-compile-pattern.h: Declare them.
850 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
852         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add proper
853         visitor.
855 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
857         * hir/tree/rust-hir-pattern.h: Add get_item method.
859 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
861         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Add proper visitor.
862         * hir/rust-ast-lower-pattern.h: Declare it.
864 2023-04-06  Lyra  <teromene@teromene.fr>
866         * expand/rust-macro-expand.cc (transcribe_expression): Fix ICE when expanding
867         empty macros.
869 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
871         * resolve/rust-ast-resolve-pattern.h: Support GroupedPattern properly.
873 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
875         * backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block):
876         Allow patterns to declare zero or multiple variables.
877         * backend/rust-compile-var-decl.h: Change function declaration.
879 2023-04-06  mxlol233  <mxlol233@outlook.com>
881         * lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token.
882         (Lexer::parse_byte_char): Likewise.
883         (Lexer::parse_byte_string): Likewise.
884         (Lexer::parse_raw_byte_string): Likewise.
885         (Lexer::parse_raw_identifier): Likewise.
886         (Lexer::parse_string): Likewise.
887         (Lexer::parse_identifier_or_keyword): Likewise.
888         (Lexer::parse_raw_string): Likewise.
889         (Lexer::parse_non_decimal_int_literal): Likewise.
890         (Lexer::parse_decimal_int_or_float): Likewise.
891         (Lexer::parse_char_or_lifetime): Likewise.
893 2023-04-06  mxlol233  <mxlol233@outlook.com>
895         * ast/rust-ast.h: Add get_locus method.
896         * ast/rust-expr.h: Likewise.
897         * ast/rust-macro.h: Likewise.
899 2023-04-06  Owen Avery  <powerboat9.gamer@gmail.com>
901         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Cleanup LetStmt
902         type checking.
904 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
906         * hir/tree/rust-hir-path.h: Add const get_identifier and get_type method.
907         * typecheck/rust-hir-path-probe.h: Use new SubstitutionArgumentMappings constructor.
908         * typecheck/rust-hir-trait-resolve.cc: Likewise.
909         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
910         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
911         Do not assert failure on size mismatch anymore.
912         (TypeBoundPredicate::TypeBoundPredicate): Use new SubstitutionArgumentMappings constructor.
913         (TypeBoundPredicate::operator=): Likewise.
914         (TypeBoundPredicate::apply_generic_arguments): Likewise.
915         (TypeBoundPredicateItem::get_tyty_for_receiver): Likewise.
916         (TypeBoundPredicate::get_num_associated_bindings): Likewise.
917         (TypeBoundPredicate::lookup_associated_type): Fix implementation for new system.
918         (TypeBoundPredicate::get_associated_type_items): Likewise.
919         * typecheck/rust-tyty.cc (SubstitutionRef::get_mappings_from_generic_args): Add new
920         behavior.
921         (SubstitutionRef::infer_substitions): Use new constructor and add comment.
922         (SubstitutionRef::solve_missing_mappings_from_this): Use new constructor.
923         * typecheck/rust-tyty.h: Define new constructors.
925 2023-04-06  Philip Herron  <herron.philip@googlemail.com>
927         * resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to
928         Trait items.
930 2023-04-06  Raiki Tamura  <tamaron1203@gmail.com>
932         * ast/rust-ast-full-decls.h (class MacroItem): Remove forward declaration.
933         * ast/rust-ast-full-test.cc (MacroRulesDefinition):
934         Rework MacroRulesDefinition class
935         * ast/rust-ast.h (class MacroItem): Remove abstract class.
936         * ast/rust-item.h (class MacroItem): Remove forward declaration.
937         * ast/rust-macro.h (class MacroItem): Likewise.
938         (class MacroRulesDefinition): Add MacroKind enum.
939         (class MacroInvocation): Fix inheritance.
940         * lex/rust-token.h: Token "macro" is now used.
941         * parse/rust-parse-impl.h (Parser::parse_item): Add handling for MACRO.
942         (Parser::parse_vis_item): Call into parse_decl_macro_def.
943         (Parser::parse_macro_item): Delete function.
944         (Parser::parse_macro_rules_def): Return MBE macros only.
945         (Parser::parse_decl_macro_def): New function.
946         (Parser::parse_stmt): Handle MACRO token.
947         (Parser::parse_stmt_or_expr_without_block): Call into parse_macro_rules_def.
948         * parse/rust-parse.h: Declare new function.
950 2023-04-06  mxlol233  <mxlol233@outlook.com>
952         * parse/rust-parse-impl.h (Parser::parse_generic_arg): Add proper bound parsing.
954 2023-04-06  Dave  <dme2223@gmail.com>
956         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Use StackedContext
957         class.
959 2023-04-06  Prajwal S N  <prajwalnadig21@gmail.com>
961         * checks/errors/rust-unsafe-checker.cc (check_target_attr): New function.
962         (UnsafeChecker::check_function_attr): Call into `check_target_attr`.
963         (UnsafeChecker::visit): Check for target_feature attributes.
964         * checks/errors/rust-unsafe-checker.h: Add declarations.
965         * util/rust-attributes.cc: Add attribute.
967 2023-04-06  Arthur Cohen  <arthur.cohen@embecosm.com>
969         * rust-session-manager.cc (Session::compile_crate): Fix typo.
971 2023-02-22  Thomas Schwinge  <thomas@codesourcery.com>
973         * rust-lang.cc (grs_langhook_type_for_mode): Also consider all
974         'int_n' modes/types.
976 2023-02-22  Thomas Schwinge  <thomas@codesourcery.com>
978         * rust-lang.cc (grs_langhook_init): Do not initialize
979         void_list_node.
981 2023-02-22  Thomas Schwinge  <thomas@codesourcery.com>
983         * config-lang.in (target_libs): Remove.
985 2023-02-21  Raiki Tamura  <tamaron1203@gmail.com>
987         * backend/rust-builtins.cc (BuiltinsContext::setup_math_fns): New functions.
989 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
991         * backend/rust-constexpr.cc (get_nth_callarg): Remove function.
992         (rs_bind_parameters_in_call): Use CALL_EXPR_ARG instead.
993         (potential_constant_expression_1): Likewise.
995 2023-02-21  Thomas Schwinge  <thomas@codesourcery.com>
997         * lang.opt: Fix ordering of file.
999 2023-02-21  Philip Herron  <herron.philip@googlemail.com>
1001         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Remove unused parameters.
1002         * backend/rust-constexpr.cc (constant_value_1): Likewise.
1003         (fold_non_dependent_init): Likewise.
1004         * backend/rust-tree.cc (publicly_uniquely_derived_p): Likewise.
1005         (instantiation_dependent_expression_p): Likewise.
1006         (type_has_nontrivial_copy_init): Likewise.
1007         (is_normal_capture_proxy): Likewise.
1008         (resolve_nondeduced_context): Likewise.
1009         (undeduced_auto_decl): Likewise.
1010         (require_deduced_type): Likewise.
1011         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
1012         * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise.
1013         * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise.
1014         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
1015         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
1016         * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
1017         * checks/lints/rust-lint-unused-var.cc (unused_var_walk_fn): Likewise.
1018         * expand/rust-macro-builtins.cc (try_expand_single_string_literal): Likewise.
1019         (try_expand_many_expr): Likewise.
1020         (parse_single_string_literal): Likewise.
1021         (MacroBuiltin::assert_handler): Likewise.
1022         (MacroBuiltin::file_handler): Likewise.
1023         (MacroBuiltin::column_handler): Likewise.
1024         (MacroBuiltin::concat_handler): Likewise.
1025         (MacroBuiltin::env_handler): Likewise.
1026         (MacroBuiltin::line_handler): Likewise.
1027         * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
1028         (ASTLoweringBase::handle_doc_item_attribute): Likewise.
1029         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
1030         * hir/tree/rust-hir-full-test.cc (ConstGenericParam::accept_vis): Likewise.
1031         * lex/rust-lex.cc (Lexer::parse_utf8_escape): Likewise.
1032         (Lexer::parse_string): Likewise.
1033         (Lexer::parse_char_or_lifetime): Likewise.
1034         * lex/rust-lex.h: Likewise.
1035         * metadata/rust-export-metadata.cc: Likewise.
1036         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
1037         * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
1038         (ResolveTypeToCanonicalPath::visit): Likewise.
1039         * resolve/rust-ast-verify-assignee.h: Likewise.
1040         * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
1041         * typecheck/rust-hir-type-check-expr.h: Likewise.
1042         * typecheck/rust-hir-type-check-item.h: Likewise.
1043         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
1044         * typecheck/rust-tyty-rules.h: Likewise.
1045         * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
1047 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1049         * hir/tree/rust-hir-expr.h: Add const `get_method_name`.
1050         * hir/tree/rust-hir-full-decls.h (struct GenericArgs): Move from `struct`...
1051         (class GenericArgs): ...to `class`.
1052         * hir/tree/rust-hir-path.h (struct GenericArgs): Likewise.
1053         (class GenericArgs): Clear `type_args` in copy constructor.
1054         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Reorder
1055         debug print.
1056         * typecheck/rust-tyty.h: Add default constructors for `SubstitutionArgumentMappings`.
1058 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1060         * backend/rust-compile-context.cc (Context::push_closure_context): New function.
1061         (Context::pop_closure_context): Likewise.
1062         (Context::insert_closure_binding): Likewise.
1063         (Context::lookup_closure_binding): Likewise.
1064         * backend/rust-compile-context.h: Declare new functions and closure mappings.
1065         * backend/rust-compile-expr.cc (CompileExpr::visit): Visit captures properly.
1066         (CompileExpr::generate_closure_function): Compile captures properly.
1067         * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Check for
1068         closure bindings.
1069         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Compile capture list's
1070         types as well.
1072 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1074         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Pass captures
1075         properly to `TyTy::ClosureType` constructor.
1076         * typecheck/rust-tyty.cc (ClosureType::as_string): Fix string representation.
1077         (ClosureType::clone): Pass `captures` argument.
1078         * typecheck/rust-tyty.h: Add `captures` field.
1080 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1082         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Use proper closure
1083         contexts.
1084         * resolve/rust-name-resolver.cc (Scope::lookup_decl_type): New function.
1085         (Scope::lookup_rib_for_decl): Likewise.
1086         (Resolver::insert_resolved_name): Insert captured items.
1087         (Resolver::push_closure_context): New function.
1088         (Resolver::pop_closure_context): Likewise.
1089         (Resolver::insert_captured_item): Likewise.
1090         (Resolver::decl_needs_capture): Likewise.
1091         (Resolver::get_captures): Likewise.
1092         * resolve/rust-name-resolver.h: Declare new functions.
1094 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1096         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add Rib argument.
1097         (ResolveExpr::resolve_closure_param): Likewise.
1098         * resolve/rust-ast-resolve-implitem.h: Likewise.
1099         * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise.
1100         (ResolveItem::visit): Likewise.
1101         * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise.
1102         * resolve/rust-ast-resolve-pattern.h: Likewise.
1103         * resolve/rust-ast-resolve-stmt.h: Likewise.
1104         * resolve/rust-ast-resolve-toplevel.h: Likewise.
1105         * resolve/rust-ast-resolve-type.h: Likewise.
1106         * resolve/rust-name-resolver.cc (Rib::lookup_decl_type): Likewise.
1107         (Scope::insert): Likewise.
1108         (Resolver::insert_builtin_types): Likewise.
1109         * resolve/rust-name-resolver.h: Likewise.
1111 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1113         * resolve/rust-name-resolver.cc (MKBUILTIN_TYPE): Remove macro.
1114         (Rib::Rib): Remove `mappings` field.
1115         (Resolver::generate_builtins): Use `setup_builtin` instead of macro.
1116         (Resolver::setup_builtin): New function.
1117         * resolve/rust-name-resolver.h: Declare `setup_builtin`, add FIXME
1118         comment.
1120 2023-02-21  Raiki Tamura  <tamaron1203@gmail.com>
1122         * lex/rust-lex.cc (Lexer::Lexer): Add `dump_lex` boolean flag.
1123         (Lexer::skip_token): Dump tokens if flag is enabled.
1124         (Lexer::dump_and_skip): New function.
1125         * lex/rust-lex.h: Include optional.h and declare functions.
1126         * parse/rust-parse-impl.h (Parser::debug_dump_lex_output): Remove old
1127         unused function.
1128         * parse/rust-parse.h: Likewise.
1129         * rust-session-manager.cc (Session::compile_crate): Pass lexer dump
1130         option to lexer.
1131         (Session::dump_lex): New function.
1132         * util/rust-optional.h: Add missing constructor.
1134 2023-02-21  Dave  <dme2223@gmail.com>
1136         * ast/rust-item.h: Remoe default location for Visibility class.
1137         * parse/rust-parse-impl.h (Parser::parse_visibility): Pass proper location
1138         when instantiating visibilities.
1140 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1142         * ast/rust-ast-dump.cc (Dump::visit): Fix dumping of fn params.
1144 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1146         * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous string when
1147         dumping statements.
1149 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1151         * ast/rust-ast-dump.cc: Remove unused include.
1153 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1155         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1156         * ast/rust-ast-dump.h: Likewise.
1158 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1160         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1162 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1164         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1166 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1168         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1170 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1172         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1174 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1176         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1178 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1180         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1182 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1184         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1185         * ast/rust-ast-dump.h: Add missing getter declaration.
1186         * ast/rust-ast-full-test.cc (BareFunctionType::as_string): Fix bare function
1187         string representation.
1188         * ast/rust-type.h (class BareFunctionType): Declare said getter.
1190 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1192         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor.
1194 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1196         * ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor.
1198 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1200         * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor.
1202 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1204         * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor.
1206 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1208         * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor
1210 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1212         * ast/rust-ast-dump.cc (Dump::visit): Add missing slice visitor.
1214 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1216         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors.
1217         * ast/rust-ast-dump.h: Likewise.
1218         * ast/rust-ast.h: Add `get_lifetime_bounds` method.
1219         * ast/rust-item.h: Add missing getter for lifetimes.
1220         * ast/rust-type.h: Likewise.
1222 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1224         * ast/rust-ast-dump.cc (Dump::visit): Add new reference visitor wrapper.
1225         * ast/rust-ast-dump.h: Declare it.
1226         * ast/rust-item.h: Add mutable visibility getters.
1228 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1230         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call
1231         to `delete`.
1233 2023-02-21  Dave  <dme2223@gmail.com>
1235         * ast/rust-item.h: Add location member.
1236         * hir/rust-ast-lower.cc (translate_visibility): Pass location argument.
1237         * hir/tree/rust-hir-item.h: Fix constructor to accept Location argument.
1239 2023-02-21  Raiki Tamura  <tamaron1203@gmail.com>
1241         * util/rust-lang-item.h: Add handling for `phantom_data` lang item.
1243 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1245         * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures.
1247 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1249         * ast/rust-ast-dump.h: Fix documentation.
1251 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1253         * ast/rust-ast-dump.cc (Dump::go): Use new API.
1254         (Dump::format_function_param): Refactor.
1255         (Dump::visit_items_joined_by_separator): New function.
1256         (Dump::emit_attrib): Refactor.
1257         (Dump::visit_as_line): New function.
1258         (Dump::visit_items_as_lines): Likewise.
1259         (Dump::visit_items_as_block): Likewise.
1260         (Dump::visit): Use new API.
1261         (Dump::emit_visibility): Likewise.
1262         (Dump::emit_indented_string): Likewise.
1263         (Dump::emit_generic_params): Likewise.
1264         (Dump::format_tuple_field): Likewise.
1265         (Dump::format_struct_field): Likewise.
1266         (Dump::format_function_common): Likewise.
1267         (Dump::visit_function_common): Likewise.
1268         * ast/rust-ast-dump.h: Declare new functions and add documentation.
1270 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1272         * ast/rust-ast-dump.cc (Dump::visit): Add new visit function for overloading.
1273         * ast/rust-ast-dump.h: Add documentation for layer.
1275 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1277         * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): Declare atomic
1278         load intrinsics.
1279         * backend/rust-compile-intrinsic.cc (atomic_load_handler_inner): New handler.
1280         (atomic_load_handler): Likewise.
1281         (unchecked_op_handler): Remove `static` function qualifier.
1282         (build_atomic_builtin_name): Handle load intrinsics.
1283         (atomic_store_handler_inner): New handler.
1285 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1287         * backend/rust-compile-intrinsic.cc (check_for_basic_integer_type): New function.
1288         (build_atomic_builtin_name): Use HIR Type instead of `tree`.
1289         (atomic_store_handler_inner): Cleanup error handling.
1290         (unchecked_op_inner): Likewise.
1292 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1294         * backend/rust-compile-intrinsic.cc (wrapping_op_handler): Refactor to return
1295         an `std::function`.
1296         (wrapping_op_handler_inner): Rename.
1297         (wrapping_add_handler): Remove function.
1298         (wrapping_sub_handler): Likewise.
1299         (wrapping_mul_handler): Likewise.
1301 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1303         * backend/rust-compile-intrinsic.cc (is_basic_integer_type): New function.
1304         (unchecked_op_inner): New handler.
1305         (unchecked_op_handler): New handler.
1307 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1309         * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): New function.
1310         (BuiltinsContext::setup): Call `setup_atomic_fns`.
1311         * backend/rust-builtins.h: Declare `setup_atomic_fns`.
1312         * backend/rust-compile-intrinsic.cc (atomic_store_handler_inner): New function.
1313         (atomic_store_handler): New handler.
1314         (make_unsigned_long_tree): Add helper around making unsigned long trees.
1315         (prefetch_data_handler): Use `make_unsigned_long_tree`.
1316         (build_atomic_builtin_name): New function.
1318 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1320         * backend/rust-constexpr.cc (build_anon_member_initialization): Workaround uninitialized
1321         values.
1322         (build_data_member_initialization): Likewise.
1324 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1326         * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler.
1328 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1330         * expand/rust-macro-builtins.cc (MacroBuiltin::assert): Rename to...
1331         (MacroBuiltin::assert_handler): ..this.
1332         (MacroBuiltin::file): Rename to...
1333         (MacroBuiltin::file_handler): ..this.
1334         (MacroBuiltin::column): Rename to...
1335         (MacroBuiltin::column_handler): ..this.
1336         (MacroBuiltin::include_bytes): Rename to...
1337         (MacroBuiltin::include_bytes_handler): ..this.
1338         (MacroBuiltin::include_str): Rename to...
1339         (MacroBuiltin::include_str_handler): ..this.
1340         (MacroBuiltin::compile_error): Rename to...
1341         (MacroBuiltin::compile_error_handler): ..this.
1342         (MacroBuiltin::concat): Rename to...
1343         (MacroBuiltin::concat_handler): ..this.
1344         (MacroBuiltin::env): Rename to...
1345         (MacroBuiltin::env_handler): ..this.
1346         (MacroBuiltin::cfg): Rename to...
1347         (MacroBuiltin::cfg_handler): ..this.
1348         (MacroBuiltin::include): Rename to...
1349         (MacroBuiltin::include_handler): ..this.
1350         (MacroBuiltin::line): Rename to...
1351         (MacroBuiltin::line_handler): ..this.
1352         * expand/rust-macro-builtins.h: Rename all handlers.
1353         * util/rust-hir-map.cc (Mappings::insert_macro_def): Use new handler
1354         names.
1356 2023-02-21  Simon Cook  <simon.cook@embecosm.com>
1358         * util/rust-inline-visitor.h: Remove some offending system includes.
1360 2023-02-21  YizhePKU  <yizhe@pku.edu.cn>
1362         * util/rust-inline-visitor.h: New file.
1364 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1366         * backend/rust-compile-expr.cc (CompileExpr::visit): Refactor checking of closures.
1367         (CompileExpr::generate_possible_fn_trait_call): New function.
1368         * backend/rust-compile-expr.h: Declare `generate_possible_fn_trait_call`.
1370 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1372         * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Add missing
1373         implementation.
1375 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1377         * Make-lang.in: Compile rust-ast-lower-type.cc.
1378         * ast/rust-path.h: Add `get_locus` method to `TypePathFunction`.
1379         * hir/rust-ast-lower-base.cc (ASTLowerTypePath::visit): Move implementation to
1380         rust-ast-lower-type.cc.
1381         (ASTLowerQualifiedPathInType::visit): Likewise.
1382         (ASTLoweringType::visit): Likewise.
1383         * hir/rust-ast-lower-type.h: Move implementations to source file.
1384         * hir/tree/rust-hir-path.h: Likewise.
1385         * hir/rust-ast-lower-type.cc: New file.
1387 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1389         * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Add missing handling of
1390         function case.
1392 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1394         * backend/rust-compile-context.h: Add new functions: `insert_closure_decl` and
1395         `lookup_closure_decl`.
1396         * backend/rust-compile-expr.cc (CompileExpr::visit): Start compiling Closures properly.
1397         (CompileExpr::generate_closure_function): New function.
1398         (CompileExpr::generate_closure_fntype): Likewise.
1399         * backend/rust-compile-expr.h: Declare `generate_closure_function` and
1400         `generate_closure_fntype`.
1401         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Visit closure types properly.
1402         * backend/rust-mangle.cc (legacy_mangle_name): Add support for closures.
1403         * backend/rust-tree.h (RS_CLOSURE_FLAG): Add new tree macro.
1404         (RS_CLOSURE_TYPE_P): And checking for it on tree nodes.
1405         * typecheck/rust-tyty.cc (ClosureType::is_equal): Add implementation.
1407 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1409         * hir/tree/rust-hir-expr.h: Add `get_params` method.
1410         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Typecheck closure nodes.
1411         (TypeCheckExpr::resolve_fn_trait_call): New function.
1412         * typecheck/rust-hir-type-check-expr.h: Declare `resolve_fn_trait_call` and
1413         `resolve_possible_fn_trait_call_method_name`.
1414         * typecheck/rust-hir-type-check.h: Declare `get_context_type`.
1415         * typecheck/rust-tyctx.cc (TypeCheckContextItem::get_context_type): New function.
1416         * typecheck/rust-tyty-cmp.h: Visit closures properly.
1417         * typecheck/rust-tyty-rules.h: Likewise.
1418         * typecheck/rust-tyty.cc (BaseType::bounds_compatible): Add commented out assertin.
1419         (ClosureType::as_string): Implement it.
1420         (ClosureType::clone): Fix closure cloning.
1421         (ClosureType::setup_fn_once_output): New function.
1422         * typecheck/rust-tyty.h: Improve `ClosureType` class and declare `setup_fn_once_output`.
1424 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1426         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Visit closures properly.
1427         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
1428         * checks/lints/rust-lint-marklive.h: Likewise.
1430 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1432         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Simplify method
1433         call type checking      by removing visitor and instead using one static cast. Use the
1434         new interface.
1435         * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
1436         (TypeCheckMethodCallExpr::go): Likewise.
1437         (TypeCheckMethodCallExpr::check): Likewise.
1438         * typecheck/rust-tyty-call.h (class TypeCheckMethodCallExpr): Likewise.
1439         (class Argument): Likewise.
1441 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1443         * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Visit closure properly when
1444         name resolving.
1445         (ResolveExpr::resolve_closure_param): Implement closure name resolving.
1446         * resolve/rust-ast-resolve-expr.h: Declare visitors for closure types.
1448 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1450         * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::ASTLoweringPattern):
1451         Improve formatting.
1452         (ASTLoweringPattern::translate): Likewise.
1453         * hir/rust-ast-lower-pattern.h: Likewise.
1454         * resolve/rust-ast-resolve-expr.h: Likewise.
1456 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1458         * Make-lang.in: Add new object file for expression lowering.
1459         * ast/rust-expr.h: Move implementation of expr lowering to source file.
1460         * backend/rust-compile-block.h: Likewise.
1461         * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
1462         * backend/rust-compile-expr.h: Likewise.
1463         * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise.
1464         * checks/errors/privacy/rust-privacy-reporter.h: Likewise.
1465         * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
1466         * checks/errors/rust-const-checker.h: Likewise.
1467         * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
1468         * checks/errors/rust-unsafe-checker.h: Likewise.
1469         * hir/rust-ast-lower-base.h: Likewise.
1470         * hir/rust-ast-lower-expr.h (RUST_AST_LOWER_EXPR): Likewise.
1471         * hir/rust-ast-lower.cc (ASTLoweringBase::lower_closure_param): Likewise.
1472         * hir/rust-hir-dump.cc (Dump::visit): Likewise.
1473         * hir/rust-hir-dump.h: Likewise.
1474         * hir/tree/rust-hir-expr.h (class ClosureExpr): Likewise.
1475         (class ClosureExprInner): Likewise.
1476         (class ClosureExprInnerTyped): Likewise.
1477         * hir/tree/rust-hir-full-decls.h (class ClosureExprInner): Likewise.
1478         (class ClosureExprInnerTyped): Likewise.
1479         * hir/tree/rust-hir-full-test.cc (ClosureExprInnerTyped::as_string): Likewise.
1480         (ClosureExprInner::as_string): Likewise.
1481         (ClosureExprInner::accept_vis): Likewise.
1482         (ClosureExpr::accept_vis): Likewise.
1483         (ClosureExprInnerTyped::accept_vis): Likewise.
1484         * hir/tree/rust-hir-visitor.h: Likewise.
1485         * hir/tree/rust-hir.h (class Expr): Likewise.
1486         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
1487         * typecheck/rust-hir-type-check-expr.h: Likewise.
1488         * hir/rust-ast-lower-expr.cc: New file.
1490 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1492         * util/rust-lang-item.h: Add handling for `fn_once_output`.
1494 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1496         * ast/rust-ast-fragment.cc (Fragment::Fragment): Add better APIs.
1497         (Fragment::complete): New function.
1498         (Fragment::unexpanded): New function.
1499         * ast/rust-ast-fragment.h: Declare new APIs and add documentation.
1500         * expand/rust-attribute-visitor.h: Use new Fragment API.
1501         * expand/rust-macro-builtins.cc (MacroBuiltin::file): Likewise.
1502         (MacroBuiltin::column): Likewise.
1503         (MacroBuiltin::include_bytes): Likewise.
1504         (MacroBuiltin::include_str): Likewise.
1505         (MacroBuiltin::concat): Likewise.
1506         (MacroBuiltin::env): Likewise.
1507         (MacroBuiltin::cfg): Likewise.
1508         (MacroBuiltin::include): Likewise.
1509         (MacroBuiltin::line): Likewise.
1510         * expand/rust-macro-expand.cc (parse_many): Likewise.
1511         (transcribe_expression): Likewise.
1512         (transcribe_type): Likewise.
1513         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
1515 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1517         * ast/rust-ast.h (class ASTFragment): Remove old ASTFragment class.
1518         * ast/rust-macro.h (class MacroRulesDefinition): Use new Fragment API.
1519         * expand/rust-attribute-visitor.h: Likewise.
1520         * expand/rust-macro-builtins.cc (macro_end_token): Likewise.
1521         (MacroBuiltin::assert): Likewise.
1522         (MacroBuiltin::file): Likewise.
1523         (MacroBuiltin::column): Likewise.
1524         (MacroBuiltin::include_bytes): Likewise.
1525         (MacroBuiltin::include_str): Likewise.
1526         (MacroBuiltin::compile_error): Likewise.
1527         (MacroBuiltin::concat): Likewise.
1528         (MacroBuiltin::env): Likewise.
1529         (MacroBuiltin::cfg): Likewise.
1530         (MacroBuiltin::include): Likewise.
1531         (MacroBuiltin::line): Likewise.
1532         * expand/rust-macro-builtins.h: Likewise.
1533         * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise.
1534         (MacroExpander::expand_invoc): Likewise.
1535         (MacroExpander::match_repetition): Likewise.
1536         (parse_many): Likewise.
1537         (transcribe_many_items): Likewise.
1538         (transcribe_many_ext): Likewise.
1539         (transcribe_many_trait_items): Likewise.
1540         (transcribe_many_impl_items): Likewise.
1541         (transcribe_many_trait_impl_items): Likewise.
1542         (transcribe_expression): Likewise.
1543         (transcribe_type): Likewise.
1544         (transcribe_on_delimiter): Likewise.
1545         (tokens_to_str): Likewise.
1546         * expand/rust-macro-expand.h (struct MacroExpander): Likewise.
1547         * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
1549 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1551         * Make-lang.in: Add `rust-ast-fragment.o` object file.
1552         * ast/rust-ast-fragment.cc: New file.
1553         * ast/rust-ast-fragment.h: New file.
1555 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1557         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): Check if a
1558         trait query is currently in progress.
1559         * typecheck/rust-hir-type-check.h (class TraitQueryGuard): Add helpers around
1560         checking for trait queries and inserting them.
1562 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1564         * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors for macro definition dumping.
1565         (get_delimiters): New function.
1566         * ast/rust-ast-dump.h: Declare `get_delimiters` and add documentation.
1567         * ast/rust-macro.h: Add `get_token_tree` method.
1569 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1571         * ast/rust-ast-dump.cc (Dump::visit): Properly handle unloaded modules.
1573 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1575         * ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules.
1577 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1579         * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly.
1581 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1583         * ast/rust-ast-dump.cc: Emit visibility when dumping items.
1585 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1587         * hir/rust-ast-lower-base.h (class ItemWrapper): New class.
1588         * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Use
1589         `ItemWrapper` class.
1590         (ASTLoweringBase::handle_doc_item_attribute): Likewise.
1591         (ASTLoweringBase::handle_lang_item_attribute): Likewise.
1592         * hir/rust-ast-lower-implitem.h: Check outer attributes on items.
1593         * hir/tree/rust-hir-item.h: Add `get_trait_locus` methods.
1594         * hir/tree/rust-hir.h: Likewise.
1595         * util/rust-hir-map.h: Add defId mappings and associated functions.
1596         * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Implement insertion to said
1597         mappings.
1598         (Mappings::lookup_trait_item_defid): And looking up said mappings.
1600 2023-02-21  Jakub Dupak  <dev@jakubdupak.com>
1602         * ast/rust-ast-dump.cc (Dump::visit): Add code for dumping type aliases.
1604 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1606         * typecheck/rust-hir-trait-resolve.cc (TraitResolver::TraitResolver): Do not nullptr init
1607         `resolved_trait_reference` anymore.
1608         (TraitResolver::resolve_path): Simplify function and rename to...
1609         (TraitResolver::resolve_path_to_trait): ...this.
1610         (TraitResolver::lookup_path): Use new interface.
1611         * typecheck/rust-hir-trait-resolve.h (class TraitResolver): Do not inherit `HIRFullVisitor`
1612         class anymore.
1614 2023-02-21  David Faust  <david.faust@oracle.com>
1616         * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs.
1618 2023-02-21  David Faust  <david.faust@oracle.com>
1620         * ast/rust-ast-dump.cc (Dump::visit): Add dump for, BorrowExpr, DereferenceExpr,
1621         ErrorPropagationExpr, NegationExpr, TypeCastExpr and GroupedExpr.
1623 2023-02-21  David Faust  <david.faust@oracle.com>
1625         * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr.
1627 2023-02-21  David Faust  <david.faust@oracle.com>
1629         * ast/rust-ast-dump.cc (Dump::visit): Add dumps for ComparisonExpr and
1630         LazyBooleanExpr.
1632 2023-02-21  David Faust  <david.faust@oracle.com>
1634         * ast/rust-ast-dump.cc (Dump::visit): Fix IfExpr formatting.
1636 2023-02-21  David Faust  <david.faust@oracle.com>
1638         * ast/rust-ast-dump.cc (Dump::visit): Fix block formatting.
1640 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1642         * typecheck/rust-autoderef.cc: Add support for multiple resolution candidates.
1643         * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver): Edit
1644         `try_result` field and change constructor.
1645         (MethodResolver::Probe): Return set of candidates instead of singular candidate.
1646         (MethodResolver::select): Add better implementation to account for multiple
1647         candidates.
1648         * typecheck/rust-hir-dot-operator.h (struct MethodCandidate): Overload comparison
1649         operator in order to store them in `std::set`.
1650         * typecheck/rust-hir-inherent-impl-overlap.h: Do not fail assertion on missing type.
1651         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Adapt code to use
1652         multiple candidates.
1653         * typecheck/rust-tyty.cc (set_cmp_autoderef_mode): Add code to handle automatic
1654         derefs properly.
1655         (reset_cmp_autoderef_mode): Add helper function to reset said mode.
1656         * typecheck/rust-tyty.h (set_cmp_autoderef_mode): Declare function.
1657         (reset_cmp_autoderef_mode): Likewise.
1658         * typecheck/rust-tyty-cmp.h: Add handling of `autoderef_cmp_flag`
1660 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1662         * util/rust-abi.cc (get_abi_from_string): Add missing "rust-call"
1663         possibility for ABI variant.
1665 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1667         * util/rust-lang-item.h: Add `fn_once` lang item.
1669 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1671         * backend/rust-compile.cc: Add note about missing support for super
1672         traits.
1673         * typecheck/rust-tyty.cc (BaseType::satisfies_bound): New function.
1674         (BaseType::bounds_compatible): New function.
1675         (DynamicObjectType::get_object_items): New function.
1676         * typecheck/rust-hir-trait-ref.h: Use new API to perform type resolution
1677         on dyn objects.
1679 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1681         * Make-lang.in: Compile early name resolver.
1682         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Move macro
1683         name resolution.
1684         * expand/rust-macro-builtins.cc (try_expand_macro_expression): Run ENR
1685         when recursively expanding macros.
1686         * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): No longer
1687         perform name resolution in `expand_invoc`.
1688         * expand/rust-macro-expand.h (struct MacroExpander): Keep ENR within
1689         MacroExpander.
1690         * rust-session-manager.cc (Session::expansion): Run ENR.
1691         * resolve/rust-early-name-resolver.cc: New file.
1692         * resolve/rust-early-name-resolver.h: New file.
1694 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1696         * ast/rust-path.h: Add `accept_vis` method to `GenericArg` class.
1698 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1700         * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for
1701         glob import resolving.
1703 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1705         * util/rust-hir-map.h: Add new mappings.
1706         * util/rust-hir-map.cc (Mappings::insert_macro_invocation): Add insertion
1707         function into mappings.
1708         (Mappings::lookup_macro_invocation): Add lookup function for mappings.
1710 2023-02-21  Marc Poulhiès  <dkm@kataplop.net>
1712         * parse/rust-parse-impl.h (Parser::parse_stmt_or_expr_without_block):
1713         Check if `expr` is valid after parsing it.
1715 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1717         * backend/rust-builtins.cc (BuiltinsContext::setup): Declare prefetch
1718         intrinsics.
1719         * backend/rust-compile-intrinsic.cc (enum class Prefetch): Add kinds of
1720         prefetch intrinsics.
1721         (prefetch_data_handler): New function.
1722         (prefetch_read_data): Likewise.
1723         (prefetch_write_data): Likewise.
1725 2023-02-21  David Faust  <david.faust@oracle.com>
1727         * ast/rust-ast-dump.cc (Dump::visit): Fill empty functions for
1728         structs, enums and unions.
1730 2023-02-21  David Faust  <david.faust@oracle.com>
1732         * ast/rust-ast-dump.cc (Dump::format_tuple_field): New.
1733         (Dump::format_struct_field): New.
1734         * ast/rust-ast-dump.h (format_tuple_field): New.
1735         (format_struct_field): New.
1737 2023-02-21  David Faust  <david.faust@oracle.com>
1739         * ast/rust-ast-dump.cc (Dump::visit): move generic params dump ...
1740         (Dump::emit_generic_params): ... here.
1741         * ast/rust-ast-dump.h (emit_generic_params): New.
1743 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1745         * typecheck/rust-hir-trait-ref.h (lookup_trait_item): Add lookup
1746         in super_trait.
1748 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1750         * backend/rust-compile-expr.cc
1751         (CompileExpr::resolve_method_address): Use auto and minor change
1752         in candidate init.
1753         * typecheck/rust-hir-type-check-path.cc
1754         (TypeCheckExpr::resolve_segments): Likewise.
1755         * typecheck/rust-hir-type-check-type.cc: Likewise.
1756         * backend/rust-compile-resolve-path.cc
1757         (HIRCompileBase::query_compile): Likewise. Removecall to
1758         set_ty_ref.
1759         * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): Add
1760         locus initializer in ctor, implement get_defid.
1761         (class PathProbeType::Probe): return a set instead of vector.
1762         Adjust class impl.
1763         (class ReportMultipleCandidateError): Do not inherit from
1764         HIRImplVisitor anymore and remove corresponding impl. Adjust for
1765         change in Probe. Simplify Report handling.
1766         (class PathProbeImplTrait::Probe): Adjust return type.
1768 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1770         * typecheck/rust-hir-type-check-enumitem.cc
1771         (TypeCheckEnumItem::visit): Adjust VariantDef ctor calls with
1772         DefID.
1773         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
1774         Likewise.
1775         * typecheck/rust-tyty.h (VariantDef): Add defid parameter to ctor.
1777 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1779         * Make-lang.in: Add `rust-builtins.o` as target
1780         * backend/rust-builtins.h: Refactor to new file.
1781         * backend/rust-builtins.cc: New file.
1783 2023-02-21  David Faust  <david.faust@oracle.com>
1785         * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for If
1786         expressions.
1788 2023-02-21  David Faust  <david.faust@oracle.com>
1790         * ast/rust-ast-dump.cc (Dump::visit): Dump assignment and compound
1791         assignment expressions.
1793 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1795         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type):
1796         Check for recursive queries.
1797         * typecheck/rust-hir-type-check.h: New functions: `query_completed`,
1798         `query_in_progress`, `insert_query`.
1799         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Use `query_type` API.
1801 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1803         * ast/rust-ast-dump.cc (Dump::emit_visibility): New function.
1804         (Dump::visit): Call into `emit_visibility`.
1805         (Dump::format_function_common): Likewise.
1806         * ast/rust-ast-dump.h: Declare `emit_visibility`.
1808 2023-02-21  Arthur Cohen  <arthur.cohen@embecosm.com>
1810         * ast/rust-item.h: Rename get_public_vis_type.
1811         * hir/rust-ast-lower.cc (translate_visibility): Use new name.
1813 2023-02-21  Philip Herron  <philip.herron@embecosm.com>
1815         * resolve/rust-name-resolver.h: Add miscellenaous item mappings.
1816         * resolve/rust-name-resolver.cc (Resolver::insert_resolved_misc): Use
1817         new mappings.
1818         (Resolver::lookup_resolved_misc): Likewise.
1819         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
1820         Adapt function to insert into miscelleanous mappings.
1821         * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
1822         Allow lookup in miscelleanous mappings in mark-live phase.
1824 2023-02-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1826         * backend/rust-tree.cc: Include memmodel.h.
1828 2023-02-17  Thomas Schwinge  <thomas@codesourcery.com>
1830         * backend/rust-tree.cc: '#include "tm_p.h"'.
1832 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1834         * Make-lang.in: Remove `rust-hir-typecheck-toplevel` object and add
1835         `rust-hir-path-probe` one.
1836         * typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver):
1837         Remove no longer used `context` and `mapping` fields, and use new
1838         `query_type` API.
1839         (MethodResolver::MethodResolver): Likewise.
1840         (MethodResolver::select): Use new `query_type` API.
1841         * typecheck/rust-hir-path-probe.h: New header.
1842         * typecheck/rust-hir-path-probe.cc: New file.
1843         * typecheck/rust-hir-dot-operator.h (class MethodResolver): Remove no
1844         longer used `context` and `mapping` fields, and use new `query_type` API.
1845         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): New function.
1846         * typecheck/rust-hir-type-check-base.h: Declare `query_type` function.
1847         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add debug print.
1848         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::Resolve):
1849         Refactor and make use of new query system.
1850         (TypeCheckTopLevelExternItem::Resolve): Likewise.
1851         (TypeCheckTopLevelExternItem::visit): Likewise.
1852         (TypeCheckTopLevelImplItem::visit): Likewise.
1853         (TypeCheckImplItem::visit): Likewise.
1854         (TypeCheckImplItem::TypeCheckImplItem): Likewise.
1855         (TypeCheckImplItem::Resolve): Likewise.
1856         (TypeCheckImplItemWithTrait::visit): Likewise.
1857         * typecheck/rust-hir-type-check-implitem.h (class TypeCheckTopLevelImplItem): Likewise.
1858         (class TypeCheckImplItemWithTrait): Likewise.
1859         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::TypeCheckItem): Likewise.
1860         (TypeCheckItem::Resolve): Likewise.
1861         (TypeCheckItem::ResolveImplItem): Likewise.
1862         (TypeCheckItem::ResolveImplBlockSelf): Likewise.
1863         (TypeCheckItem::visit): Likewise.
1864         (TypeCheckItem::resolve_impl_item): Likewise.
1865         (TypeCheckItem::resolve_impl_block_substitutions): Likewise.
1866         (TypeCheckItem::resolve_impl_block_self): Likewise.
1867         * typecheck/rust-hir-type-check-item.h: Likewise.
1868         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise.
1869         (TypeCheckExpr::resolve_segments): Likewise.
1870         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
1871         * typecheck/rust-hir-type-check-stmt.h: Likewise.
1872         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::Resolve): Likewise.
1873         (TypeCheckType::visit): Likewise.
1874         (TypeCheckType::resolve_root_path): Likewise.
1875         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
1876         * typecheck/rust-hir-type-check.h: Likewise.
1877         * typecheck/rust-substitution-mapper.h: Likewise.
1878         * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
1879         (TypeCheckBase::get_predicate_from_bound): Likewise.
1880         (TypeBoundsMappings::add_bound): Likewise.
1881         * typecheck/rust-tyty-cmp.h: Likewise.
1882         * typecheck/rust-tyty.h: Likewise.
1883         * typecheck/rust-tyty.cc (SubstitutionRef::infer_substitions): Likewise.
1884         (ParamType::resolve): Do not infinite loop anymore.
1885         * util/rust-hir-map.h: Add new `hirImplBlockTypeMappings` and
1886         declare `lookup_impl_block_type`.
1887         * util/rust-hir-map.cc (Mappings::insert_hir_impl_block): Use new
1888         `hirImplBlockTypeMappings`
1889         (Mappings::lookup_impl_block_type): New function.
1891 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1893         * backend/rust-compile-context.h: Add new optional `asm_name` string
1894         argument to `lookup_function_decl`.
1895         * backend/rust-compile-item.cc (CompileItem::visit): Compute assembly
1896         name and pass it to `lookup_function_decl` when calling it.
1898 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1900         * backend/rust-constexpr.cc (eval_store_expression): Remove invalid
1901         assertion on constexpr constructors.
1903 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1905         * backend/rust-compile-expr.h: Formatting.
1907 2023-01-31  liushuyu  <liushuyu011@gmail.com>
1909         * ast/rust-ast.h (class MacroInvocData): Store expander as
1910         member of the class.
1911         (class Expr): Add `is_literal` virtual method
1912         * ast/rust-expr.h: Override `is_literal` for `LiteralExpr`s.
1913         * expand/rust-macro-builtins.cc (try_expand_macro_expression): New function.
1914         (try_extract_string_literal_from_fragment): Likewise.
1915         (try_expand_single_string_literal): Likewise.
1916         (try_expand_many_expr): Likewise.
1917         (parse_single_string_literal): Add macro expander as argument.
1918         (MacroBuiltin::include_bytes): Pass expander as argument to
1919         `parse_single_string_literal`.
1920         (MacroBuiltin::include_str): Likewise.
1921         (MacroBuiltin::compile_error): Likewise.
1922         (MacroBuiltin::include): Likewise.
1923         (MacroBuiltin::concat): Likewise and add better error handling.
1924         (MacroBuiltin::env): Likewise.
1925         * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Expand
1926         invocations recursively.
1928 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
1930         * lang.opt: Add new ``-frust-compile-until` option.
1931         * rust-session-manager.cc (Session::compile_crate): Add stops around
1932         various compilation steps in the pipeline.
1933         * rust-session-manager.h (struct CompileOptions): Add `CompileStep` enum
1934         and field.
1936 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1938         * backend/rust-tree.cc (rs_type_quals): Comment out bad assertion
1940 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1942         * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit):
1943         Make static items behave more similarly to const items.
1945 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1947         * backend/rust-compile-item.cc (CompileItem::visit): Const evaluate
1948         static item expressions.
1950 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
1952         * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Do not lower
1953         null items within modules.
1955 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
1957         * util/rust-attributes.cc: Add `macro_use` to list of builtin
1958         attributes.
1960 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
1962         * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Allow
1963         getting an error string from a specific constant context.
1964         (ConstChecker::ctx_allows_default): New function, check if a context
1965         allows default values for Const generics.
1966         (ConstChecker::visit): Call into `ctx_allows_default`.
1967         * checks/errors/rust-const-checker.h: Declare `ctx_allows_default`.
1969 2023-01-31  liushuyu  <liushuyu011@gmail.com>
1971         * backend/rust-compile-expr.cc (CompileExpr::visit): Properly formulate
1972         exit condition when compiling while loops.
1974 2023-01-31  Faisal Abbas  <90.abbasfaisal@gmail.com>
1976         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Turn
1977         constant item typechecking into a coercion site instead of a unify
1978         site.
1980 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1982         * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with
1983         substitutions.
1985 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1987         * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::contains_associated_types):
1988         Check if a type bound predicate contains assocated types.
1989         * typecheck/rust-tyty.h: Declare the above mentioned function.
1990         * typecheck/rust-hir-trait-resolve.cc: Use `contains_associated_types`
1991         function.
1993 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
1995         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add
1996         more calls to `rust_debug` for development.
1998 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
2000         * backend/rust-compile-base.cc: Improve compilation pipeline and simplify
2001         function.
2003 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
2005         * backend/rust-tree.cc (comptypes): Remove some C++ specific checks in
2006         Rust const folder for now.
2008 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
2010         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): Add
2011         better unification function with debug calls.
2012         * typecheck/rust-autoderef.cc (AutoderefCycle::cycle): Add more debug
2013         calls and use new unify API.
2014         * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion): Likewise.
2015         (TypeCoercionRules::coerce_borrowed_pointer): Likewise.
2016         (TypeCoercionRules::select): Likewise.
2017         * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Likewise.
2018         * typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item): Likewise.
2019         (TypeCheckBase::coercion_site): Likewise.
2020         (TypeCheckBase::cast_site): Likewise.
2021         * typecheck/rust-hir-type-check-base.h: Likewise.
2022         * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
2023         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
2024         * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelImplItem::visit): Likewise.
2025         (TypeCheckImplItem::visit): Likewise.
2026         * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
2027         * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): Likewise.
2028         * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
2029         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
2030         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): Likewise.
2031         * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
2032         * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
2033         * typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
2034         * typecheck/rust-tyctx.cc (TypeCheckContext::peek_return_type): Likewise.
2035         * typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
2036         * typecheck/rust-tyty-cmp.h: Likewise.
2037         * typecheck/rust-tyty-rules.h: Likewise.
2038         * typecheck/rust-tyty.cc (BaseType::mappings_str): Likewise.
2039         (BaseType::debug): Print type name more clearly.
2040         (BaseType::debug_str): Add new function to print type pointer and name.
2041         (TupleType::get_name): Improve type name fetching function.
2042         (ReferenceType::get_name): Likewise.
2043         (PointerType::get_name): Likewise.
2044         * typecheck/rust-tyty.h: Refactor definitions outside of the header.
2046 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
2048         * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase):
2049         Remove constructor.
2050         (TypeCheckBase::coercion_site): Add `Location` argument to function.
2051         * typecheck/rust-hir-type-check-base.h: Use `TypeCheckBase::coercion_site`
2052         function with location argument.
2053         * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
2054         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
2055         * typecheck/rust-hir-type-check-expr.h (class TypeCheckExpr): Likewise.
2056         * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
2057         * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
2058         * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
2059         * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
2060         (TypeCheckMethodCallExpr::visit): Likewise.
2061         * typecheck/rust-tyty.h: Add missing locus field.
2062         * typecheck/rust-tyty.cc (StructFieldType::clone): Use locus field.
2063         (StructFieldType::monomorphized_clone): Likewise.
2065 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
2067         * typecheck/rust-tyctx.cc (TypeCheckContext::pop_return_type): Add
2068         guards around `std::vector<T>.pop_back()`.
2069         (TypeCheckContext::peek_context): Likewise for `std::vector<T>.back()`.
2071 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2072             philberty  <philip.herron@embecosm.com>
2074         * ast/rust-ast.h: Improve assertions within ASTFragment API.
2076 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2078         * ast/rust-ast.h: Add assertions and accessors for fragment nodes.
2079         * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion
2080         context typo when visiting `InherentImpl` items.
2081         (AttrVisitor::maybe_expand_expr): Use new Fragment accessor to fetch
2082         properly typed node.
2083         (AttrVisitor::maybe_expand_type): Likewise.
2084         * expand/rust-macro-expand.cc (transcribe_type): Emit parse errors
2085         when trying to parse a type.
2087 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2089         * ast/rust-ast-dump.h: Add shorthand `AST::Dump::debug` function to
2090         dump an AST node on `stderr`.
2092 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2093             philberty  <philip.herron@embecosm.com>
2095         * expand/rust-macro-expand.cc (parse_many): Return early from parsing
2096         loop if we encounter an error, and emit that error in the meantime.
2098 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2100         * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle
2101         fragments differently based on whether or not we are currently trying
2102         to match a matcher in a repetition context.
2103         (MacroExpander::match_n_matches): Use new `in_repetition` argument
2104         properly when calling `match_matcher`.
2105         * expand/rust-macro-expand.h (MacroExpander::match_matcher): Allow
2106         passing extra `in_repetition` bool argument
2108 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2110         * parse/rust-parse-impl.h: Allow parsing full range expressions without
2111         erroring out.
2113 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2115         * checks/lints/rust-lint-scan-deadcode.h: Do not report public items
2116         as dead code.
2118 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2120         * util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list
2121         of builtin attributes.
2123 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2125         * backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow
2126         checks logic.
2127         (CompileExpr::array_copied_expr): Insert overflow checks logic.
2128         * backend/rust-compile-item.cc (CompileItem::visit): Insert overflow
2129         checks logic.
2130         * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Insert
2131         overflow checks logic.
2132         * rust-gcc.cc (Gcc_backend::arithmetic_or_logical_expression): Differentiate
2133         existing function from `arithmetic_or_logical_expression_checked`.
2134         This function does insert perform overflow checks.
2135         (Gcc_backend::arithmetic_or_logical_expression_checked): New
2136         function.
2137         (is_overflowing_expr): New function. Check if an expression is an
2138         overflowing one (ADD, SUB, MUL).
2139         (fetch_overflow_builtins): New function.
2140         * rust-backend.h: Declare `arithmetic_or_logical_expression_checked` in
2141         abstract `Backend` class.
2143 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2145         * backend/rust-builtins.h: Refactor builtin context class and add
2146         overflow builtins.
2148 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2150         * rust-gcc.cc (class Bvariable): Move class to `rust-gcc.h` header.
2151         * rust-gcc.h: New file.
2153 2023-01-31  Philip Herron  <philip.herron@embecosm.com>
2155         * hir/rust-ast-lower-expr.h: Lower double borrow expressions to two
2156         `HIR::BorrowExpr`s.
2157         * hir/tree/rust-hir-expr.h: Remove `is_double_borrow` field from
2158         `HIR::BorrowExpr`.
2159         * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Remove
2160         call to `gcc_unreachable` on double borrow expressions.
2162 2023-01-31  Faisal Abbas  <90.abbasfaisal@gmail.com>
2164         * backend/rust-tree.cc : Add new includes.
2165         (scope_chain): New.
2166         (maybe_add_global): New.
2167         (init_modules): New (copied from cp)
2168         (var_in_constexpr_fn): Likewise.
2169         (member_vec_linear_search): Likewise.
2170         (member_vec_binary_search): Likewise.
2171         (is_overloaded_fn): Likewise.
2172         (ovl_make): Likewise.
2173         (lookup_add): Likewise.
2174         (type_memfn_quals): Likewise.
2175         (struct find_parameter_pack_data): Likewise.
2176         (struct conv_type_hasher): Likewise.
2177         (make_conv_op_name): Likewise.
2178         (builtin_pack_fn_p): Likewise.
2179         (builtin_pack_call_p): Likewise.
2180         (has_extra_args_mechanism_p): Likewise.
2181         (find_parameter_packs_r): Likewise.
2182         (WALK_SUBTREE): Likewise.
2183         (type_memfn_rqual): Likewise.
2184         (maybe_add_lang_type_raw): Likewise.
2185         (struct c_fileinfo): Likewise.
2186         (get_fileinfo): Likewise.
2187         (cxx_make_type): Likewise.
2188         (build_min_array_type): Likewise.
2189         (fields_linear_search): Likewise.
2190         (nothrow_spec_p): Likewise.
2191         (maybe_get_fns): Likewise.
2192         (get_fns): Likewise.
2193         (get_first_fn): Likewise.
2194         (dependent_name): Likewise.
2195         (called_fns_equal): Likewise.
2196         (canonical_eh_spec): Likewise.
2197         (rs_tree_code_length): Likewise.
2198         (rs_tree_operand_length): Likewise.
2199         (rs_tree_equal): Likewise.
2200         (publicly_uniquely_derived_p): Likewise.
2201         (comp_except_types): Likewise.
2202         (comp_except_specs): Likewise.
2203         (compparms): Likewise.
2204         (set_array_type_canon): Likewise.
2205         (struct cplus_array_info): Likewise.
2206         (struct cplus_array_hasher): Likewise.
2207         (cplus_array_hasher::hash): Likewise.
2208         (cplus_array_hasher::equal): Likewise.
2209         (is_byte_access_type): Likewise.
2210         (build_cplus_array_type): Likewise.
2211         (rs_build_qualified_type_real): Likewise.
2212         (vector_targets_convertible_p): Likewise.
2213         (comp_array_types): Likewise.
2214         (same_type_ignoring_top_level_qualifiers_p): Likewise.
2215         (comp_ptr_ttypes_const): Likewise.
2216         (similar_type_p): Likewise.
2217         (structural_comptypes): Likewise.
2218         (comptypes): Likewise.
2219         (next_initializable_field): Likewise.
2220         (sufficient_parms_p): Likewise.
2221         (default_ctor_p): Likewise.
2222         (user_provided_p): Likewise.
2223         (type_has_non_user_provided_default_constructor): Likewise.
2224         (default_init_uninitialized_part): Likewise.
2225         (extract_conversion_operator): Likewise.
2226         (get_class_binding_direct): Likewise.
2227         (lang_check_failed): Likewise.
2228         (skip_artificial_parms_for): Likewise.
2229         (in_class_defaulted_default_constructor): Likewise.
2230         (is_instantiation_of_constexpr): Likewise.
2231         (check_for_uninitialized_const_var): Likewise.
2232         (cv_unqualified): Likewise.
2233         (make_tree_vector): Likewise.
2234         (release_tree_vector): Likewise.
2235         (instantiation_dependent_expression_p): Likewise.
2236         (cp_get_callee): Likewise.
2237         (build_nop): Likewise.
2238         (scalarish_type_p): Likewise.
2239         (type_has_nontrivial_copy_init): Likewise.
2240         (build_local_temp): Likewise.
2241         (is_normal_capture_proxy): Likewise.
2242         (reject_gcc_builtin): Likewise.
2243         (is_bitfield_expr_with_lowered_type): Likewise.
2244         (maybe_undo_parenthesized_ref): Likewise.
2245         (fold_offsetof): Likewise.
2246         (char_type_p): Likewise.
2247         (resolve_nondeduced_context): Likewise.
2248         (instantiate_non_dependent_or_null): Likewise.
2249         (resolve_nondeduced_context_or_error): Likewise.
2250         (really_overloaded_fn): Likewise.
2251         (invalid_nonstatic_memfn_p): Likewise.
2252         (strip_top_quals): Likewise.
2253         (cxx_incomplete_type_inform): Likewise.
2254         (cxx_incomplete_type_diagnostic): Likewise.
2255         (decl_constant_var_p): Likewise.
2256         (undeduced_auto_decl): Likewise.
2257         (require_deduced_type): Likewise.
2258         * backend/rust-tree.h (enum c_tree_index): Likewise.
2259         (GTY): Likewise.
2260         (enum cp_tree_index): Likewise.
2261         (wchar_decl_node): Likewise.
2262         (vtable_entry_type): Likewise.
2263         (delta_type_node): Likewise.
2264         (vtable_index_type): Likewise.
2265         (class_type_node): Likewise.
2266         (unknown_type_node): Likewise.
2267         (init_list_type_node): Likewise.
2268         (explicit_void_list_node): Likewise.
2269         (vtbl_type_node): Likewise.
2270         (vtbl_ptr_type_node): Likewise.
2271         (std_node): Likewise.
2272         (abi_node): Likewise.
2273         (global_namespace): Likewise.
2274         (const_type_info_type_node): Likewise.
2275         (conv_op_marker): Likewise.
2276         (abort_fndecl): Likewise.
2277         (current_aggr): Likewise.
2278         (nullptr_node): Likewise.
2279         (nullptr_type_node): Likewise.
2280         (align_type_node): Likewise.
2281         (char8_type_node): Likewise.
2282         (char16_type_node): Likewise.
2283         (char32_type_node): Likewise.
2284         (wchar_type_node): Likewise.
2285         (underlying_wchar_type_node): Likewise.
2286         (wint_type_node): Likewise.
2287         (signed_size_type_node): Likewise.
2288         (unsigned_ptrdiff_type_node): Likewise.
2289         (intmax_type_node): Likewise.
2290         (uintmax_type_node): Likewise.
2291         (widest_integer_literal_type_node): Likewise.
2292         (widest_unsigned_literal_type_node): Likewise.
2293         (sig_atomic_type_node): Likewise.
2294         (int8_type_node): Likewise.
2295         (int16_type_node): Likewise.
2296         (int32_type_node): Likewise.
2297         (int64_type_node): Likewise.
2298         (uint8_type_node): Likewise.
2299         (c_uint16_type_node): Likewise.
2300         (c_uint32_type_node): Likewise.
2301         (c_uint64_type_node): Likewise.
2302         (int_least8_type_node): Likewise.
2303         (int_least16_type_node): Likewise.
2304         (int_least32_type_node): Likewise.
2305         (int_least64_type_node): Likewise.
2306         (uint_least8_type_node): Likewise.
2307         (uint_least16_type_node): Likewise.
2308         (uint_least32_type_node): Likewise.
2309         (uint_least64_type_node): Likewise.
2310         (int_fast8_type_node): Likewise.
2311         (int_fast16_type_node): Likewise.
2312         (int_fast32_type_node): Likewise.
2313         (int_fast64_type_node): Likewise.
2314         (uint_fast8_type_node): Likewise.
2315         (uint_fast16_type_node): Likewise.
2316         (uint_fast32_type_node): Likewise.
2317         (uint_fast64_type_node): Likewise.
2318         (intptr_type_node): Likewise.
2319         (uintptr_type_node): Likewise.
2320         (truthvalue_type_node): Likewise.
2321         (truthvalue_true_node): Likewise.
2322         (truthvalue_false_node): Likewise.
2323         (char_array_type_node): Likewise.
2324         (char8_array_type_node): Likewise.
2325         (char16_array_type_node): Likewise.
2326         (char32_array_type_node): Likewise.
2327         (wchar_array_type_node): Likewise.
2328         (string_type_node): Likewise.
2329         (const_string_type_node): Likewise.
2330         (default_function_type): Likewise.
2331         (function_name_decl_node): Likewise.
2332         (pretty_function_name_decl_node): Likewise.
2333         (c99_function_name_decl_node): Likewise.
2334         (saved_function_name_decls): Likewise.
2335         (null_node): Likewise.
2336         (ctor_identifier): Likewise.
2337         (complete_ctor_identifier): Likewise.
2338         (base_ctor_identifier): Likewise.
2339         (dtor_identifier): Likewise.
2340         (complete_dtor_identifier): Likewise.
2341         (base_dtor_identifier): Likewise.
2342         (deleting_dtor_identifier): Likewise.
2343         (conv_op_identifier): Likewise.
2344         (delta_identifier): Likewise.
2345         (in_charge_identifier): Likewise.
2346         (vtt_parm_identifier): Likewise.
2347         (as_base_identifier): Likewise.
2348         (this_identifier): Likewise.
2349         (pfn_identifier): Likewise.
2350         (vptr_identifier): Likewise.
2351         (global_identifier): Likewise.
2352         (anon_identifier): Likewise.
2353         (auto_identifier): Likewise.
2354         (decltype_auto_identifier): Likewise.
2355         (init_list_identifier): Likewise.
2356         (for_range__identifier): Likewise.
2357         (for_begin__identifier): Likewise.
2358         (for_end__identifier): Likewise.
2359         (for_range_identifier): Likewise.
2360         (for_begin_identifier): Likewise.
2361         (for_end_identifier): Likewise.
2362         (abi_tag_identifier): Likewise.
2363         (aligned_identifier): Likewise.
2364         (begin_identifier): Likewise.
2365         (end_identifier): Likewise.
2366         (get__identifier): Likewise.
2367         (gnu_identifier): Likewise.
2368         (tuple_element_identifier): Likewise.
2369         (tuple_size_identifier): Likewise.
2370         (type_identifier): Likewise.
2371         (value_identifier): Likewise.
2372         (fun_identifier): Likewise.
2373         (closure_identifier): Likewise.
2374         (heap_uninit_identifier): Likewise.
2375         (heap_identifier): Likewise.
2376         (heap_deleted_identifier): Likewise.
2377         (heap_vec_uninit_identifier): Likewise.
2378         (heap_vec_identifier): Likewise.
2379         (omp_identifier): Likewise.
2380         (lang_name_c): Likewise.
2381         (lang_name_cplusplus): Likewise.
2382         (empty_except_spec): Likewise.
2383         (noexcept_true_spec): Likewise.
2384         (noexcept_false_spec): Likewise.
2385         (noexcept_deferred_spec): Likewise.
2386         (terminate_fn): Likewise.
2387         (call_unexpected_fn): Likewise.
2388         (get_exception_ptr_fn): Likewise.
2389         (begin_catch_fn): Likewise.
2390         (end_catch_fn): Likewise.
2391         (allocate_exception_fn): Likewise.
2392         (free_exception_fn): Likewise.
2393         (throw_fn): Likewise.
2394         (rethrow_fn): Likewise.
2395         (atexit_fn_ptr_type_node): Likewise.
2396         (atexit_node): Likewise.
2397         (dso_handle_node): Likewise.
2398         (dynamic_cast_node): Likewise.
2399         (cleanup_type): Likewise.
2400         (vtt_parm_type): Likewise.
2401         (any_targ_node): Likewise.
2402         (source_location_impl): Likewise.
2403         (OVL_FUNCTION): Likewise.
2404         (OVL_CHAIN): Likewise.
2405         (OVL_DEDUP_P): Likewise.
2406         (OVL_USING_P): Likewise.
2407         (OVL_HIDDEN_P): Likewise.
2408         (OVL_NESTED_P): Likewise.
2409         (OVL_LOOKUP_P): Likewise.
2410         (OVL_EXPORT_P): Likewise.
2411         (OVL_FIRST): Likewise.
2412         (OVL_NAME): Likewise.
2413         (OVL_P): Likewise.
2414         (OVL_SINGLE_P): Likewise.
2415         (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise.
2416         (CLASSTYPE_LAZY_DEFAULT_CTOR): Likewise.
2417         (CLASSTYPE_CONSTRUCTORS): Likewise.
2418         (ATTR_IS_DEPENDENT): Likewise.
2419         (ABI_TAG_IMPLICIT): Likewise.
2420         (PARENTHESIZED_LIST_P): Likewise.
2421         (DECL_DEPENDENT_P): Likewise.
2422         (USING_DECL_SCOPE): Likewise.
2423         (USING_DECL_DECLS): Likewise.
2424         (USING_DECL_TYPENAME_P): Likewise.
2425         (USING_DECL_UNRELATED_P): Likewise.
2426         (DECL_DECLARES_FUNCTION_P): Likewise.
2427         (DECL_DECLARES_TYPE_P): Likewise.
2428         (IDENTIFIER_KIND_BIT_0): Likewise.
2429         (IDENTIFIER_KIND_BIT_1): Likewise.
2430         (IDENTIFIER_KIND_BIT_2): Likewise.
2431         (IDENTIFIER_MARKED): Likewise.
2432         (IDENTIFIER_VIRTUAL_P): Likewise.
2433         (IDENTIFIER_KEYWORD_P): Likewise.
2434         (IDENTIFIER_CDTOR_P): Likewise.
2435         (IDENTIFIER_CTOR_P): Likewise.
2436         (IDENTIFIER_DTOR_P): Likewise.
2437         (IDENTIFIER_ANY_OP_P): Likewise.
2438         (IDENTIFIER_OVL_OP_P): Likewise.
2439         (IDENTIFIER_ASSIGN_OP_P): Likewise.
2440         (IDENTIFIER_CONV_OP_P): Likewise.
2441         (IDENTIFIER_NEWDEL_OP_P): Likewise.
2442         (IDENTIFIER_NEW_OP_P): Likewise.
2443         (CLASSTYPE_DIAMOND_SHAPED_P): Likewise.
2444         (CLASSTYPE_REPEATED_BASE_P): Likewise.
2445         (CLASSTYPE_KEY_METHOD): Likewise.
2446         (CLASSTYPE_MEMBER_VEC): Likewise.
2447         (CLASSTYPE_DECL_LIST): Likewise.
2448         (CLASSTYPE_DESTRUCTOR): Likewise.
2449         (CLASSTYPE_HAS_PRIMARY_BASE_P): Likewise.
2450         (CLASSTYPE_PRIMARY_BINFO): Likewise.
2451         (CLASSTYPE_VBASECLASSES): Likewise.
2452         (CLASSTYPE_AS_BASE): Likewise.
2453         (DECL_CONV_FN_P): Likewise.
2454         (DECL_CONV_FN_TYPE): Likewise.
2455         (same_type_p): Likewise.
2456         (WILDCARD_TYPE_P): Likewise.
2457         (MAYBE_CLASS_TYPE_P): Likewise.
2458         (FUNCTION_REF_QUALIFIED): Likewise.
2459         (FUNCTION_RVALUE_QUALIFIED): Likewise.
2460         (TYPE_PTRMEMFUNC_FN_TYPE): Likewise.
2461         (TYPE_PTRMEMFUNC_FN_TYPE_RAW): Likewise.
2462         (TYPE_DEPENDENT_P): Likewise.
2463         (TYPE_DEPENDENT_P_VALID): Likewise.
2464         (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise.
2465         (TYPE_RAISES_EXCEPTIONS): Likewise.
2466         (IDENTIFIER_BINDING): Likewise.
2467         (LANG_IDENTIFIER_CAST): Likewise.
2468         (IF_COND): Likewise.
2469         (THEN_CLAUSE): Likewise.
2470         (ELSE_CLAUSE): Likewise.
2471         (IF_SCOPE): Likewise.
2472         (IF_STMT_CONSTEXPR_P): Likewise.
2473         (IF_STMT_CONSTEVAL_P): Likewise.
2474         (DECLTYPE_TYPE_EXPR): Likewise.
2475         (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise.
2476         (CLASSTYPE_INTERFACE_ONLY): Likewise.
2477         (TYPE_NAME_STRING): Likewise.
2478         (TYPE_NAME_LENGTH): Likewise.
2479         (CONSTRAINT_VAR_P): Likewise.
2480         (KOENIG_LOOKUP_P): Likewise.
2481         (DECL_PARM_INDEX): Likewise.
2482         (DECL_PARM_LEVEL): Likewise.
2483         (CONV_IMPLICIT): Likewise.
2484         (CONV_STATIC): Likewise.
2485         (CONV_CONST): Likewise.
2486         (CONV_REINTERPRET): Likewise.
2487         (CONV_PRIVATE): Likewise.
2488         (CONV_FORCE_TEMP): Likewise.
2489         (CONV_FOLD): Likewise.
2490         (CONV_OLD_CONVERT): Likewise.
2491         (CONV_C_CAST): Likewise.
2492         (CONV_BACKEND_CONVERT): Likewise.
2493         (WANT_INT): Likewise.
2494         (WANT_FLOAT): Likewise.
2495         (WANT_ENUM): Likewise.
2496         (WANT_POINTER): Likewise.
2497         (WANT_NULL): Likewise.
2498         (WANT_VECTOR_OR_COMPLEX): Likewise.
2499         (WANT_ARITH): Likewise.
2500         (COMPARE_STRICT): Likewise.
2501         (COMPARE_BASE): Likewise.
2502         (COMPARE_DERIVED): Likewise.
2503         (COMPARE_REDECLARATION): Likewise.
2504         (COMPARE_STRUCTURAL): Likewise.
2505         (SF_DEFAULT): Likewise.
2506         (SF_PRE_PARSED): Likewise.
2507         (SF_INCLASS_INLINE): Likewise.
2508         (SD_UNINITIALIZED): Likewise.
2509         (SD_INITIALIZED): Likewise.
2510         (SD_DECOMPOSITION): Likewise.
2511         (SD_DEFAULTED): Likewise.
2512         (SD_DELETED): Likewise.
2513         (TYPE_PTRDATAMEM_P): Likewise.
2514         (RS_TYPE_CONST_P): Likewise.
2515         (TYPE_MAIN_DECL): Likewise.
2516         (DECL_NONTRIVIALLY_INITIALIZED_P): Likewise.
2517         (DECL_DEFAULTED_FN): Likewise.
2518         (TYPE_HAS_USER_CONSTRUCTOR): Likewise.
2519         (DECL_INITIALIZED_IN_CLASS_P): Likewise.
2520         (DECL_DEFAULTED_IN_CLASS_P): Likewise.
2521         (DECL_NONSTATIC_MEMBER_FUNCTION_P): Likewise.
2522         (DECL_HAS_IN_CHARGE_PARM_P): Likewise.
2523         (DECL_HAS_VTT_PARM_P): Likewise.
2524         (FUNCTION_FIRST_USER_PARMTYPE): Likewise.
2525         (FUNCTION_FIRST_USER_PARM): Likewise.
2526         (DECL_CONSTRUCTOR_P): Likewise.
2527         (DECL_DELETED_FN): Likewise.
2528         (BRACE_ENCLOSED_INITIALIZER_P): Likewise.
2529         (DECL_IMMEDIATE_FUNCTION_P): Likewise.
2530         (SET_DECL_IMMEDIATE_FUNCTION_P): Likewise.
2531         (CONSTRUCTOR_MUTABLE_POISON): Likewise.
2532         (PTRMEM_CST_MEMBER): Likewise.
2533         (REF_PARENTHESIZED_P): Likewise.
2534         (TYPE_PTRMEM_P): Likewise.
2535         (TYPE_PTR_OR_PTRMEM_P): Likewise.
2536         (DECL_DECOMPOSITION_P): Likewise.
2537         (DECL_DECOMP_BASE): Likewise.
2538         (DECL_MAYBE_IN_CHARGE_CDTOR_P): Likewise.
2539         (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
2540         (DECL_CLONED_FUNCTION_P): Likewise.
2541         (DECL_CLONED_FUNCTION): Likewise.
2542         (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
2543         (cp_function_chain): Likewise.
2544         (cdtor_label): Likewise.
2545         (current_class_ptr): Likewise.
2546         (current_class_ref): Likewise.
2547         (current_eh_spec_block): Likewise.
2548         (current_in_charge_parm): Likewise.
2549         (current_vtt_parm): Likewise.
2550         (current_retval_sentinel): Likewise.
2551         (current_function_returns_value): Likewise.
2552         (current_function_returns_null): Likewise.
2553         (current_function_returns_abnormally): Likewise.
2554         (current_function_infinite_loop): Likewise.
2555         (in_base_initializer): Likewise.
2556         (in_function_try_handler): Likewise.
2557         (current_function_return_value): Likewise.
2558         (current_class_type): Likewise.
2559         (TYPE_BEING_DEFINED): Likewise.
2560         (DECL_STATIC_FUNCTION_P): Likewise.
2561         (DECL_FUNCTION_MEMBER_P): Likewise.
2562         (LANG_DECL_MIN_CHECK): Likewise.
2563         (LANG_DECL_FN_CHECK): Likewise.
2564         (LANG_DECL_NS_CHECK): Likewise.
2565         (LANG_DECL_PARM_CHECK): Likewise.
2566         (LANG_DECL_DECOMP_CHECK): Likewise.
2567         (RS_INTEGRAL_TYPE_P): Likewise.
2568         (STAT_HACK_P): Likewise.
2569         (STAT_TYPE_VISIBLE_P): Likewise.
2570         (STAT_TYPE): Likewise.
2571         (STAT_DECL): Likewise.
2572         (STAT_VISIBLE): Likewise.
2573         (MAYBE_STAT_DECL): Likewise.
2574         (MAYBE_STAT_TYPE): Likewise.
2575         (STAT_TYPE_HIDDEN_P): Likewise.
2576         (STAT_DECL_HIDDEN_P): Likewise.
2577         (class warning_sentinel): Likewise.
2578         (struct uid_sensitive_constexpr_evaluation_checker): Likewise.
2579         (class iloc_sentinel): Likewise.
2580         (struct GTY): Likewise.
2581         (struct named_decl_hash): Likewise.
2582         (enum lang_decl_selector): Likewise.
2583         (LANG_DECL_HAS_MIN): Likewise.
2584         (struct named_label_entry): Likewise.
2585         (struct named_label_hash): Likewise.
2586         (enum ref_operator): Likewise.
2587         (struct c_fileinfo): Likewise.
2588         (class ovl_iterator): Likewise.
2589         (class lkp_iterator): Likewise.
2590         (enum rs_ref_qualifier): Likewise.
2591         (enum tsubst_flags): Likewise.
2592         (enum cp_identifier_kind): Likewise.
2593         (enum tag_types): Likewise.
2594         (enum compare_bounds_t): Likewise.
2595         (mark_rvalue_use): Likewise.
2596         (type_unknown_p): Likewise.
2597         (init_modules): Likewise.
2598         (var_in_constexpr_fn): Likewise.
2599         (ovl_first): Likewise.
2600         (lookup_add): Likewise.
2601         (ovl_make): Likewise.
2602         (is_overloaded_fn): Likewise.
2603         (maybe_add_lang_type_raw): Likewise.
2604         (type_memfn_rqual): Likewise.
2605         (builtin_pack_fn_p): Likewise.
2606         (make_conv_op_name): Likewise.
2607         (type_memfn_quals): Likewise.
2608         (get_fileinfo): Likewise.
2609         (cxx_make_type): Likewise.
2610         (build_cplus_array_type): Likewise.
2611         (is_byte_access_type): Likewise.
2612         (comptypes): Likewise.
2613         (canonical_eh_spec): Likewise.
2614         (cp_tree_operand_length): Likewise.
2615         (rs_tree_equal): Likewise.
2616         (compparms): Likewise.
2617         (rs_build_qualified_type_real): Likewise.
2618         (rs_build_qualified_type): Likewise.
2619         (cv_qualified_p): Likewise.
2620         (similar_type_p): Likewise.
2621         (vector_targets_convertible_p): Likewise.
2622         (same_type_ignoring_top_level_qualifiers_p): Likewise.
2623         (comp_ptr_ttypes_const): Likewise.
2624         (get_class_binding_direct): Likewise.
2625         (skip_artificial_parms_for): Likewise.
2626         (lang_check_failed): Likewise.
2627         (default_init_uninitialized_part): Likewise.
2628         (type_has_non_user_provided_default_constructor): Likewise.
2629         (default_ctor_p): Likewise.
2630         (user_provided_p): Likewise.
2631         (sufficient_parms_p): Likewise.
2632         (next_initializable_field): Likewise.
2633         (in_class_defaulted_default_constructor): Likewise.
2634         (is_instantiation_of_constexpr): Likewise.
2635         (check_for_uninitialized_const_var): Likewise.
2636         (reduced_constant_expression_p): Likewise.
2637         (cv_unqualified): Likewise.
2638         (cp_get_callee): Likewise.
2639         (cp_get_callee_fndecl_nofold): Likewise.
2640         (is_nondependent_static_init_expression): Likewise.
2641         (maybe_constant_init): Likewise.
2642         (build_nop): Likewise.
2643         (scalarish_type_p): Likewise.
2644         (is_bitfield_expr_with_lowered_type): Likewise.
2645         (convert_bitfield_to_declared_type): Likewise.
2646         (cp_fold_maybe_rvalue): Likewise.
2647         (maybe_undo_parenthesized_ref): Likewise.
2648         (fold_offsetof): Likewise.
2649         (cp_truthvalue_conversion): Likewise.
2650         (fold_non_dependent_expr): Likewise.
2651         (char_type_p): Likewise.
2652         (instantiation_dependent_expression_p): Likewise.
2653         (type_has_nontrivial_copy_init): Likewise.
2654         (build_local_temp): Likewise.
2655         (is_normal_capture_proxy): Likewise.
2656         (reject_gcc_builtin): Likewise.
2657         (resolve_nondeduced_context): Likewise.
2658         (cxx_incomplete_type_diagnostic): Likewise.
2659         (cxx_incomplete_type_error): Likewise.
2660         (invalid_nonstatic_memfn_p): Likewise.
2661         (really_overloaded_fn): Likewise.
2662         (resolve_nondeduced_context_or_error): Likewise.
2663         (instantiate_non_dependent_or_null): Likewise.
2664         (cxx_incomplete_type_inform): Likewise.
2665         (strip_top_quals): Likewise.
2666         (undeduced_auto_decl): Likewise.
2667         (require_deduced_type): Likewise.
2668         (decl_constant_var_p): Likewise.
2669         (type_of_this_parm): Likewise.
2670         (class_of_this_parm): Likewise.
2671         (identifier_p): Likewise.
2672         (gnu_vector_type_p): Likewise.
2673         (make_tree_vector): Likewise.
2674         (release_tree_vector): Likewise.
2675         (class releasing_vec): Likewise.
2676         (vec_safe_push): Likewise.
2677         (null_node_p): Likewise.
2678         * backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Correctly
2679         set fndecl as constexpr from qualifiers.
2680         (HIRCompileBase::compile_function): Test if fndecl is constexpr.
2681         (HIRCompileBase::compile_constant_item): Set fndecl as constexpr.
2682         * backend/rust-compile-intrinsic.cc : Update include.
2683         (finalize_intrinsic_block): Set fndecl as constexpr.
2684         * backend/rust-constexpr.cc : Update include.
2685         (VERIFY_CONSTANT): New.
2686         (is_instantiation_of_constexpr): New.
2687         (literal_type_p): New.
2688         (verify_constant): New.
2689         (find_array_ctor_elt): New.
2690         (array_index_cmp): New.
2691         (potential_constant_expression_1): New.
2692         (get_nth_callarg): New.
2693         (unshare_constructor): New.
2694         (maybe_save_constexpr_fundef): New.
2695         (returns): New.
2696         (breaks): New.
2697         (continues): New.
2698         (switches): New.
2699         (struct constexpr_global_ctx): Add new fields.
2700         (constexpr_fundef): New.
2701         (struct constexpr_call): New.
2702         (constexpr_call_hasher : ggc_ptr_hash<constexpr_call>): New.
2703         (enum constexpr_switch_state): New.
2704         (struct constexpr_ctx): Add new fields.
2705         (struct constexpr_fundef_hasher): New.
2706         (constexpr_fundef_table): New.
2707         (constexpr_fundef_hasher::equal): New.
2708         (constexpr_fundef_hasher::hash): New.
2709         (retrieve_constexpr_fundef): New.
2710         (uid_sensitive_constexpr_evaluation_value): New.
2711         (uid_sensitive_constexpr_evaluation_true_counter): New.
2712         (uid_sensitive_constexpr_evaluation_p): New.
2713         (class temp_override): New.
2714         (struct uid_sensitive_constexpr_evaluation_sentinel): New.
2715         (struct uid_sensitive_constexpr_evaluation_checker): New.
2716         (::uid_sensitive_constexpr_evaluation_sentinel): New.
2717         (::uid_sensitive_constexpr_evaluation_checker): New.
2718         (uid_sensitive_constexpr_evaluation_checker::evaluation_restricted_p): New.
2719         (constexpr_call_table): New.
2720         (constexpr_call_hasher::hash): New.
2721         (constexpr_call_hasher::equal): New.
2722         (maybe_initialize_constexpr_call_table): New.
2723         (fundef_copies_table): New.
2724         (get_fundef_copy): New.
2725         (save_fundef_copy): New.
2726         (constexpr_expression): Refactor in ...
2727         (eval_constant_expression): ...this.
2728         (eval_store_expression): Add 3 bool params.
2729         (eval_call_expression): Likewise.
2730         (eval_binary_expression): Likewise.
2731         (eval_statement_list): New.
2732         (extract_string_elt): New.
2733         (eval_conditional_expression): New.
2734         (eval_bit_field_ref): New.
2735         (eval_loop_expr): New.
2736         (eval_switch_expr): New.
2737         (eval_unary_expression): New.
2738         (call_stack): New.
2739         (call_stack_tick): New.
2740         (last_cx_error_tick): New.
2741         (push_cx_call_context): New.
2742         (pop_cx_call_context): New.
2743         (cx_error_context): New.
2744         (fold_expr): Adjust call to eval_constant_expression.
2745         (same_type_ignoring_tlq_and_bounds_p): New.
2746         (union_active_member): Port more for cxx constexpr.
2747         (fold_indirect_ref_1): New.
2748         (rs_fold_indirect_ref): Likewise.
2749         (rs_eval_indirect_ref): New (from corresponding cxx FE file).
2750         (eval_logical_expression): Adjust parameter list.
2751         (lookup_placeholder): New (from corresponding cxx FE file).
2752         (constant_value_1): Remove.
2753         (inline_asm_in_constexpr_error): New (from corresponding cxx FE file).
2754         (verify_ctor_sanity): New.
2755         (get_callee): Remove.
2756         (initialized_type): New.
2757         (maybe_constexpr_fn): Remove.
2758         (init_subob_ctx): New.
2759         (base_field_constructor_elt): New.
2760         (get_or_insert_ctor_field): New.
2761         (eval_vector_conditional_expression): New (from correponding cxx FE file).
2762         (eval_bare_aggregate): New.
2763         (cxx_eval_trinary_expression): New.
2764         (reduced_constant_expression_p): New.
2765         (adjust_temp_type): New.
2766         (free_constructor): New.
2767         (eval_and_check_array_index): New.
2768         (eval_array_reference): New.
2769         (eval_component_reference): New.
2770         (label_matches): New.
2771         (eval_constant_expression): New.
2772         (modifying_const_object_error): New.
2773         (is_empty_field): New.
2774         (eval_store_expression): New.
2775         (eval_binary_expression): New.
2776         (addr_of_non_const_var): New.
2777         (rs_bind_parameters_in_call): New.
2778         (eval_builtin_function_call): New.
2779         (eval_call_expression): New.
2780         (build_anon_member_initialization): New.
2781         (build_data_member_initialization): New.
2782         (constexpr_fn_retval): New.
2783         (constant_value_1): New.
2784         (decl_constant_value): New.
2785         (non_const_var_error): New.
2786         (get_callee): New.
2787         (get_function_named_in_call): New.
2788         (maybe_constexpr_fn): New.
2789         (get_nth_callarg): New.
2790         (var_in_maybe_constexpr_fn): New.
2791         (instantiate_cx_fn_r): New.
2792         (instantiate_constexpr_fns): New.
2793         (array_index_cmp): New.
2794         (unshare_constructor): New.
2795         (find_array_ctor_elt): New.
2796         (verify_constant): New.
2797         (find_heap_var_refs): New.
2798         (find_immediate_fndecl): New.
2799         (diag_array_subscript): New.
2800         (get_array_or_vector_nelts): New.
2801         (eval_and_check_array_index): New.
2802         (extract_string_elt): New.
2803         (is_valid_constexpr_fn): New.
2804         (explain_invalid_constexpr_fn): New.
2805         (register_constexpr_fundef): New.
2806         (maybe_save_constexpr_fundef): New.
2807         (eval_statement_list): New.
2808         (eval_conditional_expression): New.
2809         (eval_bit_field_ref): New.
2810         (returns): New.
2811         (breaks): New.
2812         (continues): New.
2813         (switches): New.
2814         (eval_loop_expr): New.
2815         (eval_switch_expr): New.
2816         (eval_unary_expression): New.
2817         (cxx_eval_outermost_constant_expr): New.
2818         (is_static_init_expression): New.
2819         (is_constant_expression): New.
2820         (is_nondependent_static_init_expression): New.
2821         (maybe_constant_init_1): New.
2822         (maybe_constant_init): New.
2823         (is_nondependent_constant_expression): New.
2824         (cv_cache): New.
2825         (maybe_constant_value): New.
2826         (potential_constant_expression): New.
2827         (struct check_for_return_continue_data): New.
2828         (check_for_return_continue): New.
2829         (decl_namespace_context): New.
2830         (decl_in_std_namespace_p): New.
2831         (is_std_construct_at): New.
2832         (cxx_dynamic_cast_fn_p): New.
2833         (is_std_allocator_allocate): New.
2834         (is_std_allocator_allocate): New.
2835         (potential_constant_expression_1): New.
2836         (potential_constant_expression_1): New.
2837         (fold_non_dependent_init): New.
2838         * backend/rust-constexpr.h (maybe_save_constexpr_fundef): New.
2840 2023-01-31  Arthur Cohen  <arthur.cohen@embecosm.com>
2842         * rust-session-manager.cc (Session::compile_crate): Allow the dump of prettified AST
2843         (Session::dump_ast_pretty): New
2844         * rust-session-manager.h: Add new output file for pretty AST dump
2846 2023-01-05  David Malcolm  <dmalcolm@redhat.com>
2848         * resolve/rust-ast-resolve-item.cc (selftest::rust_flatten_list):
2849         Remove output to stderr.
2851 2023-01-05  David Malcolm  <dmalcolm@redhat.com>
2853         * Make-lang.in (selftest-rust-gdb): New.
2854         (selftest-rust-valgrind): New.
2856 2022-12-20  Marc Poulhiès  <dkm@kataplop.net>
2858         PR rust/108113
2859         * Make-lang.in (rust.serial): New variable.
2860         (rust1$(exeext)): Depend on $(rust.prev). Call LINK_PROGRESS.
2862 2022-12-14  Jakub Jelinek  <jakub@redhat.com>
2864         PR rust/106072
2865         * parse/rust-parse-impl.h (parse_closure_param): Store
2866         pattern->get_locus () in a temporary before std::move (pattern) is
2867         invoked.
2869 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2871         * CONTRIBUTING.md: New.
2872         * README.md: New.
2873         * logo.png: New.
2875 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2877         * config-lang.in: New.
2879 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
2881         * lang.opt (-frust-incomplete-and-experimental-compiler-do-not-use):
2882         New.
2883         * rust-session-manager.cc (Session::compile_crate): Check it.
2884         * Make-lang.in (RUST_SELFTEST_FLAGS): Add it.
2886 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2888         * Make-lang.in: New.
2890 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2892         * lang.opt: New.
2894 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2896         * lang-specs.h: New.
2898 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2900         * rust-lang.cc: New.
2901         * rust-session-manager.cc: New.
2902         * rust-session-manager.h: New.
2904 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2906         * rustspec.cc: New.
2908 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2910         * rust-diagnostics.cc: New.
2911         * rust-diagnostics.h: New.
2912         * rust-gcc-diagnostics.cc: New.
2913         * rust-linemap.cc: New.
2914         * rust-linemap.h: New.
2915         * rust-location.h: New.
2916         * rust-system.h: New.
2918 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2919             David Faust  <david.faust@oracle.com>
2920             Faisal Abbas  <90.abbasfaisal@gmail.com>
2922         * backend/rust-compile-context.cc: New.
2923         * backend/rust-compile-context.h: New.
2924         * backend/rust-compile.cc: New.
2925         * backend/rust-compile.h: New.
2926         * backend/rust-constexpr.cc: New.
2927         * backend/rust-constexpr.h: New.
2929 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2930             David Faust  <david.faust@oracle.com>
2932         * backend/rust-compile-block.cc: New.
2933         * backend/rust-compile-block.h: New.
2934         * backend/rust-compile-expr.cc: New.
2935         * backend/rust-compile-expr.h: New.
2936         * backend/rust-compile-extern.h: New.
2937         * backend/rust-compile-fnparam.cc: New.
2938         * backend/rust-compile-fnparam.h: New.
2939         * backend/rust-compile-implitem.cc: New.
2940         * backend/rust-compile-implitem.h: New.
2941         * backend/rust-compile-intrinsic.cc: New.
2942         * backend/rust-compile-intrinsic.h: New.
2943         * backend/rust-compile-item.cc: New.
2944         * backend/rust-compile-item.h: New.
2945         * backend/rust-compile-pattern.cc: New.
2946         * backend/rust-compile-pattern.h: New.
2947         * backend/rust-compile-resolve-path.cc: New.
2948         * backend/rust-compile-resolve-path.h: New.
2949         * backend/rust-compile-stmt.cc: New.
2950         * backend/rust-compile-stmt.h: New.
2951         * backend/rust-compile-struct-field-expr.cc: New.
2952         * backend/rust-compile-struct-field-expr.h: New.
2953         * backend/rust-compile-type.cc: New.
2954         * backend/rust-compile-type.h: New.
2955         * backend/rust-compile-var-decl.h: New.
2957 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2958             David Faust  <david.faust@oracle.com>
2960         * backend/rust-builtins.h: New.
2961         * backend/rust-compile-base.cc: New.
2962         * backend/rust-compile-base.h: New.
2963         * backend/rust-mangle.cc: New.
2964         * backend/rust-mangle.h: New.
2965         * backend/rust-tree.cc: New.
2966         * backend/rust-tree.h: New.
2967         * rust-backend.h: New.
2968         * rust-gcc.cc: New.
2970 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2972         * metadata/rust-export-metadata.cc: New.
2973         * metadata/rust-export-metadata.h: New.
2974         * metadata/rust-extern-crate.cc: New.
2975         * metadata/rust-extern-crate.h: New.
2976         * metadata/rust-import-archive.cc: New.
2977         * metadata/rust-imports.cc: New.
2978         * metadata/rust-imports.h: New.
2979         * rust-object-export.cc: New.
2980         * rust-object-export.h: New.
2982 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
2984         * checks/lints/rust-lint-unused-var.cc: New.
2985         * checks/lints/rust-lint-unused-var.h: New.
2987 2022-12-13  Thomas Young  <wenzhang5800@gmail.com>
2989         * checks/lints/rust-lint-marklive-base.h: New.
2990         * checks/lints/rust-lint-marklive.cc: New.
2991         * checks/lints/rust-lint-marklive.h: New.
2992         * checks/lints/rust-lint-scan-deadcode.h: New.
2994 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
2996         * checks/errors/privacy/rust-privacy-check.cc: New.
2997         * checks/errors/privacy/rust-privacy-check.h: New.
2998         * checks/errors/privacy/rust-privacy-common.h: New.
2999         * checks/errors/privacy/rust-privacy-ctx.cc: New.
3000         * checks/errors/privacy/rust-privacy-ctx.h: New.
3001         * checks/errors/privacy/rust-privacy-reporter.cc: New.
3002         * checks/errors/privacy/rust-privacy-reporter.h: New.
3003         * checks/errors/privacy/rust-pub-restricted-visitor.cc: New.
3004         * checks/errors/privacy/rust-pub-restricted-visitor.h: New.
3005         * checks/errors/privacy/rust-reachability.cc: New.
3006         * checks/errors/privacy/rust-reachability.h: New.
3007         * checks/errors/privacy/rust-visibility-resolver.cc: New.
3008         * checks/errors/privacy/rust-visibility-resolver.h: New.
3010 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
3012         * checks/errors/rust-const-checker.cc: New.
3013         * checks/errors/rust-const-checker.h: New.
3015 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
3017         * checks/errors/rust-unsafe-checker.cc: New.
3018         * checks/errors/rust-unsafe-checker.h: New.
3020 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3022         * typecheck/rust-autoderef.cc: New.
3023         * typecheck/rust-autoderef.h: New.
3024         * typecheck/rust-casts.cc: New.
3025         * typecheck/rust-casts.h: New.
3026         * typecheck/rust-coercion.cc: New.
3027         * typecheck/rust-coercion.h: New.
3028         * typecheck/rust-hir-dot-operator.cc: New.
3029         * typecheck/rust-hir-dot-operator.h: New.
3030         * typecheck/rust-hir-inherent-impl-overlap.h: New.
3031         * typecheck/rust-hir-path-probe.h: New.
3032         * typecheck/rust-hir-trait-ref.h: New.
3033         * typecheck/rust-hir-type-bounds.h: New.
3034         * typecheck/rust-substitution-mapper.cc: New.
3035         * typecheck/rust-substitution-mapper.h: New.
3036         * typecheck/rust-tycheck-dump.h: New.
3037         * typecheck/rust-tyctx.cc: New.
3038         * typecheck/rust-tyty-bounds.cc: New.
3039         * typecheck/rust-tyty-call.cc: New.
3040         * typecheck/rust-tyty-call.h: New.
3041         * typecheck/rust-tyty-cmp.h: New.
3042         * typecheck/rust-tyty-rules.h: New.
3044 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3046         * typecheck/rust-tyty.cc: New.
3047         * typecheck/rust-tyty.h: New.
3049 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3051         * typecheck/rust-hir-trait-resolve.cc: New.
3052         * typecheck/rust-hir-trait-resolve.h: New.
3053         * typecheck/rust-hir-type-check-base.cc: New.
3054         * typecheck/rust-hir-type-check-base.h: New.
3055         * typecheck/rust-hir-type-check-enumitem.cc: New.
3056         * typecheck/rust-hir-type-check-enumitem.h: New.
3057         * typecheck/rust-hir-type-check-expr.cc: New.
3058         * typecheck/rust-hir-type-check-expr.h: New.
3059         * typecheck/rust-hir-type-check-implitem.cc: New.
3060         * typecheck/rust-hir-type-check-implitem.h: New.
3061         * typecheck/rust-hir-type-check-item.cc: New.
3062         * typecheck/rust-hir-type-check-item.h: New.
3063         * typecheck/rust-hir-type-check-path.cc: New.
3064         * typecheck/rust-hir-type-check-pattern.cc: New.
3065         * typecheck/rust-hir-type-check-pattern.h: New.
3066         * typecheck/rust-hir-type-check-stmt.cc: New.
3067         * typecheck/rust-hir-type-check-stmt.h: New.
3068         * typecheck/rust-hir-type-check-struct-field.h: New.
3069         * typecheck/rust-hir-type-check-struct.cc: New.
3070         * typecheck/rust-hir-type-check-toplevel.cc: New.
3071         * typecheck/rust-hir-type-check-toplevel.h: New.
3072         * typecheck/rust-hir-type-check-type.cc: New.
3073         * typecheck/rust-hir-type-check-type.h: New.
3074         * typecheck/rust-hir-type-check-util.cc: New.
3075         * typecheck/rust-hir-type-check-util.h: New.
3076         * typecheck/rust-hir-type-check.cc: New.
3077         * typecheck/rust-hir-type-check.h: New.
3078         * typecheck/rust-tyty-visitor.h: New.
3080 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3082         * util/rust-canonical-path.h: New.
3083         * util/rust-common.h: New.
3084         * util/rust-hir-map.cc: New.
3085         * util/rust-hir-map.h: New.
3086         * util/rust-identifier.h: New.
3087         * util/rust-lang-item.h: New.
3088         * util/rust-mapping-common.h: New.
3089         * util/rust-stacked-contexts.h: New.
3091 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
3093         * util/rust-attributes.cc: New.
3094         * util/rust-attributes.h: New.
3096 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
3098         * util/rust-optional-test.cc: New.
3099         * util/rust-optional.h: New.
3101 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
3103         * util/rust-base62.cc: New.
3104         * util/rust-base62.h: New.
3106 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3108         * util/rust-abi.cc: New.
3109         * util/rust-abi.h: New.
3111 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3113         * util/fnv-hash.h: New.
3115 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3117         * util/rust-make-unique.h: New.
3119 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3121         * hir/rust-ast-lower-base.cc: New.
3122         * hir/rust-ast-lower-base.h: New.
3123         * hir/rust-ast-lower-block.h: New.
3124         * hir/rust-ast-lower-enumitem.h: New.
3125         * hir/rust-ast-lower-expr.h: New.
3126         * hir/rust-ast-lower-extern.h: New.
3127         * hir/rust-ast-lower-implitem.h: New.
3128         * hir/rust-ast-lower-item.cc: New.
3129         * hir/rust-ast-lower-item.h: New.
3130         * hir/rust-ast-lower-pattern.cc: New.
3131         * hir/rust-ast-lower-pattern.h: New.
3132         * hir/rust-ast-lower-stmt.h: New.
3133         * hir/rust-ast-lower-struct-field-expr.h: New.
3134         * hir/rust-ast-lower-type.h: New.
3135         * hir/rust-ast-lower.cc: New.
3136         * hir/rust-ast-lower.h: New.
3137         * hir/rust-hir-dump.cc: New.
3138         * hir/rust-hir-dump.h: New.
3140 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3142         * hir/tree/rust-hir-full-decls.h: New.
3143         * hir/tree/rust-hir-full-test.cc: New.
3144         * hir/tree/rust-hir-full.h: New.
3145         * hir/tree/rust-hir-visitor.h: New.
3146         * hir/tree/rust-hir.h: New.
3148 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3150         * hir/tree/rust-hir-expr.h: New.
3151         * hir/tree/rust-hir-item.h: New.
3152         * hir/tree/rust-hir-path.h: New.
3153         * hir/tree/rust-hir-pattern.h: New.
3154         * hir/tree/rust-hir-stmt.h: New.
3155         * hir/tree/rust-hir-type.h: New.
3157 2022-12-13  Philip Herron  <philip.herron@embecosm.com>
3159         * resolve/rust-ast-resolve-base.cc: New.
3160         * resolve/rust-ast-resolve-base.h: New.
3161         * resolve/rust-ast-resolve-expr.cc: New.
3162         * resolve/rust-ast-resolve-expr.h: New.
3163         * resolve/rust-ast-resolve-implitem.h: New.
3164         * resolve/rust-ast-resolve-item.cc: New.
3165         * resolve/rust-ast-resolve-item.h: New.
3166         * resolve/rust-ast-resolve-path.cc: New.
3167         * resolve/rust-ast-resolve-path.h: New.
3168         * resolve/rust-ast-resolve-pattern.cc: New.
3169         * resolve/rust-ast-resolve-pattern.h: New.
3170         * resolve/rust-ast-resolve-stmt.cc: New.
3171         * resolve/rust-ast-resolve-stmt.h: New.
3172         * resolve/rust-ast-resolve-struct-expr-field.cc: New.
3173         * resolve/rust-ast-resolve-struct-expr-field.h: New.
3174         * resolve/rust-ast-resolve-toplevel.h: New.
3175         * resolve/rust-ast-resolve-type.cc: New.
3176         * resolve/rust-ast-resolve-type.h: New.
3177         * resolve/rust-ast-resolve.cc: New.
3178         * resolve/rust-ast-resolve.h: New.
3179         * resolve/rust-ast-verify-assignee.h: New.
3180         * resolve/rust-name-resolver.cc: New.
3181         * resolve/rust-name-resolver.h: New.
3183 2022-12-13  Arthur Cohen  <arthur.cohen@embecosm.com>
3184             Philip Herron  <philip.herron@embecosm.com>
3185             Joel Phillips  <simplytheother@gmail.com>
3187         * expand/rust-attribute-visitor.cc: New.
3188         * expand/rust-attribute-visitor.h: New.
3189         * expand/rust-macro-builtins.cc: New.
3190         * expand/rust-macro-builtins.h: New.
3191         * expand/rust-macro-expand.cc: New.
3192         * expand/rust-macro-expand.h: New.
3193         * expand/rust-macro-invoc-lexer.cc: New.
3194         * expand/rust-macro-invoc-lexer.h: New.
3195         * expand/rust-macro-substitute-ctx.cc: New.
3196         * expand/rust-macro-substitute-ctx.h: New.
3198 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3199             Philip Herron  <philip.herron@embecosm.com>
3200             Arthur Cohen  <arthur.cohen@embecosm.com>
3202         * parse/rust-parse-impl.h: New, second half.
3204 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3205             Philip Herron  <philip.herron@embecosm.com>
3206             Arthur Cohen  <arthur.cohen@embecosm.com>
3208         * parse/rust-cfg-parser.cc: New.
3209         * parse/rust-cfg-parser.h: New.
3210         * parse/rust-parse-impl.h: New.
3211         * parse/rust-parse.cc: New.
3212         * parse/rust-parse.h: New.
3214 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3215             Philip Herron  <philip.herron@embecosm.com>
3216             Arthur Cohen  <arthur.cohen@embecosm.com>
3217             Mark Wielaard  <mark@klomp.org>
3219         * lex/rust-codepoint.h: New.
3220         * lex/rust-lex.cc: New.
3221         * lex/rust-lex.h: New.
3222         * lex/rust-token.cc: New.
3223         * lex/rust-token.h: New.
3224         * rust-buffered-queue.h: New.
3226 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3227             Philip Herron  <philip.herron@embecosm.com>
3228             Arthur Cohen  <arthur.cohen@embecosm.com>
3230         * ast/rust-ast-dump.cc: New.
3231         * ast/rust-ast-dump.h: New.
3232         * ast/rust-ast-visitor.h: New.
3233         * ast/rust-cond-compilation.h: New.
3235 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3236             Philip Herron  <philip.herron@embecosm.com>
3238         * ast/rust-expr.h: New.
3239         * ast/rust-macro.h: New.
3240         * ast/rust-path.h: New.
3241         * ast/rust-pattern.h: New.
3242         * ast/rust-stmt.h: New.
3243         * ast/rust-type.h: New.
3245 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3246             Philip Herron  <philip.herron@embecosm.com>
3248         * ast/rust-item.h: New.
3250 2022-12-13  Joel Phillips  <simplytheother@gmail.com>
3251             Philip Herron  <philip.herron@embecosm.com>
3252             Arthur Cohen  <arthur.cohen@embecosm.com>
3254         * ast/rust-ast-full-decls.h: New.
3255         * ast/rust-ast-full-test.cc: New.
3256         * ast/rust-ast-full.h: New.
3257         * ast/rust-ast.h: New.
3258         * operator.h: New.
3261 Copyright (C) 2022-2023 Free Software Foundation, Inc.
3263 Copying and distribution of this file, with or without modification,
3264 are permitted in any medium without royalty provided the copyright
3265 notice and this notice are preserved.