2014-09-27 50 views
0

我以爲我可以概括的collections::str::StrVector特點實現和膏藥貼防鏽:奇怪的錯誤「`Slice`不是特質」

然而,我的代碼失敗,一個奇怪的錯誤信息:

rustc: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections 
/home/nodakai/prog/rust-HEAD/src/libcollections/str.rs:140:17: 140:25 error: `Slice` is not a trait 
/home/nodakai/prog/rust-HEAD/src/libcollections/str.rs:140 impl<S: Str, V: Slice<S>> StrVector for V { 
                      ^~~~~~~~ 
error: aborting due to previous error 
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.collections] Error 101 

我不明白什麼是錯我的代碼,因爲the 64th line肯定use s core::prelude::Slice這是core::slice::Slice的重新導出版本。此外圍欄編譯基本相同的代碼罰款:

+0

http://ideone.com/jc6OLW – 2016-09-06 16:21:41

回答