You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let inst = |escape_quotes| to_check_cfg_arg(name, value.map(|(v, _s)| v), escape_quotes);
164
177
165
178
if is_from_cargo {
166
179
if !is_feature_cfg {
167
-
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
180
+
diag.help(format!("consider using a Cargo feature instead"));
181
+
diag.help(format!("or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:\n [lints.rust]\n unexpected_cfgs = {{ level = \"warn\", check-cfg = ['{}'] }}", inst(EscapeQuotes::No)));
182
+
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={}\");` to the top of the `build.rs`", inst(EscapeQuotes::Yes)));
168
183
}
169
-
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
184
+
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration");
170
185
}else{
171
-
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
186
+
let inst = inst(EscapeQuotes::No);
187
+
diag.help(format!("to expect this configuration use `--check-cfg={inst}`",));
172
188
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
diag.help("consider defining some features in `Cargo.toml`");
267
278
}
268
279
}elseif !is_cfg_a_well_know_name {
269
-
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
280
+
diag.help(format!("consider using a Cargo feature instead"));
281
+
diag.help(format!("or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:\n [lints.rust]\n unexpected_cfgs = {{ level = \"warn\", check-cfg = ['{}'] }}", inst(EscapeQuotes::No)));
282
+
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={}\");` to the top of the `build.rs`", inst(EscapeQuotes::Yes)));
270
283
}
271
-
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
284
+
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration");
272
285
}else{
273
286
if !is_cfg_a_well_know_name {
274
-
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
287
+
let inst = inst(EscapeQuotes::No);
288
+
diag.help(format!("to expect this configuration use `--check-cfg={inst}`",));
275
289
}
276
290
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
0 commit comments