View playground.rs
fn assert_copy<C: Copy>(_: C) {}
fn assert_fn<F: Fn()>(_: F) {}
struct Opaque(());
fn main() {
let o = Opaque(());
let f = move || { &o; };
assert_copy(f);
assert_fn(f);
View playground.rs
fn main(){
let mut a = String::from("asdfght");
a.push('\0');
let c:String = a.chars().rev().collect::<Vec<char>>();
let c:String = a.chars().rev().collect::<Vec<char>>();
println!("{:?}", std::str::from_chars(c.as_slice()));
}
#[test]
fn tenst(){
View playground.rs
use std::int::pow;
use std::rand;
use std::rand::Rng;
use std::io::prelude::*;
use std::fs::{File, OpenOptions};
use std::io::{Read};
use std::time::{Instant, Duration, SystemTime};
use std::thread;
struct Matrix {
View playground.rs
use std::int::pow;
use std::rand;
use std::rand::Rng;
use std::io::prelude::*;
use std::fs::{File, OpenOptions};
use std::io::{Read};
use std::time::{Instant, Duration, SystemTime};
use std::thread;
struct Matrix {
View playground.rs
#[inline(never)]
fn initialize() -> Vec<i32> { Vec::new() }
fn main() {
let v = initialize();
}
View playground.rs
#[inline(never)]
fn initialize() -> Vec<i32> { Vec::new() }
fn main() {
let v = initialize();
}
View playground.rs
extern crate regex;
use regex::backtrack;
fn main(){}
View playground.rs
#![feature(asm)]
fn main() {
unsafe { sched_part_2_thunk(0) };
}
unsafe fn sched_part_2_thunk(rsp: usize) -> ! {
asm!{
"
movq $0, %rsp
View playground.rs
struct AppData<'a> {
name: &'a str
}
impl<'a> AppData<'a> {
pub fn go_to_screen(&self, screen: &str) {
println!("app {} is going to screen {}", self.name, screen);
}
}
View playground.rs
struct AppData<'a> {
name: &'a str
}
impl<'a> AppData<'a> {
pub fn go_to_screen(&self, screen: &str) {
println!("app {} is going to screen {}", self.name, screen);
}
}