File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -497,13 +497,15 @@ impl<T> Once<T> {
497497 /// If the value was already initialized the closure is not called and `false` is returned,
498498 /// otherwise if the value from the closure initializes the inner value, `true` is returned
499499 #[ inline]
500- pub fn init_locking < F : FnOnce ( ) -> T > ( & self , f : F ) -> bool {
501- let mut lock = self . 0 . lock ( ) ;
502- if lock. is_some ( ) {
503- return false ;
500+ pub fn init_locking < F : FnOnce ( ) -> T > ( & self , f : F ) -> & T {
501+ {
502+ let mut lock = self . 0 . lock ( ) ;
503+ if lock. is_none ( ) {
504+ * lock = Some ( f ( ) ) ;
505+ }
504506 }
505- * lock = Some ( f ( ) ) ;
506- true
507+
508+ self . borrow ( )
507509 }
508510
509511 /// Tries to initialize the inner value by calling the closure without ensuring that no-one
Original file line number Diff line number Diff line change @@ -1351,9 +1351,7 @@ impl<'a, 'tcx> CrateMetadata {
13511351 translated_source_file : local_version,
13521352 }
13531353 } ) . collect ( )
1354- } ) ;
1355-
1356- self . source_map_import_info . borrow ( )
1354+ } )
13571355 }
13581356
13591357 /// Get the `DepNodeIndex` corresponding this crate. The result of this
You can’t perform that action at this time.
0 commit comments