Skip to content

Commit 127c253

Browse files
committed
save-analysis: don't include the crate name in fully qualified paths
1 parent 265a233 commit 127c253

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/librustc_trans/save/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use syntax::codemap::*;
4444
use syntax::parse::token::{self, get_ident, keywords};
4545
use syntax::owned_slice::OwnedSlice;
4646
use syntax::visit::{self, Visitor};
47-
use syntax::print::pprust::{path_to_string,ty_to_string};
47+
use syntax::print::pprust::{path_to_string, ty_to_string};
4848
use syntax::ptr::P;
4949

5050
use self::span_utils::SpanUtils;
@@ -123,7 +123,6 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
123123

124124
let mut result: Vec<(Span, String)> = vec!();
125125

126-
127126
let mut segs = vec!();
128127
for (seg, span) in path.segments.iter().zip(spans.iter()) {
129128
segs.push(seg.clone());
@@ -1568,8 +1567,7 @@ pub fn process_crate(sess: &Session,
15681567
SpanUtils {
15691568
sess: sess,
15701569
err_count: Cell::new(0)
1571-
},
1572-
cratename.clone()),
1570+
}),
15731571
span: SpanUtils {
15741572
sess: sess,
15751573
err_count: Cell::new(0)

src/librustc_trans/save/recorder.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ impl Recorder {
5050
pub struct FmtStrs<'a> {
5151
pub recorder: Box<Recorder>,
5252
span: SpanUtils<'a>,
53-
krate: String,
5453
}
5554

5655
macro_rules! s { ($e:expr) => { format!("{}", $e) }}
@@ -92,11 +91,10 @@ pub enum Row {
9291
}
9392

9493
impl<'a> FmtStrs<'a> {
95-
pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>, krate: String) -> FmtStrs<'a> {
94+
pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>) -> FmtStrs<'a> {
9695
FmtStrs {
9796
recorder: rec,
9897
span: span,
99-
krate: krate,
10098
}
10199
}
102100

@@ -177,16 +175,7 @@ impl<'a> FmtStrs<'a> {
177175
});
178176

179177
let pairs = fields.iter().zip(values);
180-
let strs = pairs.map(|(f, v)| format!(",{},\"{}\"", f, escape(
181-
if *f == "qualname" && v.len() > 0 {
182-
let mut n = self.krate.clone();
183-
n.push_str("::");
184-
n.push_str(v);
185-
n
186-
} else {
187-
String::from_str(v)
188-
}
189-
)));
178+
let strs = pairs.map(|(f, v)| format!(",{},\"{}\"", f, escape(String::from_str(v))));
190179
Some(strs.fold(String::new(), |mut s, ss| {
191180
s.push_str(&ss[]);
192181
s

0 commit comments

Comments
 (0)