Skip to content

Merge upstream (dummy), "Rust front-end update 2023-04-05"#2115

Merged
tschwinge merged 89 commits into
masterfrom
tschwinge/merge-upstream
Apr 11, 2023
Merged

Merge upstream (dummy), "Rust front-end update 2023-04-05"#2115
tschwinge merged 89 commits into
masterfrom
tschwinge/merge-upstream

Conversation

@tschwinge

Copy link
Copy Markdown
Member

In #2112 'Merge upstream, last commit before "Rust front-end update 2023-04-05"' we merged commit 939fb3f from upstream GCC master branch.

This one now merges the "Rust front-end update 2023-04-05", commits 939fb3f..d2a499a

  - f66b135d0b5 gccrs: fatal_error_flag: Fix typo in error message
  - 776ff053800 gccrs: unsafe: check use of `target_feature` attribute
  - d9e05700ac3 gccrs: Check for mutable references in const functions
  - ef792b9658d gccrs: rust: add bound parsing in parse_generic_arg.
  - e1394230b3f gccrs: Implement declarative macro 2.0 parser
  - 3f1dbb2cf8f gccrs: Add name resolution to generic argument associated item bindings
  - 7eab9d18d97 gccrs: Support associated type bound arguments
  - 364f4cd3072 gccrs: Reuse TypeCheckPattern on LetStmt's
  - 8e2abbef4cc gccrs: Add get_locus function for abstract class MetaItemInner.
  - 86f8e47f9df gccrs: diagnostics: Add underline for tokens in diagnostics.
  - 881ed7fb273 gccrs: Change how CompileVarDecl outputs Bvariable's
  - 60affc3a1c5 gccrs: testsuite: Handle Windows carriage returns properly
  - 910e7e0a958 gccrs: Support GroupedPattern during name resolution
  - cb42610bfba gccrs: Do not crash on empty macros expand. Fixes #1712
  - 93fcadd208a gccrs: Add HIR lowering for GroupedPattern
  - d5a303cc664 gccrs: Add get_item method for HIR::GroupedPattern
  - 83e5f634d74 gccrs: Add type resolution for grouped patterns
  - 221650c280c gccrs: Added missing GroupedPattern visitors for code generation
  - 9b19e93873c gccrs: Rename file rust-ast-full-test.cc to rust-ast.cc
  - d6cb04bf5c0 gccrs: moved operator.h to util/rust-operators.h
  - 760f529d813 gccrs: fixed compiler error message on wildcard pattern within expression
  - 8e7e682a9f8 gccrs: fixed indentations in AST pretty expanded dump of trait
  - 51b607c2227 gccrs: macro: Allow builtin `MacroInvocation`s within the AST
  - ad9d75f5080 gccrs: Create and use CompilePatternLet visitor for compiling let statments
  - 9cbd270632b gccrs: parser: Allow parsing multiple reference types
  - 2dab57c3f2f gccrs: Move rust-buffered-queue.h to util folder #1766
  - fd7358af3cf gccrs: Improve GroupedPattern lowering
  - 95efd84db13 gccrs: Remove HIR::GroupedPattern
  - 0e4bf6e7fc4 gccrs: Optimize HIR::ReferencePattern
  - 86f53e5853d gccrs: Implement lowering ReferencePattern from AST to HIR
  - 2af66ebd1d8 gccrs: parser: Improve parsing of complex generic arguments
  - 7f5144d1c96 gccrs: parser: Fix parsing of closure param list
  - 476faea3563 gccrs: Add  support for feature check.
  - 4141941ae7b gccrs: Removed comment copy-pasted from gcc/tree.def
  - 8d1d08cdbcf gccrs: Add another test case for passing associated type-bounds
  - c1b1bbbc645 gccrs: Move TypePredicateItem impl out of the header
  - 688fccb5227 gccrs: Refactor TyVar and TypeBoundPredicates
  - e42118c327f gccrs: Refactor SubstitutionRef base class into its own CC file
  - 6abbfb5280f gccrs: Refactor all substitution mapper code implementation into its own CC file
  - d73082efece gccrs: Refactor BaseType, InferType and ErrorType impl into cc file
  - 26af4b0604d gccrs: Refactor PathProbe into cc file
  - 547e511fbdd gccrs: Refactor PathProbeType code into CC file
  - 615ee14c08e gccrs: Refactor all code out of the rust-tyty.h header
  - 6c4fa22d384 gccrs: Rename rust-tyctx.cc to rust-typecheck-context.cc
  - 1019fd6337b gccrs: Rename header rust-hir-trait-ref.h to rust-hir-trait-reference.h
  - dcb2e571ac6 gccrs: Refactor handle_substitutions to take a reference
  - 2f228578d56 gccrs: Clear the substitution callbacks when copying ArgumentMappings
  - 31f1e59962b gccrs: Add missing param subst callback
  - e42c28bcfdd gccrs: Remove monomorphization hack to setup possible associated types
  - 68d671ac725 gccrs: Refactor the type unification code
  - 2a2e6712ba0 gccrs: Fix nullptr dereference
  - f62dcf2c65a gccrs: Add missing Sized, Copy and Clone lang item mappings
  - 9754a60623c gccrs: Fix higher ranked trait bounds computation of self
  - 11150b7c05c gccrs: Remove bad error message on checking function arguments
  - eb4a61ac1ba gccrs: Add general TypeBounds checks
  - fa7b3a2f07f gccrs: Add support for TuplePattern in let statements
  - 1c57244dbc0 gccrs: rust-item: include rust-expr.h
  - f548ddee96a gccrs: parser: Expose parse_macro_invocation as public API
  - 2d30e0b882f gccrs: expansion: Add `get_token_slice` to `MacroInvocLexer` class
  - 3821669164d gccrs: macros: Perform macro expansion in a fixed-point fashion.
  - fbd5244df6b gccrs: expander: Add documentation for `expand_eager_invocations`
  - 5fd04425c09 gccrs: typecheck: Refactor rust-hir-trait-reference.h
  - f64799a567e gccrs: cli: Update safety warning message
  - b4229fb086b gccrs: Update copyright years.
  - fd5eb9f2b01 gccrs: Add feature gate for "rust-intrinsic".
  - a9d72ef2d03 gccrs: Add variadic argument type checking
  - 8a9886a85ea gccrs: Add test
  - e81f5be60d1 gccrs: Simplify WildcardPattern let statement handling
  - b56d093e952 gccrs: lex: Prevent directories in RAIIFile
  - 7b00a80c9df gccrs: testsuite: Add empty string macro test
  - 20529dff93f gccrs: Add support for parsing empty tuple patterns.
  - fd406fc7046 gccrs: Implemented UTF-8 checking for include_str!()
  - c627781b8f6 gccrs: Extract query_type from TypeCheckBase to be a simple extern
  - e90d06c5447 gccrs: Add new virtual function HIR::ImplItem::get_impl_item_name
  - 4b25fc15b92 gccrs: Support for Sized builtin marker trait
  - a11b44b6a57 gccrs: Fix regression in testcase
  - ecdce2bf17a gccrs: Add trailing newline
  - 8b0ed2387a5 gccrs: builtins: Return empty list of tokens instead of nullptr
  - 6774d569c61 gccrs: Fix formatting
  - 8628486f487 gccrs: Add AST::AltPattern class
  - 0ec543c7c61 gccrs: Fix up DejaGnu directives in 'rust/compile/issue-1830_{bytes,str}.rs' test cases [#1838]
  - 1a58da7c2d8 gccrs: rename rust-hir-full-tests.cc
  - 3b342e11627 gccrs: add test case to show our query-type system is working
  - fa7675df86a gccrs: ast: Refactor TraitItem to keep Location info
  - 2785d591116 gccrs: diagnostic: Refactor Error class
  - f2d6ab839ce gccrs: Added AST Node AST::InlineAsm
  - 990ae497b86 gccrs: Address unsafe with/without block handling ambiguity
  - d2a499a9881 gccrs: Fix issue with parsing unsafe block expression statements

This merge is done with 'git merge --strategy=ours', so effectively doesn't merge any changes. Rationale: those commits are taken from GCC/Rust master branch, and any remaining changes we'd either like to persist, or assess individually, later.

This must of course not be rebased by GitHub merge queue, but has to become a proper Git merge. (I'll handle that, once ready.)

CohenArthur and others added 30 commits April 6, 2023 10:47
gcc/rust/ChangeLog:

	* rust-session-manager.cc (Session::compile_crate): Fix typo.
The `target_feature` attribute is for conditional compilation and may or
may not compile on all platforms. Using it requires an unsafe function
or block.

gcc/rust/ChangeLog:

	* checks/errors/rust-unsafe-checker.cc (check_target_attr): New function.
	(UnsafeChecker::check_function_attr): Call into `check_target_attr`.
	(UnsafeChecker::visit): Check for target_feature attributes.
	* checks/errors/rust-unsafe-checker.h: Add declarations.
	* util/rust-attributes.cc: Add attribute.

gcc/testsuite/ChangeLog:

	* rust/compile/unsafe11.rs: New test.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
Use StackedContext instead. Fix error string

Signed-off-by: Dave Evans <dave@dmetwo.org>

(Squashed commits) Check for mutable references in const functions using StackedContext

gcc/rust/ChangeLog:

	* checks/errors/rust-const-checker.cc (ConstChecker::visit): Use StackedContext
	class.

gcc/testsuite/ChangeLog:

	* rust/compile/const10.rs: New test.

Signed-off-by: Dave Evans <dave@dmetwo.org>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_generic_arg): Add proper bound parsing.

gcc/testsuite/ChangeLog:

	* rust/compile/bounds.rs: New test.

Signed-off-by: Xiao Ma <mxlol233@outlook.com>
gcc/rust/ChangeLog:

	* ast/rust-ast-full-decls.h (class MacroItem): Remove forward declaration.
	* ast/rust-ast-full-test.cc (MacroRulesDefinition):
	Rework MacroRulesDefinition class
	* ast/rust-ast.h (class MacroItem): Remove abstract class.
	* ast/rust-item.h (class MacroItem): Remove forward declaration.
	* ast/rust-macro.h (class MacroItem): Likewise.
	(class MacroRulesDefinition): Add MacroKind enum.
	(class MacroInvocation): Fix inheritance.
	* lex/rust-token.h: Token "macro" is now used.
	* parse/rust-parse-impl.h (Parser::parse_item): Add handling for MACRO.
	(Parser::parse_vis_item): Call into parse_decl_macro_def.
	(Parser::parse_macro_item): Delete function.
	(Parser::parse_macro_rules_def): Return MBE macros only.
	(Parser::parse_decl_macro_def): New function.
	(Parser::parse_stmt): Handle MACRO token.
	(Parser::parse_stmt_or_expr_without_block): Call into parse_macro_rules_def.
	* parse/rust-parse.h: Declare new function.

gcc/testsuite/ChangeLog:

	* rust/compile/decl_macro1.rs: New test.
	* rust/compile/decl_macro2.rs: New test.
	* rust/compile/decl_macro3.rs: New test.
	* rust/compile/decl_macro4.rs: New test.
	* rust/compile/decl_macro5.rs: New test.
	* rust/compile/decl_macro6.rs: New test.
	* rust/compile/decl_macro7.rs: New test.
	* rust/execute/torture/decl_macro1.rs: New test.
	* rust/execute/torture/decl_macro2.rs: New test.
	* rust/execute/torture/decl_macro3.rs: New test.
	* rust/execute/torture/decl_macro4.rs: New test.

Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
When specifying generic arguments to Traits we can also specify the
associated types using `<BindingName=i32>` syntax we need to add
name resolution to the type argument here and rely on the type
resolution pass to ensure the associated type exists and to setup the
associated types accordingly.

Addresses #1720

gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-type.cc (ResolveGenericArgs::go): Add name resolution to
	Trait items.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
This patch adds support for the GenercArgsBinding type, where you can
specify the associated types of a trait bound using `<Foo=i32>` style
syntax. Note that the type-resolution relys on the i32 impl for Add
as type resolution will resolve the `a+a` to the core::ops::Add method
so code generation will require this to exist.

I have ameded testsuite/rust/compile/bounds.rs as this code is wrongly
creating an HIR::GenericArgs with a trait-object type and causing issues.
the parsing is still correct but we dont have the mechanism to represent
this in AST and HIR properly. I think we will need a new HIR::GenericArgs
AssociatedTypeBindingBound or something similar. We are still lacking
bounds checking during are type coercions and unifications so running this
example using an f32 will wrongly pass type checking, this will need
addressed next.

Fixes #1720

gcc/rust/ChangeLog:

	* hir/tree/rust-hir-path.h: Add const get_identifier and get_type method.
	* typecheck/rust-hir-path-probe.h: Use new SubstitutionArgumentMappings constructor.
	* typecheck/rust-hir-trait-resolve.cc: Likewise.
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
	* typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
	Do not assert failure on size mismatch anymore.
	(TypeBoundPredicate::TypeBoundPredicate): Use new SubstitutionArgumentMappings constructor.
	(TypeBoundPredicate::operator=): Likewise.
	(TypeBoundPredicate::apply_generic_arguments): Likewise.
	(TypeBoundPredicateItem::get_tyty_for_receiver): Likewise.
	(TypeBoundPredicate::get_num_associated_bindings): Likewise.
	(TypeBoundPredicate::lookup_associated_type): Fix implementation for new system.
	(TypeBoundPredicate::get_associated_type_items): Likewise.
	* typecheck/rust-tyty.cc (SubstitutionRef::get_mappings_from_generic_args): Add new
	behavior.
	(SubstitutionRef::infer_substitions): Use new constructor and add comment.
	(SubstitutionRef::solve_missing_mappings_from_this): Use new constructor.
	* typecheck/rust-tyty.h: Define new constructors.

gcc/testsuite/ChangeLog:

	* rust/compile/bounds.rs: change to use -fsyntax-only
	* rust/execute/torture/issue-1720.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Update Rust type-checking to reuse TypeCheckPattern on HIR::LetStmt's.
This will unify the paths and improve error handling.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Cleanup LetStmt
	type checking.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This commit adds virtual function get_locus to base class MetaItemInner,
which is helpful when we need to print  diagnostics on some sub-classes of
MetaItemInner.

gcc/rust/ChangeLog:

	* ast/rust-ast.h: Add get_locus method.
	* ast/rust-expr.h: Likewise.
	* ast/rust-macro.h: Likewise.

Signed-off-by: Xiao Ma <mxlol233@outlook.com>
Currently, the diagnostics only point to the corresponding token's
start position by carets, and lack of underlines for full token.  This
commit add support for such underlines in diagnostics by encoding range
information in location_t.

gcc/rust/ChangeLog:

	* lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token.
	(Lexer::parse_byte_char): Likewise.
	(Lexer::parse_byte_string): Likewise.
	(Lexer::parse_raw_byte_string): Likewise.
	(Lexer::parse_raw_identifier): Likewise.
	(Lexer::parse_string): Likewise.
	(Lexer::parse_identifier_or_keyword): Likewise.
	(Lexer::parse_raw_string): Likewise.
	(Lexer::parse_non_decimal_int_literal): Likewise.
	(Lexer::parse_decimal_int_or_float): Likewise.
	(Lexer::parse_char_or_lifetime): Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/diagnostic_underline.rs: New test.

Signed-off-by: Xiao Ma <mxlol233@outlook.com>
This allows patterns to declare multiple/no variables

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block):
	Allow patterns to declare zero or multiple variables.
	* backend/rust-compile-var-decl.h: Change function declaration.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
