about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-02-07 17:34:40 +0400
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-02-13 00:10:15 +0400
commitfd73d01c98adb2adb570ab300ee0d5c4dc0eafca (patch)
tree40a6683bc5b00b53a154e41d05dc188ce9fb65ee /compiler/rustc_metadata/src
parent9080b79f2b4d5deccd4e0e6cdbb68780d7d12a58 (diff)
downloadrust-fd73d01c98adb2adb570ab300ee0d5c4dc0eafca.tar.gz
rust-fd73d01c98adb2adb570ab300ee0d5c4dc0eafca.zip
rustc_resolve: Remove `Resolver::clone_output`
And remove `Clone` impls and `Lrc`s that are no longer necessary
Diffstat (limited to 'compiler/rustc_metadata/src')
-rw-r--r--compiler/rustc_metadata/src/creader.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs
index bf8b8aa2ce4..c357f294279 100644
--- a/compiler/rustc_metadata/src/creader.rs
+++ b/compiler/rustc_metadata/src/creader.rs
@@ -8,7 +8,7 @@ use rustc_ast::expand::allocator::AllocatorKind;
 use rustc_ast::{self as ast, *};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::svh::Svh;
-use rustc_data_structures::sync::{Lrc, ReadGuard};
+use rustc_data_structures::sync::ReadGuard;
 use rustc_expand::base::SyntaxExtension;
 use rustc_hir::def_id::{CrateNum, LocalDefId, StableCrateId, LOCAL_CRATE};
 use rustc_hir::definitions::Definitions;
@@ -30,11 +30,10 @@ use proc_macro::bridge::client::ProcMacro;
 use std::ops::Fn;
 use std::path::Path;
 use std::time::Duration;
-use std::{cmp, env};
+use std::{cmp, env, iter};
 
-#[derive(Clone)]
 pub struct CStore {
-    metas: IndexVec<CrateNum, Option<Lrc<CrateMetadata>>>,
+    metas: IndexVec<CrateNum, Option<Box<CrateMetadata>>>,
     injected_panic_runtime: Option<CrateNum>,
     /// This crate needs an allocator and either provides it itself, or finds it in a dependency.
     /// If the above is true, then this field denotes the kind of the found allocator.
@@ -153,7 +152,7 @@ impl CStore {
 
     fn set_crate_data(&mut self, cnum: CrateNum, data: CrateMetadata) {
         assert!(self.metas[cnum].is_none(), "Overwriting crate metadata entry");
-        self.metas[cnum] = Some(Lrc::new(data));
+        self.metas[cnum] = Some(Box::new(data));
     }
 
     pub(crate) fn iter_crate_data(&self) -> impl Iterator<Item = (CrateNum, &CrateMetadata)> {
@@ -245,7 +244,7 @@ impl CStore {
             // order to make array indices in `metas` match with the
             // corresponding `CrateNum`. This first entry will always remain
             // `None`.
-            metas: IndexVec::from_elem_n(None, 1),
+            metas: IndexVec::from_iter(iter::once(None)),
             injected_panic_runtime: None,
             allocator_kind: None,
             alloc_error_handler_kind: None,