Skip to content

Commit b60aff6

Browse files
committed
---
yaml --- r: 146077 b: refs/heads/try2 c: 7e4404b h: refs/heads/master i: 146075: 864b918 v: v3
1 parent ab050f0 commit b60aff6

File tree

11 files changed

+101
-126
lines changed

11 files changed

+101
-126
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: 3675e42334e9e58ae16446f52b2c6c951e8e1628
8+
refs/heads/try2: 7e4404b6fbbf28bbe115ab8837f929e51c831a31
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/glob.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,32 @@ pub struct GlobIterator {
3939
priv todo: ~[(Path,uint)]
4040
}
4141

42-
/**
43-
* Return an iterator that produces all the Paths that match the given pattern,
44-
* which may be absolute or relative to the current working directory.
45-
*
46-
* This method uses the default match options and is equivalent to calling
47-
* `glob_with(pattern, MatchOptions::new())`. Use `glob_with` directly if you
48-
* want to use non-default match options.
49-
*
50-
* # Example
51-
*
52-
* Consider a directory `/media/pictures` containing only the files `kittens.jpg`,
53-
* `puppies.jpg` and `hamsters.gif`:
54-
*
55-
* ```rust
56-
* for path in glob("/media/pictures/*.jpg") {
57-
* println(path.to_str());
58-
* }
59-
* ```
60-
*
61-
* The above code will print:
62-
*
63-
* ```
64-
* /media/pictures/kittens.jpg
65-
* /media/pictures/puppies.jpg
66-
* ```
67-
*/
42+
///
43+
/// Return an iterator that produces all the Paths that match the given pattern,
44+
/// which may be absolute or relative to the current working directory.
45+
///
46+
/// is method uses the default match options and is equivalent to calling
47+
/// `glob_with(pattern, MatchOptions::new())`. Use `glob_with` directly if you
48+
/// want to use non-default match options.
49+
///
50+
/// # Example
51+
///
52+
/// Consider a directory `/media/pictures` containing only the files `kittens.jpg`,
53+
/// `puppies.jpg` and `hamsters.gif`:
54+
///
55+
/// ```rust
56+
/// for path in glob("/media/pictures/*.jpg") {
57+
/// println(path.to_str());
58+
/// }
59+
/// ```
60+
///
61+
/// The above code will print:
62+
///
63+
/// ```
64+
/// /media/pictures/kittens.jpg
65+
/// /media/pictures/puppies.jpg
66+
/// ```
67+
///
6868
pub fn glob(pattern: &str) -> GlobIterator {
6969
glob_with(pattern, MatchOptions::new())
7070
}

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,8 +2797,8 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
27972797

27982798
ifn!(intrinsics, "llvm.fabs.f32", [Type::f32()], Type::f32());
27992799
ifn!(intrinsics, "llvm.fabs.f64", [Type::f64()], Type::f64());
2800-
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32()], Type::f32());
2801-
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64()], Type::f64());
2800+
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32(), Type::f32()], Type::f32());
2801+
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64(), Type::f64()], Type::f64());
28022802

28032803
ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
28042804
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
@@ -2807,12 +2807,12 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
28072807
ifn!(intrinsics, "llvm.trunc.f32",[Type::f32()], Type::f32());
28082808
ifn!(intrinsics, "llvm.trunc.f64",[Type::f64()], Type::f64());
28092809

2810-
ifn!(intrinsics, "llvm.rint.f32",[Type::f64()], Type::f64());
2811-
ifn!(intrinsics, "llvm.rint.f64",[Type::f64()], Type::f64());
2812-
ifn!(intrinsics, "llvm.nearbyint.f32",[Type::f64()], Type::f64());
2813-
ifn!(intrinsics, "llvm.nearbyint.f64",[Type::f64()], Type::f64());
2814-
ifn!(intrinsics, "llvm.round.f32",[Type::f64()], Type::f64());
2815-
ifn!(intrinsics, "llvm.round.f64",[Type::f64()], Type::f64());
2810+
ifn!(intrinsics, "llvm.rint.f32", [Type::f32()], Type::f32());
2811+
ifn!(intrinsics, "llvm.rint.f64", [Type::f64()], Type::f64());
2812+
ifn!(intrinsics, "llvm.nearbyint.f32", [Type::f32()], Type::f32());
2813+
ifn!(intrinsics, "llvm.nearbyint.f64", [Type::f64()], Type::f64());
2814+
ifn!(intrinsics, "llvm.round.f32", [Type::f32()], Type::f32());
2815+
ifn!(intrinsics, "llvm.round.f64", [Type::f64()], Type::f64());
28162816

28172817
ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
28182818
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());

branches/try2/src/librustc/middle/trans/intrinsic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,20 +460,20 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
460460
"fmaf64" => simple_llvm_intrinsic(bcx, "llvm.fma.f64", 3),
461461
"fabsf32" => simple_llvm_intrinsic(bcx, "llvm.fabs.f32", 1),
462462
"fabsf64" => simple_llvm_intrinsic(bcx, "llvm.fabs.f64", 1),
463-
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 1),
464-
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 1),
463+
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 2),
464+
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 2),
465465
"floorf32" => simple_llvm_intrinsic(bcx, "llvm.floor.f32", 1),
466466
"floorf64" => simple_llvm_intrinsic(bcx, "llvm.floor.f64", 1),
467467
"ceilf32" => simple_llvm_intrinsic(bcx, "llvm.ceil.f32", 1),
468468
"ceilf64" => simple_llvm_intrinsic(bcx, "llvm.ceil.f64", 1),
469469
"truncf32" => simple_llvm_intrinsic(bcx, "llvm.trunc.f32", 1),
470470
"truncf64" => simple_llvm_intrinsic(bcx, "llvm.trunc.f64", 1),
471-
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
472471
"rintf32" => simple_llvm_intrinsic(bcx, "llvm.rint.f32", 1),
473-
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
474-
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
475-
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
476-
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
472+
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
473+
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
474+
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
475+
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
476+
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
477477
"ctpop8" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i8", 1),
478478
"ctpop16" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i16", 1),
479479
"ctpop32" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i32", 1),

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3809,8 +3809,8 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
38093809
}
38103810
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
38113811
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812-
"copysignf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3813-
"copysignf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812+
"copysignf32" => (0, ~[ ty::mk_f32(), ty::mk_f32() ], ty::mk_f32()),
3813+
"copysignf64" => (0, ~[ ty::mk_f64(), ty::mk_f64() ], ty::mk_f64()),
38143814
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
38153815
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
38163816
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),

branches/try2/src/libstd/os.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,6 @@ pub fn self_exe_path() -> Option<Path> {
546546
load_self().and_then(|path| Path::new_opt(path).map(|mut p| { p.pop(); p }))
547547
}
548548

549-
550-
/**
551-
* Returns the path to the user's home directory, if known.
552-
}
553-
554-
555549
/**
556550
* Returns the path to the user's home directory, if known.
557551
*

branches/try2/src/libstd/unstable/intrinsics.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,6 @@ extern "rust-intrinsic" {
330330

331331
pub fn visit_tydesc(td: *TyDesc, tv: &mut TyVisitor);
332332

333-
#[cfg(not(stage0))]
334-
pub fn frame_address(f: &fn(*u8));
335-
336333
/// Get the address of the `__morestack` stack growth function.
337334
pub fn morestack_addr() -> *();
338335

@@ -414,9 +411,9 @@ extern "rust-intrinsic" {
414411
pub fn fabsf64(x: f64) -> f64;
415412

416413
#[cfg(not(stage0))]
417-
pub fn copysignf32(x: f32) -> f32;
414+
pub fn copysignf32(x: f32, y: f32) -> f32;
418415
#[cfg(not(stage0))]
419-
pub fn copysignf64(x: f64) -> f64;
416+
pub fn copysignf64(x: f64, y: f64) -> f64;
420417

421418
pub fn floorf32(x: f32) -> f32;
422419
pub fn floorf64(x: f64) -> f64;

branches/try2/src/libsyntax/parse/lexer.rs

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -373,49 +373,49 @@ pub fn is_block_non_doc_comment(s: &str) -> bool {
373373
fn consume_block_comment(rdr: @mut StringReader)
374374
-> Option<TokenAndSpan> {
375375
// block comments starting with "/**" or "/*!" are doc-comments
376-
let res = if rdr.curr == '*' || rdr.curr == '!' {
377-
let start_bpos = rdr.pos - BytePos(3u);
378-
while !(rdr.curr == '*' && nextch(rdr) == '/') && !is_eof(rdr) {
379-
bump(rdr);
380-
}
376+
let is_doc_comment = rdr.curr == '*' || rdr.curr == '!';
377+
let start_bpos = rdr.pos - BytePos(if is_doc_comment {3u} else {2u});
378+
379+
let mut level: int = 1;
380+
while level > 0 {
381381
if is_eof(rdr) {
382-
fatal_span(rdr, start_bpos, rdr.last_pos,
383-
~"unterminated block doc-comment");
384-
} else {
382+
let msg = if is_doc_comment {
383+
~"unterminated block doc-comment"
384+
} else {
385+
~"unterminated block comment"
386+
};
387+
fatal_span(rdr, start_bpos, rdr.last_pos, msg);
388+
} else if rdr.curr == '/' && nextch(rdr) == '*' {
389+
level += 1;
385390
bump(rdr);
386391
bump(rdr);
387-
do with_str_from(rdr, start_bpos) |string| {
388-
// but comments with only "*"s between two "/"s are not
389-
if !is_block_non_doc_comment(string) {
390-
Some(TokenAndSpan{
391-
tok: token::DOC_COMMENT(str_to_ident(string)),
392-
sp: codemap::mk_sp(start_bpos, rdr.pos)
393-
})
394-
} else {
395-
None
396-
}
397-
}
392+
} else if rdr.curr == '*' && nextch(rdr) == '/' {
393+
level -= 1;
394+
bump(rdr);
395+
bump(rdr);
396+
} else {
397+
bump(rdr);
398398
}
399-
} else {
400-
let start_bpos = rdr.last_pos - BytePos(2u);
401-
loop {
402-
if is_eof(rdr) {
403-
fatal_span(rdr, start_bpos, rdr.last_pos,
404-
~"unterminated block comment");
405-
}
406-
if rdr.curr == '*' && nextch(rdr) == '/' {
407-
bump(rdr);
408-
bump(rdr);
409-
break;
399+
}
400+
401+
let res = if is_doc_comment {
402+
do with_str_from(rdr, start_bpos) |string| {
403+
// but comments with only "*"s between two "/"s are not
404+
if !is_block_non_doc_comment(string) {
405+
Some(TokenAndSpan{
406+
tok: token::DOC_COMMENT(str_to_ident(string)),
407+
sp: codemap::mk_sp(start_bpos, rdr.pos)
408+
})
410409
} else {
411-
bump(rdr);
410+
None
412411
}
413412
}
413+
} else {
414414
None
415415
};
416-
// restart whitespace munch.
417416

418-
if res.is_some() { res } else { consume_whitespace_and_comments(rdr) }
417+
// restart whitespace munch.
418+
if res.is_some() { res } else { consume_whitespace_and_comments(rdr) }
419419
}
420420

421421
fn scan_exponent(rdr: @mut StringReader, start_bpos: BytePos) -> Option<~str> {
@@ -1056,4 +1056,12 @@ mod test {
10561056
assert!(!is_line_non_doc_comment("/// blah"));
10571057
assert!(is_line_non_doc_comment("////"));
10581058
}
1059+
1060+
#[test] fn nested_block_comments() {
1061+
let env = setup(@"/* /* */ */'a'");
1062+
let TokenAndSpan {tok, sp: _} =
1063+
env.string_reader.next_token();
1064+
assert_eq!(tok,token::LIT_CHAR('a' as u32));
1065+
}
1066+
10591067
}

branches/try2/src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2013-10-21 6e6981c
2+
freebsd-x86_64 7f630581d0e881483272140e84bc2f494daf6204
3+
linux-i386 5c754455610013bbe448e8f6ef8ba1a05b167919
4+
linux-x86_64 d993920210413add241f7b235dec0e4d72164be5
5+
macos-i386 8b48d8598f4d503e6bbc40bff52457c659d6de2b
6+
macos-x86_64 e84bcd0b08af6a0ff602dca7a5bec21a001c5eb8
7+
winnt-i386 3f4441509f89a794ec9b53e38756e6124df78df0
8+
19
S 2013-10-16 6c08cc2
210
freebsd-x86_64 03caf882078eff9b4e04d116732b41a3cdfc260f
311
linux-i386 ce30bb90434e9eb9920028a5408e1f986ba2ad5d

branches/try2/src/test/compile-fail/no-comment-balancing.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,18 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-fast
11+
/* This test checks that nested comments are supported
1212
13-
mod rusti {
14-
extern "rust-intrinsic" {
15-
pub fn frame_address(f: &fn(*u8));
16-
}
17-
}
13+
/*
14+
This should not fail
15+
*/
16+
*/
1817

1918
pub fn main() {
20-
unsafe {
21-
do rusti::frame_address |addr| {
22-
assert!(addr.is_not_null());
23-
}
24-
}
2519
}

0 commit comments

Comments
 (0)