Auto merge of #14062 - WaffleLapkin:сurrent_edition, r=Veykril
internal: Set "current" edition to 2021 :p
This commit is contained in:
commit
06981d4b10
@ -282,7 +282,7 @@ pub enum Edition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Edition {
|
impl Edition {
|
||||||
pub const CURRENT: Edition = Edition::Edition2018;
|
pub const CURRENT: Edition = Edition::Edition2021;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
||||||
|
@ -811,7 +811,7 @@ fn different_crate_reexport() {
|
|||||||
fn prelude() {
|
fn prelude() {
|
||||||
check_found_path(
|
check_found_path(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
$0
|
$0
|
||||||
//- /std.rs crate:std
|
//- /std.rs crate:std
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
@ -852,7 +852,7 @@ pub mod rust_2018 {
|
|||||||
fn imported_prelude() {
|
fn imported_prelude() {
|
||||||
check_found_path(
|
check_found_path(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
use S;
|
use S;
|
||||||
$0
|
$0
|
||||||
//- /std.rs crate:std
|
//- /std.rs crate:std
|
||||||
@ -872,7 +872,7 @@ pub mod rust_2018 {
|
|||||||
#[test]
|
#[test]
|
||||||
fn enum_variant_from_prelude() {
|
fn enum_variant_from_prelude() {
|
||||||
let code = r#"
|
let code = r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
$0
|
$0
|
||||||
//- /std.rs crate:std
|
//- /std.rs crate:std
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
@ -1273,7 +1273,7 @@ fn inner() {}
|
|||||||
fn prelude_with_inner_items() {
|
fn prelude_with_inner_items() {
|
||||||
check_found_path(
|
check_found_path(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
fn f() {
|
fn f() {
|
||||||
fn inner() {}
|
fn inner() {}
|
||||||
$0
|
$0
|
||||||
|
@ -476,7 +476,7 @@ fn foo() {}
|
|||||||
fn no_std_prelude() {
|
fn no_std_prelude() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:core,std
|
//- /main.rs edition:2018 crate:main deps:core,std
|
||||||
#![cfg_attr(not(never), no_std)]
|
#![cfg_attr(not(never), no_std)]
|
||||||
use Rust;
|
use Rust;
|
||||||
|
|
||||||
@ -544,7 +544,7 @@ pub mod rust_2021 {
|
|||||||
fn std_prelude_takes_precedence_above_core_prelude() {
|
fn std_prelude_takes_precedence_above_core_prelude() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:core,std
|
//- /main.rs edition:2018 crate:main deps:core,std
|
||||||
use {Foo, Bar};
|
use {Foo, Bar};
|
||||||
|
|
||||||
//- /std.rs crate:std deps:core
|
//- /std.rs crate:std deps:core
|
||||||
@ -574,7 +574,7 @@ pub mod rust_2018 {
|
|||||||
fn cfg_not_test() {
|
fn cfg_not_test() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
use {Foo, Bar, Baz};
|
use {Foo, Bar, Baz};
|
||||||
|
|
||||||
//- /lib.rs crate:std
|
//- /lib.rs crate:std
|
||||||
@ -602,7 +602,7 @@ pub mod rust_2018 {
|
|||||||
fn cfg_test() {
|
fn cfg_test() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
use {Foo, Bar, Baz};
|
use {Foo, Bar, Baz};
|
||||||
|
|
||||||
//- /lib.rs crate:std cfg:test,feature=foo,feature=bar,opt=42
|
//- /lib.rs crate:std cfg:test,feature=foo,feature=bar,opt=42
|
||||||
|
@ -264,7 +264,7 @@ fn prelude_is_macro_use() {
|
|||||||
cov_mark::check!(prelude_is_macro_use);
|
cov_mark::check!(prelude_is_macro_use);
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
structs!(Foo);
|
structs!(Foo);
|
||||||
structs_priv!(Bar);
|
structs_priv!(Bar);
|
||||||
structs_outside!(Out);
|
structs_outside!(Out);
|
||||||
@ -634,7 +634,7 @@ fn macro_dollar_crate_is_correct_in_indirect_deps() {
|
|||||||
// From std
|
// From std
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
foo!();
|
foo!();
|
||||||
|
|
||||||
//- /std.rs crate:std deps:core
|
//- /std.rs crate:std deps:core
|
||||||
@ -1034,7 +1034,7 @@ fn resolve_macro_def() {
|
|||||||
fn macro_in_prelude() {
|
fn macro_in_prelude() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /lib.rs crate:lib deps:std
|
//- /lib.rs edition:2018 crate:lib deps:std
|
||||||
global_asm!();
|
global_asm!();
|
||||||
|
|
||||||
//- /std.rs crate:std
|
//- /std.rs crate:std
|
||||||
|
@ -813,7 +813,7 @@ fn test() {
|
|||||||
fn method_resolution_trait_from_prelude() {
|
fn method_resolution_trait_from_prelude() {
|
||||||
check_types(
|
check_types(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:core
|
//- /main.rs edition:2018 crate:main deps:core
|
||||||
struct S;
|
struct S;
|
||||||
impl Clone for S {}
|
impl Clone for S {}
|
||||||
|
|
||||||
@ -1527,7 +1527,7 @@ fn f(x: U2) {
|
|||||||
fn skip_array_during_method_dispatch() {
|
fn skip_array_during_method_dispatch() {
|
||||||
check_types(
|
check_types(
|
||||||
r#"
|
r#"
|
||||||
//- /main2018.rs crate:main2018 deps:core
|
//- /main2018.rs crate:main2018 deps:core edition:2018
|
||||||
use core::IntoIterator;
|
use core::IntoIterator;
|
||||||
|
|
||||||
fn f() {
|
fn f() {
|
||||||
|
@ -61,7 +61,7 @@ fn _alpha() {}
|
|||||||
fn completes_prelude() {
|
fn completes_prelude() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
fn foo() { let x: $0 }
|
fn foo() { let x: $0 }
|
||||||
|
|
||||||
//- /std/lib.rs crate:std
|
//- /std/lib.rs crate:std
|
||||||
@ -83,7 +83,7 @@ pub mod rust_2018 {
|
|||||||
fn completes_prelude_macros() {
|
fn completes_prelude_macros() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /main.rs crate:main deps:std
|
//- /main.rs edition:2018 crate:main deps:std
|
||||||
fn f() {$0}
|
fn f() {$0}
|
||||||
|
|
||||||
//- /std/lib.rs crate:std
|
//- /std/lib.rs crate:std
|
||||||
@ -117,14 +117,14 @@ fn foo() { let x: $0 }
|
|||||||
|
|
||||||
//- /core/lib.rs crate:core
|
//- /core/lib.rs crate:core
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub mod rust_2018 {
|
pub mod rust_2021 {
|
||||||
pub struct Option;
|
pub struct Option;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//- /std/lib.rs crate:std deps:core
|
//- /std/lib.rs crate:std deps:core
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub mod rust_2018 {
|
pub mod rust_2021 {
|
||||||
pub struct String;
|
pub struct String;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1357,7 +1357,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1404,7 +1404,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
2,
|
2,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1441,7 +1441,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
3,
|
3,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1478,7 +1478,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
4,
|
4,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1515,7 +1515,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
5,
|
5,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1562,7 +1562,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
6,
|
6,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1599,7 +1599,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
7,
|
7,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1709,7 +1709,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
8,
|
8,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1746,7 +1746,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
9,
|
9,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
@ -1783,7 +1783,7 @@ fn rust_project_hello_world_project_model() {
|
|||||||
root_file_id: FileId(
|
root_file_id: FileId(
|
||||||
10,
|
10,
|
||||||
),
|
),
|
||||||
edition: Edition2018,
|
edition: Edition2021,
|
||||||
version: None,
|
version: None,
|
||||||
display_name: Some(
|
display_name: Some(
|
||||||
CrateDisplayName {
|
CrateDisplayName {
|
||||||
|
Loading…
Reference in New Issue
Block a user