Skip to content

Commit 4c480ee

Browse files
committed
---
yaml --- r: 58307 b: refs/heads/auto c: 6da2c98 h: refs/heads/master i: 58305: ef0dc1e 58303: 91f1ef9 v: v3
1 parent 5501301 commit 4c480ee

Some content is hidden

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

74 files changed

+587
-618
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 912a352712b1b97009a11e3c3f7c4ba7360d9eaf
17+
refs/heads/auto: 6da2c989ba88dc4e6b49ddd086699404bf93916f
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/condition.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use prelude::*;
1414
use task;
15-
use task::local_data::{local_data_pop, local_data_set};
15+
use local_data::{local_data_pop, local_data_set};
1616

1717
// helper for transmutation, shown below.
1818
type RustClosure = (int, int);
@@ -24,14 +24,14 @@ pub struct Handler<T, U> {
2424

2525
pub struct Condition<'self, T, U> {
2626
name: &'static str,
27-
key: task::local_data::LocalDataKey<'self, Handler<T, U>>
27+
key: local_data::LocalDataKey<'self, Handler<T, U>>
2828
}
2929

3030
pub impl<'self, T, U> Condition<'self, T, U> {
3131
fn trap(&'self self, h: &'self fn(T) -> U) -> Trap<'self, T, U> {
3232
unsafe {
3333
let p : *RustClosure = ::cast::transmute(&h);
34-
let prev = task::local_data::local_data_get(self.key);
34+
let prev = local_data::local_data_get(self.key);
3535
let h = @Handler { handle: *p, prev: prev };
3636
Trap { cond: self, handler: h }
3737
}

branches/auto/src/libcore/core.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ pub mod trie;
215215
pub mod task;
216216
pub mod comm;
217217
pub mod pipes;
218+
pub mod local_data;
218219

219220

220221
/* Runtime and platform support */

branches/auto/src/libcore/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ fn overridden_arg_key(_v: @OverriddenArgs) {}
12081208
12091209
pub fn args() -> ~[~str] {
12101210
unsafe {
1211-
match task::local_data::local_data_get(overridden_arg_key) {
1211+
match local_data::local_data_get(overridden_arg_key) {
12121212
None => real_args(),
12131213
Some(args) => copy args.val
12141214
}
@@ -1218,7 +1218,7 @@ pub fn args() -> ~[~str] {
12181218
pub fn set_args(new_args: ~[~str]) {
12191219
unsafe {
12201220
let overridden_args = @OverriddenArgs { val: copy new_args };
1221-
task::local_data::local_data_set(overridden_arg_key, overridden_args);
1221+
local_data::local_data_set(overridden_arg_key, overridden_args);
12221222
}
12231223
}
12241224

branches/auto/src/libcore/prelude.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub use io;
8181
pub use iter;
8282
pub use old_iter;
8383
pub use libc;
84+
pub use local_data;
8485
pub use num;
8586
pub use ops;
8687
pub use option;

branches/auto/src/libcore/rand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ fn tls_rng_state(_v: @@mut IsaacRng) {}
836836
pub fn task_rng() -> @@mut IsaacRng {
837837
let r : Option<@@mut IsaacRng>;
838838
unsafe {
839-
r = task::local_data::local_data_get(tls_rng_state);
839+
r = local_data::local_data_get(tls_rng_state);
840840
}
841841
match r {
842842
None => {
843843
unsafe {
844844
let rng = @@mut IsaacRng::new_seeded(seed());
845-
task::local_data::local_data_set(tls_rng_state, rng);
845+
local_data::local_data_set(tls_rng_state, rng);
846846
rng
847847
}
848848
}

branches/auto/src/libcore/rt/local_services.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ mod test {
198198
199199
#[test]
200200
fn tls() {
201-
use task::local_data::*;
201+
use local_data::*;
202202
do run_in_newsched_task() {
203203
unsafe {
204204
fn key(_x: @~str) { }

branches/auto/src/libcore/task/local_data_priv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use cmp::Eq;
1515
use libc;
1616
use prelude::*;
1717
use task::rt;
18-
use task::local_data::LocalDataKey;
18+
use local_data::LocalDataKey;
1919

2020
use super::rt::rust_task;
2121
use rt::local_services::LocalStorage;

branches/auto/src/libcore/task/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use unstable::finally::Finally;
4747
#[cfg(test)] use comm::SharedChan;
4848

4949
mod local_data_priv;
50-
pub mod local_data;
5150
pub mod rt;
5251
pub mod spawn;
5352

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,8 @@ pub fn exported_name(sess: Session,
698698
vers: &str) -> ~str {
699699
return mangle(sess,
700700
vec::append_one(
701-
vec::append_one(path, path_name(sess.ident_of(hash.to_owned()))),
702-
path_name(sess.ident_of(vers.to_owned()))));
701+
vec::append_one(path, path_name(sess.ident_of(hash))),
702+
path_name(sess.ident_of(vers))));
703703
}
704704
705705
pub fn mangle_exported_name(ccx: @CrateContext,
@@ -717,14 +717,14 @@ pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
717717
let s = ppaux::ty_to_short_str(ccx.tcx, t);
718718
let hash = get_symbol_hash(ccx, t);
719719
return mangle(ccx.sess,
720-
~[path_name(ccx.sess.ident_of(name.to_owned())),
720+
~[path_name(ccx.sess.ident_of(name)),
721721
path_name(ccx.sess.ident_of(s)),
722-
path_name(ccx.sess.ident_of(hash.to_owned()))]);
722+
path_name(ccx.sess.ident_of(hash))]);
723723
}
724724
725725
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
726726
path: path,
727-
flav: ~str) -> ~str {
727+
flav: &str) -> ~str {
728728
return mangle(ccx.sess,
729729
vec::append_one(path, path_name((ccx.names)(flav))));
730730
}
@@ -733,7 +733,7 @@ pub fn mangle_internal_name_by_path(ccx: @CrateContext, path: path) -> ~str {
733733
return mangle(ccx.sess, path);
734734
}
735735
736-
pub fn mangle_internal_name_by_seq(ccx: @CrateContext, flav: ~str) -> ~str {
736+
pub fn mangle_internal_name_by_seq(ccx: @CrateContext, flav: &str) -> ~str {
737737
return fmt!("%s_%u", flav, (ccx.names)(flav).repr);
738738
}
739739

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ pub impl Session_ {
285285
fn str_of(@self, id: ast::ident) -> @~str {
286286
self.parse_sess.interner.get(id)
287287
}
288-
fn ident_of(@self, st: ~str) -> ast::ident {
289-
self.parse_sess.interner.intern(@st)
288+
fn ident_of(@self, st: &str) -> ast::ident {
289+
self.parse_sess.interner.intern(st)
290290
}
291291
fn intr(@self) -> @syntax::parse::token::ident_interner {
292292
self.parse_sess.interner

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn inject_libcore_ref(sess: Session,
4242
let n1 = sess.next_node_id();
4343
let vi1 = @ast::view_item {
4444
node: ast::view_item_extern_mod(
45-
sess.ident_of(~"core"), ~[], n1),
45+
sess.ident_of("core"), ~[], n1),
4646
attrs: ~[
4747
spanned(ast::attribute_ {
4848
style: ast::attr_inner,
@@ -78,8 +78,8 @@ fn inject_libcore_ref(sess: Session,
7878
span: dummy_sp(),
7979
global: false,
8080
idents: ~[
81-
sess.ident_of(~"core"),
82-
sess.ident_of(~"prelude")
81+
sess.ident_of("core"),
82+
sess.ident_of("prelude")
8383
],
8484
rp: None,
8585
types: ~[]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn mk_std(cx: &TestCtxt) -> @ast::view_item {
274274
let vers = nospan(vers);
275275
let mi = ast::meta_name_value(@~"vers", vers);
276276
let mi = nospan(mi);
277-
let id_std = cx.sess.ident_of(~"std");
277+
let id_std = cx.sess.ident_of("std");
278278
let vi = if is_std(cx) {
279279
ast::view_item_use(
280280
~[@nospan(ast::view_path_simple(id_std,
@@ -322,7 +322,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item {
322322
attr::mk_attr(attr::mk_word_item(@~"!resolve_unexported"));
323323

324324
let item = ast::item {
325-
ident: cx.sess.ident_of(~"__test"),
325+
ident: cx.sess.ident_of("__test"),
326326
attrs: ~[resolve_unexported_attr],
327327
id: cx.sess.next_node_id(),
328328
node: item_,

branches/auto/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn get_item_path(tcx: ty::ctxt, def: ast::def_id) -> ast_map::path {
7070
// FIXME #1920: This path is not always correct if the crate is not linked
7171
// into the root namespace.
7272
vec::append(~[ast_map::path_mod(tcx.sess.ident_of(
73-
/*bad*/copy *cdata.name))], path)
73+
*cdata.name))], path)
7474
}
7575

7676
pub enum found_ast {

branches/auto/src/librustc/metadata/decoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ fn item_path(intr: @ident_interner, item_doc: ebml::Doc) -> ast_map::path {
294294
for reader::docs(path_doc) |tag, elt_doc| {
295295
if tag == tag_path_elt_mod {
296296
let str = reader::doc_as_str(elt_doc);
297-
result.push(ast_map::path_mod(intr.intern(@str)));
297+
result.push(ast_map::path_mod(intr.intern(str)));
298298
} else if tag == tag_path_elt_name {
299299
let str = reader::doc_as_str(elt_doc);
300-
result.push(ast_map::path_name(intr.intern(@str)));
300+
result.push(ast_map::path_name(intr.intern(str)));
301301
} else {
302302
// ignore tag_path_len element
303303
}
@@ -311,7 +311,7 @@ fn item_name(intr: @ident_interner, item: ebml::Doc) -> ast::ident {
311311
do reader::with_doc_data(name) |data| {
312312
let string = str::from_bytes_slice(data);
313313
match intr.find_equiv(&StringRef(string)) {
314-
None => intr.intern(@(string.to_owned())),
314+
None => intr.intern(string),
315315
Some(val) => val,
316316
}
317317
}
@@ -828,7 +828,7 @@ pub fn get_type_name_if_impl(intr: @ident_interner,
828828
}
829829

830830
for reader::tagged_docs(item, tag_item_impl_type_basename) |doc| {
831-
return Some(intr.intern(@str::from_bytes(reader::doc_data(doc))));
831+
return Some(intr.intern(str::from_bytes(reader::doc_data(doc))));
832832
}
833833

834834
return None;
@@ -1080,7 +1080,7 @@ pub fn get_crate_deps(intr: @ident_interner, data: @~[u8]) -> ~[crate_dep] {
10801080
}
10811081
for reader::tagged_docs(depsdoc, tag_crate_dep) |depdoc| {
10821082
deps.push(crate_dep {cnum: crate_num,
1083-
name: intr.intern(@docstr(depdoc, tag_crate_dep_name)),
1083+
name: intr.intern(docstr(depdoc, tag_crate_dep_name)),
10841084
vers: @docstr(depdoc, tag_crate_dep_vers),
10851085
hash: @docstr(depdoc, tag_crate_dep_hash)});
10861086
crate_num += 1;

branches/auto/src/librustc/middle/astencode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ trait fake_ext_ctxt {
11631163
fn cfg(&self) -> ast::crate_cfg;
11641164
fn parse_sess(&self) -> @mut parse::ParseSess;
11651165
fn call_site(&self) -> span;
1166-
fn ident_of(&self, st: ~str) -> ast::ident;
1166+
fn ident_of(&self, st: &str) -> ast::ident;
11671167
}
11681168

11691169
#[cfg(test)]
@@ -1180,8 +1180,8 @@ impl fake_ext_ctxt for fake_session {
11801180
expn_info: None
11811181
}
11821182
}
1183-
fn ident_of(&self, st: ~str) -> ast::ident {
1184-
self.interner.intern(@st)
1183+
fn ident_of(&self, st: &str) -> ast::ident {
1184+
self.interner.intern(st)
11851185
}
11861186
}
11871187

branches/auto/src/librustc/middle/check_match.rs

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -822,65 +822,43 @@ pub fn check_legality_of_move_bindings(cx: @MatchCheckCtxt,
822822
}
823823
}
824824
825-
// Now check to ensure that any move binding is not behind an
826-
// @ or &, or within a struct with a destructor. This is
827-
// always illegal.
825+
// Now check to ensure that any move binding is not behind an @ or &.
826+
// This is always illegal.
828827
let vt = visit::mk_vt(@visit::Visitor {
829-
visit_pat: |pat, (behind_bad_pointer, behind_dtor_struct): (bool, bool), v| {
828+
visit_pat: |pat, behind_bad_pointer: bool, v| {
830829
match pat.node {
831830
pat_ident(_, _, sub) => {
832831
debug!("(check legality of move) checking pat \
833-
ident with behind_bad_pointer %? and behind_dtor_struct %?",
834-
behind_bad_pointer, behind_dtor_struct);
832+
ident with behind_bad_pointer %?",
833+
behind_bad_pointer);
835834
836-
if behind_bad_pointer || behind_dtor_struct &&
835+
if behind_bad_pointer &&
837836
cx.moves_map.contains(&pat.id)
838837
{
839-
let msg = if behind_bad_pointer {
840-
"by-move pattern bindings may not occur behind @ or & bindings"
841-
} else {
842-
"cannot bind by-move within struct (it has a destructor)"
843-
};
844-
cx.tcx.sess.span_err(pat.span, msg);
838+
cx.tcx.sess.span_err(
839+
pat.span,
840+
"by-move pattern \
841+
bindings may not occur \
842+
behind @ or & bindings");
845843
}
846844

847845
match sub {
848846
None => {}
849847
Some(subpat) => {
850-
(v.visit_pat)(subpat,
851-
(behind_bad_pointer, behind_dtor_struct),
852-
v);
848+
(v.visit_pat)(subpat, behind_bad_pointer, v);
853849
}
854850
}
855851
}
856852

857853
pat_box(subpat) | pat_region(subpat) => {
858-
(v.visit_pat)(subpat, (true, behind_dtor_struct), v);
854+
(v.visit_pat)(subpat, true, v);
859855
}
860856

861-
pat_struct(_, ref fields, _) => {
862-
let behind_dtor_struct = behind_dtor_struct ||
863-
(match cx.tcx.def_map.find(&pat.id) {
864-
Some(&def_struct(id)) => {
865-
ty::has_dtor(cx.tcx, id)
866-
}
867-
_ => false
868-
});
869-
debug!("(check legality of move) checking pat \
870-
struct with behind_bad_pointer %? and behind_dtor_struct %?",
871-
behind_bad_pointer, behind_dtor_struct);
872-
873-
for fields.each |fld| {
874-
(v.visit_pat)(fld.pat, (behind_bad_pointer,
875-
behind_dtor_struct), v)
876-
}
877-
}
878-
879-
_ => visit::visit_pat(pat, (behind_bad_pointer, behind_dtor_struct), v)
857+
_ => visit::visit_pat(pat, behind_bad_pointer, v)
880858
}
881859
},
882-
.. *visit::default_visitor::<(bool, bool)>()
860+
.. *visit::default_visitor::<bool>()
883861
});
884-
(vt.visit_pat)(*pat, (false, false), vt);
862+
(vt.visit_pat)(*pat, false, vt);
885863
}
886864
}

0 commit comments

Comments
 (0)