Skip to content

RefCell and &mut ~Trait strange syntax is required. #13307

@dpc

Description

@dpc
use std::cell::RefCell;

trait Foo {}

impl Foo for () {}

fn main() {
    let foo: RefCell<~Foo> = RefCell::new(~() as ~Foo);
    let fooref: &mut Foo = *&mut *foo.borrow_mut();
    println!("{:?}", fooref);
}

Is this really required? Thanks Eridius for helping me get this to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions