rust/tests/ui/mir/ice-mir-const-qualif-125837.rs

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

18 lines
471 B
Rust
Raw Normal View History

2024-07-21 08:42:10 -05:00
// Test for ICE: mir_const_qualif: index out of bounds: the len is 0 but the index is 0
// https://github.com/rust-lang/rust/issues/125837
use std::fmt::Debug;
trait Foo<Item> {}
impl<Item, D: Debug + Clone> Foo for D {
//~^ ERROR missing generics for trait `Foo`
fn foo<'a>(&'a self) -> impl Debug {
//~^ ERROR method `foo` is not a member of trait `Foo`
const { return }
//~^ ERROR return statement outside of function body
}
}
pub fn main() {}