1use std::env;
2
3const IGNORED_LINTS: &[&str] = &["dead_code"];
4
5pub(crate) fn toml(extra_rustflags: &[&'static str]) -> toml::Value {
6 let mut rustflags = vec!["--cfg", "trybuild", "--verbose"];
7
8 for &lint in IGNORED_LINTS {
9 rustflags.push("-A");
10 rustflags.push(lint);
11 }
12
13 if let Some(flags) = env::var_os("RUSTFLAGS") {
14 if flags.to_string_lossy().contains("-C instrument-coverage") {
17 rustflags.extend(["-C", "instrument-coverage"]);
18 }
19 }
20
21 rustflags.extend(extra_rustflags);
22
23 toml::Value::try_from(rustflags).unwrap()
24}