%load_ext rust_magic
%rust 2+2
4
%%rust
let mut a = (2, 3);
a.1 = 10;
a
(2, 10)
%%rust
fn main() {
println!("Hi, Rust!");
}
Hi, Rust!
%%rust
//! ```cargo
//! [dependencies]
//! time = "0.1.42"
//! ```
extern crate time;
println!("{}", time::now().rfc822z());
'//! ```cargo\n//! [dependencies]\n//! time = "0.1.42"\n//! ```\nextern crate time;\n\nprintln!("{}", time::now().rfc822z());\n' Thu, 22 Aug 2019 12:17:11 +0700
%%rust --debug
let a: u8 = 255;
a + 1
thread 'main' panicked at 'attempt to add with overflow', cell.rs:4:1 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.