blob: 719835af0a9fde54c64f4f6a9f6e48ee15b5cb5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
//@ 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> where ApplicationError: From<<T as Trait>::Error> {
t.run()?; //~ ERROR E0277
Ok(())
}
}
fn main() {}
|