Skip to content

Commit a00bbcd

Browse files
committed
---
yaml --- r: 54333 b: refs/heads/dist-snap c: 7142cde h: refs/heads/master i: 54331: 5473896 v: v3
1 parent 4aa6ad3 commit a00bbcd

Some content is hidden

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

87 files changed

+1644
-1198
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 810c4d8a1e0bdae3c2aba86a8b93e20faecba283
10+
refs/heads/dist-snap: 7142cdef1e083c628d787abe5b5eaabe52491197
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ elseif exists("b:current_syntax")
1010
finish
1111
endif
1212

13-
syn match rustAssert "\<assert\(\w\)*"
1413
syn keyword rustKeyword as break
1514
syn keyword rustKeyword copy do drop else extern
1615
syn keyword rustKeyword for if impl let log
17-
syn keyword rustKeyword loop match mod once priv pub pure
18-
syn keyword rustKeyword ref return static
16+
syn keyword rustKeyword loop match mod once priv pub
17+
syn keyword rustKeyword return
1918
syn keyword rustKeyword unsafe use while
2019
" FIXME: Scoped impl's name is also fallen in this category
2120
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
2221
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
23-
syn keyword rustStorage const mut
22+
syn keyword rustStorage const mut ref static
2423

2524
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
2625
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -71,8 +70,8 @@ syn keyword rustConstant STDIN_FILENO STDOUT_FILENO STDERR_FILENO
7170
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
7271
syn match rustModPathSep "::"
7372

74-
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1 contains=rustAssert
75-
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 contains=rustAssert " foo::<T>();
73+
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
74+
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
7675

7776
syn match rustMacro '\w\(\w\)*!'
7877
syn match rustMacro '#\w\(\w\)*'
@@ -126,7 +125,6 @@ hi def link rustBoolean Boolean
126125
hi def link rustConstant Constant
127126
hi def link rustSelf Constant
128127
hi def link rustFloat Float
129-
hi def link rustAssert Keyword
130128
hi def link rustKeyword Keyword
131129
hi def link rustIdentifier Identifier
132130
hi def link rustModPath Include
@@ -140,7 +138,6 @@ hi def link rustStorage StorageClass
140138
hi def link rustLifetime Special
141139

142140
" Other Suggestions:
143-
" hi rustAssert ctermfg=yellow
144141
" hi rustMacro ctermfg=magenta
145142

146143
syn sync minlines=200

