Put overlapping impls behind feature gate, add tests

I've added some explicit tests that negative impls are allowed to
overlap, and also to make sure that the feature doesn't interfere with
specialization. I've not added an explicit test for positive overlapping
with negative, as that's already tested elsewhere.
This commit is contained in:
Sean Griffin 2017-03-17 14:16:29 -04:00 committed by Corey Farwell
parent c81c958e98
commit adcdd605be
7 changed files with 59 additions and 0 deletions

View file

@ -9,6 +9,7 @@
// except according to those terms.
#![feature(optin_builtin_traits)]
#![feature(overlapping_marker_traits)]
trait MyTrait {}

View file

@ -9,6 +9,7 @@
// except according to those terms.
#![feature(optin_builtin_traits)]
#![feature(overlapping_marker_traits)]
use std::marker::Copy;

View file

@ -0,0 +1,17 @@
// Copyright 2017 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.
trait MyMarker {}
impl<T> MyMarker for T {}
impl<T> MyMarker for Vec<T> {}
//~^ ERROR E0119
fn main() {}