Skip to content

Commit e1c3125

Browse files
committed
---
yaml --- r: 58301 b: refs/heads/auto c: 4400bbd h: refs/heads/master i: 58299: e2e9dc0 v: v3
1 parent f7397fa commit e1c3125

File tree

21 files changed

+31
-52
lines changed

21 files changed

+31
-52
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: f04eb37c7ea19bbd2cff12d15816873e0a46fc86
17+
refs/heads/auto: 4400bbd72a18b5f034a5c43c29af87e1e453c2cb
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/middle/resolve.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use syntax::attr::{attr_metas, contains_name, attrs_contains_name};
6464
use syntax::parse::token::ident_interner;
6565
use syntax::parse::token::special_idents;
6666
use syntax::print::pprust::path_to_str;
67-
use syntax::codemap::{span, dummy_sp, BytePos};
67+
use syntax::codemap::{span, dummy_sp};
6868
use syntax::visit::{default_visitor, mk_vt, Visitor, visit_block};
6969
use syntax::visit::{visit_crate, visit_expr, visit_expr_opt};
7070
use syntax::visit::{visit_foreign_item, visit_item};
@@ -2482,16 +2482,6 @@ pub impl Resolver {
24822482
TypeNS,
24832483
name_search_type) {
24842484
Failed => {
2485-
let segment_name = self.session.str_of(name);
2486-
let module_name = self.module_to_str(search_module);
2487-
if module_name == ~"???" {
2488-
self.session.span_err(span {lo: span.lo, hi: span.lo +
2489-
BytePos(str::len(*segment_name)), expn_info:
2490-
span.expn_info}, fmt!("unresolved import. maybe \
2491-
a missing 'extern mod %s'?",
2492-
*segment_name));
2493-
return Failed;
2494-
}
24952485
self.session.span_err(span, ~"unresolved name");
24962486
return Failed;
24972487
}

branches/auto/src/librustdoc/extract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use astsrv;
1414
use doc::ItemUtils;
1515
use doc;
1616

17-
use core::task::local_data::local_data_get;
17+
use core::local_data::local_data_get;
1818
use syntax::ast;
1919
use syntax;
2020

branches/auto/src/libstd/c_vec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn DtorRes(dtor: Option<@fn()>) -> DtorRes {
7878
* * base - A foreign pointer to a buffer
7979
* * len - The number of elements in the buffer
8080
*/
81-
pub unsafe fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
81+
pub fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
8282
return CVec{
8383
base: base,
8484
len: len,
@@ -97,7 +97,7 @@ pub unsafe fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
9797
* * dtor - A function to run when the value is destructed, useful
9898
* for freeing the buffer, etc.
9999
*/
100-
pub unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: @fn())
100+
pub fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: @fn())
101101
-> CVec<T> {
102102
return CVec{
103103
base: base,
@@ -138,7 +138,7 @@ pub fn set<T:Copy>(t: CVec<T>, ofs: uint, v: T) {
138138
pub fn len<T>(t: CVec<T>) -> uint { t.len }
139139

140140
/// Returns a pointer to the first element of the vector
141-
pub unsafe fn ptr<T>(t: CVec<T>) -> *mut T { t.base }
141+
pub fn ptr<T>(t: CVec<T>) -> *mut T { t.base }
142142

143143
#[cfg(test)]
144144
mod tests {
@@ -191,7 +191,7 @@ mod tests {
191191
#[test]
192192
fn test_and_I_mean_it() {
193193
let cv = malloc(16u as size_t);
194-
let p = unsafe { ptr(cv) };
194+
let p = ptr(cv);
195195

196196
set(cv, 0u, 32u8);
197197
set(cv, 1u, 33u8);

branches/auto/src/libstd/rl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ fn complete_key(_v: @CompletionCb) {}
6969

7070
/// Bind to the main completion callback
7171
pub unsafe fn complete(cb: CompletionCb) {
72-
task::local_data::local_data_set(complete_key, @(cb));
72+
local_data::local_data_set(complete_key, @(cb));
7373

7474
extern fn callback(line: *c_char, completions: *()) {
7575
unsafe {
76-
let cb = *task::local_data::local_data_get(complete_key)
76+
let cb = *local_data::local_data_get(complete_key)
7777
.get();
7878

7979
do cb(str::raw::from_c_str(line)) |suggestion| {

branches/auto/src/libstd/sort.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,11 +1211,11 @@ mod big_tests {
12111211
#[unsafe_destructor]
12121212
impl<'self> Drop for LVal<'self> {
12131213
fn finalize(&self) {
1214-
let x = unsafe { task::local_data::local_data_get(self.key) };
1214+
let x = unsafe { local_data::local_data_get(self.key) };
12151215
match x {
12161216
Some(@y) => {
12171217
unsafe {
1218-
task::local_data::local_data_set(self.key, @(y+1));
1218+
local_data::local_data_set(self.key, @(y+1));
12191219
}
12201220
}
12211221
_ => fail!(~"Expected key to work"),

branches/auto/src/libstd/sort_stage0.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,11 +1202,11 @@ mod big_tests {
12021202
#[unsafe_destructor]
12031203
impl<'self> Drop for LVal<'self> {
12041204
fn finalize(&self) {
1205-
let x = unsafe { task::local_data::local_data_get(self.key) };
1205+
let x = unsafe { local_data::local_data_get(self.key) };
12061206
match x {
12071207
Some(@y) => {
12081208
unsafe {
1209-
task::local_data::local_data_set(self.key, @(y+1));
1209+
local_data::local_data_set(self.key, @(y+1));
12101210
}
12111211
}
12121212
_ => fail!(~"Expected key to work"),

branches/auto/src/libsyntax/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<S:Encoder> Encodable<S> for ident {
7474
fn encode(&self, s: &mut S) {
7575
unsafe {
7676
let intr =
77-
match task::local_data::local_data_get(interner_key!()) {
77+
match local_data::local_data_get(interner_key!()) {
7878
None => fail!(~"encode: TLS interner not set up"),
7979
Some(intr) => intr
8080
};
@@ -87,7 +87,7 @@ impl<S:Encoder> Encodable<S> for ident {
8787
impl<D:Decoder> Decodable<D> for ident {
8888
fn decode(d: &mut D) -> ident {
8989
let intr = match unsafe {
90-
task::local_data::local_data_get(interner_key!())
90+
local_data::local_data_get(interner_key!())
9191
} {
9292
None => fail!(~"decode: TLS interner not set up"),
9393
Some(intr) => intr

branches/auto/src/libsyntax/parse/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ pub fn mk_fresh_ident_interner() -> @ident_interner {
462462
interner: interner::Interner::prefill(init_vec)
463463
};
464464
unsafe {
465-
task::local_data::local_data_set(interner_key!(), @rv);
465+
local_data::local_data_set(interner_key!(), @rv);
466466
}
467467
rv
468468
}
@@ -471,7 +471,7 @@ pub fn mk_fresh_ident_interner() -> @ident_interner {
471471
// fresh one.
472472
pub fn mk_ident_interner() -> @ident_interner {
473473
unsafe {
474-
match task::local_data::local_data_get(interner_key!()) {
474+
match local_data::local_data_get(interner_key!()) {
475475
Some(interner) => *interner,
476476
None => {
477477
mk_fresh_ident_interner()

branches/auto/src/test/compile-fail/core-tls-store-pointer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
// Testing that we can't store a borrowed pointer it task-local storage
1212

13-
use core::task::local_data::*;
13+
use core::local_data::*;
1414

1515
fn key(_x: @&int) { }
1616

1717
fn main() {
1818
unsafe {
1919
local_data_set(key, @&0); //~ ERROR does not fulfill `'static`
2020
}
21-
}
21+
}

branches/auto/src/test/compile-fail/issue-1697.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Testing that we don't fail abnormally after hitting the errors
1212

13-
use unresolved::*; //~ ERROR unresolved import. maybe a missing
13+
use unresolved::*; //~ ERROR unresolved name
1414
//~^ ERROR failed to resolve import
1515

1616
fn main() {

branches/auto/src/test/compile-fail/unresolved-import.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)