Skip to content

Commit 511076a

Browse files
committed
Test that if we promise to not impl what would overlap it doesn't actually overlap
1 parent ab17068 commit 511076a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![crate_type = "lib"]
2+
#![feature(negative_impls)]
3+
4+
pub trait Error {}
5+
impl !Error for &str {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// check-pass
2+
// aux-build:error_lib.rs
3+
//
4+
// Check that if we promise to not impl what would overlap it doesn't actually overlap
5+
6+
extern crate error_lib as lib;
7+
use lib::Error;
8+
9+
trait From<T> {}
10+
11+
impl From<&str> for Box<dyn Error> {}
12+
impl<E> From<E> for Box<dyn Error> where E: Error {}
13+
14+
fn main() {}

0 commit comments

Comments
 (0)