]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_interface/src/interface.rs
Rollup merge of #83571 - a1phyr:feature_const_slice_first_last, r=dtolnay
[rust.git] / compiler / rustc_interface / src / interface.rs
index 14bffb54e7a8e959d19c59a25d31667e59142abc..a1090ee316db48881a508485b2d1f31dd052f7ba 100644 (file)
@@ -181,7 +181,11 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R
     );
 
     if let Some(parse_sess_created) = config.parse_sess_created {
-        parse_sess_created(&mut Lrc::get_mut(&mut sess).unwrap().parse_sess);
+        parse_sess_created(
+            &mut Lrc::get_mut(&mut sess)
+                .expect("create_session() should never share the returned session")
+                .parse_sess,
+        );
     }
 
     let compiler = Compiler {