diff options
| author | Steven Fackler <sfackler@gmail.com> | 2013-10-03 00:15:54 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2013-10-03 00:15:54 -0700 |
| commit | 435ca16f4fa7bd47c16de693054be5cba5fd4ebb (patch) | |
| tree | f03e768b9ca00cbd0b0e004b86f68a8a24f619aa /src/test | |
| parent | b637798a5aa7878daa57c147028e98f2c5bc03c5 (diff) | |
Close out #9155
Add a test to make sure it works and switch a private struct over to a newtype. Closes #9155
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/auxiliary/issue_9155.rs | 17 | ||||
| -rw-r--r-- | src/test/run-pass/issue_9155.rs | 20 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue_9155.rs b/src/test/auxiliary/issue_9155.rs new file mode 100644 index 00000000000..486eb8fd6f6 --- /dev/null +++ b/src/test/auxiliary/issue_9155.rs @@ -0,0 +1,17 @@ +// 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. + +pub struct Foo<T>(T); + +impl<T> Foo<T> { + pub fn new(t: T) -> Foo<T> { + Foo(t) + } +} diff --git a/src/test/run-pass/issue_9155.rs b/src/test/run-pass/issue_9155.rs new file mode 100644 index 00000000000..ba92a0c7b1f --- /dev/null +++ b/src/test/run-pass/issue_9155.rs @@ -0,0 +1,20 @@ +// 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_9155.rs +// xfail-fast windows doesn't like the aux-build + +extern mod issue_9155; + +struct Baz; + +fn main() { + issue_9155::Foo::new(Baz); +} |
