Skip to content

Commit ee191de

Browse files
committed
---
yaml --- r: 94064 b: refs/heads/try c: 0cd79ee h: refs/heads/master v: v3
1 parent e281519 commit ee191de

File tree

20 files changed

+74
-126
lines changed

20 files changed

+74
-126
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 1191ae87dbf301a26379ca1b9797c352ab082b85
5+
refs/heads/try: 0cd79ee18aa38339147516413679f6fdaf01ca1a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
55
" Maintainer: Chris Morgan <[email protected]>
6-
" Last Change: 2013 Dec 04
6+
" Last Change: 2013 Oct 29
77

88
if version < 600
99
syntax clear
@@ -28,7 +28,6 @@ syn keyword rustKeyword use nextgroup=rustModPath skipwhite
2828
" FIXME: Scoped impl's name is also fallen in this category
2929
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
3030
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
31-
syn keyword rustKeyword proc
3231
syn keyword rustStorage const mut ref static
3332

3433
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -90,7 +89,6 @@ syn keyword rustTrait Orderable Signed Unsigned Round
9089
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
9190
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
9291
syn keyword rustTrait RawPtr
93-
syn keyword rustTrait Buffer Writer Reader Seek
9492
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9593
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9694
syn keyword rustTrait IterBytes
@@ -145,29 +143,38 @@ syn match rustOperator display "&&\|||"
145143
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
146144
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
147145

148-
syn match rustSpecialError display contained /\\./
146+
syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
147+
syn match rustFormat display "%%" contained
149148
syn match rustSpecial display contained /\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
150149
syn match rustStringContinuation display contained /\\\n\s*/
151-
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation
150+
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial,rustStringContinuation
152151
syn region rustString start='r\z(#*\)"' end='"\z1'
153152

154153
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
155154
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
156155

157156
" Number literals
158-
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
159-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
160-
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
161-
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
162-
163-
" To mark it as a float, it must have at least one of the three things integral values don't have:
164-
" a decimal point and more numbers; an exponent; and a type suffix.
165-
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
166-
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
167-
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
168-
" Special case for numbers of the form "1." which are float literals, unless followed by
169-
" an identifier, which makes them integer literals with a method call or field access.
170-
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
157+
syn match rustNumber display "\<[0-9][0-9_]*\>"
158+
syn match rustNumber display "\<[0-9][0-9_]*\(u\|u8\|u16\|u32\|u64\)\>"
159+
syn match rustNumber display "\<[0-9][0-9_]*\(i\|i8\|i16\|i32\|i64\)\>"
160+
161+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\>"
162+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(u\|u8\|u16\|u32\|u64\)\>"
163+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(i8\|i16\|i32\|i64\)\>"
164+
syn match rustOctNumber display "\<0o[0-7_]\+\>"
165+
syn match rustOctNumber display "\<0o[0-7_]\+\(u\|u8\|u16\|u32\|u64\)\>"
166+
syn match rustOctNumber display "\<0o[0-7_]\+\(i8\|i16\|i32\|i64\)\>"
167+
syn match rustBinNumber display "\<0b[01_]\+\>"
168+
syn match rustBinNumber display "\<0b[01_]\+\(u\|u8\|u16\|u32\|u64\)\>"
169+
syn match rustBinNumber display "\<0b[01_]\+\(i8\|i16\|i32\|i64\)\>"
170+
171+
syn match rustFloat display "\<[0-9][0-9_]*\(f\|f32\|f64\)\>"
172+
syn match rustFloat display "\<[0-9][0-9_]*\([eE][+-]\=[0-9_]\+\)\>"
173+
syn match rustFloat display "\<[0-9][0-9_]*\([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
174+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\>"
175+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\>"
176+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>"
177+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
171178

172179
" For the benefit of delimitMate
173180
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
@@ -176,24 +183,12 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
176183

177184
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
178185
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
179-
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError
180-
181-
syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc
182-
syn region rustCommentLine start="//" end="$" contains=rustTodo
183-
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo
184-
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment keepend extend
185-
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment keepend extend
186-
" FIXME: this is a really ugly and not fully correct implementation. Most
187-
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
188-
" a comment, but in practice at present it leaves comments open two levels
189-
" deep. But as long as you stay away from that particular case, I *believe*
190-
" the highlighting is correct. Due to the way Vim's syntax engine works
191-
" (greedy for start matches, unlike Rust's tokeniser which is searching for
192-
" the earliest-starting match, start or end), I believe this cannot be solved.
193-
" Oh you who would fix it, don't bother with things like duplicating the Block
194-
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
195-
" then you must deal with cases like ``/*/**/*/``. And don't try making it
196-
" worse with ``\%(/\@<!\*\)\@<!``, either...
186+
syn match rustCharacter /'\([^'\\]\|\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
187+
188+
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
189+
syn region rustComment start="//" end="$" contains=rustTodo keepend
190+
syn region rustCommentMLDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo
191+
syn region rustCommentDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo keepend
197192

198193
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
199194

@@ -205,16 +200,15 @@ syn region rustFoldBraces start="{" end="}" transparent fold
205200
" It's not enabled by default as it would drive some people mad.
206201

207202
" Default highlighting {{{1
208-
hi def link rustDecNumber rustNumber
209203
hi def link rustHexNumber rustNumber
210204
hi def link rustOctNumber rustNumber
211205
hi def link rustBinNumber rustNumber
212206
hi def link rustIdentifierPrime rustIdentifier
213207
hi def link rustTrait rustType
214208

215209
hi def link rustSigil StorageClass
210+
hi def link rustFormat Special
216211
hi def link rustSpecial Special
217-
hi def link rustSpecialError Error
218212
hi def link rustStringContinuation Special
219213
hi def link rustString String
220214
hi def link rustCharacter Character
@@ -235,10 +229,10 @@ hi def link rustModPathSep Delimiter
235229
hi def link rustFunction Function
236230
hi def link rustFuncName Function
237231
hi def link rustFuncCall Function
238-
hi def link rustCommentLine Comment
239-
hi def link rustCommentLineDoc SpecialComment
240-
hi def link rustCommentBlock rustCommentLine
241-
hi def link rustCommentBlockDoc rustCommentLineDoc
232+
hi def link rustCommentMLDoc rustCommentDoc
233+
hi def link rustCommentDoc SpecialComment
234+
hi def link rustCommentML rustComment
235+
hi def link rustComment Comment
242236
hi def link rustAssert PreCondit
243237
hi def link rustFail PreCondit
244238
hi def link rustMacro Macro

branches/try/src/libextra/url.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,23 @@ use std::hashmap::HashMap;
1919
use std::to_bytes;
2020
use std::uint;
2121

22-
/// A Uniform Resource Locator (URL). A URL is a form of URI (Uniform Resource
23-
/// Identifier) that includes network location information, such as hostname or
24-
/// port number.
25-
///
26-
/// # Example
27-
///
28-
/// ```rust
29-
/// let url = Url { scheme: ~"https",
30-
/// user: Some(UserInfo { user: ~"username", pass: None }),
31-
/// host: ~"example.com",
32-
/// port: Some(~"8080"),
33-
/// path: ~"/foo/bar",
34-
/// query: ~[(~"baz", ~"qux")],
35-
/// fragment: Some(~"quz") };
36-
/// // https://[email protected]:8080/foo/bar?baz=qux#quz
37-
/// ```
3822
#[deriving(Clone, Eq)]
3923
pub struct Url {
40-
/// The scheme part of a URL, such as `https` in the above example.
4124
scheme: ~str,
42-
/// A URL subcomponent for user authentication. `username` in the above example.
4325
user: Option<UserInfo>,
44-
/// A domain name or IP address. For example, `example.com`.
4526
host: ~str,
46-
/// A TCP port number, for example `8080`.
4727
port: Option<~str>,
48-
/// The path component of a URL, for example `/foo/bar`.
4928
path: ~str,
50-
/// The query component of a URL. `~[(~"baz", ~"qux")]` represents the
51-
/// fragment `baz=qux` in the above example.
5229
query: Query,
53-
/// The fragment component, such as `quz`. Doesn't include the leading `#` character.
5430
fragment: Option<~str>
5531
}
5632

