gccrs: Check for mutable references in const functions
authorDave <dme2223@gmail.com>
Mon, 19 Dec 2022 16:59:00 +0000 (10:59 -0600)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:16 +0000 (10:47 +0200)
commitd9e05700ac3085f29e95d53b3ec59c22adbc7c71
treeeb8b097393929fe9fd7ce3ef4abe4405085bb67c
parent776ff053800ad989564b0b3c2904fb072abaf422
gccrs: Check for mutable references in const functions

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/checks/errors/rust-const-checker.cc
gcc/testsuite/rust/compile/const10.rs [new file with mode: 0644]