Files
rust/tests/ui/traits/bound/suggest-complex-bound-on-method.rs

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

24 lines
421 B
Rust
Raw Normal View History

//@ run-rustfix
#![allow(dead_code)]
struct Application;
// https://github.com/rust-lang/rust/issues/144734
trait Trait {
type Error: std::error::Error;
fn run(&self) -> Result<(), Self::Error>;
}
#[derive(Debug)]
enum ApplicationError {
Quit,
}
impl Application {
fn thing<T: Trait>(&self, t: T) -> Result<(), ApplicationError> {
t.run()?; //~ ERROR E0277
Ok(())
}
}
fn main() {}