rust/tests/ui/traits/ice-index-out-of-bounds-issue-117446.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
668 B
Rust
Raw Normal View History

2024-11-02 08:17:53 +00:00
//@ check-fail
//
// Regression for https://github.com/rust-lang/rust/issues/117446
pub struct Repeated<T>(Vec<T>);
trait Foo<'a> {
fn outer<D>() -> Option<()>;
}
impl<'a, T> Foo<'a> for Repeated<T> {
fn outer() -> Option<()> {
//~^ ERROR associated function `outer` has 0 type parameters but its trait declaration has 1 type parameter [E0049]
//~^^ ERROR mismatched types [E0308]
fn inner<Q>(value: Option<()>) -> Repeated<Q> {
match value {
_ => Self(unimplemented!()),
//~^ ERROR can't reference `Self` constructor from outer item [E0401]
}
}
}
}
fn main() {}