Replace Rc with Lrc for shared data

This commit is contained in:
John Kåre Alsaker
2018-02-27 17:11:14 +01:00
parent 878f5b0514
commit b74e97cf42
86 changed files with 435 additions and 413 deletions

View File

@@ -13,7 +13,7 @@ use errors::Handler;
use errors::emitter::EmitterWriter;
use std::io;
use std::io::prelude::*;
use std::rc::Rc;
use rustc_data_structures::sync::Lrc;
use std::str;
use std::sync::{Arc, Mutex};
use std::path::Path;
@@ -48,7 +48,7 @@ impl<T: Write> Write for Shared<T> {
fn test_harness(file_text: &str, span_labels: Vec<SpanLabel>, expected_output: &str) {
let output = Arc::new(Mutex::new(Vec::new()));
let code_map = Rc::new(CodeMap::new(FilePathMapping::empty()));
let code_map = Lrc::new(CodeMap::new(FilePathMapping::empty()));
code_map.new_filemap_and_lines(Path::new("test.rs"), &file_text);
let primary_span = make_span(&file_text, &span_labels[0].start, &span_labels[0].end);