-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jakub Bukaj
committed
Dec 17, 2014
1 parent
66c297d
commit 62d80df
Showing
35 changed files
with
935 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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. | ||
|
||
#![crate_type="lib"] | ||
|
||
use std::cell::RefCell; | ||
|
||
pub struct Window<Data>{ | ||
pub data: RefCell<Data> | ||
} | ||
|
||
impl<Data: Update> Window<Data> { | ||
pub fn update(&self, e: i32) { | ||
match e { | ||
1 => self.data.borrow_mut().update(), | ||
_ => {} | ||
} | ||
} | ||
} | ||
|
||
pub trait Update { | ||
fn update(&mut self); | ||
} |
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,31 @@ | ||
// 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. | ||
|
||
#![crate_type="lib"] | ||
|
||
struct Foo; | ||
// This is the ICE trigger | ||
struct Formatter; | ||
|
||
trait Show { | ||
fn fmt(&self); | ||
} | ||
|
||
impl Show for Foo { | ||
fn fmt(&self) {} | ||
} | ||
|
||
fn bar<T>(f: extern "Rust" fn(&T), t: &T) { } | ||
|
||
// ICE requirement: this has to be marked as inline | ||
#[inline] | ||
pub fn baz() { | ||
bar(Show::fmt, &Foo); | ||
} |
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,16 @@ | ||
// 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. | ||
|
||
fn f() -> int { | ||
(return 1, return 2) | ||
//~^ ERROR mismatched types: expected `int`, found `(_, _)` (expected int, found tuple) | ||
} | ||
|
||
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,25 @@ | ||
// 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. | ||
|
||
struct Foo { | ||
f: for <'b> |&'b int|: | ||
'b -> &'b int //~ ERROR use of undeclared lifetime name `'b` | ||
} | ||
|
||
fn main() { | ||
let mut x: Vec< for <'a> || | ||
:'a //~ ERROR use of undeclared lifetime name `'a` | ||
> = Vec::new(); | ||
x.push(|| {}); | ||
|
||
let foo = Foo { | ||
f: |x| x | ||
}; | ||
} |
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,20 @@ | ||
// 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. | ||
|
||
fn main() { | ||
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8]; | ||
|
||
for | ||
[x,y,z] | ||
//~^ ERROR refutable pattern in `for` loop binding: `[]` not covered | ||
in values.as_slice().chunks(3).filter(|&xs| xs.len() == 3) { | ||
println!("y={}", y); | ||
} | ||
} |
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,20 @@ | ||
// 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. | ||
|
||
fn main() { | ||
let v = vec![ | ||
&3i | ||
//~^ ERROR borrowed value does not live long enough | ||
]; | ||
|
||
for &&x in v.iter() { | ||
println!("{}", x + 3); | ||
} | ||
} |
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,24 @@ | ||
// 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. | ||
|
||
use std::slice::Chunks; | ||
use std::slice::MutChunks; | ||
|
||
fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: MutChunks<'a,T>) | ||
{ | ||
for | ||
&something | ||
//~^ ERROR the trait `core::kinds::Sized` is not implemented for the type `[T]` | ||
in arg2 | ||
{ | ||
} | ||
} | ||
|
||
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,15 @@ | ||
// 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. | ||
|
||
fn main() { | ||
panic!( | ||
1.2 //~ ERROR cannot determine a type for this expression | ||
); | ||
} |
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,18 @@ | ||
// 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. | ||
|
||
#![feature(unboxed_closures)] | ||
|
||
pub fn foo<'a, F: Fn<(&'a (),), ()>>(bar: F) { | ||
bar.call(( | ||
&(), //~ ERROR borrowed value does not live long enough | ||
)); | ||
} | ||
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,27 @@ | ||
// 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. | ||
|
||
#[deriving(Show)] | ||
struct Pair<T, V> (T, V); | ||
|
||
impl Pair< | ||
&str, //~ ERROR missing lifetime specifier | ||
int | ||
> { | ||
fn say(self: &Pair<&str, int>) { | ||
//~^ ERROR mismatched types: expected `Pair<&'static str, int>`, found `Pair<&str, int>` | ||
println!("{}", self); | ||
} | ||
} | ||
|
||
fn main() { | ||
let result = &Pair("shane", 1i); | ||
result.say(); | ||
} |
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,19 @@ | ||
// 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. | ||
|
||
type Step<'s, R, T> = |R, T|: 's -> R; | ||
type Transducer<'t, R, T, U> = |Step<'t, R, U>|: 't -> Step<'t, R, T>; | ||
|
||
fn mapping<'f, R, T, U>(f: |T|: 'f -> U) -> &'f Transducer<'f, R, T, U> { | ||
|step| |r, x| | ||
step(r, f(x)) //~ ERROR the type of this value must be known in this context | ||
} | ||
|
||
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,34 @@ | ||
// 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. | ||
|
||
#![feature(unboxed_closures)] | ||
#![feature(associated_types)] | ||
|
||
use std::any::Any; | ||
use std::intrinsics::TypeId; | ||
|
||
pub trait Pt {} | ||
pub trait Rt {} | ||
|
||
trait Private<P: Pt, R: Rt> { | ||
fn call(&self, p: P, r: R); | ||
} | ||
pub trait Public: Private< | ||
<Self as Public>::P, | ||
//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired | ||
<Self as Public>::R | ||
> { | ||
type P; | ||
type R; | ||
|
||
fn call_inner(&self); | ||
} | ||
|
||
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,36 @@ | ||
// 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. | ||
|
||
trait Set<T> { | ||
fn contains(&self, T) -> bool; | ||
fn set(&mut self, T); | ||
} | ||
|
||
impl<'a, T, S> Set<&'a [T]> for S where | ||
T: Copy, | ||
S: Set<T>, | ||
{ | ||
fn contains(&self, bits: &[T]) -> bool { | ||
bits.iter().all(|&bit| self.contains(bit)) | ||
} | ||
|
||
fn set(&mut self, bits: &[T]) { | ||
for &bit in bits.iter() { | ||
self.set(bit) | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
let bits: &[_] = &[0, 1]; | ||
|
||
0.contains(bits); | ||
//~^ ERROR the trait `Set<_>` is not implemented for the type `_` | ||
} |
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 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. | ||
|
||
#![feature(associated_types)] | ||
|
||
fn add_state(op: | ||
<int as HasState>::State | ||
//~^ ERROR it is currently unsupported to access associated types except through a type parameter | ||
) {} | ||
|
||
trait HasState { | ||
type State; | ||
} | ||
|
||
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,37 @@ | ||
// 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. | ||
|
||
use std::cell::RefCell; | ||
|
||
fn main() { | ||
let c = RefCell::new(vec![]); | ||
let mut y = 1u; | ||
c.push(|| y = 0); | ||
c.push(|| y = 0); | ||
//~^ ERROR cannot borrow `y` as mutable more than once at a time | ||
} | ||
|
||
fn ufcs() { | ||
let c = RefCell::new(vec![]); | ||
let mut y = 1u; | ||
|
||
Push::push(&c, || y = 0); | ||
Push::push(&c, || y = 0); | ||
} | ||
|
||
trait Push<'c> { | ||
fn push<'f: 'c>(&self, push: ||:'f -> ()); | ||
} | ||
|
||
impl<'c> Push<'c> for RefCell<Vec<||:'c>> { | ||
fn push<'f: 'c>(&self, fun: ||:'f -> ()) { | ||
self.borrow_mut().push(fun) | ||
} | ||
} |
Oops, something went wrong.
62d80df
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 alexcrichton
at https://github.com/jakub-/rust/commit/62d80df0c9dc229d3efda6d84d5967e717d8a996
62d80df
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 jakub-/rust/e-needstest = 62d80df into auto
62d80df
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.
status: {"merge_sha": "2a231594c41636f057de1de80d05b0aae03f8218"}
62d80df
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.
jakub-/rust/e-needstest = 62d80df merged ok, testing candidate = 2a23159
62d80df
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/2740
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/2735
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/2736
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/2727
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2726
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/2730
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/2722
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2722
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2388
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2385
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/1227
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/1220
62d80df
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 = 2a23159
62d80df
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 = 2a23159