Test that if we promise to not impl what would overlap it doesn't actually overlap
This commit is contained in:
parent
ab17068662
commit
511076a102
2 changed files with 19 additions and 0 deletions
5
src/test/ui/coherence/auxiliary/error_lib.rs
Normal file
5
src/test/ui/coherence/auxiliary/error_lib.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
#![crate_type = "lib"]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
pub trait Error {}
|
||||
impl !Error for &str {}
|
14
src/test/ui/coherence/coherence-overlap-negative-trait.rs
Normal file
14
src/test/ui/coherence/coherence-overlap-negative-trait.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// check-pass
|
||||
// aux-build:error_lib.rs
|
||||
//
|
||||
// Check that if we promise to not impl what would overlap it doesn't actually overlap
|
||||
|
||||
extern crate error_lib as lib;
|
||||
use lib::Error;
|
||||
|
||||
trait From<T> {}
|
||||
|
||||
impl From<&str> for Box<dyn Error> {}
|
||||
impl<E> From<E> for Box<dyn Error> where E: Error {}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in a new issue