Skip to content

Instantly share code, notes, and snippets.

@erickt
erickt / main.rs
Last active February 26, 2016 17:05
src/main.rs:111:22: 111:26 error: no method named `init` found for type `parsell::impls::AndThen<parsell::impls::Star<ValueParser, fn() -> collections::vec::Vec<_> {collections::vec::Vec<T>::new}>, parsell::impls::Character<fn(char) -> bool {ListParser.Uncommitted<char, Chars<'a>>::init::is_rbracket}>>` in the current scope
src/main.rs:111 match parser.init(data).unwrap() {
^~~~
src/main.rs:111:22: 111:26 note: the method `init` exists but the following trait bounds were not satisfied: `parsell::impls::Character<fn(char) -> bool {ListParser.Uncommitted<char, Chars<'a>>::init::is_rbracket}> : parsell::Committed<_, _>`
error: aborting due to previous error
@erickt
erickt / foo.md
Last active January 6, 2016 20:19

Structure Annotations:

Annotation Function
#[serde(disallow_unknown) Always error during serialization when encountering unknown fields. When
                            absent, unknown fields are ignored for self-describing formats like JSON. |

Field Annotations:

@erickt
erickt / code.rs
Last active December 24, 2015 21:11
#![feature(plugin)]
#![plugin(stateful)]
#![allow(unused_variables)]
#[state_machine]
fn yield_(mut i: usize, then: usize, else_: usize) -> usize {
loop {
if i < 10 {
i += 1;
return i;
#![feature(plugin)]
#![plugin(stateful)]
#![allow(unused_variables)]
fn increment(x: usize) -> usize { x + 1 }
#[state_machine]
fn yield_(a: usize) -> usize {
let x = increment(a);
#![feature(prelude_import)]
#![no_std]
#![feature(plugin)]
#![plugin(stateful)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
fn yield_() -> ::std::boxed::Box<::std::iter::Iterator<Item = usize>> {
#![feature(plugin_registrar, rustc_private, quote)]
extern crate aster;
extern crate petgraph;
extern crate rustc_plugin;
extern crate syntax;
use std::mem;
use syntax::ast;

Keybase proof

I hereby claim:

  • I am erickt on github.
  • I am erickt (https://keybase.io/erickt) on keybase.
  • I have a public key whose fingerprint is AFAF B47F 759F DE7A D6B5 8C44 AC30 64BE 7992 CCDF

To claim this, I am signing this object:

#![feature(test)]
extern crate test;
use std::env;
use std::mem;
use std::str::FromStr;
enum State {
X0,
@erickt
erickt / bar.rs
Last active October 16, 2015 03:38
multirust run nightly rustc --crate-type lib bar.rs && multirust run nightly rustc -L . foo.rs
pub trait MyFrom2<T> {
fn my_from2(T) -> Self;
}
<html>
<head>
<!--[if IE]><script language="javascript" type="text/javascript" src="http://flot.googlecode.com/svn/trunk/excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="http://flot.googlecode.com/svn/trunk/jquery.js"></script>
<script language="javascript" type="text/javascript" src="http://flot.googlecode.com/svn/trunk/jquery.flot.js"></script>
</head>
<body>
<script>
series_settings = {