From 249ea9502d3d69c3acbbae7a4cdfabcbf38de0c3 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 31 Jan 2023 10:39:25 +0000 Subject: [PATCH] Set "current" edition to 2021 --- crates/base-db/src/input.rs | 2 +- crates/hir-def/src/find_path.rs | 8 ++++---- crates/hir-def/src/nameres/tests.rs | 8 ++++---- crates/hir-def/src/nameres/tests/macros.rs | 6 +++--- crates/hir-ty/src/tests/method_resolution.rs | 4 ++-- crates/ide-completion/src/tests/special.rs | 8 ++++---- crates/project-model/src/tests.rs | 20 ++++++++++---------- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/crates/base-db/src/input.rs b/crates/base-db/src/input.rs index ea0561772d2..db9589ca186 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 ddd7ad99e9a..3f439232083 100644 --- a/crates/hir-def/src/find_path.rs +++ b/crates/hir-def/src/find_path.rs @@ -811,7 +811,7 @@ fn different_crate_reexport() { 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 rust_2018 { 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 rust_2018 { #[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 inner() {} 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 0d90047c28f..8a27c60df5c 100644 --- a/crates/hir-def/src/nameres/tests.rs +++ b/crates/hir-def/src/nameres/tests.rs @@ -476,7 +476,7 @@ fn foo() {} 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 @@ pub mod rust_2021 { 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 rust_2018 { 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 rust_2018 { 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 fe0ad4f3863..a4ccd14cbb4 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 @@ fn resolve_macro_def() { 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 6c7a5329970..616ca8058e9 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 cad4af4937d..6052b062320 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 rust_2018 { 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 505b660f344..9e9691d11e8 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 {