Skip to content

Commit 573981b

Browse files
committed
---
yaml --- r: 124803 b: refs/heads/auto c: ca6ffac h: refs/heads/master i: 124801: 0526a0f 124799: e25f2c0 v: v3
1 parent 566cb34 commit 573981b

File tree

3 files changed

+13
-106
lines changed

3 files changed

+13
-106
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 72625defd7a127c238da05abf22364448b7be526
16+
refs/heads/auto: ca6ffac4e4683705b895e368375103315ca0e1ca
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/etc/vim/syntax/rust.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlace
6060
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
6161
" {} are handled by rustFoldBraces
6262

63+
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
64+
syn match rustMacroRepeatCount ".\?[*+]" contained
65+
syn match rustMacroVariable "$\w\+"
66+
6367
" Reserved (but not yet used) keywords {{{2
6468
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
6569

@@ -233,6 +237,9 @@ hi def link rustBinNumber rustNumber
233237
hi def link rustIdentifierPrime rustIdentifier
234238
hi def link rustTrait rustType
235239

240+
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
241+
hi def link rustMacroRepeatDelimiters Macro
242+
hi def link rustMacroVariable Define
236243
hi def link rustSigil StorageClass
237244
hi def link rustEscape Special
238245
hi def link rustEscapeUnicode rustEscape

branches/auto/src/librlibc/lib.rs

Lines changed: 5 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,22 @@
2121
//! the system libc library.
2222
2323
#![crate_name = "rlibc"]
24-
#![experimental]
2524
#![license = "MIT/ASL2"]
2625
#![crate_type = "rlib"]
2726
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2827
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2928
html_root_url = "http://doc.rust-lang.org/master/")]
29+
#![feature(intrinsics)]
3030

31-
#![feature(intrinsics, phase)]
3231
#![no_std]
32+
#![experimental]
3333

3434
// This library defines the builtin functions, so it would be a shame for
3535
// LLVM to optimize these function calls to themselves!
3636
#![no_builtins]
3737

38+
#[cfg(test)] extern crate std;
3839
#[cfg(test)] extern crate native;
39-
#[cfg(test)] extern crate test;
40-
#[cfg(test)] extern crate debug;
41-
42-
#[cfg(test)] #[phase(plugin, link)] extern crate std;
43-
#[cfg(test)] #[phase(plugin, link)] extern crate core;
4440

4541
// Require the offset intrinsics for LLVM to properly optimize the
4642
// implementations below. If pointer arithmetic is done through integers the
@@ -99,107 +95,11 @@ pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: uint) -> i32 {
9995
let a = *offset(s1, i as int);
10096
let b = *offset(s2, i as int);
10197
if a != b {
102-
return a as i32 - b as i32
98+
return (a - b) as i32
10399
}
104100
i += 1;
105101
}
106102
return 0;
107103
}
108104

109-
#[cfg(test)]
110-
mod test {
111-
use core::option::{Some, None};
112-
use core::iter::Iterator;
113-
use core::collections::Collection;
114-
use core::str::StrSlice;
115-
use core::slice::{MutableVector, ImmutableVector};
116-
117-
use super::{memcmp, memset, memcpy, memmove};
118-
119-
#[test]
120-
fn memcmp_single_byte_pointers() {
121-
unsafe {
122-
assert_eq!(memcmp(&0xFAu8, &0xFAu8, 1), 0x00);
123-
assert!(memcmp(&0xEFu8, &0xFEu8, 1) < 0x00);
124-
}
125-
}
126-
127-
#[test]
128-
fn memcmp_strings() {
129-
{
130-
let (x, z) = ("Hello!", "Good Bye.");
131-
let l = x.len();
132-
unsafe {
133-
assert_eq!(memcmp(x.as_ptr(), x.as_ptr(), l), 0);
134-
assert!(memcmp(x.as_ptr(), z.as_ptr(), l) > 0);
135-
assert!(memcmp(z.as_ptr(), x.as_ptr(), l) < 0);
136-
}
137-
}
138-
{
139-
let (x, z) = ("hey!", "hey.");
140-
let l = x.len();
141-
unsafe {
142-
assert!(memcmp(x.as_ptr(), z.as_ptr(), l) < 0);
143-
}
144-
}
145-
}
146-
147-
#[test]
148-
fn memset_single_byte_pointers() {
149-
let mut x: u8 = 0xFF;
150-
unsafe {
151-
memset(&mut x, 0xAA, 1);
152-
assert_eq!(x, 0xAA);
153-
memset(&mut x, 0x00, 1);
154-
assert_eq!(x, 0x00);
155-
x = 0x01;
156-
memset(&mut x, 0x12, 0);
157-
assert_eq!(x, 0x01);
158-
}
159-
}
160-
161-
#[test]
162-
fn memset_array() {
163-
let mut buffer = [b'X', .. 100];
164-
unsafe {
165-
memset(buffer.as_mut_ptr(), b'#' as i32, buffer.len());
166-
}
167-
for byte in buffer.iter() { assert_eq!(*byte, b'#'); }
168-
}
169-
170-
#[test]
171-
fn memcpy_and_memcmp_arrays() {
172-
let (src, mut dst) = ([b'X', .. 100], [b'Y', .. 100]);
173-
unsafe {
174-
assert!(memcmp(src.as_ptr(), dst.as_ptr(), 100) != 0);
175-
let _ = memcpy(dst.as_mut_ptr(), src.as_ptr(), 100);
176-
assert_eq!(memcmp(src.as_ptr(), dst.as_ptr(), 100), 0);
177-
}
178-
}
179-
180-
#[test]
181-
fn memmove_overlapping() {
182-
{
183-
let mut buffer = [ b'0', b'1', b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9' ];
184-
unsafe {
185-
memmove(&mut buffer[4], &buffer[0], 6);
186-
let mut i = 0;
187-
for byte in b"0123012345".iter() {
188-
assert_eq!(buffer[i], *byte);
189-
i += 1;
190-
}
191-
}
192-
}
193-
{
194-
let mut buffer = [ b'0', b'1', b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9' ];
195-
unsafe {
196-
memmove(&mut buffer[0], &buffer[4], 6);
197-
let mut i = 0;
198-
for byte in b"4567896789".iter() {
199-
assert_eq!(buffer[i], *byte);
200-
i += 1;
201-
}
202-
}
203-
}
204-
}
205-
}
105+
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

0 commit comments

Comments
 (0)