Skip to content

Commit 622c311

Browse files
committed
---
yaml --- r: 147819 b: refs/heads/try2 c: a52cdfd h: refs/heads/master i: 147817: 8a6d797 147815: 3c209e5 v: v3
1 parent c29a9a8 commit 622c311

File tree

16 files changed

+42
-92
lines changed

16 files changed

+42
-92
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 51ace54597984b221321d1cac0f80c50f9e00f71
8+
refs/heads/try2: a52cdfdfce58c3fda80d4503a2b198546f96b6c0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/driver/driver.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ extern mod this = "rustdoc";
1919
#[cfg(rustc)]
2020
extern mod this = "rustc";
2121

22+
#[cfg(rustdoc_ng)]
23+
extern mod this = "rustdoc_ng";
24+
2225
fn main() { this::main() }

branches/try2/src/etc/emacs/rust-mode.el

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@
5454
;; We don't want to indent out to the open bracket if the
5555
;; open bracket ends the line
5656
(when (not (looking-at "[[:blank:]]*\\(?://.*\\)?$"))
57-
(when (looking-at "[[:space:]]")
58-
(forward-word 1)
59-
(backward-word 1))
57+
(when (looking-at "[[:space:]]") (forward-to-word 1))
6058
(current-column))))
6159

6260
(defun rust-mode-indent-line ()

branches/try2/src/librustc/back/link.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use std::run;
3434
use std::str;
3535
use std::io;
3636
use std::io::fs;
37-
use extra::hex::ToHex;
3837
use extra::tempfile::TempDir;
3938
use syntax::abi;
4039
use syntax::ast;
@@ -491,10 +490,8 @@ pub fn build_link_meta(sess: Session,
491490
}
492491
}
493492

494-
fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
495-
let output = symbol_hasher.result_bytes();
496-
// 64 bits should be enough to avoid collisions.
497-
output.slice_to(8).to_hex()
493+
pub fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
494+
symbol_hasher.result_str()
498495
}
499496

500497

