简介
在本实验中,编译器提供了一个 dead_code
检查,用于警告未使用的函数,但你可以使用属性(如 #[allow(dead_code)]
)来禁用该检查并防止警告。
注意:如果实验未指定文件名,你可以使用任何你想要的文件名。例如,你可以使用
main.rs
,通过rustc main.rs &&./main
进行编译和运行。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
rust(("Rust")) -.-> rust/FunctionsandClosuresGroup(["Functions and Closures"])
rust/FunctionsandClosuresGroup -.-> rust/function_syntax("Function Syntax")
rust/FunctionsandClosuresGroup -.-> rust/expressions_statements("Expressions and Statements")
subgraph Lab Skills
rust/function_syntax -.-> lab-99340{{"禁用 Rust 未使用代码警告"}}
rust/expressions_statements -.-> lab-99340{{"禁用 Rust 未使用代码警告"}}
end