aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/method_resolution.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/method_resolution.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/method_resolution.rs')
-rw-r--r--crates/hir_ty/src/tests/method_resolution.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs
index a4c132bc5..058eb9129 100644
--- a/crates/hir_ty/src/tests/method_resolution.rs
+++ b/crates/hir_ty/src/tests/method_resolution.rs
@@ -796,7 +796,7 @@ fn test() {
796fn method_resolution_trait_from_prelude() { 796fn method_resolution_trait_from_prelude() {
797 check_types( 797 check_types(
798 r#" 798 r#"
799//- /main.rs crate:main deps:other_crate 799//- /main.rs crate:main deps:core
800struct S; 800struct S;
801impl Clone for S {} 801impl Clone for S {}
802 802
@@ -805,12 +805,12 @@ fn test() {
805 //^ S 805 //^ S
806} 806}
807 807
808//- /lib.rs crate:other_crate 808//- /lib.rs crate:core
809#[prelude_import] use foo::*; 809pub mod prelude {
810 810 pub mod rust_2018 {
811mod foo { 811 pub trait Clone {
812 trait Clone { 812 fn clone(&self) -> Self;
813 fn clone(&self) -> Self; 813 }
814 } 814 }
815} 815}
816"#, 816"#,