Skip to content

Commit

Permalink
Rollup merge of rust-lang#24259 - lstat:needstest, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Apr 10, 2015
2 parents 4aea07a + 2a88b79 commit bbec378
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/compile-fail/issue-20772.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2015 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 T : Iterator<Item=Self::Item>
//~^ ERROR unsupported cyclic reference between types/traits detected
{}

fn main() {}
16 changes: 16 additions & 0 deletions src/test/compile-fail/issue-20939.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2015 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 {}

impl<'a> Foo for Foo+'a {}
//~^ ERROR the object type `Foo + 'a` automatically implements the trait `Foo`

fn main() {}
20 changes: 20 additions & 0 deletions src/test/compile-fail/issue-21950.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2015 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.

// ignore-tidy-linelength

use std::ops::Add;

fn main() {
let x = &10 as
//~^ ERROR the value of the associated type `Output` (from the trait `core::ops::Add`) must be specified
&Add;
//~^ ERROR the type parameter `RHS` must be explicitly specified in an object type because its default value `Self` references the type `Self`
}
19 changes: 19 additions & 0 deletions src/test/compile-fail/issue-22034.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2015 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.

extern crate libc;

fn main() {
let foo: *mut libc::c_void;
let cb: &mut Fn() = unsafe {
&mut *(foo as *mut Fn())
//~^ ERROR use of possibly uninitialized variable: `foo`
};
}

0 comments on commit bbec378

Please sign in to comment.