@@ -443,27 +443,27 @@ value is passed to the constructor in `clippy_lints/lib.rs`.
443443
444444``` rust
445445pub struct ManualStrip {
446- msrv : Option < RustcVersion > ,
446+ msrv : Msrv ,
447447}
448448
449449impl ManualStrip {
450450 #[must_use]
451- pub fn new (msrv : Option < RustcVersion > ) -> Self {
451+ pub fn new (msrv : Msrv ) -> Self {
452452 Self { msrv }
453453 }
454454}
455455```
456456
457457The project's MSRV can then be matched against the feature MSRV in the LintPass
458- using the ` meets_msrv ` utility function .
458+ using the ` Msrv::meets ` method .
459459
460460``` rust
461- if ! meets_msrv ( self . msrv, msrvs :: STR_STRIP_PREFIX ) {
461+ if ! self . msrv. meets ( msrvs :: STR_STRIP_PREFIX ) {
462462 return ;
463463}
464464```
465465
466- The project's MSRV can also be specified as an inner attribute, which overrides
466+ The project's MSRV can also be specified as an attribute, which overrides
467467the value from ` clippy.toml ` . This can be accounted for using the
468468` extract_msrv_attr!(LintContext) ` macro and passing
469469` LateContext ` /` EarlyContext ` .
@@ -483,19 +483,15 @@ have a case for the version below the MSRV and one with the same contents but
483483for the MSRV version itself.
484484
485485``` rust
486- #![feature(custom_inner_attributes)]
487-
488486...
489487
488+ #[clippy:: msrv = " 1.44" ]
490489fn msrv_1_44 () {
491- #![clippy:: msrv = " 1.44" ]
492-
493490 /* something that would trigger the lint */
494491}
495492
493+ #[clippy:: msrv = " 1.45" ]
496494fn msrv_1_45 () {
497- #![clippy:: msrv = " 1.45" ]
498-
499495 /* something that would trigger the lint */
500496}
501497```
0 commit comments