Skip to content
Permalink
Browse files

Add tests for #26448

  • Loading branch information...
varkor committed Feb 25, 2019
1 parent 5c563f9 commit 651c1abfb74b0e190fa5a010e59578fa967e2e94
Showing with 59 additions and 0 deletions.
  1. +13 −0 src/test/ui/issues/issue-26448-1.rs
  2. +21 −0 src/test/ui/issues/issue-26448-2.rs
  3. +25 −0 src/test/ui/issues/issue-26448-3.rs
@@ -0,0 +1,13 @@
// run-pass

pub trait Foo<T> {
fn foo(self) -> T;
}

impl<'a, T> Foo<T> for &'a str where &'a str: Into<T> {
fn foo(self) -> T {
panic!();
}
}

fn main() {}
@@ -0,0 +1,21 @@
// run-pass

pub struct Bar<T> {
items: Vec<&'static str>,
inner: T,
}

pub trait IntoBar<T> {
fn into_bar(self) -> Bar<T>;
}

impl<'a, T> IntoBar<T> for &'a str where &'a str: Into<T> {
fn into_bar(self) -> Bar<T> {
Bar {
items: Vec::new(),
inner: self.into(),
}
}
}

fn main() {}
@@ -0,0 +1,25 @@
// run-pass

pub struct Item {
_inner: &'static str,
}

pub struct Bar<T> {
items: Vec<Item>,
inner: T,
}

pub trait IntoBar<T> {
fn into_bar(self) -> Bar<T>;
}

impl<'a, T> IntoBar<T> for &'a str where &'a str: Into<T> {
fn into_bar(self) -> Bar<T> {
Bar {
items: Vec::new(),
inner: self.into(),
}
}
}

fn main() {}

0 comments on commit 651c1ab

Please sign in to comment.
You can’t perform that action at this time.