]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: 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)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 14:52:28 +0000 (16:52 +0200)
commit215139e7e81edb17447a97f7612b581eeedf8f20
tree3aada3d61554104300f959511cf95583eb71f93a
parentb87c06fd351e0df489ac451b2b2a8c3c3c44ec72
gccrs: 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