Skip to content

Commit ab5f37a

Browse files
committed
---
yaml --- r: 152216 b: refs/heads/try2 c: 60e0f6f h: refs/heads/master v: v3
1 parent 3b9eb76 commit ab5f37a

File tree

28 files changed

+52
-131
lines changed

28 files changed

+52
-131
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 837013717abaa0bb0e1a63f9fb2847c1f3d64479
8+
refs/heads/try2: 60e0f6fbb06d8a1c848cd8793edafa42ba4e1940
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ An example of re-exporting:
904904
~~~~
905905
# fn main() { }
906906
mod quux {
907-
pub use quux::foo::{bar, baz};
907+
pub use quux::foo::*;
908908
909909
pub mod foo {
910910
pub fn bar() { }
@@ -913,10 +913,10 @@ mod quux {
913913
}
914914
~~~~
915915

916-
In this example, the module `quux` re-exports two public names defined in `foo`.
916+
In this example, the module `quux` re-exports all of the public names defined in `foo`.
917917

918918
Also note that the paths contained in `use` items are relative to the crate root.
919-
So, in the previous example, the `use` refers to `quux::foo::{bar, baz}`, and not simply to `foo::{bar, baz}`.
919+
So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`.
920920
This also means that top-level module declarations should be at the crate root if direct usage
921921
of the declared modules within `use` items is desired. It is also possible to use `self` and `super`
922922
at the beginning of a `use` item to refer to the current and direct parent modules respectively.

branches/try2/src/libregex_macros/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
html_root_url = "http://doc.rust-lang.org/")]
2121

2222
#![feature(macro_registrar, managed_boxes, quote)]
23-
#![allow(unused_imports)] // `quote_expr!` adds some `use` globs which may be unused
2423

2524
extern crate regex;
2625
extern crate syntax;

branches/try2/src/librustdoc/html/markdown.rs

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
287287
slice::raw::buf_as_slice((*lang).data,
288288
(*lang).size as uint, |lang| {
289289
let s = str::from_utf8(lang).unwrap();
290-
parse_lang_string(s)
290+
(s.contains("should_fail"),
291+
s.contains("no_run"),
292+
s.contains("ignore"),
293+
s.contains("notrust"))
291294
})
292295
};
293296
if notrust { return }
@@ -337,35 +340,6 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
337340
}
338341
}
339342

340-
fn parse_lang_string(string: &str) -> (bool,bool,bool,bool) {
341-
let mut seen_rust_tags = false;
342-
let mut seen_other_tags = false;
343-
let mut should_fail = false;
344-
let mut no_run = false;
345-
let mut ignore = false;
346-
let mut notrust = false;
347-
348-
let mut tokens = string.as_slice().split(|c: char|
349-
!(c == '_' || c == '-' || c.is_alphanumeric())
350-
);
351-
352-
for token in tokens {
353-
match token {
354-
"" => {},
355-
"should_fail" => { should_fail = true; seen_rust_tags = true; },
356-
"no_run" => { no_run = true; seen_rust_tags = true; },
357-
"ignore" => { ignore = true; seen_rust_tags = true; },
358-
"notrust" => { notrust = true; seen_rust_tags = true; },
359-
"rust" => { notrust = false; seen_rust_tags = true; },
360-
_ => { seen_other_tags = true }
361-
}
362-
}
363-
364-
let notrust = notrust || (seen_other_tags && !seen_rust_tags);
365-
366-
(should_fail, no_run, ignore, notrust)
367-
}
368-
369343
/// By default this markdown renderer generates anchors for each header in the
370344
/// rendered document. The anchor name is the contents of the header spearated
371345
/// by hyphens, and a task-local map is used to disambiguate among duplicate
@@ -393,22 +367,3 @@ impl<'a> fmt::Show for MarkdownWithToc<'a> {
393367
render(fmt, md.as_slice(), true)
394368
}
395369
}
396-
397-
#[cfg(test)]
398-
mod tests {
399-
use super::parse_lang_string;
400-
401-
#[test]
402-
fn test_parse_lang_string() {
403-
assert_eq!(parse_lang_string(""), (false,false,false,false))
404-
assert_eq!(parse_lang_string("rust"), (false,false,false,false))
405-
assert_eq!(parse_lang_string("sh"), (false,false,false,true))
406-
assert_eq!(parse_lang_string("notrust"), (false,false,false,true))
407-
assert_eq!(parse_lang_string("ignore"), (false,false,true,false))
408-
assert_eq!(parse_lang_string("should_fail"), (true,false,false,false))
409-
assert_eq!(parse_lang_string("no_run"), (false,true,false,false))
410-
assert_eq!(parse_lang_string("{.no_run .example}"), (false,true,false,false))
411-
assert_eq!(parse_lang_string("{.sh .should_fail}"), (true,false,false,false))
412-
assert_eq!(parse_lang_string("{.example .rust}"), (false,false,false,false))
413-
}
414-
}

branches/try2/src/libsyntax/ext/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
// except according to those terms.
1010

1111
use abi;
12-
use ast::{P, Ident, Generics, NodeId, Expr};
12+
use ast::{P, Ident};
1313
use ast;
1414
use ast_util;
1515
use attr;
1616
use codemap::{Span, respan, Spanned, DUMMY_SP};
1717
use ext::base::ExtCtxt;
18+
use ext::quote::rt::*;
1819
use fold::Folder;
1920
use owned_slice::OwnedSlice;
2021
use parse::token::special_idents;
21-
use parse::token::InternedString;
2222
use parse::token;
2323

2424
pub struct Field {

branches/try2/src/libsyntax/ext/deriving/bounds.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use ast::{MetaItem, MetaWord, Item};
1212
use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::deriving::generic::*;
15-
use ext::deriving::generic::ty::*;
1615

1716
pub fn expand_deriving_bound(cx: &mut ExtCtxt,
1817
span: Span,

branches/try2/src/libsyntax/ext/deriving/clone.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16-
use ext::deriving::generic::ty::*;
1716
use parse::token::InternedString;
1817

1918
pub fn expand_deriving_clone(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/cmp/eq.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16-
use ext::deriving::generic::ty::*;
1716
use parse::token::InternedString;
1817

1918
pub fn expand_deriving_eq(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/cmp/ord.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::AstBuilder;
1616
use ext::deriving::generic::*;
17-
use ext::deriving::generic::ty::*;
1817
use parse::token::InternedString;
1918

2019
pub fn expand_deriving_ord(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/cmp/totaleq.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16-
use ext::deriving::generic::ty::*;
1716
use parse::token::InternedString;
1817

1918
pub fn expand_deriving_totaleq(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/cmp/totalord.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::AstBuilder;
1616
use ext::deriving::generic::*;
17-
use ext::deriving::generic::ty::*;
1817
use parse::token::InternedString;
1918

2019
use std::cmp::{Ordering, Equal, Less, Greater};

branches/try2/src/libsyntax/ext/deriving/decodable.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use codemap::Span;
1919
use ext::base::ExtCtxt;
2020
use ext::build::AstBuilder;
2121
use ext::deriving::generic::*;
22-
use ext::deriving::generic::ty::*;
2322
use parse::token::InternedString;
2423
use parse::token;
2524

branches/try2/src/libsyntax/ext/deriving/default.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16-
use ext::deriving::generic::ty::*;
1716
use parse::token::InternedString;
1817

1918
pub fn expand_deriving_default(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/encodable.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ use codemap::Span;
8888
use ext::base::ExtCtxt;
8989
use ext::build::AstBuilder;
9090
use ext::deriving::generic::*;
91-
use ext::deriving::generic::ty::*;
9291
use parse::token;
9392

9493
pub fn expand_deriving_encodable(cx: &mut ExtCtxt,
@@ -176,14 +175,6 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
176175
stmts.push(cx.stmt_expr(call));
177176
}
178177

179-
// unit structs have no fields and need to return Ok()
180-
if stmts.is_empty() {
181-
let ret_ok = cx.expr(trait_span,
182-
ExprRet(Some(cx.expr_ok(trait_span,
183-
cx.expr_lit(trait_span, LitNil)))));
184-
stmts.push(cx.stmt_expr(ret_ok));
185-
}
186-
187178
let blk = cx.lambda_stmts_1(trait_span, stmts, blkarg);
188179
cx.expr_method_call(trait_span,
189180
encoder,

branches/try2/src/libsyntax/ext/deriving/generic/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,8 @@ use codemap::Span;
191191
use owned_slice::OwnedSlice;
192192
use parse::token::InternedString;
193193

194-
use self::ty::*;
195-
196-
pub mod ty;
194+
pub use self::ty::*;
195+
mod ty;
197196

198197
pub struct TraitDef<'a> {
199198
/// The span for the current #[deriving(Foo)] header.

branches/try2/src/libsyntax/ext/deriving/hash.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::AstBuilder;
1616
use ext::deriving::generic::*;
17-
use ext::deriving::generic::ty::*;
1817
use parse::token::InternedString;
1918

2019
pub fn expand_deriving_hash(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/primitive.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::AstBuilder;
1616
use ext::deriving::generic::*;
17-
use ext::deriving::generic::ty::*;
1817
use parse::token::InternedString;
1918

2019
pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/deriving/rand.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::{AstBuilder};
1616
use ext::deriving::generic::*;
17-
use ext::deriving::generic::ty::*;
1817

1918
pub fn expand_deriving_rand(cx: &mut ExtCtxt,
2019
span: Span,

branches/try2/src/libsyntax/ext/deriving/show.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use ext::format;
1515
use ext::base::ExtCtxt;
1616
use ext::build::AstBuilder;
1717
use ext::deriving::generic::*;
18-
use ext::deriving::generic::ty::*;
1918
use parse::token;
2019

2120
use collections::HashMap;

branches/try2/src/libsyntax/ext/deriving/zero.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16-
use ext::deriving::generic::ty::*;
1716
use parse::token::InternedString;
1817

1918
pub fn expand_deriving_zero(cx: &mut ExtCtxt,

branches/try2/src/libsyntax/ext/quote.rs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,8 @@ pub mod rt {
3636
use parse;
3737
use print::pprust;
3838

39-
#[cfg(not(stage0))]
40-
use ast::{TokenTree, Generics, Expr};
41-
42-
// NOTE remove this after snapshot
43-
// (stage0 quasiquoter needs this)
44-
#[cfg(stage0)]
45-
pub use ast::{Generics, TokenTree, TTTok};
46-
#[cfg(stage0)]
47-
pub use parse::token::{IDENT, SEMI, LBRACE, RBRACE, LIFETIME, COLON, AND, BINOP, EQ,
48-
LBRACKET, RBRACKET, LPAREN, RPAREN, POUND, NOT, MOD_SEP, DOT, COMMA};
49-
39+
pub use ast::*;
40+
pub use parse::token::*;
5041
pub use parse::new_parser_from_tts;
5142
pub use codemap::{BytePos, Span, dummy_spanned};
5243

@@ -81,7 +72,7 @@ pub mod rt {
8172

8273
impl ToSource for ast::Ident {
8374
fn to_source(&self) -> String {
84-
token::get_ident(*self).get().to_string()
75+
get_ident(*self).get().to_string()
8576
}
8677
}
8778

@@ -694,14 +685,11 @@ fn expand_wrapper(cx: &ExtCtxt,
694685
sp: Span,
695686
cx_expr: @ast::Expr,
696687
expr: @ast::Expr) -> @ast::Expr {
697-
let uses = [
698-
&["syntax", "ast"],
699-
&["syntax", "parse", "token"],
700-
&["syntax", "ext", "quote", "rt"],
701-
].iter().map(|path| {
702-
let path = path.iter().map(|s| s.to_string()).collect();
703-
cx.view_use_glob(sp, ast::Inherited, ids_ext(path))
704-
}).collect();
688+
let uses = vec![ cx.view_use_glob(sp, ast::Inherited,
689+
ids_ext(vec!["syntax".to_string(),
690+
"ext".to_string(),
691+
"quote".to_string(),
692+
"rt".to_string()])) ];
705693

706694
let stmt_let_ext_cx = cx.stmt_let(sp, false, id_ext("ext_cx"), cx_expr);
707695

branches/try2/src/libsyntax/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub mod util {
4848
pub mod syntax {
4949
pub use ext;
5050
pub use parse;
51-
pub use ast;
5251
}
5352

5453
pub mod owned_slice;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
fn f(_: extern "Rust" fn()) {}
12+
extern fn bar() {}
13+
14+
fn main() { f(bar) }
15+
//~^ ERROR: expected `fn()` but found `extern "C" fn()`

branches/try2/src/test/run-pass/extern-pass-TwoU64s.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// Test a foreign function that accepts and returns a struct
1212
// by value.
1313

14+
// ignore-win32 #9205
15+
1416
#[deriving(PartialEq, Show)]
1517
struct TwoU64s {
1618
one: u64, two: u64

branches/try2/src/test/run-pass/extern-return-TwoU64s.rs

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

11+
// ignore-win32 #9205
12+
1113
struct TwoU64s {
1214
one: u64, two: u64
1315
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
extern "Rust" fn main() {}

0 commit comments

Comments
 (0)