Skip to content

Instantly share code, notes, and snippets.

@Kerollmops
Last active January 14, 2018 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kerollmops/dd2499b9b83ce8df35fdc96d39b2b786 to your computer and use it in GitHub Desktop.
Save Kerollmops/dd2499b9b83ce8df35fdc96d39b2b786 to your computer and use it in GitHub Desktop.
test on impl
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
fn <impl at src/lib.rs:5:1: 9:2>::from(_1: i16) -> Koko {
let mut _0: Koko; // return place
let mut _2: i16;
bb0: {
StorageLive(_2); // bb0[0]: scope 0 at src/lib.rs:7:23: 7:28
_2 = _1; // bb0[1]: scope 0 at src/lib.rs:7:23: 7:28
_0 = Koko { field: move _2 }; // bb0[2]: scope 0 at src/lib.rs:7:9: 7:30
StorageDead(_2); // bb0[3]: scope 0 at src/lib.rs:7:30: 7:30
return; // bb0[4]: scope 0 at src/lib.rs:8:6: 8:6
}
}
pub struct Koko {
field: i16
}
impl From<i16> for Koko {
fn from(value: i16) -> Self {
Koko { field: value }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment