Instantly share code, notes, and snippets.
- Somewhere, Earth
- https://bjorn3.github.io/
bjorn3 /playground.rs
CreatedApril 5, 2018 16:12 — forked fromrust-play/playground.rs
Code shared from the Rust Playground This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
traitKind<T>{ | |
typeMake; | |
} | |
enumOptionKind{} | |
impl<T>Kind<T>forOptionKind{ | |
typeMake =Option<T>; | |
} |
bjorn3 /playground.rs
CreatedApril 5, 2018 15:57 — forked fromrust-play/playground.rs
Code shared from the Rust Playground This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
traitKind<T>{ | |
typeMake; | |
} | |
enumOptionKind{} | |
impl<T>Kind<T>forOptionKind{ | |
typeMake =Option<T>; | |
} |
bjorn3 /rust_read_rlib_for_rustc_driver.txt
CreatedDecember 2, 2017 14:56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[Running cargo run -- rustc_driver] | |
Compiling rlib_view v0.1.0 (file:///Users/bjorn/Documents/rlib_view) | |
Finished dev [unoptimized + debuginfo] target(s) in 2.42 secs | |
Running `target/debug/rlib_view rustc_driver` | |
Reading rlib rustc_driver | |
Rust args: ["target/debug/rlib_view", "rustc_driver", "--sysroot", "/Users/bjorn/.rustup/toolchains/nightly-x86_64-apple-darwin"] | |
name : rustc_driver | |
hash : d79ca04fef62dfca | |
disambiguator : 9d0979424297d363-2fdb30027cf93b5 | |
needs_allocator : false |
bjorn3 /gist:e9956d455ea09ecf25a04dfbb3207e8e
CreatedNovember 11, 2017 10:23 — forked fromgregsifr/gist:6bdcc23c540d63dd5ffdb441fb452d94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
loop { | |
for message in client.incoming_messages() { | |
match message.unwrap() { | |
OwnedMessage::Text(data) => data, | |
_ => None, | |
}; | |
} | |
} |
bjorn3 /playground.rs
CreatedFebruary 19, 2017 16:26 — forked fromanonymous/playground.rs
Shared via Rust Playground This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
typeMemory =Vec<u64>; | |
enumInstr{ | |
Call(Rvalue),// call *arg1 | |
Jmp(Rvalue),// jmp *arg1 | |
Print(Rvalue),// print *arg1 | |
} | |
enumLvalue{ | |
Reg(Reg), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
target/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
use std::collections::VecDeque; | |
use std::iter::Peekable; | |
use std::str::Chars; | |
use std::mem; | |
#[derive(Debug,Clone,Hash,Eq,PartialEq)] | |
enumInstruction{ | |
Nop, | |
Next, | |
Prev, |