Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn type_id<T>(_x: T) -> fn() {
- || {}
- }
- fn main() {
- let x = 0;
- let xref = &x;
- let id_x = type_id(xref);
- let id_y;
- {
- let y = 1;
- let yref = &y;
- id_y = type_id(yref);
- }
- println!("{:?}, {:?}", id_x, id_y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement