Skip to content

Commit

Permalink
Add even more tests
Browse files Browse the repository at this point in the history
Closes #8248
Closes #8249
Closes #8398
Closes #8401
  • Loading branch information
alexcrichton committed Aug 15, 2013
1 parent 443bf93 commit 1764e20
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/test/auxiliary/issue_8401.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2013 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.

// for this issue, this code must be built in a library

use std::cast;

trait A {}
struct B;
impl A for B {}

fn bar<T>(_: &mut A, _: &T) {}

fn foo<T>(t: &T) {
let b = B;
bar(unsafe { cast::transmute(&b as &A) }, t)
}

21 changes: 21 additions & 0 deletions src/test/run-pass/issue-8248.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2013 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 A {}
struct B;
impl A for B {}

fn foo(_: &mut A) {}

fn main() {
let mut b = B;
foo(&mut b as &mut A);
}

25 changes: 25 additions & 0 deletions src/test/run-pass/issue-8249.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2013 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 A {}
struct B;
impl A for B {}

struct C<'self> {
foo: &'self mut A,
}

fn foo(a: &mut A) {
C{ foo: a };
}

fn main() {
}

18 changes: 18 additions & 0 deletions src/test/run-pass/issue-8398.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2013 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::rt::io;

fn foo(a: &mut io::Writer) {
a.write([])
}

fn main(){}

16 changes: 16 additions & 0 deletions src/test/run-pass/issue-8401.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2013 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.

// aux-build:issue_8401.rs
// xfail-fast

extern mod issue_8401;

pub fn main() {}

5 comments on commit 1764e20

@bors
Copy link
Contributor

@bors bors commented on 1764e20 Aug 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from catamorphism
at alexcrichton@1764e20

@bors
Copy link
Contributor

@bors bors commented on 1764e20 Aug 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/add-tests = 1764e20 into auto

@bors
Copy link
Contributor

@bors bors commented on 1764e20 Aug 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/add-tests = 1764e20 merged ok, testing candidate = c4656cf

@bors
Copy link
Contributor

@bors bors commented on 1764e20 Aug 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1764e20 Aug 16, 2013

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 = c4656cf

Please sign in to comment.