@@ -443,27 +443,27 @@ value is passed to the constructor in `clippy_lints/lib.rs`.
443
443
444
444
``` rust
445
445
pub struct ManualStrip {
446
- msrv : Option < RustcVersion > ,
446
+ msrv : Msrv ,
447
447
}
448
448
449
449
impl ManualStrip {
450
450
#[must_use]
451
- pub fn new (msrv : Option < RustcVersion > ) -> Self {
451
+ pub fn new (msrv : Msrv ) -> Self {
452
452
Self { msrv }
453
453
}
454
454
}
455
455
```
456
456
457
457
The 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 .
459
459
460
460
``` rust
461
- if ! meets_msrv ( self . msrv, msrvs :: STR_STRIP_PREFIX ) {
461
+ if ! self . msrv. meets ( msrvs :: STR_STRIP_PREFIX ) {
462
462
return ;
463
463
}
464
464
```
465
465
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
467
467
the value from ` clippy.toml ` . This can be accounted for using the
468
468
` extract_msrv_attr!(LintContext) ` macro and passing
469
469
` LateContext ` /` EarlyContext ` .
@@ -483,19 +483,15 @@ have a case for the version below the MSRV and one with the same contents but
483
483
for the MSRV version itself.
484
484
485
485
``` rust
486
- #![feature(custom_inner_attributes)]
487
-
488
486
...
489
487
488
+ #[clippy:: msrv = " 1.44" ]
490
489
fn msrv_1_44 () {
491
- #![clippy:: msrv = " 1.44" ]
492
-
493
490
/* something that would trigger the lint */
494
491
}
495
492
493
+ #[clippy:: msrv = " 1.45" ]
496
494
fn msrv_1_45 () {
497
- #![clippy:: msrv = " 1.45" ]
498
-
499
495
/* something that would trigger the lint */
500
496
}
501
497
```
0 commit comments