about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-02-18 15:57:27 +0900
committerGitHub <noreply@github.com>2021-02-18 15:57:27 +0900
commit9d33abdc2a1dce2f933b84fff4ea351216365ede (patch)
tree436566234f893d2a6299f22d5ac0125e8ed8735b /compiler
parent0c25d154bd5b48819f490ac4a630f28fcfe4d321 (diff)
parent64b5b75e65f010d88175fbb98b4396ccede5c32e (diff)
downloadrust-9d33abdc2a1dce2f933b84fff4ea351216365ede.tar.gz
rust-9d33abdc2a1dce2f933b84fff4ea351216365ede.zip
Rollup merge of #82155 - tmiasko:once, r=matthewjasper
Use !Sync std::lazy::OnceCell in usefulness checking

The `rustc_data_structures::sync::OnceCell` is thread-safe when building
a parallel compiler. This is unnecessary for the purposes of pattern
usefulness checking. Use `!Sync` `std::lazy::OnceCell` instead.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/usefulness.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
index 010fe4fd524..38b7e50d786 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
@@ -289,7 +289,6 @@ use super::{PatternFoldable, PatternFolder};
 
 use rustc_data_structures::captures::Captures;
 use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::sync::OnceCell;
 
 use rustc_arena::TypedArena;
 use rustc_hir::def_id::DefId;
@@ -300,6 +299,7 @@ use rustc_span::Span;
 use smallvec::{smallvec, SmallVec};
 use std::fmt;
 use std::iter::{FromIterator, IntoIterator};
+use std::lazy::OnceCell;
 
 crate struct MatchCheckCtxt<'a, 'tcx> {
     crate tcx: TyCtxt<'tcx>,