Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests + Fix rustdoc regression + Fix rebase
- Loading branch information
1 parent
9c05fb2
commit 2859f8b
Showing
10 changed files
with
134 additions
and
4 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
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,35 @@ | ||
// Copyright 2016 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. | ||
|
||
#![feature(rustc_attrs)] | ||
#![allow(warnings)] | ||
|
||
struct CNFParser { | ||
token: char, | ||
} | ||
|
||
impl CNFParser { | ||
fn is_whitespace(c: char) -> bool { | ||
c == ' ' || c == '\n' | ||
} | ||
|
||
fn consume_whitespace(&mut self) { | ||
self.consume_while(&(CNFParser::is_whitespace)) | ||
} | ||
|
||
fn consume_while(&mut self, p: &Fn(char) -> bool) { | ||
while p(self.token) { | ||
return | ||
} | ||
} | ||
} | ||
|
||
#[rustc_error] | ||
fn main() {} //~ ERROR compilation successful |
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,21 @@ | ||
// Copyright 2016 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. | ||
|
||
enum Delicious { | ||
Pie = 0x1, | ||
Apple = 0x2, | ||
ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, | ||
//~^ ERROR constant evaluation error: unresolved path in constant expression | ||
} | ||
|
||
const FOO: [u32; u8::MIN as usize] = []; | ||
//~^ ERROR array length constant evaluation error: unresolved path in constant expression | ||
|
||
fn main() {} |
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,22 @@ | ||
// Copyright 2016 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. | ||
|
||
enum S { | ||
A, | ||
} | ||
|
||
fn bug(l: S) { | ||
match l { | ||
S::B{ } => { }, | ||
//~^ ERROR ambiguous associated type; specify the type using the syntax `<S as Trait>::B` | ||
} | ||
} | ||
|
||
fn main () {} |
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,37 @@ | ||
// Copyright 2016 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. | ||
|
||
struct S; | ||
|
||
trait Tr { | ||
type A; | ||
} | ||
|
||
impl Tr for S { | ||
type A = S; | ||
} | ||
|
||
fn f<T: Tr>() { | ||
match S { | ||
T::A {} => {} //~ ERROR `T::A` does not name a struct or a struct variant | ||
} | ||
} | ||
|
||
fn g<T: Tr<A = S>>() { | ||
match S { | ||
T::A {} => {} //~ ERROR `T::A` does not name a struct or a struct variant | ||
} | ||
} | ||
|
||
fn main() { | ||
match S { | ||
S::A {} => {} //~ ERROR ambiguous associated type | ||
} | ||
} |