Test that if we promise to not impl what would overlap it doesn't actually overlap

This commit is contained in:
Santiago Pastorino 2021-10-11 16:03:00 -03:00
parent ab17068662
commit 511076a102
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,5 @@
#![crate_type = "lib"]
#![feature(negative_impls)]
pub trait Error {}
impl !Error for &str {}

View 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() {}