From 31da66364566247be9761b07bdadcd524118d165 Mon Sep 17 00:00:00 2001 From: Pedro Turik Firmino Date: Wed, 28 Aug 2024 15:21:56 -0300 Subject: [PATCH 1/2] adds new trait-method-added lint --- src/lints/trait_method_added.ron | 61 ++++ src/query.rs | 1 + test_crates/trait_method_added/new/Cargo.toml | 7 + test_crates/trait_method_added/new/src/lib.rs | 45 +++ test_crates/trait_method_added/old/Cargo.toml | 7 + test_crates/trait_method_added/old/src/lib.rs | 30 ++ test_outputs/trait_method_added.output.ron | 338 ++++++++++++++++++ test_outputs/trait_newly_sealed.output.ron | 12 + 8 files changed, 501 insertions(+) create mode 100644 src/lints/trait_method_added.ron create mode 100644 test_crates/trait_method_added/new/Cargo.toml create mode 100644 test_crates/trait_method_added/new/src/lib.rs create mode 100644 test_crates/trait_method_added/old/Cargo.toml create mode 100644 test_crates/trait_method_added/old/src/lib.rs create mode 100644 test_outputs/trait_method_added.output.ron diff --git a/src/lints/trait_method_added.ron b/src/lints/trait_method_added.ron new file mode 100644 index 00000000..19607582 --- /dev/null +++ b/src/lints/trait_method_added.ron @@ -0,0 +1,61 @@ +SemverQuery( + id: "trait_method_added", + human_readable_name: "pub trait method added", + description: "A non-sealed public trait added a new method without a default implementation", + required_update: Major, + lint_level: Deny, + reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default"), + query: r#" + { + CrateDiff { + current { + item { + ... on Trait { + visibility_limit @filter(op: "=", value: ["$public"]) @output + sealed @filter(op: "!=", value: ["$true"]) + name @output + + importable_path { + path @output @tag + public_api @filter(op: "=", value: ["$true"]) + } + + method { + method_name: name @output @tag + has_body @filter(op: "!=", value: ["$true"]) + + span_: span @optional { + filename @output + begin_line @output + } + } + } + } + } + baseline { + item { + ... on Trait { + visibility_limit @filter(op: "=", value: ["$public"]) + sealed @filter(op: "!=", value: ["$true"]) + + importable_path { + path @filter(op: "=", value: ["%path"]) + public_api @filter(op: "=", value: ["$true"]) + } + + method @fold @transform(op: "count") @filter(op: "=", value: ["$zero"]) { + name @filter(op: "=", value: ["%method_name"]) + } + } + } + } + } + }"#, + arguments: { + "true": true, + "public": "public", + "zero": 0, + }, + error_message: "A non-sealed public trait added a new method without a default implementation, which breaks downstream implementations of the trait", + per_result_error_template: Some("trait method {{join \"::\" path}}::{{method_name}} in file {{span_filename}}:{{span_begin_line}}"), +) diff --git a/src/query.rs b/src/query.rs index 16bfdbe0..a5277bc8 100644 --- a/src/query.rs +++ b/src/query.rs @@ -839,6 +839,7 @@ add_lints!( trait_associated_type_added, trait_associated_type_now_doc_hidden, trait_default_impl_removed, + trait_method_added, trait_method_missing, trait_method_now_doc_hidden, trait_method_unsafe_added, diff --git a/test_crates/trait_method_added/new/Cargo.toml b/test_crates/trait_method_added/new/Cargo.toml new file mode 100644 index 00000000..878fba75 --- /dev/null +++ b/test_crates/trait_method_added/new/Cargo.toml @@ -0,0 +1,7 @@ +[package] +publish = false +name = "trait_method_added" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/test_crates/trait_method_added/new/src/lib.rs b/test_crates/trait_method_added/new/src/lib.rs new file mode 100644 index 00000000..0ef0a657 --- /dev/null +++ b/test_crates/trait_method_added/new/src/lib.rs @@ -0,0 +1,45 @@ +mod sealed { + pub(crate) trait Sealed {} +} + +// ---- Should be reported ---- +pub trait WillGainMethodWithoutDefault { + fn one_method(self); +} + +pub trait WillGainAnotherMethodWithoutDefault { + fn one_method(self); + fn two_method(self); +} + +pub trait WillGainMultipleMethodsWithoutDefault { + fn one_method(self); + fn two_method(self); +} + +// ---- Should not be reported ---- +pub trait WillGainMethodWithDefault { + fn one_method(self) {} +} + +pub trait WillGainAnotherMethodWithDefault { + fn one_method(self); + fn two_method(self) {} +} + +pub trait WillGainMethodWithoutDefaultSealed: sealed::Sealed { + fn one_method(self); +} + +pub trait WillGainMethodWithoutDefaultAndLoseSeal { + fn one_method(self); +} + +/* +Will let this case to be reported only by the newly sealed trait Lint, +and not by this one, since sealing a trait indicates that the user +wants to remove this type from the public API. +*/ +pub trait WillGainMethodWithoutDefaultAndSeal: sealed::Sealed { + fn one_method(self); +} diff --git a/test_crates/trait_method_added/old/Cargo.toml b/test_crates/trait_method_added/old/Cargo.toml new file mode 100644 index 00000000..878fba75 --- /dev/null +++ b/test_crates/trait_method_added/old/Cargo.toml @@ -0,0 +1,7 @@ +[package] +publish = false +name = "trait_method_added" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/test_crates/trait_method_added/old/src/lib.rs b/test_crates/trait_method_added/old/src/lib.rs new file mode 100644 index 00000000..abc47940 --- /dev/null +++ b/test_crates/trait_method_added/old/src/lib.rs @@ -0,0 +1,30 @@ +mod sealed { + pub(crate) trait Sealed {} +} + +// ---- Should be reported ---- +pub trait WillGainMethodWithoutDefault {} + +pub trait WillGainAnotherMethodWithoutDefault { + fn one_method(self); +} + +pub trait WillGainMultipleMethodsWithoutDefault {} + +// ---- Should not be reported ---- +pub trait WillGainMethodWithDefault {} + +pub trait WillGainAnotherMethodWithDefault { + fn one_method(self); +} + +pub trait WillGainMethodWithoutDefaultSealed: sealed::Sealed {} + +pub trait WillGainMethodWithoutDefaultAndLoseSeal: sealed::Sealed {} + +/* +Will let this case to be reported only by the newly sealed trait Lint, +and not by this one, since sealing a trait indicates that the user +wants to remove this type from the public API. +*/ +pub trait WillGainMethodWithoutDefaultAndSeal {} diff --git a/test_outputs/trait_method_added.output.ron b/test_outputs/trait_method_added.output.ron new file mode 100644 index 00000000..8738ee17 --- /dev/null +++ b/test_outputs/trait_method_added.output.ron @@ -0,0 +1,338 @@ +{ + "./test_crates/method_moved_to_trait_must_use_added/": [ + { + "method_name": String("MethodToMovedDeclaredMustUseMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(49), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(52), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMethodToMovedDeclaredMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(54), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(57), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(59), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMustUseMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(62), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(65), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedImplDeclaredMustUseMethod"), + "name": String("TraitWithMovedImplMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("enum_method_moved_to_trait_must_use_added"), + String("TraitWithMovedImplMustUseMethods"), + ]), + "span_begin_line": Uint64(135), + "span_filename": String("src/enum_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedDeclaredMustUseMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(45), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(48), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMethodToMovedDeclaredMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(50), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(53), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(55), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMustUseMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(58), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(61), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedImplDeclaredMustUseMethod"), + "name": String("TraitWithMovedImplMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("struct_method_moved_to_trait_must_use_added"), + String("TraitWithMovedImplMustUseMethods"), + ]), + "span_begin_line": Uint64(127), + "span_filename": String("src/struct_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedDeclaredMustUseMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(49), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(52), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMethodToMovedDeclaredMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(54), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(57), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(59), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMustUseMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(62), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MustUseMessageMethodToMovedDeclaredMustUseMessageMethod"), + "name": String("TraitWithMovedDeclaredMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedDeclaredMustUseMethods"), + ]), + "span_begin_line": Uint64(65), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("MethodToMovedImplDeclaredMustUseMethod"), + "name": String("TraitWithMovedImplMustUseMethods"), + "path": List([ + String("method_moved_to_trait_must_use_added"), + String("union_method_moved_to_trait_must_use_added"), + String("TraitWithMovedImplMustUseMethods"), + ]), + "span_begin_line": Uint64(135), + "span_filename": String("src/union_method_moved_to_trait_must_use_added.rs"), + "visibility_limit": String("public"), + }, + ], + "./test_crates/trait_method_added/": [ + { + "method_name": String("one_method"), + "name": String("WillGainMethodWithoutDefault"), + "path": List([ + String("trait_method_added"), + String("WillGainMethodWithoutDefault"), + ]), + "span_begin_line": Uint64(7), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("two_method"), + "name": String("WillGainAnotherMethodWithoutDefault"), + "path": List([ + String("trait_method_added"), + String("WillGainAnotherMethodWithoutDefault"), + ]), + "span_begin_line": Uint64(12), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("one_method"), + "name": String("WillGainMultipleMethodsWithoutDefault"), + "path": List([ + String("trait_method_added"), + String("WillGainMultipleMethodsWithoutDefault"), + ]), + "span_begin_line": Uint64(16), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("two_method"), + "name": String("WillGainMultipleMethodsWithoutDefault"), + "path": List([ + String("trait_method_added"), + String("WillGainMultipleMethodsWithoutDefault"), + ]), + "span_begin_line": Uint64(17), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, + ], +} diff --git a/test_outputs/trait_newly_sealed.output.ron b/test_outputs/trait_newly_sealed.output.ron index 1363a9d1..a9de11b0 100644 --- a/test_outputs/trait_newly_sealed.output.ron +++ b/test_outputs/trait_newly_sealed.output.ron @@ -11,6 +11,18 @@ "visibility_limit": String("public"), }, ], + "./test_crates/trait_method_added/": [ + { + "name": String("WillGainMethodWithoutDefaultAndSeal"), + "path": List([ + String("trait_method_added"), + String("WillGainMethodWithoutDefaultAndSeal"), + ]), + "span_begin_line": Uint64(43), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, + ], "./test_crates/trait_newly_sealed/": [ { "name": String("TraitBecomesSealed"), From e8b0f043b162d9f714ca7d50d713198a11f01d84 Mon Sep 17 00:00:00 2001 From: Pedro Turik Firmino Date: Wed, 28 Aug 2024 17:52:43 -0300 Subject: [PATCH 2/2] corrects lint to account for traits that have also become sealed, and adds tests for it --- src/lints/trait_method_added.ron | 1 - test_crates/trait_method_added/new/src/lib.rs | 18 +++++++++------ test_crates/trait_method_added/old/src/lib.rs | 13 ++++++----- test_outputs/trait_method_added.output.ron | 22 +++++++++++++++++++ test_outputs/trait_newly_sealed.output.ron | 2 +- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/lints/trait_method_added.ron b/src/lints/trait_method_added.ron index 19607582..c5ebd43b 100644 --- a/src/lints/trait_method_added.ron +++ b/src/lints/trait_method_added.ron @@ -12,7 +12,6 @@ SemverQuery( item { ... on Trait { visibility_limit @filter(op: "=", value: ["$public"]) @output - sealed @filter(op: "!=", value: ["$true"]) name @output importable_path { diff --git a/test_crates/trait_method_added/new/src/lib.rs b/test_crates/trait_method_added/new/src/lib.rs index 0ef0a657..564a786a 100644 --- a/test_crates/trait_method_added/new/src/lib.rs +++ b/test_crates/trait_method_added/new/src/lib.rs @@ -17,6 +17,15 @@ pub trait WillGainMultipleMethodsWithoutDefault { fn two_method(self); } +pub trait WillGainMethodWithoutDefaultAndSeal: sealed::Sealed { + fn one_method(self); +} + +pub trait WIllGainDocHiddenMethodWithoutDefault { + #[doc(hidden)] + fn one_method(self); +} + // ---- Should not be reported ---- pub trait WillGainMethodWithDefault { fn one_method(self) {} @@ -35,11 +44,6 @@ pub trait WillGainMethodWithoutDefaultAndLoseSeal { fn one_method(self); } -/* -Will let this case to be reported only by the newly sealed trait Lint, -and not by this one, since sealing a trait indicates that the user -wants to remove this type from the public API. -*/ -pub trait WillGainMethodWithoutDefaultAndSeal: sealed::Sealed { +pub trait WillKeepAMethodWithoutDefault { fn one_method(self); -} +} diff --git a/test_crates/trait_method_added/old/src/lib.rs b/test_crates/trait_method_added/old/src/lib.rs index abc47940..004952ea 100644 --- a/test_crates/trait_method_added/old/src/lib.rs +++ b/test_crates/trait_method_added/old/src/lib.rs @@ -11,6 +11,10 @@ pub trait WillGainAnotherMethodWithoutDefault { pub trait WillGainMultipleMethodsWithoutDefault {} +pub trait WillGainMethodWithoutDefaultAndSeal {} + +pub trait WIllGainDocHiddenMethodWithoutDefault {} + // ---- Should not be reported ---- pub trait WillGainMethodWithDefault {} @@ -22,9 +26,6 @@ pub trait WillGainMethodWithoutDefaultSealed: sealed::Sealed {} pub trait WillGainMethodWithoutDefaultAndLoseSeal: sealed::Sealed {} -/* -Will let this case to be reported only by the newly sealed trait Lint, -and not by this one, since sealing a trait indicates that the user -wants to remove this type from the public API. -*/ -pub trait WillGainMethodWithoutDefaultAndSeal {} +pub trait WillKeepAMethodWithoutDefault { + fn one_method(self); +} diff --git a/test_outputs/trait_method_added.output.ron b/test_outputs/trait_method_added.output.ron index 8738ee17..c1589c82 100644 --- a/test_outputs/trait_method_added.output.ron +++ b/test_outputs/trait_method_added.output.ron @@ -334,5 +334,27 @@ "span_filename": String("src/lib.rs"), "visibility_limit": String("public"), }, + { + "method_name": String("one_method"), + "name": String("WillGainMethodWithoutDefaultAndSeal"), + "path": List([ + String("trait_method_added"), + String("WillGainMethodWithoutDefaultAndSeal"), + ]), + "span_begin_line": Uint64(21), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, + { + "method_name": String("one_method"), + "name": String("WIllGainDocHiddenMethodWithoutDefault"), + "path": List([ + String("trait_method_added"), + String("WIllGainDocHiddenMethodWithoutDefault"), + ]), + "span_begin_line": Uint64(26), + "span_filename": String("src/lib.rs"), + "visibility_limit": String("public"), + }, ], } diff --git a/test_outputs/trait_newly_sealed.output.ron b/test_outputs/trait_newly_sealed.output.ron index a9de11b0..14aee41b 100644 --- a/test_outputs/trait_newly_sealed.output.ron +++ b/test_outputs/trait_newly_sealed.output.ron @@ -18,7 +18,7 @@ String("trait_method_added"), String("WillGainMethodWithoutDefaultAndSeal"), ]), - "span_begin_line": Uint64(43), + "span_begin_line": Uint64(20), "span_filename": String("src/lib.rs"), "visibility_limit": String("public"), },