Skip to content

Commit 1a3bfe5

Browse files
committed
---
yaml --- r: 106604 b: refs/heads/try c: 712c630 h: refs/heads/master v: v3
1 parent 4d8f4fc commit 1a3bfe5

File tree

11 files changed

+50
-13
lines changed

11 files changed

+50
-13
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: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
5-
refs/heads/try: 258dbd09ba4aa868b373df7e82721ba0c40167ba
5+
refs/heads/try: 712c630ab6bc67a934311c0e31ead3a46ae1a75f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This API is completely unstable and subject to change.
2727
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2828
html_root_url = "http://static.rust-lang.org/doc/master")];
2929

30+
#[allow(deprecated)];
3031
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
3132
#[feature(quote)];
3233

branches/try/src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,10 @@ impl CStore {
154154
.collect()
155155
}
156156

157-
pub fn add_used_library(&self, lib: ~str, kind: NativeLibaryKind)
158-
-> bool {
157+
pub fn add_used_library(&self, lib: ~str, kind: NativeLibaryKind) {
159158
assert!(!lib.is_empty());
160159
let mut used_libraries = self.used_libraries.borrow_mut();
161-
if used_libraries.get().iter().any(|&(ref x, _)| x == &lib) {
162-
return false;
163-
}
164160
used_libraries.get().push((lib, kind));
165-
true
166161
}
167162

168163
pub fn get_used_libraries<'a>(&'a self)

branches/try/src/libstd/vec_ng.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ impl<T> Vec<T> {
369369
}
370370

371371
#[inline]
372+
#[deprecated="Use `xs.iter().map(closure)` instead."]
372373
pub fn map<U>(&self, f: |t: &T| -> U) -> Vec<U> {
373374
self.iter().map(f).collect()
374375
}

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ macro_rules! with_exts_frame (
248248
// When we enter a module, record it, for the sake of `module!`
249249
pub fn expand_item(it: @ast::Item, fld: &mut MacroExpander)
250250
-> SmallVector<@ast::Item> {
251-
let mut decorator_items = SmallVector::zero();
251+
let mut decorator_items: SmallVector<@ast::Item> = SmallVector::zero();
252252
for attr in it.attrs.rev_iter() {
253253
let mname = attr.name();
254254

@@ -262,20 +262,21 @@ pub fn expand_item(it: @ast::Item, fld: &mut MacroExpander)
262262
span: None
263263
}
264264
});
265+
265266
// we'd ideally decorator_items.push_all(expand_item(item, fld)),
266267
// but that double-mut-borrows fld
268+
let mut items: SmallVector<@ast::Item> = SmallVector::zero();
267269
dec_fn(fld.cx, attr.span, attr.node.value, it,
268-
|item| decorator_items.push(item));
270+
|item| items.push(item));
271+
decorator_items.extend(&mut items.move_iter()
272+
.flat_map(|item| expand_item(item, fld).move_iter()));
273+
269274
fld.cx.bt_pop();
270275
}
271276
_ => {}
272277
}
273278
}
274279

275-
let decorator_items = decorator_items.move_iter()
276-
.flat_map(|item| expand_item(item, fld).move_iter())
277-
.collect();
278-
279280
let mut new_items = match it.node {
280281
ast::ItemMac(..) => expand_item_mac(it, fld),
281282
ast::ItemMod(_) | ast::ItemForeignMod(_) => {

branches/try/src/libsyntax/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This API is completely unstable and subject to change.
3030
#[allow(unknown_features)];// Note: remove it after a snapshot.
3131
#[feature(quote)];
3232

33+
#[allow(deprecated)];
3334
#[deny(non_camel_case_types)];
3435

3536
extern crate serialize;

branches/try/src/libsyntax/util/small_vector.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ impl<T> FromIterator<T> for SmallVector<T> {
3939
}
4040
}
4141

42+
impl<T> Extendable<T> for SmallVector<T> {
43+
fn extend<I: Iterator<T>>(&mut self, iter: &mut I) {
44+
for val in *iter {
45+
self.push(val);
46+
}
47+
}
48+
}
49+
4250
impl<T> SmallVector<T> {
4351
pub fn zero() -> SmallVector<T> {
4452
Zero
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-include ../tools.mk
2+
3+
all: $(call STATICLIB,foo) $(call STATICLIB,bar)
4+
$(RUSTC) main.rs
5+
$(call RUN,main)
6+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extern void foo();
2+
3+
void bar() { foo(); }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void foo() {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[link(name = "foo")]
12+
#[link(name = "bar")]
13+
#[link(name = "foo")]
14+
extern {
15+
fn bar();
16+
}
17+
18+
fn main() {
19+
unsafe { bar() }
20+
}

0 commit comments

Comments
 (0)