除了可以推断loop
体内设置的未初始化值这一事实之外,还有其他令人信服的理由存在loop
吗?
Other than you state your intention, there is no difference. All loops are the same once normalization has happened in the compiler.
See an example of a loop
in the Rust playground and the same example with a while true
. The assembly generated is exactly the same. The compiler gives a warning for the while true
-example to use loop
instead.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.