Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccrs: improve mutability checks #3311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

gccrs: improve mutability checks #3311

wants to merge 1 commit into from

Conversation

philberty
Copy link
Member

This ensures that we handle var decls readonly checks much better

Addresses: #807 #3287

gcc/rust/ChangeLog:

* checks/errors/rust-readonly-check.cc (check_decl): improve mut check
(emit_error): helper
(check_modify_expr): likewise
(readonly_walk_fn): reuse helper
(ReadonlyCheck::Lint): cleanup context each run

gcc/testsuite/ChangeLog:

* rust/execute/torture/builtin_macro_include_bytes.rs: missing mut

@philberty philberty added bug diagnostic diagnostic static analysis labels Dec 18, 2024
@philberty philberty added this to the Remaining typecheck issues milestone Dec 18, 2024
This ensures that we handle var decls readonly checks much better

Addresses: #807 #3287

gcc/rust/ChangeLog:

	* checks/errors/rust-readonly-check.cc (check_decl): improve mut check
	(emit_error): helper
	(check_modify_expr): likewise
	(readonly_walk_fn): reuse helper
	(ReadonlyCheck::Lint): cleanup context each run

gcc/testsuite/ChangeLog:

	* rust/execute/torture/builtin_macro_include_bytes.rs: needs mut
	* rust/compile/mutability_checks1.rs: New test.

Signed-off-by: Philip Herron <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug diagnostic diagnostic static analysis
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant