diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-11-05 22:06:04 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-11-17 14:25:11 -0500 |
| commit | f8403aac81d5720bb722a85a9120c14ceb763eb9 (patch) | |
| tree | 510db4cf66cb0bd455cbf1775fbe9bf5041512a3 /src/test/compile-fail/method-commit-to-trait.rs | |
| parent | f09279395b6ca40f1398277971586197f949738a (diff) | |
| download | rust-f8403aac81d5720bb722a85a9120c14ceb763eb9.tar.gz rust-f8403aac81d5720bb722a85a9120c14ceb763eb9.zip | |
Rewrite method resolution to be cleaner, more correct, and to lay
groundwork for better performance. Key points: - Separate out determining which method to use from actually selecting a method (this should enable caching, as well as the pcwalton fast-reject strategy). - Merge the impl selection back into method resolution and don't rely on trait matching (this should perform better but also is needed to resolve some kind of conflicts, see e.g. `method-two-traits-distinguished-via-where-clause.rs`) - Purge a lot of out-of-date junk and coercions from method lookups.
Diffstat (limited to 'src/test/compile-fail/method-commit-to-trait.rs')
| -rw-r--r-- | src/test/compile-fail/method-commit-to-trait.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/test/compile-fail/method-commit-to-trait.rs b/src/test/compile-fail/method-commit-to-trait.rs deleted file mode 100644 index 6e4b5e088c9..00000000000 --- a/src/test/compile-fail/method-commit-to-trait.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2012 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. - -// Test that we pick `Foo`, and also pick the `impl`, even though in -// this case the vector type `T` is not copyable. This is because -// there is no other reasonable choice. The error you see is thus -// about `T` being non-copyable, not about `Foo` being -// unimplemented. This is better for user too, since it suggests minimal -// diff requird to fix program. - -trait Object { } - -trait Foo { - fn foo(self) -> int; -} - -impl<T:Copy> Foo for Vec<T> { - fn foo(self) -> int {1} -} - -fn test1<T>(x: Vec<T>) { - x.foo(); - //~^ ERROR `core::kinds::Copy` is not implemented for the type `T` -} - -fn main() { } |
