diff --git a/src/lints/inherent_method_const_removed.ron b/src/lints/inherent_method_const_removed.ron index f9623228..558ca2e9 100644 --- a/src/lints/inherent_method_const_removed.ron +++ b/src/lints/inherent_method_const_removed.ron @@ -73,7 +73,7 @@ SemverQuery( method { visibility_limit @filter(op: "one_of", value: ["$public_or_default"]) name @filter(op: "=", value: ["%method_name"]) - unsafe @filter(op: "=", value: ["$true"]) + const @filter(op: "!=", value: ["$true"]) non_matching_span_: span @optional { filename @output @@ -93,5 +93,5 @@ SemverQuery( "true": true, }, error_message: "A publicly-visible method or associated fn is no longer `const` and can no longer be used in a `const` context.", - per_result_error_template: Some("{{name}}::{{method_name}} in file {{span_filename}}:{{span_begin_line}}"), + per_result_error_template: Some("{{name}}::{{method_name}} in {{multiple_spans non_matching_span_filename non_matching_span_begin_line}}"), ) diff --git a/test_outputs/inherent_method_const_removed.output.ron b/test_outputs/inherent_method_const_removed.output.ron index 5a9f6974..4c3390c4 100644 --- a/test_outputs/inherent_method_const_removed.output.ron +++ b/test_outputs/inherent_method_const_removed.output.ron @@ -4,8 +4,12 @@ "method_name": String("associated_fn"), "method_visibility": String("public"), "name": String("Foo"), - "non_matching_span_begin_line": List([]), - "non_matching_span_filename": List([]), + "non_matching_span_begin_line": List([ + Uint64(4), + ]), + "non_matching_span_filename": List([ + String("src/lib.rs"), + ]), "path": List([ String("inherent_method_const_removed"), String("Foo"), @@ -18,8 +22,12 @@ "method_name": String("method"), "method_visibility": String("public"), "name": String("Foo"), - "non_matching_span_begin_line": List([]), - "non_matching_span_filename": List([]), + "non_matching_span_begin_line": List([ + Uint64(8), + ]), + "non_matching_span_filename": List([ + String("src/lib.rs"), + ]), "path": List([ String("inherent_method_const_removed"), String("Foo"),