This file contains hidden or 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
#[deriving(Show, Clone, PartialEq)] | |
struct City<'a> { | |
name: &'a str, | |
country: &'a str | |
} | |
impl<'a> City<'a> { | |
fn prototype() -> City<'a> { | |
City { name: "", country: "" } |
This file contains hidden or 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
struct FooResult { | |
good: Option<String>, | |
bad: Option<String> | |
} | |
impl FooResult { | |
fn new(result: Result<String, String>) -> FooResult { | |
match result { |
This file contains hidden or 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
enum Foo { | |
Bar(uint), | |
Baz(i32) | |
} | |
fn dest(Bar(u): Foo) { | |
} |
This file contains hidden or 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
extern crate serialize; | |
use std::collections::TreeMap; | |
use serialize::json::ToJson; | |
use serialize::json; | |
use super::case_folds::CaseFolds; | |
use super::{ Category, HotelsRequest }; | |
#[deriving(Show)] |
This file contains hidden or 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
#[deriving(PartialEq, Show, Clone)] | |
enum List<T> { | |
Cons(T, Box<List<T>>), | |
Nil | |
} | |
impl<'a, T:Clone> List<T> { | |
fn empty() -> List<T> { | |
Nil |
This file contains hidden or 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
require 'deterministic/enum' | |
List = Deterministic::enum { | |
Cons(:head, :tail) | |
Nil() | |
} | |
Deterministic::impl(List) { | |
class EmptyListError < StandardError; end |
This file contains hidden or 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
stack backtrace: | |
1: 0x10e472c45 - rt::backtrace::imp::write::hd2f888e449bbd94eoiq | |
2: 0x10e475dc3 - failure::on_fail::he27adfa3d8f252c2Tyq | |
3: 0x10e47ceb5 - unwind::begin_unwind_inner::h5b97974f8716d208S5d | |
4: 0x10e47ca8b - unwind::begin_unwind_fmt::hc263c2d677566b22n3d | |
5: 0x10e47c8e2 - rust_begin_unwind | |
6: 0x10e49e62c - failure::begin_unwind::h4e97151c53e68d96j5j | |
7: 0x10e2bd0fc - option::Option<T>::unwrap::h2778475912063396917 | |
8: 0x10e2bcf09 - json::Decoder::pop::hab5b5f6e228e32aftQd | |
9: 0x10e31f5c7 - json::Decoder...Decoder<DecoderError>::read_struct::h14270248516275819116 |
This file contains hidden or 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
#![feature(phase, macro_rules)] | |
extern crate debug; | |
#[phase(plugin, link)] extern crate log; | |
extern crate serialize; | |
pub use serialize::{ Decodable, Decoder, Encoder, Encodable,}; | |
#[path="../src/json.rs"] | |
mod json; |
This file contains hidden or 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
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
This file contains hidden or 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::local_data; | |
trait Locale { | |
fn to_upper(&self, s: &str) {} | |
} | |
struct Indifferent; | |
impl Locale for Indifferent {} |