Skip to content

Commit 06981d4

Browse files
committed
Auto merge of rust-lang#14062 - WaffleLapkin:сurrent_edition, r=Veykril
internal: Set "current" edition to 2021 :p
2 parents b4832b3 + 249ea95 commit 06981d4

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

crates/base-db/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub enum Edition {
282282
}
283283

284284
impl Edition {
285-
pub const CURRENT: Edition = Edition::Edition2018;
285+
pub const CURRENT: Edition = Edition::Edition2021;
286286
}
287287

288288
#[derive(Default, Debug, Clone, PartialEq, Eq)]

crates/hir-def/src/find_path.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ pub struct S;
811811
fn prelude() {
812812
check_found_path(
813813
r#"
814-
//- /main.rs crate:main deps:std
814+
//- /main.rs edition:2018 crate:main deps:std
815815
$0
816816
//- /std.rs crate:std
817817
pub mod prelude {
@@ -852,7 +852,7 @@ pub mod prelude {
852852
fn imported_prelude() {
853853
check_found_path(
854854
r#"
855-
//- /main.rs crate:main deps:std
855+
//- /main.rs edition:2018 crate:main deps:std
856856
use S;
857857
$0
858858
//- /std.rs crate:std
@@ -872,7 +872,7 @@ pub mod prelude {
872872
#[test]
873873
fn enum_variant_from_prelude() {
874874
let code = r#"
875-
//- /main.rs crate:main deps:std
875+
//- /main.rs edition:2018 crate:main deps:std
876876
$0
877877
//- /std.rs crate:std
878878
pub mod prelude {
@@ -1273,7 +1273,7 @@ fn f() {
12731273
fn prelude_with_inner_items() {
12741274
check_found_path(
12751275
r#"
1276-
//- /main.rs crate:main deps:std
1276+
//- /main.rs edition:2018 crate:main deps:std
12771277
fn f() {
12781278
fn inner() {}
12791279
$0

crates/hir-def/src/nameres/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub struct Bar;
476476
fn no_std_prelude() {
477477
check(
478478
r#"
479-
//- /main.rs crate:main deps:core,std
479+
//- /main.rs edition:2018 crate:main deps:core,std
480480
#![cfg_attr(not(never), no_std)]
481481
use Rust;
482482
@@ -544,7 +544,7 @@ fn edition_specific_preludes() {
544544
fn std_prelude_takes_precedence_above_core_prelude() {
545545
check(
546546
r#"
547-
//- /main.rs crate:main deps:core,std
547+
//- /main.rs edition:2018 crate:main deps:core,std
548548
use {Foo, Bar};
549549
550550
//- /std.rs crate:std deps:core
@@ -574,7 +574,7 @@ pub mod prelude {
574574
fn cfg_not_test() {
575575
check(
576576
r#"
577-
//- /main.rs crate:main deps:std
577+
//- /main.rs edition:2018 crate:main deps:std
578578
use {Foo, Bar, Baz};
579579
580580
//- /lib.rs crate:std
@@ -602,7 +602,7 @@ pub mod prelude {
602602
fn cfg_test() {
603603
check(
604604
r#"
605-
//- /main.rs crate:main deps:std
605+
//- /main.rs edition:2018 crate:main deps:std
606606
use {Foo, Bar, Baz};
607607
608608
//- /lib.rs crate:std cfg:test,feature=foo,feature=bar,opt=42

crates/hir-def/src/nameres/tests/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fn prelude_is_macro_use() {
264264
cov_mark::check!(prelude_is_macro_use);
265265
check(
266266
r#"
267-
//- /main.rs crate:main deps:std
267+
//- /main.rs edition:2018 crate:main deps:std
268268
structs!(Foo);
269269
structs_priv!(Bar);
270270
structs_outside!(Out);
@@ -634,7 +634,7 @@ fn macro_dollar_crate_is_correct_in_indirect_deps() {
634634
// From std
635635
check(
636636
r#"
637-
//- /main.rs crate:main deps:std
637+
//- /main.rs edition:2018 crate:main deps:std
638638
foo!();
639639
640640
//- /std.rs crate:std deps:core
@@ -1034,7 +1034,7 @@ structs!(Foo);
10341034
fn macro_in_prelude() {
10351035
check(
10361036
r#"
1037-
//- /lib.rs crate:lib deps:std
1037+
//- /lib.rs edition:2018 crate:lib deps:std
10381038
global_asm!();
10391039
10401040
//- /std.rs crate:std

crates/hir-ty/src/tests/method_resolution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ fn test() {
813813
fn method_resolution_trait_from_prelude() {
814814
check_types(
815815
r#"
816-
//- /main.rs crate:main deps:core
816+
//- /main.rs edition:2018 crate:main deps:core
817817
struct S;
818818
impl Clone for S {}
819819
@@ -1527,7 +1527,7 @@ fn f(x: U2) {
15271527
fn skip_array_during_method_dispatch() {
15281528
check_types(
15291529
r#"
1530-
//- /main2018.rs crate:main2018 deps:core
1530+
//- /main2018.rs crate:main2018 deps:core edition:2018
15311531
use core::IntoIterator;
15321532
15331533
fn f() {

crates/ide-completion/src/tests/special.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn _alpha() {}
6161
fn completes_prelude() {
6262
check(
6363
r#"
64-
//- /main.rs crate:main deps:std
64+
//- /main.rs edition:2018 crate:main deps:std
6565
fn foo() { let x: $0 }
6666
6767
//- /std/lib.rs crate:std
@@ -83,7 +83,7 @@ pub mod prelude {
8383
fn completes_prelude_macros() {
8484
check(
8585
r#"
86-
//- /main.rs crate:main deps:std
86+
//- /main.rs edition:2018 crate:main deps:std
8787
fn f() {$0}
8888
8989
//- /std/lib.rs crate:std
@@ -117,14 +117,14 @@ fn foo() { let x: $0 }
117117
118118
//- /core/lib.rs crate:core
119119
pub mod prelude {
120-
pub mod rust_2018 {
120+
pub mod rust_2021 {
121121
pub struct Option;
122122
}
123123
}
124124
125125
//- /std/lib.rs crate:std deps:core
126126
pub mod prelude {
127-
pub mod rust_2018 {
127+
pub mod rust_2021 {
128128
pub struct String;
129129
}
130130
}

crates/project-model/src/tests.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ fn rust_project_hello_world_project_model() {
13571357
root_file_id: FileId(
13581358
1,
13591359
),
1360-
edition: Edition2018,
1360+
edition: Edition2021,
13611361
version: None,
13621362
display_name: Some(
13631363
CrateDisplayName {
@@ -1404,7 +1404,7 @@ fn rust_project_hello_world_project_model() {
14041404
root_file_id: FileId(
14051405
2,
14061406
),
1407-
edition: Edition2018,
1407+
edition: Edition2021,
14081408
version: None,
14091409
display_name: Some(
14101410
CrateDisplayName {
@@ -1441,7 +1441,7 @@ fn rust_project_hello_world_project_model() {
14411441
root_file_id: FileId(
14421442
3,
14431443
),
1444-
edition: Edition2018,
1444+
edition: Edition2021,
14451445
version: None,
14461446
display_name: Some(
14471447
CrateDisplayName {
@@ -1478,7 +1478,7 @@ fn rust_project_hello_world_project_model() {
14781478
root_file_id: FileId(
14791479
4,
14801480
),
1481-
edition: Edition2018,
1481+
edition: Edition2021,
14821482
version: None,
14831483
display_name: Some(
14841484
CrateDisplayName {
@@ -1515,7 +1515,7 @@ fn rust_project_hello_world_project_model() {
15151515
root_file_id: FileId(
15161516
5,
15171517
),
1518-
edition: Edition2018,
1518+
edition: Edition2021,
15191519
version: None,
15201520
display_name: Some(
15211521
CrateDisplayName {
@@ -1562,7 +1562,7 @@ fn rust_project_hello_world_project_model() {
15621562
root_file_id: FileId(
15631563
6,
15641564
),
1565-
edition: Edition2018,
1565+
edition: Edition2021,
15661566
version: None,
15671567
display_name: Some(
15681568
CrateDisplayName {
@@ -1599,7 +1599,7 @@ fn rust_project_hello_world_project_model() {
15991599
root_file_id: FileId(
16001600
7,
16011601
),
1602-
edition: Edition2018,
1602+
edition: Edition2021,
16031603
version: None,
16041604
display_name: Some(
16051605
CrateDisplayName {
@@ -1709,7 +1709,7 @@ fn rust_project_hello_world_project_model() {
17091709
root_file_id: FileId(
17101710
8,
17111711
),
1712-
edition: Edition2018,
1712+
edition: Edition2021,
17131713
version: None,
17141714
display_name: Some(
17151715
CrateDisplayName {
@@ -1746,7 +1746,7 @@ fn rust_project_hello_world_project_model() {
17461746
root_file_id: FileId(
17471747
9,
17481748
),
1749-
edition: Edition2018,
1749+
edition: Edition2021,
17501750
version: None,
17511751
display_name: Some(
17521752
CrateDisplayName {
@@ -1783,7 +1783,7 @@ fn rust_project_hello_world_project_model() {
17831783
root_file_id: FileId(
17841784
10,
17851785
),
1786-
edition: Edition2018,
1786+
edition: Edition2021,
17871787
version: None,
17881788
display_name: Some(
17891789
CrateDisplayName {

0 commit comments

Comments
 (0)