aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/regression.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-01 12:46:59 +0100
committerGitHub <[email protected]>2021-06-01 12:46:59 +0100
commit4f63e79eb30a0695675a560dfe7ebae6f1dd8a94 (patch)
tree6de19b3c128809cd56641f70873c35f17974aced /crates/hir_ty/src/tests/regression.rs
parent71117e6812f87e014bc8e984e195a75e222ac227 (diff)
parentf96c1a0414ee302fe96503d89f2998483345c8a9 (diff)
Merge #9097
9097: feat: Implement per-edition preludes r=jonas-schievink a=jonas-schievink Part of https://github.com/rust-analyzer/rust-analyzer/issues/9056 Our previous implementation was incorrect (presumably because of the misleading comment in libstd [here](https://github.com/rust-lang/rust/blob/a7890c7952bdc9445eb6c63dc671fa7a1ab0260d/library/std/src/lib.rs#L339-L343)). `#[prelude_import]` does not define the prelude, it can only override the implicit prelude for the current crate. This PR fixes that, which also makes the prelude imports in `rustc_span` work. Closes https://github.com/rust-analyzer/rust-analyzer/issues/8815. bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/tests/regression.rs')
-rw-r--r--crates/hir_ty/src/tests/regression.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs
index ad9edf11c..1019e783b 100644
--- a/crates/hir_ty/src/tests/regression.rs
+++ b/crates/hir_ty/src/tests/regression.rs
@@ -426,11 +426,12 @@ fn test() {
426 426
427//- /std.rs crate:std 427//- /std.rs crate:std
428#[prelude_import] 428#[prelude_import]
429use prelude::*; 429use self::prelude::rust_2018::*;
430
431pub mod prelude { 430pub mod prelude {
432 pub use crate::iter::Iterator; 431 pub mod rust_2018 {
433 pub use crate::option::Option; 432 pub use crate::iter::Iterator;
433 pub use crate::option::Option;
434 }
434} 435}
435 436
436pub mod iter { 437pub mod iter {