57-
/// An optional subcomponent of a URI authority component.
5833
#[deriving(Clone, Eq)]
5934
pub struct UserInfo {
60-
/// The user name.
6135
user: ~str,
62-
/// Password or other scheme-specific authentication information.
6336
pass: Option<~str>
6437
}
6538

66-
/// Represents the query component of a URI.
6739
pub type Query = ~[(~str, ~str)];
6840

6941
impl Url {

branches/try/src/librustc/back/archive.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,18 @@ impl Archive {
119119
}
120120

121121
fn find_library(&self, name: &str) -> Path {
122-
let (osprefix, osext) = match self.sess.targ_cfg.os {
122+
let (prefix, ext) = match self.sess.targ_cfg.os {
123123
abi::OsWin32 => ("", "lib"), _ => ("lib", "a"),
124124
};
125-
// On windows, static libraries sometimes show up as libfoo.a and other
126-
// times show up as foo.lib
127-
let oslibname = format!("{}{}.{}", osprefix, name, osext);
128-
let unixlibname = format!("lib{}.a", name);
125+
let libname = format!("{}{}.{}", prefix, name, ext);
129126

130127
let mut rustpath = filesearch::rust_path();
131128
rustpath.push(self.sess.filesearch.get_target_lib_path());
132129
let path = self.sess.opts.addl_lib_search_paths.iter();
133130
for path in path.chain(rustpath.iter()) {
134131
debug!("looking for {} inside {}", name, path.display());
135-
let test = path.join(oslibname.as_slice());
132+
let test = path.join(libname.clone());
136133
if test.exists() { return test }
137-
if oslibname != unixlibname {
138-
let test = path.join(unixlibname.as_slice());
139-
if test.exists() { return test }
140-
}
141134
}
142135
self.sess.fatal(format!("could not find native static library `{}`, \
143136
perhaps an -L flag is missing?", name));

branches/try/src/librustc/middle/typeck/check/_match.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,24 +294,17 @@ pub fn check_struct_pat_fields(pcx: &pat_ctxt,
294294
etc: bool) {
295295
let tcx = pcx.fcx.ccx.tcx;
296296
297-
// Index the class fields. The second argument in the tuple is whether the
298-
// field has been bound yet or not.
297+
// Index the class fields.
299298
let mut field_map = HashMap::new();
300299
for (i, class_field) in class_fields.iter().enumerate() {
301-
field_map.insert(class_field.name, (i, false));
300+
field_map.insert(class_field.name, i);
302301
}
303302
304303
// Typecheck each field.
305304
let mut found_fields = HashSet::new();
306305
for field in fields.iter() {
307-
match field_map.find_mut(&field.ident.name) {
308-
Some(&(_, true)) => {
309-
tcx.sess.span_err(span,
310-
format!("field `{}` bound twice in pattern",
311-
tcx.sess.str_of(field.ident)));
312-
}
313-
Some(&(index, ref mut used)) => {
314-
*used = true;
306+
match field_map.find(&field.ident.name) {
307+
Some(&index) => {
315308
let class_field = class_fields[index];
316309
let field_type = ty::lookup_field_type(tcx,
317310
class_id,

branches/try/src/librustuv/timer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ impl RtioTimer for TimerWatcher {
7777
let _missile = match util::replace(&mut self.action, None) {
7878
None => missile, // no need to do a homing dance
7979
Some(action) => {
80-
drop(missile); // un-home ourself
81-
drop(action); // destroy the previous action
80+
util::ignore(missile); // un-home ourself
81+
util::ignore(action); // destroy the previous action
8282
self.fire_homing_missile() // re-home ourself
8383
}
8484
};

branches/try/src/librustuv/uvio.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use std::libc::{O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY, O_WRONLY,
2626
use std::io::{FileMode, FileAccess, Open, Append, Truncate, Read, Write,
2727
ReadWrite, FileStat};
2828
use std::io::signal::Signum;
29+
use std::util;
2930
use ai = std::io::net::addrinfo;
3031

3132
#[cfg(test)] use std::unstable::run_in_bare_thread;
@@ -103,7 +104,7 @@ impl HomingMissile {
103104

104105
impl Drop for HomingMissile {
105106
fn drop(&mut self) {
106-
let _f = ForbidUnwind::new("leaving home");
107+
let f = ForbidUnwind::new("leaving home");
107108

108109
// It would truly be a sad day if we had moved off the home I/O
109110
// scheduler while we were doing I/O.
@@ -119,6 +120,8 @@ impl Drop for HomingMissile {
119120
});
120121
})
121122
}
123+
124+
util::ignore(f);
122125
}
123126
}
124127

branches/try/src/libstd/io/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ mod test {
11791179
file.write(bytes!("foo"));
11801180
file.fsync();
11811181
file.datasync();
1182-
drop(file);
1182+
util::ignore(file);
11831183
})
11841184

11851185
test!(fn truncate_works() {
@@ -1210,7 +1210,7 @@ mod test {
12101210
assert_eq!(stat(&path).size, 9);
12111211
assert_eq!(File::open(&path).read_to_end(),
12121212
(bytes!("fo", 0, 0, 0, 0, "wut")).to_owned());
1213-
drop(file);
1213+
util::ignore(file);
12141214
})
12151215

12161216
test!(fn open_flavors() {

branches/try/src/libstd/prelude.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,3 @@ pub use vec::{Vector, VectorVector, CopyableVector, ImmutableVector};
8686
// Reexported runtime types
8787
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};
8888
pub use task::spawn;
89-
90-
/// Disposes of a value.
91-
#[inline]
92-
pub fn drop<T>(_x: T) { }

branches/try/src/libstd/rt/sched.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ mod test {
11731173
use rt::sleeper_list::SleeperList;
11741174
use rt::stack::StackPool;
11751175
use rt::sched::{Shutdown, TaskFromFriend};
1176+
use util;
11761177

11771178
do run_in_bare_thread {
11781179
stress_factor().times(|| {
@@ -1204,7 +1205,7 @@ mod test {
12041205
handle.send(TaskFromFriend(task));
12051206

12061207
handle.send(Shutdown);
1207-
drop(handle);
1208+
util::ignore(handle);
12081209

12091210
thread.join();
12101211
})

branches/try/src/libstd/unstable/sync.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ mod tests {
467467
use prelude::*;
468468
use super::{Exclusive, UnsafeArc, atomically};
469469
use task;
470+
use util;
470471
use mem::size_of;
471472

472473
//#[unsafe_no_drop_flag] FIXME: #9758
@@ -570,7 +571,7 @@ mod tests {
570571
let x2 = x.clone();
571572
let left_x = x.try_unwrap();
572573
assert!(left_x.is_self());
573-
drop(left_x);
574+
util::ignore(left_x);
574575
assert!(x2.try_unwrap().expect_t("try_unwrap none") == ~~"hello");
575576
}
576577
@@ -589,7 +590,7 @@ mod tests {
589590
task::deschedule(); // Try to make the unwrapper get blocked first.
590591
let left_x = x.try_unwrap();
591592
assert!(left_x.is_self());
592-
drop(left_x);
593+
util::ignore(left_x);
593594
p.recv();
594595
}
595596
@@ -619,7 +620,7 @@ mod tests {
619620
assert!(x2.unwrap() == ~~"hello");
620621
}
621622
// Have to get rid of our reference before blocking.
622-
drop(x);
623+
util::ignore(x);
623624
res.recv();
624625
}
625626

branches/try/src/libstd/util.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ use unstable::intrinsics;
1919
#[inline]
2020
pub fn id<T>(x: T) -> T { x }
2121

22+
/// Ignores a value.
23+
#[inline]
24+
pub fn ignore<T>(_x: T) { }
25+
2226
/**
2327
* Swap the values at two mutable locations of the same type, without
2428
* deinitialising or copying either one.

0 commit comments

Comments
 (0)