Skip to content

Commit d5643a0

Browse files
authored
Rollup merge of rust-lang#151783 - mu001999-contrib:impl/final-method, r=fee1-dead
Implement RFC 3678: Final trait methods Tracking: rust-lang#131179 This PR is based on rust-lang#130802, with some minor changes and conflict resolution. Futhermore, this PR excludes final methods from the vtable of a dyn Trait. And some excerpt from the original PR description: > Implements the surface part of rust-lang/rfcs#3678. > > I'm using the word "method" in the title, but in the diagnostics and the feature gate I used "associated function", since that's more accurate. cc @joshtriplett
2 parents 32d32b6 + ae2d679 commit d5643a0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • clippy_utils/src/ast_utils

clippy_utils/src/ast_utils/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ pub fn eq_use_tree_kind(l: &UseTreeKind, r: &UseTreeKind) -> bool {
819819
pub fn eq_defaultness(l: Defaultness, r: Defaultness) -> bool {
820820
matches!(
821821
(l, r),
822-
(Defaultness::Final, Defaultness::Final) | (Defaultness::Default(_), Defaultness::Default(_))
822+
(Defaultness::Implicit, Defaultness::Implicit)
823+
| (Defaultness::Default(_), Defaultness::Default(_))
824+
| (Defaultness::Final(_), Defaultness::Final(_))
823825
)
824826
}
825827

0 commit comments

Comments
 (0)