In dg-output, check for \r* carriage returns to make sure execution
tests pass on windows platforms

gcc/testsuite/ChangeLog:

	* rust/execute/torture/builtin_macro_cfg.rs: Handle carriage returns
		properly.
	* rust/execute/torture/builtin_macro_concat.rs: Likewise.
	* rust/execute/torture/builtin_macro_env.rs: Likewise.
	* rust/execute/torture/builtin_macro_include_bytes.rs: Likewise.
	* rust/execute/torture/builtin_macro_include_str.rs: Likewise.
	* rust/execute/torture/builtin_macro_line.rs: Likewise.
	* rust/execute/torture/builtin_macros1.rs: Likewise.
	* rust/execute/torture/builtin_macros3.rs: Likewise.
	* rust/execute/torture/cfg1.rs: Likewise.
	* rust/execute/torture/cfg2.rs: Likewise.
	* rust/execute/torture/cfg3.rs: Likewise.
	* rust/execute/torture/cfg4.rs: Likewise.
	* rust/execute/torture/coercion1.rs: Likewise.
	* rust/execute/torture/coercion2.rs: Likewise.
	* rust/execute/torture/extern_mod4.rs: Likewise.
	* rust/execute/torture/helloworld1.rs: Likewise.
	* rust/execute/torture/helloworld2.rs: Likewise.
	* rust/execute/torture/issue-1198.rs: Likewise.
	* rust/execute/torture/issue-1231.rs: Likewise.
	* rust/execute/torture/issue-1232.rs: Likewise.
	* rust/execute/torture/issue-1249.rs: Likewise.
	* rust/execute/torture/issue-1436.rs: Likewise.
	* rust/execute/torture/issue-1496.rs: Likewise.
	* rust/execute/torture/issue-647.rs: Likewise.
	* rust/execute/torture/issue-845.rs: Likewise.
	* rust/execute/torture/issue-851.rs: Likewise.
	* rust/execute/torture/issue-858.rs: Likewise.
	* rust/execute/torture/issue-976.rs: Likewise.
	* rust/execute/torture/macros10.rs: Likewise.
	* rust/execute/torture/macros11.rs: Likewise.
	* rust/execute/torture/macros12.rs: Likewise.
	* rust/execute/torture/macros13.rs: Likewise.
	* rust/execute/torture/macros14.rs: Likewise.
	* rust/execute/torture/macros2.rs: Likewise.
	* rust/execute/torture/macros22.rs: Likewise.
	* rust/execute/torture/macros29.rs: Likewise.
	* rust/execute/torture/macros3.rs: Likewise.
	* rust/execute/torture/macros30.rs: Likewise.
	* rust/execute/torture/macros31.rs: Likewise.
	* rust/execute/torture/macros7.rs: Likewise.
	* rust/execute/torture/macros8.rs: Likewise.
	* rust/execute/torture/macros9.rs: Likewise.
	* rust/execute/torture/match1.rs: Likewise.
	* rust/execute/torture/match2.rs: Likewise.
	* rust/execute/torture/match3.rs: Likewise.
	* rust/execute/torture/match_bool1.rs: Likewise.
	* rust/execute/torture/match_byte1.rs: Likewise.
	* rust/execute/torture/match_char1.rs: Likewise.
	* rust/execute/torture/match_int1.rs: Likewise.
	* rust/execute/torture/match_loop1.rs: Likewise.
	* rust/execute/torture/match_range1.rs: Likewise.
	* rust/execute/torture/match_range2.rs: Likewise.
	* rust/execute/torture/match_tuple1.rs: Likewise.
	* rust/execute/torture/method1.rs: Likewise.
	* rust/execute/torture/method2.rs: Likewise.
	* rust/execute/torture/method3.rs: Likewise.
	* rust/execute/torture/method4.rs: Likewise.
	* rust/execute/torture/operator_overload_1.rs: Likewise.
	* rust/execute/torture/operator_overload_10.rs: Likewise.
	* rust/execute/torture/operator_overload_11.rs: Likewise.
	* rust/execute/torture/operator_overload_12.rs: Likewise.
	* rust/execute/torture/operator_overload_2.rs: Likewise.
	* rust/execute/torture/operator_overload_4.rs: Likewise.
	* rust/execute/torture/operator_overload_5.rs: Likewise.
	* rust/execute/torture/operator_overload_6.rs: Likewise.
	* rust/execute/torture/operator_overload_7.rs: Likewise.
	* rust/execute/torture/operator_overload_8.rs: Likewise.
	* rust/execute/torture/operator_overload_9.rs: Likewise.
	* rust/execute/torture/str-layout1.rs: Likewise.
	* rust/execute/torture/str-zero.rs: Likewise.
	* rust/execute/torture/trait1.rs: Likewise.
	* rust/execute/torture/trait10.rs: Likewise.
	* rust/execute/torture/trait11.rs: Likewise.
	* rust/execute/torture/trait12.rs: Likewise.
	* rust/execute/torture/trait13.rs: Likewise.
	* rust/execute/torture/trait2.rs: Likewise.
	* rust/execute/torture/trait3.rs: Likewise.
	* rust/execute/torture/trait4.rs: Likewise.
	* rust/execute/torture/trait5.rs: Likewise.
	* rust/execute/torture/trait6.rs: Likewise.
	* rust/execute/torture/trait7.rs: Likewise.
	* rust/execute/torture/trait8.rs: Likewise.
	* rust/execute/torture/trait9.rs: Likewise.
	* rust/execute/torture/closure2.rs: Likewise.
	* rust/execute/torture/closure3.rs: Likewise.
	* rust/execute/torture/loop-condition-eval.rs: Likewise.
	* rust/execute/torture/operator_overload_3.rs: Likewise.
gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-pattern.h: Support GroupedPattern properly.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This commit fixes a compiler crash when expanding an empty macro into an existing AST.

gcc/rust/ChangeLog:

	* expand/rust-macro-expand.cc (transcribe_expression): Fix ICE when expanding
	empty macros.

gcc/testsuite/ChangeLog:

	* rust/compile/macro45.rs: New test.

Signed-off-by: Lyra Karenai <teromene@teromene.fr>
gcc/rust/ChangeLog:

	* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Add proper visitor.
	* hir/rust-ast-lower-pattern.h: Declare it.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-pattern.h: Add get_item method.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Add proper
	visitor.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Add proper
	visitor.
	(CompilePatternBindings::visit): Likewise.
	* backend/rust-compile-pattern.h: Declare them.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* Make-lang.in: Rename object file.
	* ast/rust-ast-full-test.cc: Moved to...
	* ast/rust-ast.cc: ...here.
gcc/rust/ChangeLog:

	* ast/rust-ast.cc: Fix include list.
	* ast/rust-expr.h: Likewise.
	* hir/tree/rust-hir-expr.h: Likewise.
	* rust-backend.h: Likewise.
	* util/rust-lang-item.h: Likewise.
	* operator.h: Moved to...
	* util/rust-operators.h: ...here.

