astral-sh/ruff · error · anyhow::Error
The following rules have been removed and cannot be selected
Error message
The following rules have been removed and cannot be selected:
What it means
Error "The following rules have been removed and cannot be selected:" thrown in astral-sh/ruff.
Source
Thrown at crates/ruff_workspace/src/configuration.rs:1143
match removed_selectors.as_slice() {
[] => (),
[selection] => {
let (prefix, code) = selection.prefix_and_code();
return Err(anyhow!(
"Rule `{prefix}{code}` was removed and cannot be selected."
));
}
[..] => {
let mut message =
"The following rules have been removed and cannot be selected:".to_string();
for selection in removed_selectors {
let (prefix, code) = selection.prefix_and_code();
message.push_str("\n - ");
message.push_str(prefix);
message.push_str(code);
}
message.push('\n');
return Err(anyhow!(message));
}
}
if !removed_ignored_rules.is_empty() {
let mut rules = String::new();
for selection in removed_ignored_rules.iter().sorted() {
let (prefix, code) = selection.prefix_and_code();
rules.push_str("\n - ");
rules.push_str(prefix);
rules.push_str(code);
}
rules.push('\n');
warn_user_once_by_message!(
"The following rules have been removed and ignoring them has no effect:{rules}"
);
}
for (from, target) in redirects.iter().sorted_by_key(|item| item.0) {View on GitHub (pinned to 672bb4edf0)
When it happens
Trigger: Thrown at crates/ruff_workspace/src/configuration.rs:1143 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of astral-sh/ruff@672bb4edf0 (2026-08-16).
Data as JSON: /api/errors/311888bc6d733a0f.
Report an issue: GitHub.