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

Merged
merged 1 commit into from
Jan 10, 2025
Merged

gccrs: improve mutability checks #3311

merged 1 commit into from
Jan 10, 2025

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

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]>
@philberty philberty added this pull request to the merge queue Jan 10, 2025
Merged via the queue into master with commit c957f18 Jan 10, 2025
12 checks passed
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: Done
Development

Successfully merging this pull request may close these issues.

1 participant