2
類型別名在Rust中的工作原理如何?Rust中的類型別名
我一直在研究一些老鏽代碼破損不是我寫的,發現Thunk::new(...)
導致此錯誤:
error: type `Box<alloc::boxed::FnBox<_, Output=_> + Send>`
does not implement any method in scope named `new`
Thunk被定義爲:
type Thunk<'a, A =(), R =()> = Box<FnBox<A, Output=R> + Send + 'a>;
我想Alias::method
在以前版本的Rust中沒有工作?我應該如何將Thunk::new
變成有效的東西?它是否缺少Box
或某物的導入?
完美答案。謝謝! – 2015-04-03 15:32:20