1
Fork 0

Auto merge of #113573 - lcnr:typeck-results, r=compiler-errors

remove unnecessary `Rc`

the typeck results are already in a `RefCell`, so we don't need to wrap its fields in an `Rc`
This commit is contained in:
bors 2023-07-12 07:50:40 +00:00
commit 910be1b3e8
3 changed files with 8 additions and 15 deletions

View file

@ -7,11 +7,8 @@ use crate::{
GenericArgKind, InternalSubsts, SubstsRef, Ty, UserSubsts,
},
};
use rustc_data_structures::{
fx::{FxHashMap, FxIndexMap},
sync::Lrc,
unord::{UnordItems, UnordSet},
};
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
use rustc_data_structures::unord::{UnordItems, UnordSet};
use rustc_errors::ErrorGuaranteed;
use rustc_hir as hir;
use rustc_hir::{
@ -145,7 +142,7 @@ pub struct TypeckResults<'tcx> {
/// This is used for warning unused imports. During type
/// checking, this `Lrc` should not be cloned: it must have a ref-count
/// of 1 so that we can insert things into the set mutably.
pub used_trait_imports: Lrc<UnordSet<LocalDefId>>,
pub used_trait_imports: UnordSet<LocalDefId>,
/// If any errors occurred while type-checking this body,
/// this field will be set to `Some(ErrorGuaranteed)`.
@ -273,7 +270,7 @@ impl<'tcx> TypeckResults<'tcx> {
liberated_fn_sigs: Default::default(),
fru_field_types: Default::default(),
coercion_casts: Default::default(),
used_trait_imports: Lrc::new(Default::default()),
used_trait_imports: Default::default(),
tainted_by_errors: None,
concrete_opaque_types: Default::default(),
closure_min_captures: Default::default(),