Skip to content

Commit 18652fd

Browse files
michaelwoeristernikomatsakis
authored andcommitted
---
yaml --- r: 276471 b: refs/heads/try c: 606c985 h: refs/heads/master i: 276469: e5e2753 276467: a4670b9 276463: 299b252
1 parent 9d12c21 commit 18652fd

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 5027a79279353ca86d7ebb1f3fb9cc03361b84b4
4+
refs/heads/try: 606c985a50c588a320efb1441471589211744f56
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/middle/cstore.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ use syntax::ast_util::{IdVisitingOperation};
4242
use syntax::attr;
4343
use syntax::codemap::Span;
4444
use syntax::ptr::P;
45+
use syntax::parse::token::InternedString;
4546
use rustc_back::target::Target;
4647
use rustc_front::hir;
4748
use rustc_front::intravisit::Visitor;
@@ -203,7 +204,7 @@ pub trait CrateStore<'tcx> : Any {
203204
fn is_explicitly_linked(&self, cnum: ast::CrateNum) -> bool;
204205
fn is_allocator(&self, cnum: ast::CrateNum) -> bool;
205206
fn crate_attrs(&self, cnum: ast::CrateNum) -> Vec<ast::Attribute>;
206-
fn crate_name(&self, cnum: ast::CrateNum) -> String;
207+
fn crate_name(&self, cnum: ast::CrateNum) -> InternedString;
207208
fn crate_hash(&self, cnum: ast::CrateNum) -> Svh;
208209
fn crate_struct_field_attrs(&self, cnum: ast::CrateNum)
209210
-> FnvHashMap<DefId, Vec<ast::Attribute>>;
@@ -382,7 +383,7 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
382383
fn is_allocator(&self, cnum: ast::CrateNum) -> bool { unimplemented!() }
383384
fn crate_attrs(&self, cnum: ast::CrateNum) -> Vec<ast::Attribute>
384385
{ unimplemented!() }
385-
fn crate_name(&self, cnum: ast::CrateNum) -> String { unimplemented!() }
386+
fn crate_name(&self, cnum: ast::CrateNum) -> InternedString { unimplemented!() }
386387
fn crate_hash(&self, cnum: ast::CrateNum) -> Svh { unimplemented!() }
387388
fn crate_struct_field_attrs(&self, cnum: ast::CrateNum)
388389
-> FnvHashMap<DefId, Vec<ast::Attribute>>

branches/try/src/librustc/middle/ty/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,14 +2680,15 @@ impl<'tcx> TyCtxt<'tcx> {
26802680
{
26812681
dep_graph::visit_all_items_in_krate(self, dep_node_fn, visitor);
26822682
}
2683+
26832684
/// Looks up the span of `impl_did` if the impl is local; otherwise returns `Err`
26842685
/// with the name of the crate containing the impl.
2685-
pub fn span_of_impl(&self, impl_did: DefId) -> Result<Span, String> {
2686+
pub fn span_of_impl(&self, impl_did: DefId) -> Result<Span, InternedString> {
26862687
if impl_did.is_local() {
26872688
let node_id = self.map.as_local_node_id(impl_did).unwrap();
26882689
Ok(self.map.span(node_id))
26892690
} else {
2690-
Err(self.sess.cstore.crate_name(impl_did.krate))
2691+
Err(self.crate_name(impl_did.krate))
26912692
}
26922693
}
26932694
}

branches/try/src/librustc_metadata/csearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore {
334334
decoder::get_crate_attributes(self.get_crate_data(cnum).data())
335335
}
336336

337-
fn crate_name(&self, cnum: ast::CrateNum) -> String
337+
fn crate_name(&self, cnum: ast::CrateNum) -> token::InternedString
338338
{
339-
self.get_crate_data(cnum).name.clone()
339+
token::intern_and_get_ident(&self.get_crate_data(cnum).name[..])
340340
}
341341

342342
fn crate_hash(&self, cnum: ast::CrateNum) -> Svh

branches/try/src/librustc_trans/save/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
9090

9191
for n in self.tcx.sess.cstore.crates() {
9292
result.push(CrateData {
93-
name: self.tcx.sess.cstore.crate_name(n),
93+
name: (&self.tcx.sess.cstore.crate_name(n)[..]).to_owned(),
9494
number: n,
9595
});
9696
}

branches/try/src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl Clean<ExternalCrate> for CrateNum {
241241
}
242242
});
243243
ExternalCrate {
244-
name: cx.sess().cstore.crate_name(self.0),
244+
name: (&cx.sess().cstore.crate_name(self.0)[..]).to_owned(),
245245
attrs: cx.sess().cstore.crate_attrs(self.0).clean(cx),
246246
primitives: primitives,
247247
}

0 commit comments

Comments
 (0)