diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-06 09:55:35 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-06 10:45:08 -0800 |
| commit | 13e10f5b7e6fef35770cb6f835492893d43c2e07 (patch) | |
| tree | 7c1cc20e2b8af86c3ee586e415aeb4f97282382e /src/test/auxiliary | |
| parent | fb80b384f4b6611ce4d880991a1026e93acdd6f7 (diff) | |
| download | rust-13e10f5b7e6fef35770cb6f835492893d43c2e07.tar.gz rust-13e10f5b7e6fef35770cb6f835492893d43c2e07.zip | |
test: Add some tests for closed issues
Closes #6738 Closes #7061 Closes #7899 Closes #9719 Closes #10028 Closes #10228 Closes #10401 Closes #11192 Closes #11508 Closes #11529 Closes #11873 Closes #11925
Diffstat (limited to 'src/test/auxiliary')
| -rw-r--r-- | src/test/auxiliary/issue-10028.rs | 20 | ||||
| -rw-r--r-- | src/test/auxiliary/issue-11508.rs | 20 | ||||
| -rw-r--r-- | src/test/auxiliary/issue-11529.rs | 11 | ||||
| -rw-r--r-- | src/test/auxiliary/issue-7899.rs | 11 |
4 files changed, 62 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue-10028.rs b/src/test/auxiliary/issue-10028.rs new file mode 100644 index 00000000000..00fdb3e40b9 --- /dev/null +++ b/src/test/auxiliary/issue-10028.rs @@ -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. + +#[unsafe_no_drop_flag] +pub struct ZeroLengthThingWithDestructor; +impl Drop for ZeroLengthThingWithDestructor { + fn drop(&mut self) {} +} +impl ZeroLengthThingWithDestructor { + pub fn new() -> ZeroLengthThingWithDestructor { + ZeroLengthThingWithDestructor + } +} diff --git a/src/test/auxiliary/issue-11508.rs b/src/test/auxiliary/issue-11508.rs new file mode 100644 index 00000000000..dfdde5e5e4e --- /dev/null +++ b/src/test/auxiliary/issue-11508.rs @@ -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. + +pub struct Closed01<F>(F); + +pub trait Bar { fn new() -> Self; } + +impl<T: Bar> Bar for Closed01<T> { + fn new() -> Closed01<T> { Closed01(Bar::new()) } +} +impl Bar for f32 { fn new() -> f32 { 1.0 } } + +pub fn random<T: Bar>() -> T { Bar::new() } diff --git a/src/test/auxiliary/issue-11529.rs b/src/test/auxiliary/issue-11529.rs new file mode 100644 index 00000000000..9d500532401 --- /dev/null +++ b/src/test/auxiliary/issue-11529.rs @@ -0,0 +1,11 @@ +// 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. + +pub struct A<'a>(&'a int); diff --git a/src/test/auxiliary/issue-7899.rs b/src/test/auxiliary/issue-7899.rs new file mode 100644 index 00000000000..f1a0fcffd16 --- /dev/null +++ b/src/test/auxiliary/issue-7899.rs @@ -0,0 +1,11 @@ +// 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. + +pub struct V2<T>(T, T); |
