Close out #9155
Add a test to make sure it works and switch a private struct over to a newtype. Closes #9155
This commit is contained in:
parent
b637798a5a
commit
435ca16f4f
3 changed files with 46 additions and 13 deletions
17
src/test/auxiliary/issue_9155.rs
Normal file
17
src/test/auxiliary/issue_9155.rs
Normal file
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
20
src/test/run-pass/issue_9155.rs
Normal file
20
src/test/run-pass/issue_9155.rs
Normal file
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue