diff mbox series

[062/125] gccrs: session manager: Init Immutable name resolver.

Message ID 20240801145809.366388-64-arthur.cohen@embecosm.com
State New
Headers show
Series [001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work | expand

Commit Message

Arthur Cohen Aug. 1, 2024, 2:56 p.m. UTC
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 | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 64e0190f716..1c7e2766d71 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -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);