branches/dist-snap/src/libcore/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
pub mod rusti {
1414
#[abi = "rust-intrinsic"]
1515
#[link_name = "rusti"]
16-
pub extern {
16+
pub extern "rust-intrinsic" {
1717
fn forget<T>(+x: T);
1818
fn reinterpret_cast<T, U>(&&e: T) -> U;
1919
}

branches/dist-snap/src/libcore/hashmap.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -393,16 +393,10 @@ pub mod linear {
393393
}
394394
}
395395
396-
pub impl<K: Hash + IterBytes + Eq, V> LinearMap<K, V> {
396+
pub impl<K:Hash + IterBytes + Eq,V> LinearMap<K, V> {
397397
/// Create an empty LinearMap
398398
fn new() -> LinearMap<K, V> {
399-
LinearMap::with_capacity(INITIAL_CAPACITY)
400-
}
401-
402-
/// Create an empty LinearMap with space for at least `n` elements in
403-
/// the hash table.
404-
fn with_capacity(capacity: uint) -> LinearMap<K, V> {
405-
linear_map_with_capacity(capacity)
399+
linear_map_with_capacity(INITIAL_CAPACITY)
406400
}
407401
408402
/// Reserve space for at least `n` elements in the hash table.
@@ -658,15 +652,7 @@ pub mod linear {
658652

659653
pub impl <T:Hash + IterBytes + Eq> LinearSet<T> {
660654
/// Create an empty LinearSet
661-
fn new() -> LinearSet<T> {
662-
LinearSet::with_capacity(INITIAL_CAPACITY)
663-
}
664-
665-
/// Create an empty LinearSet with space for at least `n` elements in
666-
/// the hash table.
667-
fn with_capacity(capacity: uint) -> LinearSet<T> {
668-
LinearSet { map: LinearMap::with_capacity(capacity) }
669-
}
655+
fn new() -> LinearSet<T> { LinearSet{map: LinearMap::new()} }
670656

671657
/// Reserve space for at least `n` elements in the hash table.
672658
fn reserve_at_least(&mut self, n: uint) {

branches/dist-snap/src/libcore/libc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ pub mod funcs {
16171617
use libc::types::os::arch::extra::{HANDLE};
16181618

16191619
#[abi = "stdcall"]
1620-
pub extern {
1620+
pub extern "stdcall" {
16211621
unsafe fn GetEnvironmentVariableW(n: LPCWSTR,
16221622
v: LPWSTR,
16231623
nsize: DWORD)

branches/dist-snap/src/libcore/os.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ pub fn errno() -> uint {
942942
943943
#[link_name = "kernel32"]
944944
#[abi = "stdcall"]
945-
extern {
945+
extern "stdcall" {
946946
unsafe fn GetLastError() -> DWORD;
947947
}
948948
@@ -1004,7 +1004,7 @@ pub fn last_os_error() -> ~str {
10041004
10051005
#[link_name = "kernel32"]
10061006
#[abi = "stdcall"]
1007-
extern {
1007+
extern "stdcall" {
10081008
unsafe fn FormatMessageA(flags: DWORD, lpSrc: LPVOID,
10091009
msgId: DWORD, langId: DWORD,
10101010
buf: LPSTR, nsize: DWORD,
@@ -1118,15 +1118,15 @@ type LPCWSTR = *u16;
11181118
#[cfg(windows)]
11191119
#[link_name="kernel32"]
11201120
#[abi="stdcall"]
1121-
extern {
1121+
extern "stdcall" {
11221122
fn GetCommandLineW() -> LPCWSTR;
11231123
fn LocalFree(ptr: *c_void);
11241124
}
11251125
11261126
#[cfg(windows)]
11271127
#[link_name="shell32"]
11281128
#[abi="stdcall"]
1129-
extern {
1129+
extern "stdcall" {
11301130
fn CommandLineToArgvW(lpCmdLine: LPCWSTR, pNumArgs: *mut c_int) -> **u16;
11311131
}
11321132

branches/dist-snap/src/libcore/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub mod libc_ {
4343

4444
pub mod rusti {
4545
#[abi = "rust-intrinsic"]
46-
pub extern {
46+
pub extern "rust-intrinsic" {
4747
fn addr_of<T>(&&val: T) -> *T;
4848
}
4949
}

branches/dist-snap/src/libcore/rt/thread_local_storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub unsafe fn get(key: Key) -> *mut c_void {
7373

7474
#[cfg(windows)]
7575
#[abi = "stdcall"]
76-
extern {
76+
extern "stdcall" {
7777
fn TlsAlloc() -> DWORD;
7878
fn TlsSetValue(dwTlsIndex: DWORD, lpTlsvalue: LPVOID) -> BOOL;
7979
fn TlsGetValue(dwTlsIndex: DWORD) -> LPVOID;

branches/dist-snap/src/libcore/stackwalk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub mod rustrt {
9494

9595
pub mod rusti {
9696
#[abi = "rust-intrinsic"]
97-
pub extern {
97+
pub extern "rust-intrinsic" {
9898
pub fn frame_address(f: &once fn(x: *u8));
9999
}
100100
}

branches/dist-snap/src/libcore/sys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub struct Closure {
3939

4040
pub mod rusti {
4141
#[abi = "rust-intrinsic"]
42-
pub extern {
42+
pub extern "rust-intrinsic" {
4343
fn get_tydesc<T>() -> *();
4444
fn size_of<T>() -> uint;
4545
fn pref_align_of<T>() -> uint;

branches/dist-snap/src/libcore/unstable/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The intrinsics are defined in librustc/middle/trans/foreign.rs.
1515
*/
1616

1717
#[abi = "rust-intrinsic"]
18-
pub extern {
18+
pub extern "rust-intrinsic" {
1919
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
2020
pub fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
2121
pub fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;

branches/dist-snap/src/libcore/vec.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -560,28 +560,6 @@ pub fn consume<T>(mut v: ~[T], f: &fn(uint, v: T)) {
560560
}
561561
}
562562
563-
pub fn consume_reverse<T>(mut v: ~[T], f: &fn(uint, v: T)) {
564-
unsafe {
565-
do as_mut_buf(v) |p, ln| {
566-
let mut i = ln;
567-
while i > 0 {
568-
i -= 1;
569-
570-
// NB: This unsafe operation counts on init writing 0s to the
571-
// holes we create in the vector. That ensures that, if the
572-
// iterator fails then we won't try to clean up the consumed
573-
// elements during unwinding
574-
let mut x = intrinsics::init();
575-
let p = ptr::mut_offset(p, i);
576-
x <-> *p;
577-
f(i, x);
578-
}
579-
}
580-
581-
raw::set_len(&mut v, 0);
582-
}
583-
}
584-
585563
/// Remove the last element from a vector and return it
586564
pub fn pop<T>(v: &mut ~[T]) -> T {
587565
let ln = v.len();
@@ -2007,7 +1985,6 @@ pub trait OwnedVector<T> {
20071985
fn truncate(&mut self, newlen: uint);
20081986
fn retain(&mut self, f: &fn(t: &T) -> bool);
20091987
fn consume(self, f: &fn(uint, v: T));
2010-
fn consume_reverse(self, f: &fn(uint, v: T));
20111988
fn filter(self, f: &fn(t: &T) -> bool) -> ~[T];
20121989
fn partition(self, f: &fn(&T) -> bool) -> (~[T], ~[T]);
20131990
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
@@ -2069,11 +2046,6 @@ impl<T> OwnedVector<T> for ~[T] {
20692046
consume(self, f)
20702047
}
20712048

2072-
#[inline]
2073-
fn consume_reverse(self, f: &fn(uint, v: T)) {
2074-
consume_reverse(self, f)
2075-
}
2076-
20772049
#[inline]
20782050
fn filter(self, f: &fn(&T) -> bool) -> ~[T] {
20792051
filter(self, f)

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub mod jit {
9797
pub mod rusti {
9898
#[nolink]
9999
#[abi = "rust-intrinsic"]
100-
pub extern {
100+
pub extern "rust-intrinsic" {
101101
pub fn morestack_addr() -> *();
102102
}
103103
}

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
3333
use std::getopts::{opt_present};
3434
use std::getopts;
3535
use syntax::ast;
36+
use syntax::abi;
3637
use syntax::attr;
3738
use syntax::codemap;
3839
use syntax::diagnostic;
@@ -85,10 +86,10 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
8586
// ARM is bi-endian, however using NDK seems to default
8687
// to little-endian unless a flag is provided.
8788
let (end,arch,wordsz) = match sess.targ_cfg.arch {
88-
session::arch_x86 => (~"little",~"x86",~"32"),
89-
session::arch_x86_64 => (~"little",~"x86_64",~"64"),
90-
session::arch_arm => (~"little",~"arm",~"32"),
91-
session::arch_mips => (~"little",~"arm",~"32")
89+
abi::X86 => (~"little",~"x86",~"32"),
90+
abi::X86_64 => (~"little",~"x86_64",~"64"),
91+
abi::Arm => (~"little",~"arm",~"32"),
92+
abi::Mips => (~"little",~"arm",~"32")
9293
};
9394

9495
return ~[ // Target bindings.
@@ -308,7 +309,7 @@ pub fn compile_rest(sess: Session, cfg: ast::crate_cfg,
308309
};
309310

310311
// NOTE: Android hack
311-
if sess.targ_cfg.arch == session::arch_arm &&
312+
if sess.targ_cfg.arch == abi::Arm &&
312313
(sess.opts.output_type == link::output_type_object ||
313314
sess.opts.output_type == link::output_type_exe) {
314315
let output_type = link::output_type_assembly;
@@ -453,20 +454,20 @@ pub fn get_os(triple: &str) -> Option<session::os> {
453454
} else { None }
454455
}
455456

456-
pub fn get_arch(triple: &str) -> Option<session::arch> {
457+
pub fn get_arch(triple: &str) -> Option<abi::Architecture> {
457458
if str::contains(triple, ~"i386") ||
458459
str::contains(triple, ~"i486") ||
459460
str::contains(triple, ~"i586") ||
460461
str::contains(triple, ~"i686") ||
461462
str::contains(triple, ~"i786") {
462-
Some(session::arch_x86)
463+
Some(abi::X86)
463464
} else if str::contains(triple, ~"x86_64") {
464-
Some(session::arch_x86_64)
465+
Some(abi::X86_64)
465466
} else if str::contains(triple, ~"arm") ||
466467
str::contains(triple, ~"xscale") {
467-
Some(session::arch_arm)
468+
Some(abi::Arm)
468469
} else if str::contains(triple, ~"mips") {
469-
Some(session::arch_mips)
470+
Some(abi::Mips)
470471
} else { None }
471472
}
472473

@@ -483,16 +484,16 @@ pub fn build_target_config(sopts: @session::options,
483484
~"unknown architecture: " + sopts.target_triple)
484485
};
485486
let (int_type, uint_type, float_type) = match arch {
486-
session::arch_x86 => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
487-
session::arch_x86_64 => (ast::ty_i64, ast::ty_u64, ast::ty_f64),
488-
session::arch_arm => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
489-
session::arch_mips => (ast::ty_i32, ast::ty_u32, ast::ty_f64)
487+
abi::X86 => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
488+
abi::X86_64 => (ast::ty_i64, ast::ty_u64, ast::ty_f64),
489+
abi::Arm => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
490+
abi::Mips => (ast::ty_i32, ast::ty_u32, ast::ty_f64)
490491
};
491492
let target_strs = match arch {
492-
session::arch_x86 => x86::get_target_strs(os),
493-
session::arch_x86_64 => x86_64::get_target_strs(os),
494-
session::arch_arm => arm::get_target_strs(os),
495-
session::arch_mips => mips::get_target_strs(os)
493+
abi::X86 => x86::get_target_strs(os),
494+
abi::X86_64 => x86_64::get_target_strs(os),
495+
abi::Arm => arm::get_target_strs(os),
496+
abi::Mips => mips::get_target_strs(os)
496497
};
497498
let target_cfg = @session::config {
498499
os: os,

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,17 @@ use syntax::codemap::span;
2525
use syntax::diagnostic;
2626
use syntax::parse::ParseSess;
2727
use syntax::{ast, codemap};
28+
use syntax::abi;
2829
use syntax;
2930

3031
#[deriving(Eq)]
3132
pub enum os { os_win32, os_macos, os_linux, os_android, os_freebsd, }
3233

33-
#[deriving(Eq)]
34-
pub enum arch { arch_x86, arch_x86_64, arch_arm, arch_mips, }
35-
3634
pub enum crate_type { bin_crate, lib_crate, unknown_crate, }
3735

3836
pub struct config {
3937
os: os,
40-
arch: arch,
38+
arch: abi::Architecture,
4139
target_strs: target_strs::t,
4240
int_type: int_ty,
4341
uint_type: uint_ty,

branches/dist-snap/src/librustc/front/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn fold_foreign_mod(
9292
nm.view_items.filter_mapped(|a| filter_view_item(cx, *a));
9393
ast::foreign_mod {
9494
sort: nm.sort,
95-
abi: nm.abi,
95+
abis: nm.abis,
9696
view_items: vec::map(filtered_view_items, |x| fld.fold_view_item(*x)),
9797
items: filtered_items
9898
}

branches/dist-snap/src/librustc/front/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub mod intrinsic {
126126
use super::{TyDesc, TyVisitor};
127127

128128
#[abi = "rust-intrinsic"]
129-
pub extern {
129+
pub extern "rust-intrinsic" {
130130
pub fn get_tydesc<T>() -> *();
131131
pub fn visit_tydesc(++td: *TyDesc, &&tv: @TyVisitor);
132132
}

branches/dist-snap/src/librustc/front/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ fn fold_item(cx: @mut TestCtxt, &&i: @ast::item, fld: @fold::ast_fold)
146146

147147
if is_test_fn(i) || is_bench_fn(i) {
148148
match i.node {
149-
ast::item_fn(_, purity, _, _) if purity == ast::unsafe_fn => {
149+
ast::item_fn(_, purity, _, _, _) if purity == ast::unsafe_fn => {
150150
let sess = cx.sess;
151151
sess.span_fatal(
152152
i.span,
@@ -178,7 +178,7 @@ fn is_test_fn(i: @ast::item) -> bool {
178178

179179
fn has_test_signature(i: @ast::item) -> bool {
180180
match &i.node {
181-
&ast::item_fn(ref decl, _, ref generics, _) => {
181+
&ast::item_fn(ref decl, _, _, ref generics, _) => {
182182
let no_output = match decl.output.node {
183183
ast::ty_nil => true,
184184
_ => false
@@ -200,7 +200,7 @@ fn is_bench_fn(i: @ast::item) -> bool {
200200

201201
fn has_test_signature(i: @ast::item) -> bool {
202202
match i.node {
203-
ast::item_fn(ref decl, _, ref generics, _) => {
203+
ast::item_fn(ref decl, _, _, ref generics, _) => {
204204
let input_cnt = vec::len(decl.inputs);
205205
let no_output = match decl.output.node {
206206
ast::ty_nil => true,

0 commit comments

Comments
 (0)