]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: session manager: Init Immutable name resolver.
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 24 Aug 2023 15:50:45 +0000 (17:50 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 14:52:24 +0000 (16:52 +0200)
gcc/rust/ChangeLog:

* rust-session-manager.cc (Session::compile_crate): Create an immutable
view of the name resolution context.

gcc/rust/rust-session-manager.cc

index 64e0190f716df9495017117ddde0f8f8667683a0..1c7e2766d710b09b35eea8c068a91415c67cd99b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "rust-session-manager.h"
 #include "rust-diagnostics.h"
+#include "rust-immutable-name-resolution-context.h"
 #include "rust-unsafe-checker.h"
 #include "rust-lex.h"
 #include "rust-parse.h"
@@ -659,6 +660,9 @@ Session::compile_crate (const char *filename)
   if (last_step == CompileOptions::CompileStep::TypeCheck)
     return;
 
+  // name resolution is done, we now freeze the name resolver for type checking
+  Resolver2_0::ImmutableNameResolutionContext::init (name_resolution_ctx);
+
   // type resolve
   Resolver::TypeResolution::Resolve (hir);