This file contains 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
lazy_init! { | |
static ref map: T = new_T(); | |
} | |
=> | |
static map: lazy1::Lazy = lazy1::Lazy; | |
mod lazy1 { | |
static mut map: *T = 0 as *T; | |
struct Lazy; |
This file contains 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
pub struct Property<T> { | |
priv val: T | |
} | |
impl<T> Property<T> { | |
fn new(new_val: T) -> Property<T> { | |
Property { | |
val: new_val | |
} | |
} |
This file contains 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
pub struct MutRefProperty<'a, T> { | |
priv val: &'a mut T | |
} | |
impl<'a, T> MutRefProperty<'a, T> { | |
fn new(new_val: &'a mut T) -> MutRefProperty<'a, T> { | |
MutRefProperty { | |
val: new_val | |
} | |
} |
This file contains 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
pub struct MutRefProperty<'a, T> { | |
priv val: &'a mut T | |
} | |
impl<'a, T> MutRefProperty<'a, T> { | |
fn new(new_val: &'a mut T) -> MutRefProperty<'a, T> { | |
MutRefProperty { | |
val: new_val | |
} | |
} |
This file contains 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(macro_rules)]; | |
macro_rules! meth_chain( | |
($inp:expr $(.. $call:ident($($e:expr),*))*) => ( | |
{ | |
let mut tmp = $inp; | |
$( | |
tmp.$call($($e),*); | |
)* | |
tmp |
This file contains 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
failures: | |
---- [debug-info] debug-info/limited-debuginfo.rs stdout ---- | |
error: line not found in debugger output: static void limited-debuginfo::main(); | |
command: gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debug-info/limited-debuginfo.debugger.script x86_64-unknown-linux-gnu/test/debug-info/limited-debuginfo.stage2-x86_64-unknown-linux-gnu | |
stdout: | |
------------------------------------------ | |
All defined functions: | |
This file contains 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
mod config { | |
pub enum Node<T> { | |
Directory(~str, ~[Node<T>]), | |
Entry(~str, ~T) | |
} | |
pub fn add_entry<T>(node: &Node<T>, entry: &Node<T>) -> ::std::option::Option<&Node<T>> { | |
match node { | |
Directory(name, list) => { ::std::vec::append_one(list, entry); Some(node) } | |
_ => { None } |
This file contains 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
mod config { | |
pub enum Node<T> { | |
Directory(~str, ~[Node<T>]), | |
Entry(~str, ~T) | |
} | |
pub fn add_entry<'a, T>(node: &'a mut Node<T>, entry: Node<T>) -> Option<&'a mut Node<T>> { | |
if match node { | |
&Directory(_, ref mut list) => { list.push(entry); true } | |
_ => false |
This file contains 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
#![crate_type = "dylib"] | |
#![feature(macro_registrar, managed_boxes)] | |
extern crate syntax; | |
use syntax::ast; | |
use syntax::ast::Name; | |
use syntax::codemap::{Span}; | |
use syntax::ext::base::{SyntaxExtension, ItemDecorator, ExtCtxt}; | |
use syntax::ext::build::AstBuilder; |
This file contains 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 Crate(~()); | |
impl Crate { | |
fn symbol<'a, H, T: Sdo<'a, H>>(&'a self, t: T) -> H { | |
t.wrap(::std::kinds::marker::ContravariantLifetime::<'a>) | |
} | |
} | |
type Zref<'a> = ::std::kinds::marker::ContravariantLifetime<'a>; |
OlderNewer