mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Implement per-edition preludes
This commit is contained in:
parent
71117e6812
commit
f96c1a0414
12 changed files with 318 additions and 141 deletions
|
@ -796,7 +796,7 @@ fn test() {
|
|||
fn method_resolution_trait_from_prelude() {
|
||||
check_types(
|
||||
r#"
|
||||
//- /main.rs crate:main deps:other_crate
|
||||
//- /main.rs crate:main deps:core
|
||||
struct S;
|
||||
impl Clone for S {}
|
||||
|
||||
|
@ -805,12 +805,12 @@ fn test() {
|
|||
//^ S
|
||||
}
|
||||
|
||||
//- /lib.rs crate:other_crate
|
||||
#[prelude_import] use foo::*;
|
||||
|
||||
mod foo {
|
||||
trait Clone {
|
||||
fn clone(&self) -> Self;
|
||||
//- /lib.rs crate:core
|
||||
pub mod prelude {
|
||||
pub mod rust_2018 {
|
||||
pub trait Clone {
|
||||
fn clone(&self) -> Self;
|
||||
}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue