mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
internal: use minicore deref more
This commit is contained in:
parent
991919e71f
commit
89a0e58393
5 changed files with 81 additions and 127 deletions
|
@ -1269,16 +1269,11 @@ fn bar(t: &Foo) {}
|
|||
fn suggest_deref_fn_ret() {
|
||||
check_relevance(
|
||||
r#"
|
||||
#[lang = "deref"]
|
||||
trait Deref {
|
||||
type Target;
|
||||
fn deref(&self) -> &Self::Target;
|
||||
}
|
||||
|
||||
//- minicore: deref
|
||||
struct S;
|
||||
struct T(S);
|
||||
|
||||
impl Deref for T {
|
||||
impl core::ops::Deref for T {
|
||||
type Target = S;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
|
@ -1292,15 +1287,16 @@ fn bar() -> T {}
|
|||
fn main() {
|
||||
foo($0);
|
||||
}
|
||||
"#,
|
||||
"#,
|
||||
expect![[r#"
|
||||
tt Deref []
|
||||
fn bar() []
|
||||
fn &bar() [type]
|
||||
fn foo(…) []
|
||||
st T []
|
||||
st S []
|
||||
fn main() []
|
||||
fn bar() []
|
||||
fn &bar() [type]
|
||||
fn foo(…) []
|
||||
md core []
|
||||
tt Sized []
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue