-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to
Ignore
output mode for () blocks
- Loading branch information
Showing
3 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// xfail-pretty | ||
|
||
// Don't fail on blocks without results | ||
// There are several tests in this run-pass that raised | ||
// when this bug was oppened. The cases where the compiler | ||
// failed before the fix have a comment. | ||
|
||
struct S {x:()} | ||
|
||
|
||
fn test(slot: &mut Option<proc() -> proc()>, _: proc()) -> () { | ||
let a = slot.take(); | ||
let _a = match a { | ||
// `{let .. a(); }` would break | ||
Some(a) => { let _a = a(); }, | ||
None => (), | ||
}; | ||
} | ||
|
||
fn not(b: bool) -> bool { | ||
if b { | ||
!b | ||
} else { | ||
// `fail!(...)` would break | ||
fail!("Break the compiler"); | ||
} | ||
} | ||
|
||
pub fn main() { | ||
// {} would break | ||
let _r = {}; | ||
let mut slot = None; | ||
// `{ test(...); }` would break | ||
let _s : S = S{ x: { test(&mut slot, proc() {}); } }; | ||
|
||
let _b = not(true); | ||
} |
31576c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from nikomatsakis
at flaper87@31576c7
31576c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging FlaPer87/rust/issue-11709 = 31576c7 into auto
31576c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlaPer87/rust/issue-11709 = 31576c7 merged ok, testing candidate = cf9164f
31576c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/4137
success: http://buildbot.rust-lang.org/builders/auto-mac-32-nopt-c/builds/1979
success: http://buildbot.rust-lang.org/builders/auto-mac-32-nopt-t/builds/1981
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/4136
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/3236
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/3242
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/4151
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/3239
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/3245
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/4153
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/3239
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/3244
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/3313
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1091
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/4144
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/3245
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/3250
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/3913
31576c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = cf9164f