0
對於下面的代碼:什麼「別名與非沒有LP PTR」是指在鏽
import io::*;
import to_str::*;
impl <T : to_str copy> of to_str for @[mut T] {
fn to_str() -> str {
let tmp = copy self;
tmp.map(|x| { x.to_str() }).to_str()
}
}
fn main() {
println((@[mut 1, 2, 3]).to_str());
}
我得到一個錯誤:
example.rs:7:8: 7:11 error: internal compiler error: aliased ptr with a non-none lp
example.rs:7 tmp.map(|x| { x.to_str() }).to_str()
^~~
如何解決呢?反正aliased ptr with a non-none lp
是什麼意思?
哈,我剛剛找到https://github.com/mozilla/rust/issues/2926,看到你已經提交了錯誤並找到了解決方法。幹得不錯! – 2012-07-16 18:42:47
我的報告是重複的,原始錯誤https://github.com/mozilla/rust/issues/2797剛剛關閉。這個ICE在最近(0.3(30d94fe 2012-07-17 22:16:55 -0400))rustc中不再出現。謝謝! – 2012-07-18 12:52:58