Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #14062 - WaffleLapkin:сurrent_edition, r=Veykril
internal: Set "current" edition to 2021 :p
bors 2023-01-31
parent b4832b3 · parent 249ea95 · commit 06981d4
-rw-r--r--crates/base-db/src/input.rs2
-rw-r--r--crates/hir-def/src/find_path.rs8
-rw-r--r--crates/hir-def/src/nameres/tests.rs8
-rw-r--r--crates/hir-def/src/nameres/tests/macros.rs6
-rw-r--r--crates/hir-ty/src/tests/method_resolution.rs4
-rw-r--r--crates/ide-completion/src/tests/special.rs8
-rw-r--r--crates/project-model/src/tests.rs20
7 files changed, 28 insertions, 28 deletions
diff --git a/crates/base-db/src/input.rs b/crates/base-db/src/input.rs
index ea0561772d..db9589ca18 100644
--- a/crates/base-db/src/input.rs
+++ b/crates/base-db/src/input.rs
@@ -282,7 +282,7 @@ pub enum Edition {
}
impl Edition {
- pub const CURRENT: Edition = Edition::Edition2018;
+ pub const CURRENT: Edition = Edition::Edition2021;
}
#[derive(Default, Debug, Clone, PartialEq, Eq)]
diff --git a/crates/hir-def/src/find_path.rs b/crates/hir-def/src/find_path.rs
index ddd7ad99e9..3f43923208 100644
--- a/crates/hir-def/src/find_path.rs
+++ b/crates/hir-def/src/find_path.rs
@@ -811,7 +811,7 @@ pub struct S;
fn prelude() {
check_found_path(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
$0
//- /std.rs crate:std
pub mod prelude {
@@ -852,7 +852,7 @@ pub mod prelude {
fn imported_prelude() {
check_found_path(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
use S;
$0
//- /std.rs crate:std
@@ -872,7 +872,7 @@ pub mod prelude {
#[test]
fn enum_variant_from_prelude() {
let code = r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
$0
//- /std.rs crate:std
pub mod prelude {
@@ -1273,7 +1273,7 @@ fn f() {
fn prelude_with_inner_items() {
check_found_path(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
fn f() {
fn inner() {}
$0
diff --git a/crates/hir-def/src/nameres/tests.rs b/crates/hir-def/src/nameres/tests.rs
index 0d90047c28..8a27c60df5 100644
--- a/crates/hir-def/src/nameres/tests.rs
+++ b/crates/hir-def/src/nameres/tests.rs
@@ -476,7 +476,7 @@ pub struct Bar;
fn no_std_prelude() {
check(
r#"
- //- /main.rs crate:main deps:core,std
+ //- /main.rs edition:2018 crate:main deps:core,std
#![cfg_attr(not(never), no_std)]
use Rust;
@@ -544,7 +544,7 @@ fn edition_specific_preludes() {
fn std_prelude_takes_precedence_above_core_prelude() {
check(
r#"
-//- /main.rs crate:main deps:core,std
+//- /main.rs edition:2018 crate:main deps:core,std
use {Foo, Bar};
//- /std.rs crate:std deps:core
@@ -574,7 +574,7 @@ pub mod prelude {
fn cfg_not_test() {
check(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
use {Foo, Bar, Baz};
//- /lib.rs crate:std
@@ -602,7 +602,7 @@ pub mod prelude {
fn cfg_test() {
check(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
use {Foo, Bar, Baz};
//- /lib.rs crate:std cfg:test,feature=foo,feature=bar,opt=42
diff --git a/crates/hir-def/src/nameres/tests/macros.rs b/crates/hir-def/src/nameres/tests/macros.rs
index fe0ad4f386..a4ccd14cbb 100644
--- a/crates/hir-def/src/nameres/tests/macros.rs
+++ b/crates/hir-def/src/nameres/tests/macros.rs
@@ -264,7 +264,7 @@ fn prelude_is_macro_use() {
cov_mark::check!(prelude_is_macro_use);
check(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
structs!(Foo);
structs_priv!(Bar);
structs_outside!(Out);
@@ -634,7 +634,7 @@ fn macro_dollar_crate_is_correct_in_indirect_deps() {
// From std
check(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
foo!();
//- /std.rs crate:std deps:core
@@ -1034,7 +1034,7 @@ structs!(Foo);
fn macro_in_prelude() {
check(
r#"
-//- /lib.rs crate:lib deps:std
+//- /lib.rs edition:2018 crate:lib deps:std
global_asm!();
//- /std.rs crate:std
diff --git a/crates/hir-ty/src/tests/method_resolution.rs b/crates/hir-ty/src/tests/method_resolution.rs
index 6c7a532997..616ca8058e 100644
--- a/crates/hir-ty/src/tests/method_resolution.rs
+++ b/crates/hir-ty/src/tests/method_resolution.rs
@@ -813,7 +813,7 @@ fn test() {
fn method_resolution_trait_from_prelude() {
check_types(
r#"
-//- /main.rs crate:main deps:core
+//- /main.rs edition:2018 crate:main deps:core
struct S;
impl Clone for S {}
@@ -1527,7 +1527,7 @@ fn f(x: U2) {
fn skip_array_during_method_dispatch() {
check_types(
r#"
-//- /main2018.rs crate:main2018 deps:core
+//- /main2018.rs crate:main2018 deps:core edition:2018
use core::IntoIterator;
fn f() {
diff --git a/crates/ide-completion/src/tests/special.rs b/crates/ide-completion/src/tests/special.rs
index cad4af4937..6052b06232 100644
--- a/crates/ide-completion/src/tests/special.rs
+++ b/crates/ide-completion/src/tests/special.rs
@@ -61,7 +61,7 @@ fn _alpha() {}
fn completes_prelude() {
check(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
fn foo() { let x: $0 }
//- /std/lib.rs crate:std
@@ -83,7 +83,7 @@ pub mod prelude {
fn completes_prelude_macros() {
check(
r#"
-//- /main.rs crate:main deps:std
+//- /main.rs edition:2018 crate:main deps:std
fn f() {$0}
//- /std/lib.rs crate:std
@@ -117,14 +117,14 @@ fn foo() { let x: $0 }
//- /core/lib.rs crate:core
pub mod prelude {
- pub mod rust_2018 {
+ pub mod rust_2021 {
pub struct Option;
}
}
//- /std/lib.rs crate:std deps:core
pub mod prelude {
- pub mod rust_2018 {
+ pub mod rust_2021 {
pub struct String;
}
}
diff --git a/crates/project-model/src/tests.rs b/crates/project-model/src/tests.rs
index 505b660f34..9e9691d11e 100644
--- a/crates/project-model/src/tests.rs
+++ b/crates/project-model/src/tests.rs
@@ -1357,7 +1357,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
1,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1404,7 +1404,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
2,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1441,7 +1441,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
3,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1478,7 +1478,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
4,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1515,7 +1515,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
5,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1562,7 +1562,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
6,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1599,7 +1599,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
7,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1709,7 +1709,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
8,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1746,7 +1746,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
9,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {
@@ -1783,7 +1783,7 @@ fn rust_project_hello_world_project_model() {
root_file_id: FileId(
10,
),
- edition: Edition2018,
+ edition: Edition2021,
version: None,
display_name: Some(
CrateDisplayName {