mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
31 lines
444 B
Rust
31 lines
444 B
Rust
//@ check-pass
|
|
|
|
use std::fmt::Debug;
|
|
|
|
#[derive(Debug)]
|
|
pub struct Target;
|
|
|
|
#[derive(Debug)]
|
|
pub struct Source;
|
|
impl From<Source> for Target {
|
|
fn from(_: Source) -> Self {
|
|
Self
|
|
}
|
|
}
|
|
|
|
fn maybe_source() -> Result<(), Source> {
|
|
todo!()
|
|
}
|
|
|
|
pub fn typaram() -> Result<(), impl Debug> {
|
|
maybe_source()?;
|
|
Ok::<_, Target>(())
|
|
}
|
|
|
|
pub fn direct() -> Result<(), impl Debug> {
|
|
maybe_source()?;
|
|
Err(Target)
|
|
}
|
|
|
|
fn main() {}
|