File tree 6 files changed +16
-12
lines changed
6 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ declare_lint! {
11
11
///
12
12
/// ### Example
13
13
///
14
- /// ```rust
14
+ /// ```rust,edition2018
15
15
/// pub trait Trait {
16
16
/// async fn method(&self);
17
17
/// }
@@ -32,7 +32,7 @@ declare_lint! {
32
32
///
33
33
/// For example, this code is invalid:
34
34
///
35
- /// ```rust,compile_fail
35
+ /// ```rust,edition2018, compile_fail
36
36
/// pub trait Trait {
37
37
/// async fn method(&self) {}
38
38
/// }
@@ -49,7 +49,7 @@ declare_lint! {
49
49
///
50
50
/// For example, instead of:
51
51
///
52
- /// ```rust
52
+ /// ```rust,edition2018
53
53
/// pub trait Trait {
54
54
/// async fn method(&self) {}
55
55
/// }
Original file line number Diff line number Diff line change @@ -1290,7 +1290,7 @@ declare_lint! {
1290
1290
///
1291
1291
/// ### Example
1292
1292
///
1293
- /// ```rust
1293
+ /// ```rust,edition2018
1294
1294
/// #[track_caller]
1295
1295
/// async fn foo() {}
1296
1296
/// ```
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ declare_lint! {
19
19
///
20
20
/// ### Example
21
21
///
22
- /// ```rust,compile_fail
22
+ /// ```rust,edition2018, compile_fail
23
23
/// #![deny(deref_into_dyn_supertrait)]
24
24
/// #![allow(dead_code)]
25
25
///
Original file line number Diff line number Diff line change @@ -1899,7 +1899,7 @@ declare_lint! {
1899
1899
///
1900
1900
/// ### Example
1901
1901
///
1902
- /// ```rust,compile_fail
1902
+ /// ```rust,edition2018, compile_fail
1903
1903
/// # use core::sync::atomic::{AtomicU8, Ordering};
1904
1904
/// let atom = AtomicU8::new(0);
1905
1905
/// let value = atom.load(Ordering::Release);
Original file line number Diff line number Diff line change @@ -428,7 +428,7 @@ declare_lint! {
428
428
///
429
429
/// ### Example
430
430
///
431
- /// ```rust
431
+ /// ```rust,edition2018
432
432
/// #![feature(must_not_suspend)]
433
433
/// #![warn(must_not_suspend)]
434
434
///
@@ -1195,7 +1195,7 @@ declare_lint! {
1195
1195
///
1196
1196
/// ### Example
1197
1197
///
1198
- /// ```rust,compile_fail
1198
+ /// ```rust,edition2018, compile_fail
1199
1199
/// extern crate core;
1200
1200
/// pub use core as reexported_core;
1201
1201
/// ```
@@ -4514,7 +4514,7 @@ declare_lint! {
4514
4514
///
4515
4515
/// ### Example
4516
4516
///
4517
- /// ```rust,compile_fail
4517
+ /// ```rust,edition2018, compile_fail
4518
4518
/// #![deny(ambiguous_glob_imports)]
4519
4519
/// pub fn foo() -> u32 {
4520
4520
/// use sub::*;
Original file line number Diff line number Diff line change @@ -441,10 +441,14 @@ impl<'a> LintExtractor<'a> {
441
441
fs:: write ( & tempfile, source)
442
442
. map_err ( |e| format ! ( "failed to write {}: {}" , tempfile. display( ) , e) ) ?;
443
443
let mut cmd = Command :: new ( self . rustc_path ) ;
444
- if options. contains ( & "edition2015" ) {
445
- cmd. arg ( "--edition=2015" ) ;
446
- } else {
444
+ if options. contains ( & "edition2024" ) {
445
+ cmd. arg ( "--edition=2024" ) ;
446
+ } else if options. contains ( & "edition2021" ) {
447
+ cmd. arg ( "--edition=2021" ) ;
448
+ } else if options. contains ( & "edition2018" ) {
447
449
cmd. arg ( "--edition=2018" ) ;
450
+ } else {
451
+ cmd. arg ( "--edition=2015" ) ;
448
452
}
449
453
cmd. arg ( "--error-format=json" ) ;
450
454
cmd. arg ( "--target" ) . arg ( self . rustc_target ) ;
You can’t perform that action at this time.
0 commit comments