Skip to content

Commit dcc2625

Browse files
committed
---
yaml --- r: 63675 b: refs/heads/snap-stage3 c: 0d471d3 h: refs/heads/master i: 63673: d8df1f8 63671: 4f1ff48 v: v3
1 parent 5aa0905 commit dcc2625

Some content is hidden

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

60 files changed

+112
-251
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4967bd0508a4d04797e0fff49517b7abbc086b74
4+
refs/heads/snap-stage3: 0d471d310ded00283338ae28350b304e0f36e562
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/resolve.rs

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ pub enum Namespace {
101101
ValueNS
102102
}
103103

104-
#[deriving(Eq)]
105-
pub enum NamespaceError {
106-
NoError,
107-
ModuleError,
108-
TypeError,
109-
ValueError
110-
}
111-
112104
/// A NamespaceResult represents the result of resolving an import in
113105
/// a particular namespace. The result is either definitely-resolved,
114106
/// definitely- unresolved, or unknown.
@@ -767,12 +759,10 @@ pub fn PrimitiveTypeTable() -> PrimitiveTypeTable {
767759
}
768760

769761

770-
pub fn namespace_error_to_str(ns: NamespaceError) -> &'static str {
762+
pub fn namespace_to_str(ns: Namespace) -> ~str {
771763
match ns {
772-
NoError => "",
773-
ModuleError => "module",
774-
TypeError => "type",
775-
ValueError => "value",
764+
TypeNS => ~"type",
765+
ValueNS => ~"value",
776766
}
777767
}
778768

