Rust 中的关键字

177 阅读1分钟

Rust 中的关键字

学不可以已。青取之于蓝,而青于蓝

严格关键字

在开发中禁止使用

as、 break、 const、 continue、 crate、 if、 else、 struct、 enum、 true、 false、 fn、 for、 in、 let、 loop、 impl、 mod、 match、 move 、 mut 、pub、 ref、 return、 self、 Self、 static、 super、 trait、 type、 unsafe、 use、 where、 while 、async、 await、 dyn 、 main。

保留字

在开中建议不要使用

abstract、 become、 box、 do、 final、 macro、 override、 priv、 typeof、 unsized、 virtual、 yield 、 try。

弱关键字

在开中建议不要使用

2018 Edition: union、 'static 2015 Edition: dyn(在2018中被提升为严格关键字)

在开中建议不要使用任何的关键字, 因为在下个版本很可能会被提升为严格关键字.