aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-tree.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-08-23 16:31:55 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-12-13 14:00:06 +0100
commit5215235f01665062fbe182bb0c3c49539d882ad7 (patch)
tree54c3845668c1c679b56ea69585805ef6a7d5ac3b /gcc/rust/backend/rust-tree.h
parentb1b35204d8a186a6fadc8534e99e9161892192ac (diff)
downloadgcc-5215235f01665062fbe182bb0c3c49539d882ad7.zip
gcc-5215235f01665062fbe182bb0c3c49539d882ad7.tar.gz
gcc-5215235f01665062fbe182bb0c3c49539d882ad7.tar.bz2
gccrs: Add const checker
Similarly to the unsafe checker, constant evaluation can only be performed in a few contexts and include restrictions on the Rust language. Should the user fail to uphold those conditions, errors will be reported and the compilation pipeline interrupted. These contexts are as follow: - Array type length expressions - Array repeat length expressions - Constants - Statics - Enum discriminants - Const generic arguments In these contexts, the user is restricted to calling only functions marked as `const` or perform arithmetic operations only on certain types, among other restrictions. gcc/rust/ * checks/errors/rust-const-checker.cc: New. * checks/errors/rust-const-checker.h: New.
Diffstat (limited to 'gcc/rust/backend/rust-tree.h')
0 files changed, 0 insertions, 0 deletions