-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 Wieczorek
committed
Aug 17, 2014
1 parent
a12a4dd
commit 5b9cd45
Showing
4 changed files
with
90 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,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. | ||
|
||
trait Foo { | ||
fn bar(&mut self, other: &mut Foo); | ||
} | ||
|
||
struct Baz; | ||
|
||
impl Foo for Baz { | ||
fn bar(&mut self, other: &Foo) {} | ||
//~^ ERROR method `bar` has an incompatible type for trait: values differ in mutability [E0053] | ||
} | ||
|
||
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,33 @@ | ||
// 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(overloaded_calls)] | ||
|
||
use std::{fmt, ops}; | ||
|
||
struct Shower<T> { | ||
x: T | ||
} | ||
|
||
impl<T: fmt::Show> ops::Fn<(), ()> for Shower<T> { | ||
fn call(&self, _args: ()) { | ||
//~^ ERROR `call` has an incompatible type for trait: expected "rust-call" fn but found "Rust" fn | ||
println!("{}", self.x); | ||
} | ||
} | ||
|
||
fn make_shower<T>(x: T) -> Shower<T> { | ||
Shower { x: x } | ||
} | ||
|
||
pub fn main() { | ||
let show3 = make_shower(3i); | ||
show3(); | ||
} |
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. | ||
|
||
enum Foo { | ||
A = 1i64, | ||
//~^ ERROR mismatched types: expected `int` but found `i64` | ||
B = 2u8 | ||
//~^ ERROR mismatched types: expected `int` but found `u8` | ||
} | ||
|
||
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,17 @@ | ||
// 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() { | ||
if true { return } | ||
match () { | ||
() => { static MAGIC: uint = 0; } | ||
} | ||
} | ||
|
5b9cd45
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 pcwalton
at https://github.com/jakub-/rust/commit/5b9cd453c971b967049e63f5c048fbadf2a8e261
5b9cd45
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/needstest = 5b9cd45 into auto
5b9cd45
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/needstest = 5b9cd45 merged ok, testing candidate = 1721e81
5b9cd45
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/896
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/896
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/895
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/896
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/891
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/892
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/891
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/897
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/892
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/891
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/894
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/892
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/892
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/893
5b9cd45
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 = 1721e81