]> git.ipfire.org Git - thirdparty/gcc.git/commit
Prevent getting immutable context with classic nr
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 13 Mar 2024 15:44:00 +0000 (16:44 +0100)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Tue, 26 Mar 2024 17:35:02 +0000 (17:35 +0000)
commita63f0ac77e448551b7320dac3acfb0a6331d6fe9
treed3d559014999969648993b5d30ecd33c41c6f154
parent0874163bbf8b13350ec20bcba766d436147bbfa5
Prevent getting immutable context with classic nr

Immutable name resolution context is not initialized when the classic
name resolution is in use. It can therefore not be used, the getter would
error out.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
Only get immutable name resolution context when name resolution 2.0 is
used.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/rust/typecheck/rust-hir-type-check-type.cc