Skip to content

Suggest name value cfg when only value is used for check-cfg #120435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
limit the names_possiblilities to less than 3
Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
  • Loading branch information
chenyukang and Urgau authored Jan 30, 2024
commit 0213c87e12460e8f7101f96cc5daf4c3d20d6b9f
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/context/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ pub(super) fn builtin(

is_feature_cfg |= best_match == sym::feature;
} else {
if !names_possibilities.is_empty() {
if !names_possibilities.is_empty() && names_possibilities.len() <= 3 {
names_possibilities.sort();
for cfg_name in names_possibilities.iter() {
db.span_suggestion(
Expand Down