@@ -1003,25 +993,21 @@ impl Resolver {
1003993
// * If no duplicate checking was requested at all, do
1004994
// nothing.
1005995

1006-
let mut duplicate_type = NoError;
996+
let mut is_duplicate = false;
1007997
let ns = match duplicate_checking_mode {
1008998
ForbidDuplicateModules => {
1009-
if (child.get_module_if_available().is_some()) {
1010-
duplicate_type = ModuleError;
1011-
}
999+
is_duplicate = child.get_module_if_available().is_some();
10121000
Some(TypeNS)
10131001
}
10141002
ForbidDuplicateTypes => {
10151003
match child.def_for_namespace(TypeNS) {
10161004
Some(def_mod(_)) | None => {}
1017-
Some(_) => duplicate_type = TypeError
1005+
Some(_) => is_duplicate = true
10181006
}
10191007
Some(TypeNS)
10201008
}
10211009
ForbidDuplicateValues => {
1022-
if child.defined_in_namespace(ValueNS) {
1023-
duplicate_type = ValueError;
1024-
}
1010+
is_duplicate = child.defined_in_namespace(ValueNS);
10251011
Some(ValueNS)
10261012
}
10271013
ForbidDuplicateTypesAndValues => {
@@ -1030,31 +1016,31 @@ impl Resolver {
10301016
Some(def_mod(_)) | None => {}
10311017
Some(_) => {
10321018
n = Some(TypeNS);
1033-
duplicate_type = TypeError;
1019+
is_duplicate = true;
10341020
}
10351021
};
10361022
if child.defined_in_namespace(ValueNS) {
1037-
duplicate_type = ValueError;
1023+
is_duplicate = true;
10381024
n = Some(ValueNS);
10391025
}
10401026
n
10411027
}
10421028
OverwriteDuplicates => None
10431029
};
1044-
if (duplicate_type != NoError) {
1030+
if is_duplicate {
10451031
// Return an error here by looking up the namespace that
10461032
// had the duplicate.
10471033
let ns = ns.unwrap();
10481034
self.session.span_err(sp,
10491035
fmt!("duplicate definition of %s `%s`",
1050-
namespace_error_to_str(duplicate_type),
1036+
namespace_to_str(ns),
10511037
self.session.str_of(name)));
10521038
{
10531039
let r = child.span_for_namespace(ns);
10541040
for r.iter().advance |sp| {
10551041
self.session.span_note(*sp,
1056-
fmt!("first definition of %s `%s` here",
1057-
namespace_error_to_str(duplicate_type),
1042+
fmt!("first definition of %s %s here:",
1043+
namespace_to_str(ns),
10581044
self.session.str_of(name)));
10591045
}
10601046
}

branches/snap-stage3/src/libsyntax/abi.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
13-
use core::to_bytes;
11+
use std::to_bytes;
1412

1513
#[deriving(Eq)]
1614
pub enum Abi {

branches/snap-stage3/src/libsyntax/ast.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@
1010

1111
// The Rust abstract syntax tree.
1212

13-
use core::prelude::*;
14-
1513
use codemap::{span, spanned};
1614
use abi::AbiSet;
1715
use opt_vec::OptVec;
1816
use parse::token::{interner_get, str_to_ident};
1917

20-
use core::hashmap::HashMap;
21-
use core::option::Option;
22-
use core::to_bytes::IterBytes;
23-
use core::to_bytes;
24-
use core::to_str::ToStr;
18+
use std::hashmap::HashMap;
19+
use std::option::Option;
20+
use std::to_bytes::IterBytes;
21+
use std::to_bytes;
22+
use std::to_str::ToStr;
2523
use extra::serialize::{Encodable, Decodable, Encoder, Decoder};
2624

2725

branches/snap-stage3/src/libsyntax/ast_map.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use abi::AbiSet;
1412
use ast::*;
1513
use ast;
@@ -22,9 +20,9 @@ use print::pprust;
2220
use visit;
2321
use syntax::parse::token::special_idents;
2422

25-
use core::cmp;
26-
use core::hashmap::HashMap;
27-
use core::vec;
23+
use std::cmp;
24+
use std::hashmap::HashMap;
25+
use std::vec;
2826

2927
pub enum path_elt {
3028
path_mod(ident),

branches/snap-stage3/src/libsyntax/ast_util.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use ast::*;
1412
use ast;
1513
use ast_util;
1614
use codemap::{span, spanned};
17-
use core::cast;
18-
use core::local_data;
1915
use opt_vec;
2016
use parse::token;
2117
use visit;
2218

23-
use core::hashmap::HashMap;
24-
use core::int;
25-
use core::option;
26-
use core::to_bytes;
19+
use std::hashmap::HashMap;
20+
use std::int;
21+
use std::option;
22+
use std::to_bytes;
23+
use std::cast;
24+
use std::local_data;
2725

2826
pub fn path_name_i(idents: &[ident]) -> ~str {
2927
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
@@ -793,7 +791,7 @@ pub fn getLast(arr: &~[Mrk]) -> uint {
793791
mod test {
794792
use ast::*;
795793
use super::*;
796-
use core::io;
794+
use std::io;
797795
798796
#[test] fn xorpush_test () {
799797
let mut s = ~[];

branches/snap-stage3/src/libsyntax/attr.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Functions dealing with attributes and meta_items
1212

13-
use core::prelude::*;
13+
extern mod extra;
1414

1515
use ast;
1616
use codemap::{spanned, dummy_spanned};
@@ -19,10 +19,8 @@ use codemap::BytePos;
1919
use diagnostic::span_handler;
2020
use parse::comments::{doc_comment_style, strip_doc_comment_decoration};
2121

22-
use core::hashmap::HashSet;
23-
use core::vec;
24-
use extra;
25-
22+
use std::hashmap::HashSet;
23+
use std::vec;
2624
/* Constructors */
2725

2826
pub fn mk_name_value_item_str(name: @str, value: @str)

branches/snap-stage3/src/libsyntax/codemap.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ source code snippets, etc.
2121
2222
*/
2323

24-
use core::prelude::*;
25-
26-
use core::cmp;
27-
use core::to_bytes;
28-
use core::uint;
24+
use std::cmp;
25+
use std::to_bytes;
26+
use std::uint;
2927
use extra::serialize::{Encodable, Decodable, Encoder, Decoder};
3028

3129
pub trait Pos {

branches/snap-stage3/src/libsyntax/diagnostic.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use codemap::{Pos, span};
1412
use codemap;
1513

16-
use core::io;
17-
use core::uint;
18-
use core::vec;
14+
use std::io;
15+
use std::uint;
16+
use std::vec;
1917
use extra::term;
2018

2119
pub type Emitter = @fn(cmsp: Option<(@codemap::CodeMap, span)>,

branches/snap-stage3/src/libsyntax/ext/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
* Inline assembly support.
1313
*/
1414

15-
use core::prelude::*;
16-
17-
use core::vec;
1815
use ast;
1916
use codemap::span;
2017
use ext::base;
2118
use ext::base::*;
2219
use parse;
2320
use parse::token;
2421

22+
use std::vec;
23+
2524
enum State {
2625
Asm,
2726
Outputs,

branches/snap-stage3/src/libsyntax/ext/base.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
13-
use core::vec;
1411
use ast;
1512
use ast::Name;
1613
use codemap;
@@ -22,7 +19,8 @@ use parse;
2219
use parse::token;
2320
use parse::token::{ident_to_str, intern, str_to_ident};
2421

25-
use core::hashmap::HashMap;
22+
use std::vec;
23+
use std::hashmap::HashMap;
2624

2725
// new-style macro! tt code:
2826
//
@@ -535,7 +533,7 @@ fn satisfies_pred<K : Eq + Hash + IterBytes,V>(map : &mut HashMap<K,V>,
535533
#[cfg(test)]
536534
mod test {
537535
use super::MapChain;
538-
use core::hashmap::HashMap;
536+
use std::hashmap::HashMap;
539537
540538
#[test] fn testenv () {
541539
let mut a = HashMap::new();

branches/snap-stage3/src/libsyntax/ext/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use abi::AbiSet;
1412
use ast::ident;
1513
use ast;

branches/snap-stage3/src/libsyntax/ext/concat_idents.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use ast;
1412
use codemap::span;
1513
use ext::base::*;

branches/snap-stage3/src/libsyntax/ext/deriving/clone.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use ast::{meta_item, item, expr};
1412
use codemap::span;
1513
use ext::base::ExtCtxt;

branches/snap-stage3/src/libsyntax/ext/deriving/cmp/eq.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use ast::{meta_item, item, expr};
1412
use codemap::span;
1513
use ext::base::ExtCtxt;

branches/snap-stage3/src/libsyntax/ext/deriving/cmp/ord.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use ast;
1412
use ast::{meta_item, item, expr};
1513
use codemap::span;

branches/snap-stage3/src/libsyntax/ext/deriving/cmp/totaleq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
11+
use std::prelude::*;
1212

1313
use ast::{meta_item, item, expr};
1414
use codemap::span;

branches/snap-stage3/src/libsyntax/ext/deriving/cmp/totalord.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::prelude::*;
12-
1311
use ast::{meta_item, item, expr};
1412
use codemap::span;
1513
use ext::base::ExtCtxt;
1614
use ext::build::AstBuilder;
1715
use ext::deriving::generic::*;
18-
use core::cmp::{Ordering, Equal, Less, Greater};
16+
use std::cmp::{Ordering, Equal, Less, Greater};
1917

2018
pub fn expand_deriving_totalord(cx: @ExtCtxt,
2119
span: span,

branches/snap-stage3/src/libsyntax/ext/deriving/decodable.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ The compiler code necessary for #[deriving(Decodable)]. See
1313
encodable.rs for more.
1414
*/
1515

16-
use core::prelude::*;
17-
use core::vec;
18-
use core::uint;
16+
use std::vec;
17+
use std::uint;
1918

2019
use ast::{meta_item, item, expr, m_mutbl};
2120
use codemap::span;

branches/snap-stage3/src/libsyntax/ext/deriving/encodable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ would yield functions like:
7575
}
7676
*/
7777

78-
use core::prelude::*;
79-
8078
use ast::{meta_item, item, expr, m_imm, m_mutbl};
8179
use codemap::span;
8280
use ext::base::ExtCtxt;

0 commit comments

Comments
 (0)