Skip to content

Instantly share code, notes, and snippets.

@SiegeLord
Created March 18, 2013 19:11
Show Gist options
  • Save SiegeLord/5189925 to your computer and use it in GitHub Desktop.
Save SiegeLord/5189925 to your computer and use it in GitHub Desktop.
struct A { a : int }
trait TA { }
impl TA for A { }
fn test_struct(a : &A)
{
}
fn test_trait(a : &TA)
{
}
fn main()
{
let a = ~A{a : 1};
let b = A{a : 1};
let c = @A{a : 1};
// This works fine
test_struct(a);
test_struct(&b);
test_struct(c);
// How to write these?
test_trait(a as &TA);
test_trait(&a as &TA);
test_trait(a as &TA);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment