From e47a980566050a290e1fbf9fb4792065ea772a47 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Sun, 17 Sep 2023 20:11:23 +0100 Subject: gccrs: port over readonly_error from c-family for lvalue assignment checks Fixes #2391 gcc/rust/ChangeLog: * Make-lang.in: fixup formatting * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): remove old check * rust-session-manager.cc (Session::compile_crate): call new lint * resolve/rust-ast-verify-assignee.h: Removed. * checks/errors/rust-readonly-check.cc: New file. * checks/errors/rust-readonly-check.h: New file. gcc/testsuite/ChangeLog: * rust/compile/wrong_lhs_assignment.rs: update error message * rust/compile/issue-2391.rs: New test. Signed-off-by: Philip Herron --- gcc/rust/Make-lang.in | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'gcc/rust/Make-lang.in') diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index 25ead23..85da9b2 100644 --- a/gcc/rust/Make-lang.in +++ b/gcc/rust/Make-lang.in @@ -86,12 +86,12 @@ GRS_OBJS = \ rust/rust-compile-resolve-path.o \ rust/rust-macro-expand.o \ rust/rust-cfg-strip.o \ - rust/rust-expand-visitor.o \ - rust/rust-ast-builder.o \ - rust/rust-derive.o \ - rust/rust-derive-clone.o \ - rust/rust-derive-copy.o \ - rust/rust-proc-macro.o \ + rust/rust-expand-visitor.o \ + rust/rust-ast-builder.o \ + rust/rust-derive.o \ + rust/rust-derive-clone.o \ + rust/rust-derive-copy.o \ + rust/rust-proc-macro.o \ rust/rust-macro-invoc-lexer.o \ rust/rust-proc-macro-invoc-lexer.o \ rust/rust-macro-substitute-ctx.o \ @@ -101,19 +101,19 @@ GRS_OBJS = \ rust/rust-attributes.o \ rust/rust-abi.o \ rust/rust-token-converter.o \ - rust/rust-macro.o \ + rust/rust-macro.o \ rust/rust-ast-lower.o \ rust/rust-ast-lower-base.o \ rust/rust-ast-lower-pattern.o \ rust/rust-ast-lower-item.o \ rust/rust-ast-lower-expr.o \ rust/rust-ast-lower-type.o \ - rust/rust-ast-lower-stmt.o \ - rust/rust-rib.o \ - rust/rust-name-resolution-context.o \ - rust/rust-default-resolver.o \ + rust/rust-ast-lower-stmt.o \ + rust/rust-rib.o \ + rust/rust-name-resolution-context.o \ + rust/rust-default-resolver.o \ rust/rust-toplevel-name-resolver-2.0.o \ - rust/rust-early-name-resolver-2.0.o \ + rust/rust-early-name-resolver-2.0.o \ rust/rust-early-name-resolver.o \ rust/rust-name-resolver.o \ rust/rust-ast-resolve.o \ @@ -160,6 +160,7 @@ GRS_OBJS = \ rust/rust-const-checker.o \ rust/rust-lint-marklive.o \ rust/rust-lint-unused-var.o \ + rust/rust-readonly-check.o \ rust/rust-hir-type-check-path.o \ rust/rust-unsafe-checker.o \ rust/rust-compile-intrinsic.o \ -- cgit v1.1