diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-08-07 10:59:28 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-08-12 17:58:56 -0400 |
| commit | 92d16d961d01dfa5f16218ddc630df31b099d2aa (patch) | |
| tree | 38bda22024c7861e93b70763501edd0d066f6246 /src | |
| parent | 09bf2fef2249602bdd3d4d58ae0dcb9e7968cacc (diff) | |
| download | rust-92d16d961d01dfa5f16218ddc630df31b099d2aa.tar.gz rust-92d16d961d01dfa5f16218ddc630df31b099d2aa.zip | |
Fallout in tests -- break the object safety part into a separate file because error
will be in future reported by wfcheck, which runs in a later stage than coherence
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs | 19 | ||||
| -rw-r--r-- | src/test/compile-fail/coherence-impl-trait-for-trait.rs | 5 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs b/src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs new file mode 100644 index 00000000000..ce6baeb204c --- /dev/null +++ b/src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs @@ -0,0 +1,19 @@ +// Copyright 2015 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 give suitable error messages when the user attempts to +// impl a trait `Trait` for its own object type. + +// If the trait is not object-safe, we give a more tailored message +// because we're such schnuckels: +trait NotObjectSafe { fn eq(&self, other: Self); } +impl NotObjectSafe for NotObjectSafe { } //~ ERROR E0372 + +fn main() { } diff --git a/src/test/compile-fail/coherence-impl-trait-for-trait.rs b/src/test/compile-fail/coherence-impl-trait-for-trait.rs index 332965cc940..cd75b0e34f2 100644 --- a/src/test/compile-fail/coherence-impl-trait-for-trait.rs +++ b/src/test/compile-fail/coherence-impl-trait-for-trait.rs @@ -24,9 +24,4 @@ impl Baz for Baz { } //~ ERROR E0371 trait Other { } impl Other for Baz { } // OK, Other not a supertrait of Baz -// If the trait is not object-safe, we give a more tailored message -// because we're such schnuckels: -trait NotObjectSafe { fn eq(&self, other: Self); } -impl NotObjectSafe for NotObjectSafe { } //~ ERROR E0372 - fn main() { } |