Signed-off-by: Abdul Rafey <abdulrafeyq@gmail.com>
…sion

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::null_denotation): Add proper error
	when seeing wildcard var on right side of assignment.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-867.rs: New test.

Signed-off-by: Abdul Rafey <abdulrafeyq@gmail.com>
gcc/rust/ChangeLog:

	* ast/rust-ast-dump.cc (Dump::visit): removed extra indentations in trait ast dump

Signed-off-by: Abdul Rafey <abdulrafeyq@gmail.com>
gcc/rust/ChangeLog:

	* ast/rust-macro.h (enum class): Add `BuiltinMacro` enum class.
	* expand/rust-attribute-visitor.cc (AttrVisitor::visit): Mention
	switching on `macro.kind` once builtin macro invocations are properly
	handled.
	* parse/rust-parse-impl.h (Parser::parse_macro_invocation): Switch to new MacroInvocation
	API.
	(Parser::parse_type): Likewise.
	(Parser::parse_type_no_bounds): Likewise.
…tments

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc (CompilePatternLet::visit): New function.
	* backend/rust-compile-stmt.cc (CompileStmt::visit): Likewise.
	* backend/rust-compile-pattern.h (class CompilePatternLet): New visitor.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
The parser now recursively tries to parse a reference type after seeing
a `&` or `&&` token.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_type): Handle double ampersan
	properly
	(Parser::parse_reference_type): Call into `parse_reference_type_inner`
	and wrap double reference types in another `AST::ReferenceType` node
	(Parser::parse_reference_type_inner): Add parsing implementation
	which does not care about the leading token (& or  &&)
	(Parser::parse_type_no_bounds): Handle double ampersand properly
	* parse/rust-parse.h: Declare `parse_reference_type_inner`

gcc/testsuite/ChangeLog:

	* rust/compile/multi_reference_type.rs: New test.
gcc/rust/ChangeLog:

	* rust-buffered-queue.h: Moved to...
	* util/rust-buffered-queue.h: ...here.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/ChangeLog:

	* hir/rust-ast-lower-pattern.cc
	(ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* backend/rust-compile-fnparam.h
	(CompileFnParam::visit): Remove HIR::GroupedPattern visitor.
	* backend/rust-compile-pattern.cc
	(CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
	(CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
	* backend/rust-compile-pattern.h
	(CompilePatternCaseLabelExpr::visit): Remove HIR::GroupedPattern visitor.
	(CompilePatternBindings::visit): Remove HIR::GroupedPattern visitor.
	(CompilePatternLet::visit): Remove HIR::GroupedPattern visitor.
	* backend/rust-compile-resolve-path.h
	(ResolvePathRef::visit): Remove HIR::GroupedPattern visitor.
	* backend/rust-compile-var-decl.h
	(CompileVarDecl::visit): Remove HIR::GroupedPattern visitor.
	* checks/errors/rust-const-checker.cc
	(ConstChecker::visit): Remove HIR::GroupedPattern visitor.
	* checks/errors/rust-const-checker.h
	(ConstChecker::visit): Remove HIR::GroupedPattern visitor.
	* checks/errors/rust-unsafe-checker.cc
	(UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
	* checks/errors/rust-unsafe-checker.h
	(UnsafeChecker::visit): Remove HIR::GroupedPattern visitor.
	* hir/rust-hir-dump.cc (Dump::visit): Remove HIR::GroupedPattern visitor.
	* hir/rust-hir-dump.h (Dump::visit): Remove HIR::GroupedPattern visitor.
	* hir/tree/rust-hir-full-decls.h (class GroupedPattern): Remove class.
	* hir/tree/rust-hir-full-test.cc (GroupedPattern::accept_vis): Remove method.
	* hir/tree/rust-hir-pattern.h (class GroupedPattern): Remove class.
	* hir/tree/rust-hir-visitor.h
	(HIRFullVisitor::visit): Remove HIR::GroupedPattern visitor.
	(HIRFullVisitorBase::visit): Remove HIR::GroupedPattern visitor.
	(HIRPatternVisitor::visit): Remove HIR::GroupedPattern visitor.
	* typecheck/rust-hir-type-check-pattern.cc
	(TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.
	* typecheck/rust-hir-type-check-pattern.h
	(TypeCheckPattern::visit): Remove HIR::GroupedPattern visitor.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-pattern.h
	(class ReferencePattern): Remove has_two_amps field.
	* hir/tree/rust-hir-full-test.cc
	(ReferencePattern::as_string): Remove usage of ReferencePattern::has_two_amps.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* ast/rust-pattern.h:
	(ReferencePattern::is_double_reference): Add method.
	(ReferencePattern::get_is_mut): Add method.
	* hir/rust-ast-lower-pattern.cc
	(ASTLoweringPattern::visit): Add ReferencePattern visitor.
	* hir/rust-ast-lower-pattern.h:
	(ASTLoweringPattern::visit): Add ReferencePattern visitor.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
P-E-P and others added 28 commits April 6, 2023 10:47
Move function body to their own cc file instead of keeping them in the
header file.

gcc/rust/ChangeLog:

	* Make-lang.in: Add `rust-hir-trait-reference.o`.
	* typecheck/rust-hir-trait-reference.h: Remove multiple function body.
	* typecheck/rust-hir-trait-reference.cc: Add multiple function body.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
The compiler's warning message about the safety flag did not match
cargo-gccrs environment variable name anymore.

gcc/rust/ChangeLog:

	* rust-session-manager.cc (Session::compile_crate): Update the
	environment variable name.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ChangeLog:

	* ast/rust-ast-fragment.cc: Update copyright years.
	* ast/rust-ast-fragment.h: Likewise.
	* ast/rust-macro.cc: Likewise.
	* checks/errors/rust-feature-gate.cc: Likewise.
	* checks/errors/rust-feature-gate.h: Likewise.
	* checks/errors/rust-feature.cc: Likewise.
	* checks/errors/rust-feature.h: Likewise.
	* hir/rust-ast-lower-expr.cc: Likewise.
	* hir/rust-ast-lower-type.cc: Likewise.
	* resolve/rust-early-name-resolver.cc: Likewise.
	* resolve/rust-early-name-resolver.h: Likewise.
	* rust-gcc.h: Likewise.
	* typecheck/rust-hir-path-probe.cc: Likewise.
	* typecheck/rust-hir-trait-reference.cc: Likewise.
	* typecheck/rust-tyty-bounds.h: Likewise.
	* typecheck/rust-tyty-subst.cc: Likewise.
	* typecheck/rust-tyty-subst.h: Likewise.
	* typecheck/rust-tyty-util.cc: Likewise.
	* typecheck/rust-tyty-util.h: Likewise.
	* typecheck/rust-unify.cc: Likewise.
	* typecheck/rust-unify.h: Likewise.
	* util/rust-inline-visitor.h: Likewise.
This commit implemented a feature gate to check `intrinsics`.

gcc/rust/ChangeLog:

	* checks/errors/rust-feature-gate.cc: Add implementation for
	`void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature`
	construction process in `FeatureGate::check`.
	* checks/errors/rust-feature-gate.h: Add declaration for
	`void FeatureGate::visit (AST::ExternBlock &block)`. Add private
	variable `valid_feature`.
	* checks/errors/rust-feature.h: Change `issue` to `m_issue`.

gcc/testsuite/ChangeLog:

	* rust/compile/const-issue1440.rs: Add crate feature: `intrinsics`.
	* rust/compile/feature_intrinsics.rs: New file.
	* rust/compile/issue-1031.rs: Add crate feature: `intrinsics`.
	* rust/compile/issue-1130.rs: Add crate feature: `intrinsics`.
	* rust/compile/issue-1131.rs: Add crate feature: `intrinsics`.
	* rust/compile/issue-1237.rs: Add crate feature: `intrinsics`.
	* rust/compile/issue-1289.rs: Add crate feature: `intrinsics`.
	* rust/compile/rust-const-blog-issue.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/intrinsics-3.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/intrinsics-4.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/intrinsics-5.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/intrinsics-6.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/intrinsics-7.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/issue-1024.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/issue-1075.rs: Add crate feature: `intrinsics`.
	* rust/compile/torture/issue-1432.rs: Add crate feature: `intrinsics`.
	* rust/compile/unsafe10.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/atomic_load.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/atomic_store.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/copy_nonoverlapping1.rs: Add crate feature:
	`intrinsics`.
	* rust/execute/torture/issue-1120.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/issue-1133.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/issue-1232.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/slice-magic.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/slice-magic2.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/str-layout1.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/transmute1.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/wrapping_op1.rs: Add crate feature: `intrinsics`.
	* rust/execute/torture/wrapping_op2.rs: Add crate feature: `intrinsics`.

Signed-off-by: Xiao Ma <mxlol233@outlook.com>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty-call.cc
	(TypeCheckCallExpr::visit): Add variadic argument type checking.
	(TypeCheckCallExpr::visit): Fix comment spelling ("varadic").

gcc/testsuite/ChangeLog:

	* rust/execute/torture/overflow1.rs: Fix test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/testsuite/ChangeLog:

	* rust/compile/variadic.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc
	(CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements.
	* backend/rust-compile-var-decl.h:
	(CompileVarDecl::visit): Remove variable declaration for WildcardPattern.
	* resolve/rust-ast-resolve-pattern.h:
	(PatternDeclaration::visit): Remove name resolution for WildcardPattern.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
RAIIFile constructor was accepting directory filename. This lead to
unattended directory opening in some part of the code (load_file_bytes)
wich resulted in ice. Since RAIIFile are used for the lexer, removing
the ability to open directories with RAIIFile fixes those issues and
prevent future mistakes.

gcc/rust/ChangeLog:

	* lex/rust-lex.h: Add file type check.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Add two new tests with empty string for include_str and include_bytes
macros.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-1830_bytes.rs: New test.
	* rust/compile/issue-1830_str.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h
	(Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns.

gcc/testsuite/ChangeLog:

	* rust/compile/parse_empty_tuple_pattern.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc
	(MacroBuiltin::include_str_handler): Add check for valid UTF-8.

gcc/testsuite/ChangeLog:

	* rust/compile/builtin_macro_include_str.rs:
	Include test of invalid UTF-8.
	* rust/compile/invalid_utf8: File with invalid UTF-8.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/rust/ChangeLog:

	* Make-lang.in: add new dependancy
	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor
	* typecheck/rust-hir-type-check-base.h: refactor
	* typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): refactor
	* typecheck/rust-type-util.cc: New file.
	* typecheck/rust-type-util.h: New file.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/rust/ChangeLog:

	* hir/tree/rust-hir-item.h: implement virtual function
	* hir/tree/rust-hir.h: add virtual function
When implementing general bounds checking as part of unify calls, we did
not check associated types on bounds which lead to alot of missed error
checking. This now recursively checks the bounds and the associated types
with a decent error message. This also required us to implement the Sized
marker trait to keep existing test-cases happy.

Fixes #1725

Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/rust/ChangeLog:

	* typecheck/rust-hir-trait-reference.cc (TraitReference::clear_associated_types): make const
	(TraitReference::clear_associated_type_projections): new interface
	* typecheck/rust-hir-trait-reference.h:
	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): refactor
	(TraitItemReference::associated_type_reset): reset projections
	* typecheck/rust-hir-type-bounds.h:
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): fix bounds
	* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): refactor into cc file
	(TypeBoundsProbe::Probe): refactor
	(TypeBoundsProbe::is_bound_satisfied_for_type): likewise
	(TypeBoundsProbe::assemble_sized_builtin): add builtin for Sized
	(TypeCheckBase::get_predicate_from_bound): refactor
	(TypeBoundPredicate::lookup_associated_type): refactor
	* typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl)
	(SubstitutionRef::prepare_higher_ranked_bounds): new interface to clear hanging bounds
	(SubstitutionRef::monomorphize): refactor
	* typecheck/rust-tyty-subst.h:
	* typecheck/rust-tyty.cc (BaseType::get_locus): helper
	(BaseType::satisfies_bound): ensure bounds are satisfied and assoicated types
	(ParamType::ParamType): new field in constructor
	(ParamType::clone): update clone
	(ParamType::set_implicit_self_trait): new interface
	(ParamType::is_implicit_self_trait): likewise
	* typecheck/rust-tyty.h: cleanup
	* util/rust-hir-map.cc (Mappings::Mappings): builtin marker
	(Mappings::~Mappings): delete marker
	(Mappings::lookup_builtin_marker): lookup
	* util/rust-hir-map.h: update header

gcc/testsuite/ChangeLog:

	* rust/compile/issue-1725-1.rs: New test.
	* rust/compile/issue-1725-2.rs: New test.
Fixes #776

Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/testsuite/ChangeLog:

	* rust/compile/torture/traits10.rs: Fix test-case
gcc/rust/ChangeLog:

	* checks/errors/rust-feature-gate.h: Add trailing newline before EOF.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not
	return nullptr token in expansion of `include!()`

gcc/testsuite/ChangeLog:

	* rust/compile/empty.in: New test.
	* rust/compile/include_empty.rs: New test.
gcc/rust/ChangeLog:

	* ast/rust-pattern.h: Fix formatting.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* ast/rust-ast-dump.cc
	(Dump::visit): Add AltPattern visitor.
	* ast/rust-ast-dump.h:
	(Dump::visit): Add AltPattern visitor.
	* ast/rust-ast-full-decls.h
	(class AltPattern): Add declaration.
	* ast/rust-ast-visitor.h:
	(ASTVisitor::visit): Add AltPattern visitor.
	* ast/rust-ast.cc
	(AltPattern::as_string): Add definition.
	(AltPattern::accept_vis): Add definition.
	* ast/rust-pattern.h
	(class AltPattern): Add declaration.
	* checks/errors/rust-feature-gate.h:
	(FeatureGate::visit) Add AltPattern visitor
	* expand/rust-attribute-visitor.cc
	(AttrVisitor::visit): Add AltPattern visitor.
	* expand/rust-attribute-visitor.h:
	(AttrVisitor::visit): Add AltPattern visitor.
	* hir/rust-ast-lower-base.cc
	(ASTLoweringBase::visit): Add AltPattern visitor.
	* hir/rust-ast-lower-base.h:
	(ASTLoweringBase::visit): Add AltPattern visitor.
	* resolve/rust-ast-resolve-base.cc
	(ResolverBase::visit): Add AltPattern visitor.
	* resolve/rust-ast-resolve-base.h:
	(ResolverBase::visit): Add AltPattern visitor.
	* resolve/rust-early-name-resolver.cc
	(EarlyNameResolver::visit): Add AltPattern visitor.
	* resolve/rust-early-name-resolver.h:
	(EarlyNameResolver::visit): Add AltPattern visitor.
	* util/rust-attributes.cc
	(AttributeChecker::visit): Add AltPattern visitor.
	* util/rust-attributes.h:
	(AttributeChecker::visit): Add AltPattern visitor.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
…tr}.rs' test cases [#1838]

'dg-excess-errors' "indicates that the test is expected to fail due to compiler
messages that are not handled by 'dg-error', [etc.]".  It's argument doesn't
specify the message to match but just just a comment.  Here, however, we'd like
to match specific compiler messages, so we should use 'dg-error', etc.  Use the
magic line number zero as the compiler error diagnostic doesn't tell which line
the error occurred on (separate issue to resolve).  This gives us:

    -XFAIL: rust/compile/issue-1830_str.rs (test for excess errors)
    +PASS: rust/compile/issue-1830_bytes.rs  at line 8 (test for errors, line )
    +PASS: rust/compile/issue-1830_bytes.rs (test for excess errors)
    -XFAIL: rust/compile/issue-1830_bytes.rs (test for excess errors)
    +PASS: rust/compile/issue-1830_str.rs  at line 8 (test for errors, line )
    +PASS: rust/compile/issue-1830_str.rs (test for excess errors)

Fix-up for recent GCC/Rust master branch #1838
commit cf9ed40
"testsuite: Add empty string macro test".

	gcc/testsuite/
	* rust/compile/issue-1830_bytes.rs: Fix up DejaGnu directives.
	* rust/compile/issue-1830_str.rs: Likewise.
gcc/rust/Changelog:

	* hir/tree/rust-hir-full-test.cc: Moved to...
	* hir/tree/rust-hir.cc: ...here.
	* Make-lang.in: Rename rust-hir-full-test.

Signed-off-by: SainiAditya1 <Adityasaini10012001@outlook.com>
Fixes #1361

Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/testsuite/ChangeLog:

	* rust/compile/issue-1361.rs: New test.
gcc/rust/ChangeLog:

	* ast/rust-ast.h: Keep location in TraitItem base class
	* ast/rust-item.h (class TraitItemFunc): Use base class location instead.
	(class TraitItemMethod): Likewise.
	(class TraitItemConst): Likewise.
	(class TraitItemType): Likewise.
	* ast/rust-macro.h: Likewise.
The class now allows for more variants including a `Hint` one which
then gets emitted by calling `rust_inform`. This allows us to display
hints/tips/notes in backtracking contexts such as the parser.

gcc/rust/ChangeLog:

	* rust-diagnostics.h (struct Error): Add new Kind enum and various new
	static constructors to allow for hints as well.
	* rust-diagnostics.cc (Error::Error): Use new `kind` field properly.
	* checks/errors/privacy/rust-visibility-resolver.cc
	(VisibilityResolver::resolve_module_path): Use new Error API.
	* expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise.
	* expand/rust-macro-expand.cc (parse_many): Likewise.
	(transcribe_type): Likewise.
	* parse/rust-parse-impl.h (Parser::parse_crate): Likewise.
	* rust-session-manager.cc (Session::handle_crate_name): Likewise.
	* ast/rust-ast.cc (Module::load_items): Likewise.
Addresses #1567
Created a AST node InlineAsm similar to the one found in rustc.
As there is no Symbol struct/class in gccrs I have made every instance
of Symbol a string.

gcc/rust/ChangeLog:

	* ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.
	* ast/rust-expr.h (class InlineAsm):Added class definition.

Signed-off-by: M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h
	(Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h
	(Parser::parse_stmt): Handle unsafe expression statements.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-1422.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
In #2112 'Merge upstream, last commit before "Rust front-end update 2023-04-05"'
we merged commit 939fb3f from upstream GCC
master branch.

This one now merges the "Rust front-end update 2023-04-05", commits
939fb3f..d2a499a:

      - f66b135 gccrs: fatal_error_flag: Fix typo in error message
      - 776ff05 gccrs: unsafe: check use of `target_feature` attribute
      - d9e0570 gccrs: Check for mutable references in const functions
      - ef792b9 gccrs: rust: add bound parsing in parse_generic_arg.
      - e139423 gccrs: Implement declarative macro 2.0 parser
      - 3f1dbb2 gccrs: Add name resolution to generic argument associated item bindings
      - 7eab9d1 gccrs: Support associated type bound arguments
      - 364f4cd gccrs: Reuse TypeCheckPattern on LetStmt's
      - 8e2abbe gccrs: Add get_locus function for abstract class MetaItemInner.
      - 86f8e47 gccrs: diagnostics: Add underline for tokens in diagnostics.
      - 881ed7f gccrs: Change how CompileVarDecl outputs Bvariable's
      - 60affc3 gccrs: testsuite: Handle Windows carriage returns properly
      - 910e7e0 gccrs: Support GroupedPattern during name resolution
      - cb42610 gccrs: Do not crash on empty macros expand. Fixes #1712
      - 93fcadd gccrs: Add HIR lowering for GroupedPattern
      - d5a303c gccrs: Add get_item method for HIR::GroupedPattern
      - 83e5f63 gccrs: Add type resolution for grouped patterns
      - 221650c gccrs: Added missing GroupedPattern visitors for code generation
      - 9b19e93 gccrs: Rename file rust-ast-full-test.cc to rust-ast.cc
      - d6cb04b gccrs: moved operator.h to util/rust-operators.h
      - 760f529 gccrs: fixed compiler error message on wildcard pattern within expression
      - 8e7e682 gccrs: fixed indentations in AST pretty expanded dump of trait
      - 51b607c gccrs: macro: Allow builtin `MacroInvocation`s within the AST
      - ad9d75f gccrs: Create and use CompilePatternLet visitor for compiling let statments
      - 9cbd270 gccrs: parser: Allow parsing multiple reference types
      - 2dab57c gccrs: Move rust-buffered-queue.h to util folder #1766
      - fd7358a gccrs: Improve GroupedPattern lowering
      - 95efd84 gccrs: Remove HIR::GroupedPattern
      - 0e4bf6e gccrs: Optimize HIR::ReferencePattern
      - 86f53e5 gccrs: Implement lowering ReferencePattern from AST to HIR
      - 2af66eb gccrs: parser: Improve parsing of complex generic arguments
      - 7f5144d gccrs: parser: Fix parsing of closure param list
      - 476faea gccrs: Add  support for feature check.
      - 4141941 gccrs: Removed comment copy-pasted from gcc/tree.def
      - 8d1d08c gccrs: Add another test case for passing associated type-bounds
      - c1b1bbb gccrs: Move TypePredicateItem impl out of the header
      - 688fccb gccrs: Refactor TyVar and TypeBoundPredicates
      - e42118c gccrs: Refactor SubstitutionRef base class into its own CC file
      - 6abbfb5 gccrs: Refactor all substitution mapper code implementation into its own CC file
      - d73082e gccrs: Refactor BaseType, InferType and ErrorType impl into cc file
      - 26af4b0 gccrs: Refactor PathProbe into cc file
      - 547e511 gccrs: Refactor PathProbeType code into CC file
      - 615ee14 gccrs: Refactor all code out of the rust-tyty.h header
      - 6c4fa22 gccrs: Rename rust-tyctx.cc to rust-typecheck-context.cc
      - 1019fd6 gccrs: Rename header rust-hir-trait-ref.h to rust-hir-trait-reference.h
      - dcb2e57 gccrs: Refactor handle_substitutions to take a reference
      - 2f22857 gccrs: Clear the substitution callbacks when copying ArgumentMappings
      - 31f1e59 gccrs: Add missing param subst callback
      - e42c28b gccrs: Remove monomorphization hack to setup possible associated types
      - 68d671a gccrs: Refactor the type unification code
      - 2a2e671 gccrs: Fix nullptr dereference
      - f62dcf2 gccrs: Add missing Sized, Copy and Clone lang item mappings
      - 9754a60 gccrs: Fix higher ranked trait bounds computation of self
      - 11150b7 gccrs: Remove bad error message on checking function arguments
      - eb4a61a gccrs: Add general TypeBounds checks
      - fa7b3a2 gccrs: Add support for TuplePattern in let statements
      - 1c57244 gccrs: rust-item: include rust-expr.h
      - f548dde gccrs: parser: Expose parse_macro_invocation as public API
      - 2d30e0b gccrs: expansion: Add `get_token_slice` to `MacroInvocLexer` class
      - 3821669 gccrs: macros: Perform macro expansion in a fixed-point fashion.
      - fbd5244 gccrs: expander: Add documentation for `expand_eager_invocations`
      - 5fd0442 gccrs: typecheck: Refactor rust-hir-trait-reference.h
      - f64799a gccrs: cli: Update safety warning message
      - b4229fb gccrs: Update copyright years.
      - fd5eb9f gccrs: Add feature gate for "rust-intrinsic".
      - a9d72ef gccrs: Add variadic argument type checking
      - 8a9886a gccrs: Add test
      - e81f5be gccrs: Simplify WildcardPattern let statement handling
      - b56d093 gccrs: lex: Prevent directories in RAIIFile
      - 7b00a80 gccrs: testsuite: Add empty string macro test
      - 20529df gccrs: Add support for parsing empty tuple patterns.
      - fd406fc gccrs: Implemented UTF-8 checking for include_str!()
      - c627781 gccrs: Extract query_type from TypeCheckBase to be a simple extern
      - e90d06c gccrs: Add new virtual function HIR::ImplItem::get_impl_item_name
      - 4b25fc1 gccrs: Support for Sized builtin marker trait
      - a11b44b gccrs: Fix regression in testcase
      - ecdce2b gccrs: Add trailing newline
      - 8b0ed23 gccrs: builtins: Return empty list of tokens instead of nullptr
      - 6774d56 gccrs: Fix formatting
      - 8628486 gccrs: Add AST::AltPattern class
      - 0ec543c gccrs: Fix up DejaGnu directives in 'rust/compile/issue-1830_{bytes,str}.rs' test cases [#1838]
      - 1a58da7 gccrs: rename rust-hir-full-tests.cc
      - 3b342e1 gccrs: add test case to show our query-type system is working
      - fa7675d gccrs: ast: Refactor TraitItem to keep Location info
      - 2785d59 gccrs: diagnostic: Refactor Error class
      - f2d6ab8 gccrs: Added AST Node AST::InlineAsm
      - 990ae49 gccrs: Address unsafe with/without block handling ambiguity
      - d2a499a gccrs: Fix issue with parsing unsafe block expression statements

This merge is done with 'git merge --strategy=ours', so effectively doesn't
merge any changes.  Rationale: those commits are taken from GCC/Rust master
branch, and any remaining changes we'd either like to persist, or assess
individually, later.
@CohenArthur

Copy link
Copy Markdown
Member

The commit format checks are failing since some commits have a Changelog that appear after the commit signoff, which is fine and can be ignored

@tschwinge tschwinge merged commit 626dabb into master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.