Use Foo::from(ptr) to construct objects (to fix build error on master).