Skip to content

Commit a60e45b

Browse files
committed
---
yaml --- r: 47823 b: refs/heads/incoming c: 8a520ff h: refs/heads/master i: 47821: 1d8e5d0 47819: d8f27dd 47815: a54aa9c 47807: 8a63c33 v: v3
1 parent ca721b9 commit a60e45b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+995
-901
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 34c39bb1c41cd3af81b00654301f9a39c64b932d
9+
refs/heads/incoming: 8a520ff99fb2fe8e289d940dde27b7df645d6b3a
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/tutorial.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ for more information on them.
114114

115115
When complete, `make install` will place several programs into
116116
`/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
117-
API-documentation tool; `rustpkg`, the Rust package manager;
118-
`rusti`, the Rust REPL; and `rust`, a tool which acts both as a unified
119-
interface for them, and for a few common command line scenarios.
117+
API-documentation tool; `cargo`, the Rust package manager;
118+
and `rusti`, the Rust REPL.
120119

121120
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
122121
[tarball]: http://static.rust-lang.org/dist/rust-0.5.tar.gz
@@ -155,22 +154,6 @@ declaration to appear at the top level of the file: all statements must
155154
live inside a function. Rust programs can also be compiled as
156155
libraries, and included in other programs.
157156

158-
## Using the rust tool
159-
160-
While using `rustc` directly to generate your executables, and then
161-
running them manually is a perfectly valid way to test your code,
162-
for smaller projects, prototypes, or if you're a beginner, it might be
163-
more convenient to use the `rust` tool.
164-
165-
The `rust` tool provides central access to the other rust tools,
166-
as well as handy shortcuts for directly running source files.
167-
For example, if you have a file `foo.rs` in your current directory,
168-
`rust run foo.rs` would attempt to compile it and, if successful,
169-
directly run the resulting binary.
170-
171-
To get a list of all available commands, simply call `rust` without any
172-
argument.
173-
174157
## Editing Rust code
175158

176159
There are vim highlighting and indentation scripts in the Rust source
@@ -2201,7 +2184,7 @@ impl Circle for CircleStruct {
22012184
}
22022185
impl Shape for CircleStruct {
22032186
fn area(&self) -> float { pi * square(self.radius) }
2204-
}
2187+
}
22052188
~~~~
22062189

22072190
Notice that methods of `Circle` can call methods on `Shape`, as our

branches/incoming/src/libcore/to_str.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ impl ToStr for @str {
4343
pure fn to_str(&self) -> ~str { ::str::from_slice(*self) }
4444
}
4545

46+
// FIXME #4898: impl for one-tuples
47+
4648
impl<A: ToStr, B: ToStr> ToStr for (A, B) {
4749
#[inline(always)]
4850
pure fn to_str(&self) -> ~str {

branches/incoming/src/libcore/tuple.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ impl<A: Copy, B: Copy> ExtendedTupleOps<A,B> for (~[A], ~[B]) {
111111
}
112112
}
113113

114+
// FIXME #4898: impl for one-tuples
115+
114116
#[cfg(notest)]
115117
impl<A: Eq, B: Eq> Eq for (A, B) {
116118
#[inline(always)]

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,14 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
466466
let linkage_metas = attr::find_linkage_metas(c.node.attrs);
467467
attr::require_unique_names(sess.diagnostic(), linkage_metas);
468468
for linkage_metas.each |meta| {
469-
if attr::get_meta_item_name(*meta) == ~"name" {
469+
if *attr::get_meta_item_name(*meta) == ~"name" {
470470
match attr::get_meta_item_value_str(*meta) {
471471
// Changing attr would avoid the need for the copy
472472
// here
473473
Some(v) => { name = Some(v.to_managed()); }
474474
None => cmh_items.push(*meta)
475475
}
476-
} else if attr::get_meta_item_name(*meta) == ~"vers" {
476+
} else if *attr::get_meta_item_name(*meta) == ~"vers" {
477477
match attr::get_meta_item_value_str(*meta) {
478478
Some(v) => { vers = Some(v.to_managed()); }
479479
None => cmh_items.push(*meta)
@@ -487,27 +487,27 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
487487
fn crate_meta_extras_hash(symbol_hasher: &hash::State,
488488
-cmh_items: ~[@ast::meta_item],
489489
dep_hashes: ~[~str]) -> @str {
490-
fn len_and_str(s: ~str) -> ~str {
491-
return fmt!("%u_%s", str::len(s), s);
490+
fn len_and_str(s: &str) -> ~str {
491+
fmt!("%u_%s", s.len(), s)
492492
}
493493

494494
fn len_and_str_lit(l: ast::lit) -> ~str {
495-
return len_and_str(pprust::lit_to_str(@l));
495+
len_and_str(pprust::lit_to_str(@l))
496496
}
497497

498498
let cmh_items = attr::sort_meta_items(cmh_items);
499499

500500
fn hash(symbol_hasher: &hash::State, m: &@ast::meta_item) {
501501
match m.node {
502-
ast::meta_name_value(ref key, value) => {
503-
symbol_hasher.write_str(len_and_str((*key)));
502+
ast::meta_name_value(key, value) => {
503+
symbol_hasher.write_str(len_and_str(*key));
504504
symbol_hasher.write_str(len_and_str_lit(value));
505505
}
506-
ast::meta_word(ref name) => {
507-
symbol_hasher.write_str(len_and_str((*name)));
506+
ast::meta_word(name) => {
507+
symbol_hasher.write_str(len_and_str(*name));
508508
}
509-
ast::meta_list(ref name, ref mis) => {
510-
symbol_hasher.write_str(len_and_str((*name)));
509+
ast::meta_list(name, ref mis) => {
510+
symbol_hasher.write_str(len_and_str(*name));
511511
for mis.each |m_| {
512512
hash(symbol_hasher, m_);
513513
}
@@ -615,7 +615,7 @@ pub fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> @str {
615615
616616
// Name sanitation. LLVM will happily accept identifiers with weird names, but
617617
// gas doesn't!
618-
pub fn sanitize(s: ~str) -> ~str {
618+
pub fn sanitize(s: &str) -> ~str {
619619
let mut result = ~"";
620620
for str::chars_each(s) |c| {
621621
match c {
@@ -629,10 +629,10 @@ pub fn sanitize(s: ~str) -> ~str {
629629
'a' .. 'z'
630630
| 'A' .. 'Z'
631631
| '0' .. '9'
632-
| '_' => str::push_char(&mut result, c),
632+
| '_' => result.push_char(c),
633633
_ => {
634634
if c > 'z' && char::is_XID_continue(c) {
635-
str::push_char(&mut result, c);
635+
result.push_char(c);
636636
}
637637
}
638638
}
@@ -655,7 +655,7 @@ pub fn mangle(sess: Session, ss: path) -> ~str {
655655

656656
for ss.each |s| {
657657
match *s { path_name(s) | path_mod(s) => {
658-
let sani = sanitize(sess.str_of(s));
658+
let sani = sanitize(*sess.str_of(s));
659659
n += fmt!("%u%s", str::len(sani), sani);
660660
} }
661661
}

branches/incoming/src/librustc/driver/driver.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn anon_src() -> ~str { ~"<anon>" }
6262
6363
pub fn source_name(input: input) -> ~str {
6464
match input {
65-
file_input(ref ifile) => (*ifile).to_str(),
65+
file_input(ref ifile) => ifile.to_str(),
6666
str_input(_) => anon_src()
6767
}
6868
}
@@ -97,24 +97,24 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
9797
};
9898

9999
return ~[ // Target bindings.
100-
attr::mk_word_item(str::from_slice(os::FAMILY)),
101-
mk(~"target_os", tos),
102-
mk(~"target_family", str::from_slice(os::FAMILY)),
103-
mk(~"target_arch", arch),
104-
mk(~"target_endian", end),
105-
mk(~"target_word_size", wordsz),
106-
mk(~"target_libc", libc),
100+
attr::mk_word_item(@str::from_slice(os::FAMILY)),
101+
mk(@~"target_os", @tos),
102+
mk(@~"target_family", @str::from_slice(os::FAMILY)),
103+
mk(@~"target_arch", @arch),
104+
mk(@~"target_endian", @end),
105+
mk(@~"target_word_size", @wordsz),
106+
mk(@~"target_libc", @libc),
107107
// Build bindings.
108-
mk(~"build_compiler", argv0),
109-
mk(~"build_input", source_name(input))];
108+
mk(@~"build_compiler", @argv0),
109+
mk(@~"build_input", @source_name(input))];
110110
}
111111

112112
pub fn append_configuration(+cfg: ast::crate_cfg, +name: ~str)
113113
-> ast::crate_cfg {
114114
if attr::contains_name(cfg, name) {
115-
return cfg;
115+
cfg
116116
} else {
117-
return vec::append_one(cfg, attr::mk_word_item(name));
117+
vec::append_one(cfg, attr::mk_word_item(@name))
118118
}
119119
}
120120

@@ -142,7 +142,7 @@ pub fn parse_cfgspecs(cfgspecs: ~[~str]) -> ast::crate_cfg {
142142
// meta_word variant.
143143
let mut words = ~[];
144144
for cfgspecs.each |s| {
145-
words.push(attr::mk_word_item(/*bad*/copy *s));
145+
words.push(attr::mk_word_item(@/*bad*/copy *s));
146146
}
147147
return words;
148148
}
@@ -541,11 +541,11 @@ pub fn build_session_options(+binary: ~str,
541541
let flags = vec::append(getopts::opt_strs(matches, level_short),
542542
getopts::opt_strs(matches, level_name));
543543
for flags.each |lint_name| {
544-
let lint_name = str::replace(*lint_name, ~"-", ~"_");
544+
let lint_name = @str::replace(*lint_name, ~"-", ~"_");
545545
match lint_dict.find(&lint_name) {
546546
None => {
547547
early_error(demitter, fmt!("unknown %s flag: %s",
548-
level_name, lint_name));
548+
level_name, *lint_name));
549549
}
550550
Some(lint) => {
551551
lint_opts.push((lint.lint, *level));

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ pub impl Session {
253253
self.debugging_opt(no_monomorphic_collapse)
254254
}
255255

256-
fn str_of(id: ast::ident) -> ~str {
257-
/*bad*/copy *self.parse_sess.interner.get(id)
256+
fn str_of(id: ast::ident) -> @~str {
257+
self.parse_sess.interner.get(id)
258258
}
259259
fn ident_of(+st: ~str) -> ast::ident {
260260
self.parse_sess.interner.intern(@st)
@@ -310,7 +310,7 @@ pub fn building_library(req_crate_type: crate_type,
310310
match syntax::attr::first_attr_value_str_by_name(
311311
crate.node.attrs,
312312
~"crate_type") {
313-
option::Some(~"lib") => true,
313+
Some(@~"lib") => true,
314314
_ => false
315315
}
316316
}
@@ -346,7 +346,7 @@ pub mod test {
346346
style: ast::attr_outer,
347347
value: codemap::respan(codemap::dummy_sp(),
348348
ast::meta_name_value(
349-
~"crate_type",
349+
@~"crate_type",
350350
codemap::respan(codemap::dummy_sp(),
351351
ast::lit_str(@t)))),
352352
is_sugared_doc: false

branches/incoming/src/librustc/front/core_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn inject_libcore_ref(sess: Session,
5151
spanned(ast::attribute_ {
5252
style: ast::attr_inner,
5353
value: spanned(ast::meta_name_value(
54-
~"vers",
54+
@~"vers",
5555
spanned(ast::lit_str(@CORE_VERSION.to_str()))
5656
)),
5757
is_sugared_doc: false

branches/incoming/src/librustc/front/test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn modify_for_testing(sess: session::Session,
5757
// configuration, either with the '--test' or '--cfg test'
5858
// command line options.
5959
let should_test = attr::contains(crate.node.config,
60-
attr::mk_word_item(~"test"));
60+
attr::mk_word_item(@~"test"));
6161

6262
if should_test {
6363
generate_test_harness(sess, crate)
@@ -111,7 +111,7 @@ fn fold_mod(cx: @mut TestCtxt,
111111
fn nomain(cx: @mut TestCtxt, item: @ast::item) -> @ast::item {
112112
if !*cx.sess.building_library {
113113
@ast::item{attrs: item.attrs.filtered(|attr| {
114-
attr::get_attr_name(*attr) != ~"main"
114+
*attr::get_attr_name(attr) != ~"main"
115115
}),.. copy *item}
116116
} else { item }
117117
}
@@ -262,7 +262,7 @@ mod __test {
262262
fn mk_std(cx: &TestCtxt) -> @ast::view_item {
263263
let vers = ast::lit_str(@~"0.6");
264264
let vers = nospan(vers);
265-
let mi = ast::meta_name_value(~"vers", vers);
265+
let mi = ast::meta_name_value(@~"vers", vers);
266266
let mi = nospan(mi);
267267
let id_std = cx.sess.ident_of(~"std");
268268
let vi = if is_std(cx) {
@@ -310,7 +310,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item {
310310

311311
// This attribute tells resolve to let us call unexported functions
312312
let resolve_unexported_attr =
313-
attr::mk_attr(attr::mk_word_item(~"!resolve_unexported"));
313+
attr::mk_attr(attr::mk_word_item(@~"!resolve_unexported"));
314314

315315
let item = ast::item {
316316
ident: cx.sess.ident_of(~"__test"),
@@ -366,7 +366,7 @@ fn is_std(cx: &TestCtxt) -> bool {
366366
let is_std = {
367367
let items = attr::find_linkage_metas(cx.crate.node.attrs);
368368
match attr::last_meta_item_value_str_by_name(items, ~"name") {
369-
Some(~"std") => true,
369+
Some(@~"std") => true,
370370
_ => false
371371
}
372372
};

0 commit comments

Comments
 (0)