Constify DropGuard::dismiss and trait impls by nxsaken · Pull Request #148755 · rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it hinges on what gets decided for the associated function name. If this API is stabilized as unguard(), then allowing method syntax seems fine because having guard objects (or something else with an unguard method?) inside of guard objects is sufficiently obscure. Whereas if it is stabilized as into_inner(), I think method syntax is unambiguously off the table. dismiss() would be somewhere in between.

Since changing from guard: Self to self after stabilization is not a breaking change while the reverse is, switching this back to guard: Self would put it closer to stabilization, so feel free to go ahead with that.