Rust part10at TECHRust part10 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト705:デフォルトの名無しさん 21/05/21 13:4 706:0:53.52 ID:J6y23PLS.net 707:デフォルトの名無しさん 21/05/21 13:44:28.52 J6y23PLS.net Compiling playground v0.0.1 (/playground) error[E0382]: borrow of moved value: `_a` --> src/main.rs:22:9 | | let _a = Droppable { id: &0 }; | -- move occurs because `_a` has type `Droppable`, which does not implement the `Copy` trait | if *_a.id == 1 { | drop(_a); | -- value moved here | } | sub(&_a); | ^^^ value borrowed here after move //ここでuse-after-free errorが発生! error: aborting due to previous error For more information about this error, try `rustc --explain E0382`. error: could not compile `playground` To learn more, run the command again with --verbose. 見やすくした 708:デフォルトの名無しさん 21/05/21 14:49:33.29 vx/ErwhM.net 意味のないコードだよ 709:デフォルトの名無しさん 21/05/21 14:53:16.15 PNtD97K1.net コンパイラは別に値まで見ないからな clippyが意味のない分岐だよと指摘してくれるのかどうかは知らんが 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch