mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Use std::future::Future trait from stdlib
This commit is contained in:
parent
957de26a1d
commit
6a94f203fc
2 changed files with 44 additions and 32 deletions
|
@ -425,28 +425,25 @@ mod tests {
|
|||
assert_debug_snapshot_matches!(
|
||||
do_completion(
|
||||
r###"
|
||||
// Mock Future trait from stdlib
|
||||
pub mod std {
|
||||
pub mod future {
|
||||
#[lang = "future_trait"]
|
||||
pub trait Future {}
|
||||
}
|
||||
}
|
||||
|
||||
//- /main.rs
|
||||
use std::future::*;
|
||||
struct A {}
|
||||
impl Future for A {}
|
||||
|
||||
fn foo(a: A) {
|
||||
a.<|>
|
||||
}
|
||||
|
||||
//- /std/lib.rs
|
||||
pub mod future {
|
||||
pub trait Future {}
|
||||
}
|
||||
"###, CompletionKind::Keyword),
|
||||
@r###"
|
||||
⋮[
|
||||
⋮ CompletionItem {
|
||||
⋮ label: "await",
|
||||
⋮ source_range: [358; 358),
|
||||
⋮ delete: [358; 358),
|
||||
⋮ source_range: [74; 74),
|
||||
⋮ delete: [74; 74),
|
||||
⋮ insert: "await",
|
||||
⋮ detail: "expr.await",
|
||||
⋮ },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue