Skip to content

Commit

Permalink
Use !Sync std::lazy::OnceCell in usefulness checking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tmiasko committed Feb 15, 2021
1 parent d1206f9 commit 64b5b75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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>,
Expand Down

0 comments on commit 64b5b75

Please sign in to comment.