diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-12-30 12:09:21 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-12-30 12:09:21 -0500 |
| commit | e186accbc43dad8c340112fc39d8df924a9a79e9 (patch) | |
| tree | dc55dc0219844669606d0dcd314b08ebf1ccf209 /src/test | |
| parent | 919975d0a5c90a25bf09a0a7c27fb7156d6aa2ad (diff) | |
| download | rust-e186accbc43dad8c340112fc39d8df924a9a79e9.tar.gz rust-e186accbc43dad8c340112fc39d8df924a9a79e9.zip | |
Fix rebase conflicts
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/trait-static-method-generic-inference.rs (renamed from src/test/run-pass/trait-static-method-generic-inference.rs) | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/test/run-pass/trait-static-method-generic-inference.rs b/src/test/compile-fail/trait-static-method-generic-inference.rs index 4151ad6530e..651f663fc99 100644 --- a/src/test/run-pass/trait-static-method-generic-inference.rs +++ b/src/test/compile-fail/trait-static-method-generic-inference.rs @@ -8,6 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// Issue #3902. We are (at least currently) unable to infer `Self` +// based on `T`, even though there is only a single impl, because of +// the possibility of associated types and other things (basically: no +// constraints on `Self` here at all). + mod base { pub trait HasNew<T> { fn new() -> T; @@ -22,19 +27,11 @@ mod base { Foo { dummy: () } } } - - pub struct Bar { - dummy: (), - } - - impl HasNew<Bar> for Bar { - fn new() -> Bar { - Bar { dummy: () } - } - } } -pub fn main() { +pub fn foo() { let _f: base::Foo = base::HasNew::new(); - let _b: base::Bar = base::HasNew::new(); + //~^ ERROR type annotations required } + +fn main() { } |
