Skip to content

Instantly share code, notes, and snippets.

#[feature(macro_rules)];
use spec::test;
use spec::my_macro;
#[feature(macro_escape)]
mod spec {
#[macro_export]
macro_rules! my_macro (
() => (println!("hello"));
#[feature(macro_rules)];
use spec::test;
#[macro_escape]
mod spec {
macro_rules! my_macro (
() => (println!("hello"));
)
@sfackler
sfackler / cmp.rs
Last active August 29, 2015 14:02 — forked from alexcrichton/cmp.rs
pub trait Eq {
fn eq(&self, other: &Self) -> bool;
}
// equality operators are wired to this trait
#[lang = "partial_eq"]
pub trait PartialEq {
fn eq(&self, other: &Self) -> bool;
fn ne(&self, other: &Self) -> bool;
}
#![allow(unstable)]
use std::fmt;
use std::fmt::rt::Flag;
struct PadAdapter<'a, 'b: 'a> {
fmt: &'a mut fmt::Formatter<'b>,
on_newline: bool,
}
#![allow(unstable)]
use std::fmt;
use std::fmt::rt::Flag;
struct PadAdapter<'a, 'b: 'a> {
fmt: &'a mut fmt::Formatter<'b>,
on_newline: bool,
}
#![feature(test, big_misc, thread_sleep, std_misc)]
extern crate test;
use std::io::prelude::*;
use std::cmp;
use std::iter;
use std::time::Duration;
use std::thread;
use std::io::{self, ErrorKind};
rust: task failed at 'region parameterization should have inferred that this type is RP', /home/sfackler/rust/src/librustc/middle/typeck/rscope.rs:237
/home/sfackler/.rust-local/bin/../lib/librustrt.so(+0x1e3ed)[0x7f6dbe3703ed]
/home/sfackler/.rust-local/bin/../lib/librustrt.so(+0x1f049)[0x7f6dbe371049]
/home/sfackler/.rust-local/bin/../lib/librustrt.so(+0x2e679)[0x7f6dbe380679]
/home/sfackler/.rust-local/bin/../lib/librustrt.so(_ZN9rust_task15call_on_c_stackEPvS0_+0xc3)[0x7f6dbe371d73]
/home/sfackler/.rust-local/bin/../lib/librustrt.so(upcall_fail+0x9f)[0x7f6dbe37275f]
/home/sfackler/.rust-local/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(_ZN3sys13begin_unwind_16_89e154cd091567114_0$x2e8$x2dpreE+0x569)[0x7f6dbdc1b4e9]
/home/sfackler/.rust-local/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x118632)[0x7f6dbdc1b632]
/home/sfackler/.rust-local/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x117ea1)[0x7f6dbdc1aea1]
/home/sfackler/.rust-local/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so(+0x1185e4)[0x7f6dbdc
use std::task;
pub enum UnwindMethod {
Success,
Failure,
Exit
}
pub struct ScopeGuard<'self> {
priv blk: &'self fn(),
pub trait ApplicationDelegate {
fn application_did_quit(&mut self, _timestamp: u32) {}
}
pub struct MouseMotionEventInfo;
pub struct MouseButtonEventInfo;
pub struct MouseWheelEventInfo;
pub trait MouseDelegate {
fn mouse_did_move(&mut self, _info: &MouseMotionEventInfo) {}
@sfackler
sfackler / gist:8271819
Last active January 2, 2016 07:39 — forked from krdln/gist:8271696
use std::util;
enum List {
Cons(int, ~List),
Nil
}
impl List {
fn prepend(&mut self, x : int) {
let new = ~util::replace(self, Nil);
*self = Cons(x, new);