diff options
author | Jonas Schievink <[email protected]> | 2021-06-01 12:39:19 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-06-01 12:39:19 +0100 |
commit | f96c1a0414ee302fe96503d89f2998483345c8a9 (patch) | |
tree | 6de19b3c128809cd56641f70873c35f17974aced /crates/hir_def/src/find_path.rs | |
parent | 71117e6812f87e014bc8e984e195a75e222ac227 (diff) |
Implement per-edition preludes
Diffstat (limited to 'crates/hir_def/src/find_path.rs')
-rw-r--r-- | crates/hir_def/src/find_path.rs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/crates/hir_def/src/find_path.rs b/crates/hir_def/src/find_path.rs index ee52794aa..219ed4c07 100644 --- a/crates/hir_def/src/find_path.rs +++ b/crates/hir_def/src/find_path.rs | |||
@@ -682,9 +682,11 @@ pub struct S; | |||
682 | //- /main.rs crate:main deps:std | 682 | //- /main.rs crate:main deps:std |
683 | $0 | 683 | $0 |
684 | //- /std.rs crate:std | 684 | //- /std.rs crate:std |
685 | pub mod prelude { pub struct S; } | 685 | pub mod prelude { |
686 | #[prelude_import] | 686 | pub mod rust_2018 { |
687 | pub use prelude::*; | 687 | pub struct S; |
688 | } | ||
689 | } | ||
688 | "#, | 690 | "#, |
689 | "S", | 691 | "S", |
690 | "S", | 692 | "S", |
@@ -700,11 +702,11 @@ pub use prelude::*; | |||
700 | $0 | 702 | $0 |
701 | //- /std.rs crate:std | 703 | //- /std.rs crate:std |
702 | pub mod prelude { | 704 | pub mod prelude { |
703 | pub enum Option<T> { Some(T), None } | 705 | pub mod rust_2018 { |
704 | pub use Option::*; | 706 | pub enum Option<T> { Some(T), None } |
707 | pub use Option::*; | ||
708 | } | ||
705 | } | 709 | } |
706 | #[prelude_import] | ||
707 | pub use prelude::*; | ||
708 | "#; | 710 | "#; |
709 | check_found_path(code, "None", "None", "None", "None"); | 711 | check_found_path(code, "None", "None", "None", "None"); |
710 | check_found_path(code, "Some", "Some", "Some", "Some"); | 712 | check_found_path(code, "Some", "Some", "Some", "Some"); |
@@ -1080,11 +1082,11 @@ fn f() { | |||
1080 | } | 1082 | } |
1081 | //- /std.rs crate:std | 1083 | //- /std.rs crate:std |
1082 | pub mod prelude { | 1084 | pub mod prelude { |
1083 | pub enum Option { None } | 1085 | pub mod rust_2018 { |
1084 | pub use Option::*; | 1086 | pub enum Option { None } |
1087 | pub use Option::*; | ||
1088 | } | ||
1085 | } | 1089 | } |
1086 | #[prelude_import] | ||
1087 | pub use prelude::*; | ||
1088 | "#, | 1090 | "#, |
1089 | "None", | 1091 | "None", |
1090 | "None", | 1092 | "None", |