Arc -> Lrc

This commit is contained in:
klensy 2023-04-28 13:41:48 +03:00
parent a621ec35ae
commit 597c6514d1
2 changed files with 4 additions and 6 deletions

View File

@ -2,6 +2,7 @@
use hir::CRATE_HIR_ID;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;
use rustc_expand::base::resolve_path;
use rustc_hir as hir;
use rustc_hir::HirId;
@ -9,8 +10,6 @@ use rustc_middle::ty::TyCtxt;
use rustc_middle::{query::LocalCrate, ty::query::Providers};
use rustc_span::{sym, DebuggerVisualizerFile, DebuggerVisualizerType};
use std::sync::Arc;
use crate::errors::DebugVisualizerUnreadable;
fn check_for_debugger_visualizer(
@ -52,7 +51,7 @@ fn check_for_debugger_visualizer(
match std::fs::read(&file) {
Ok(contents) => {
debugger_visualizers
.insert(DebuggerVisualizerFile::new(Arc::from(contents), visualizer_type));
.insert(DebuggerVisualizerFile::new(Lrc::from(contents), visualizer_type));
}
Err(error) => {
tcx.sess.emit_err(DebugVisualizerUnreadable {

View File

@ -69,7 +69,6 @@ use std::hash::Hash;
use std::ops::{Add, Range, Sub};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::sync::Arc;
use md5::Digest;
use md5::Md5;
@ -1269,13 +1268,13 @@ pub enum DebuggerVisualizerType {
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable)]
pub struct DebuggerVisualizerFile {
/// The complete debugger visualizer source.
pub src: Arc<[u8]>,
pub src: Lrc<[u8]>,
/// Indicates which visualizer type this targets.
pub visualizer_type: DebuggerVisualizerType,
}
impl DebuggerVisualizerFile {
pub fn new(src: Arc<[u8]>, visualizer_type: DebuggerVisualizerType) -> Self {
pub fn new(src: Lrc<[u8]>, visualizer_type: DebuggerVisualizerType) -> Self {
DebuggerVisualizerFile { src, visualizer_type }
}
}