We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31fdc2e commit 9d82fb4Copy full SHA for 9d82fb4
lintcheck/src/output.rs
@@ -70,7 +70,14 @@ impl ClippyWarning {
70
let rendered = diag.rendered.as_mut().unwrap();
71
*rendered = strip_ansi_escapes::strip_str(&rendered);
72
73
- let span = diag.spans.iter().find(|span| span.is_primary).unwrap();
+ // Turns out that there are lints without spans... For example Rust's
74
+ // `renamed_and_removed_lints` if the lint is given via the CLI.
75
+ let span = diag
76
+ .spans
77
+ .iter()
78
+ .find(|span| span.is_primary)
79
+ .or(diag.spans.first())
80
+ .unwrap_or_else(|| panic!("Diagnositc without span: {diag}"));
81
let file = &span.file_name;
82
let url = if let Some(src_split) = file.find("/src/") {
83
// This removes the inital `target/lintcheck/sources/<crate>-<version>/`
0 commit comments