@@ -882,11 +879,8 @@ fn link_rlib(sess: Session,
882879
match trans {
883880
Some(trans) => {
884881
// Instead of putting the metadata in an object file section, rlibs
885-
// contain the metadata in a separate file. We use a temp directory
886-
// here so concurrent builds in the same directory don't try to use
887-
// the same filename for metadata (stomping over one another)
888-
let tmpdir = TempDir::new("rustc").expect("needs a temp dir");
889-
let metadata = tmpdir.path().join(METADATA_FILENAME);
882+
// contain the metadata in a separate file.
883+
let metadata = obj_filename.with_filename(METADATA_FILENAME);
890884
fs::File::create(&metadata).write(trans.metadata);
891885
a.add_file(&metadata, false);
892886
fs::unlink(&metadata);

branches/try2/src/librustc/driver/driver.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ pub fn host_triple() -> ~str {
686686
(env!("CFG_COMPILER")).to_owned()
687687
}
688688

689-
pub fn build_session_options(binary: @str,
689+
pub fn build_session_options(binary: ~str,
690690
matches: &getopts::Matches,
691691
demitter: @diagnostic::Emitter)
692692
-> @session::options {
@@ -1105,7 +1105,7 @@ pub fn build_output_filenames(input: &input,
11051105
}
11061106
}
11071107

1108-
pub fn early_error(emitter: @diagnostic::Emitter, msg: &str) -> ! {
1108+
pub fn early_error(emitter: &diagnostic::Emitter, msg: &str) -> ! {
11091109
emitter.emit(None, msg, diagnostic::fatal);
11101110
fail!();
11111111
}
@@ -1135,7 +1135,7 @@ mod test {
11351135
Err(f) => fail!("test_switch_implies_cfg_test: {}", f.to_err_msg())
11361136
};
11371137
let sessopts = build_session_options(
1138-
@"rustc",
1138+
~"rustc",
11391139
matches,
11401140
@diagnostic::DefaultEmitter as @diagnostic::Emitter);
11411141
let sess = build_session(sessopts,
@@ -1158,7 +1158,7 @@ mod test {
11581158
}
11591159
};
11601160
let sessopts = build_session_options(
1161-
@"rustc",
1161+
~"rustc",
11621162
matches,
11631163
@diagnostic::DefaultEmitter as @diagnostic::Emitter);
11641164
let sess = build_session(sessopts,

branches/try2/src/librustc/driver/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub struct options {
163163
// will be added to the crate AST node. This should not be used for
164164
// anything except building the full crate config prior to parsing.
165165
cfg: ast::CrateConfig,
166-
binary: @str,
166+
binary: ~str,
167167
test: bool,
168168
parse_only: bool,
169169
no_trans: bool,
@@ -395,7 +395,7 @@ pub fn basic_options() -> @options {
395395
target_cpu: ~"generic",
396396
target_feature: ~"",
397397
cfg: ~[],
398-
binary: @"rustc",
398+
binary: ~"rustc",
399399
test: false,
400400
parse_only: false,
401401
no_trans: false,

branches/try2/src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub fn describe_debug_flags() {
197197

198198
pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
199199
let mut args = args.to_owned();
200-
let binary = args.shift().to_managed();
200+
let binary = args.shift();
201201

202202
if args.is_empty() { usage(binary); return; }
203203

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
11401140
let impl_vtables = ty::lookup_impl_vtables(tcx, def_id);
11411141
encode_impl_vtables(ebml_w, ecx, &impl_vtables);
11421142
}
1143-
let elt = ast_map::impl_pretty_name(opt_trait, ty);
1143+
let elt = ast_map::impl_pretty_name(opt_trait, ty, item.ident);
11441144
encode_path(ecx, ebml_w, path, elt);
11451145
ebml_w.end_tag();
11461146

branches/try2/src/librustdoc/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn get_ast_and_resolve(cpath: &Path,
4949
let input = file_input(cpath.clone());
5050

5151
let sessopts = @driver::session::options {
52-
binary: @"rustdoc",
52+
binary: ~"rustdoc",
5353
maybe_sysroot: Some(@os::self_exe_path().unwrap().dir_path()),
5454
addl_lib_search_paths: @RefCell::new(libs),
5555
outputs: ~[driver::session::OutputDylib],

branches/try2/src/librustdoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
242242
}
243243

244244
// Load all plugins/passes into a PluginManager
245-
let path = matches.opt_str("plugin-path").unwrap_or(~"/tmp/rustdoc/plugins");
245+
let path = matches.opt_str("plugin-path").unwrap_or(~"/tmp/rustdoc_ng/plugins");
246246
let mut pm = plugins::PluginManager::new(Path::new(path));
247247
for pass in passes.iter() {
248248
let plugin = match PASSES.iter().position(|&(p, _, _)| p == *pass) {

branches/try2/src/librustdoc/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn run(input: &str, matches: &getopts::Matches) -> int {
3838
let libs = @RefCell::new(libs.move_iter().collect());
3939

4040
let sessopts = @session::options {
41-
binary: @"rustdoc",
41+
binary: ~"rustdoc",
4242
maybe_sysroot: Some(@os::self_exe_path().unwrap().dir_path()),
4343
addl_lib_search_paths: libs,
4444
outputs: ~[session::OutputDylib],
@@ -98,7 +98,7 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>) {
9898
let input = driver::str_input(test);
9999

100100
let sessopts = @session::options {
101-
binary: @"rustdoctest",
101+
binary: ~"rustdoctest",
102102
maybe_sysroot: Some(@os::self_exe_path().unwrap().dir_path()),
103103
addl_lib_search_paths: @RefCell::new(libs),
104104
outputs: ~[session::OutputExecutable],

branches/try2/src/librustpkg/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'a> PkgScript<'a> {
101101
workspace: &Path,
102102
id: &'a CrateId) -> PkgScript<'a> {
103103
// Get the executable name that was invoked
104-
let binary = os::args()[0].to_managed();
104+
let binary = os::args()[0].to_owned();
105105
// Build the rustc session data structures to pass
106106
// to the compiler
107107
debug!("pkgscript parse: {}", sysroot.display());

branches/try2/src/librustpkg/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ fn test_linker_build() {
18231823
let workspace = create_local_package(&p_id);
18241824
let workspace = workspace.path();
18251825
let matches = getopts([], optgroups());
1826-
let options = build_session_options(@"rustpkg",
1826+
let options = build_session_options(~"rustpkg",
18271827
matches.as_ref().unwrap(),
18281828
@diagnostic::DefaultEmitter as
18291829
@diagnostic::Emitter);

branches/try2/src/librustpkg/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub fn compile_input(context: &BuildContext,
189189
// Make the output directory if it doesn't exist already
190190
fs::mkdir_recursive(&out_dir, io::UserRWX);
191191

192-
let binary = os::args()[0].to_managed();
192+
let binary = os::args()[0].to_owned();
193193

194194
debug!("flags: {}", flags.connect(" "));
195195
debug!("cfgs: {}", cfgs.connect(" "));

branches/try2/src/libsyntax/ast_map.rs

Lines changed: 16 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -82,71 +82,26 @@ pub fn path_elt_to_str(pe: path_elt, itr: @ident_interner) -> ~str {
8282
}
8383
}
8484

85-
/// write a "pretty" version of `ty` to `out`. This is designed so
86-
/// that symbols of `impl`'d methods give some hint of where they came
87-
/// from, even if it's hard to read (previously they would all just be
88-
/// listed as `__extensions__::method_name::hash`, with no indication
89-
/// of the type).
90-
// XXX: these dollar signs and the names in general are actually a
91-
// relic of $ being one of the very few valid symbol names on
92-
// unix. These kinds of details shouldn't be exposed way up here
93-
// in the ast.
94-
fn pretty_ty(ty: &Ty, itr: @ident_interner, out: &mut ~str) {
95-
let (prefix, subty) = match ty.node {
96-
ty_uniq(ty) => ("$UP$", &*ty),
97-
ty_box(mt { ty, .. }) => ("$SP$", &*ty),
98-
ty_ptr(mt { ty, mutbl }) => (if mutbl == MutMutable {"$RPmut$"} else {"$RP$"},
99-
&*ty),
100-
ty_rptr(_, mt { ty, mutbl }) => (if mutbl == MutMutable {"$BPmut$"} else {"$BP$"},
101-
&*ty),
102-
103-
ty_vec(ty) => ("$VEC$", &*ty),
104-
ty_fixed_length_vec(ty, _) => ("$FIXEDVEC$", &*ty),
105-
106-
// these can't be represented as <prefix><contained ty>, so
107-
// need custom handling.
108-
ty_nil => { out.push_str("$NIL$"); return }
109-
ty_path(ref path, _, _) => {
110-
out.push_str(itr.get(path.segments.last().identifier.name));
111-
return
112-
}
113-
ty_tup(ref tys) => {
114-
out.push_str(format!("$TUP_{}$", tys.len()));
115-
for subty in tys.iter() {
116-
pretty_ty(*subty, itr, out);
117-
out.push_char('$');
118-
}
119-
return
120-
}
121-
122-
// meh, better than nothing.
123-
ty_bot => { out.push_str("$BOT$"); return }
124-
ty_closure(..) => { out.push_str("$CLOSURE$"); return }
125-
ty_bare_fn(..) => { out.push_str("$FN$"); return }
126-
ty_typeof(..) => { out.push_str("$TYPEOF$"); return }
127-
ty_infer(..) => { out.push_str("$INFER$"); return }
128-
129-
};
130-
131-
out.push_str(prefix);
132-
pretty_ty(subty, itr, out);
133-
}
134-
135-
pub fn impl_pretty_name(trait_ref: &Option<trait_ref>, ty: &Ty) -> path_elt {
85+
pub fn impl_pretty_name(trait_ref: &Option<trait_ref>,
86+
ty: &Ty, default: Ident) -> path_elt {
13687
let itr = get_ident_interner();
137-
88+
let ty_ident = match ty.node {
89+
ty_path(ref path, _, _) => path.segments.last().identifier,
90+
_ => default
91+
};
13892
let hash = (trait_ref, ty).hash();
139-
let mut pretty;
14093
match *trait_ref {
141-
None => pretty = ~"",
94+
None => path_pretty_name(ty_ident, hash),
14295
Some(ref trait_ref) => {
143-
pretty = itr.get(trait_ref.path.segments.last().identifier.name).to_owned();
144-
pretty.push_char('$');
96+
// XXX: this dollar sign is actually a relic of being one of the
97+
// very few valid symbol names on unix. These kinds of
98+
// details shouldn't be exposed way up here in the ast.
99+
let s = format!("{}${}",
100+
itr.get(trait_ref.path.segments.last().identifier.name),
101+
itr.get(ty_ident.name));
102+
path_pretty_name(Ident::new(itr.gensym(s)), hash)
145103
}
146-
};
147-
pretty_ty(ty, itr, &mut pretty);
148-
149-
path_pretty_name(Ident::new(itr.gensym(pretty)), hash)
104+
}
150105
}
151106

152107
#[deriving(Clone)]
@@ -310,7 +265,7 @@ impl Visitor<()> for Ctx {
310265
// Right now the ident on impls is __extensions__ which isn't
311266
// very pretty when debugging, so attempt to select a better
312267
// name to use.
313-
let elt = impl_pretty_name(maybe_trait, ty);
268+
let elt = impl_pretty_name(maybe_trait, ty, i.ident);
314269

315270
let impl_did = ast_util::local_def(i.id);
316271
for m in ms.iter() {

branches/try2/src/test/compile-fail/ambig_impl_unify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ trait foo {
1313
}
1414

1515
impl foo for ~[uint] {
16-
fn foo(&self) -> int {1} //~ NOTE candidate #1 is `foo$$UP$$VEC$uint::foo`
16+
fn foo(&self) -> int {1} //~ NOTE candidate #1 is `foo$__extensions__::foo`
1717
}
1818

1919
impl foo for ~[int] {
20-
fn foo(&self) -> int {2} //~ NOTE candidate #2 is `foo$$UP$$VEC$int::foo`
20+
fn foo(&self) -> int {2} //~ NOTE candidate #2 is `foo$__extensions__::foo`
2121
}
2222

2323
fn main() {

0 commit comments

Comments
 (0)