mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
parent
7e9c4d58f1
commit
c6f53aaaa4
1 changed files with 23 additions and 0 deletions
|
@ -1991,6 +1991,29 @@ fn test() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fn_item_fn_trait() {
|
||||
check_types(
|
||||
r#"
|
||||
//- /main.rs
|
||||
#[lang = "fn_once"]
|
||||
trait FnOnce<Args> {
|
||||
type Output;
|
||||
}
|
||||
|
||||
struct S;
|
||||
|
||||
fn foo() -> S {}
|
||||
|
||||
fn takes_closure<U, F: FnOnce() -> U>(f: F) -> U { f() }
|
||||
|
||||
fn test() {
|
||||
takes_closure(foo);
|
||||
} //^^^^^^^^^^^^^^^^^^ S
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unselected_projection_in_trait_env_1() {
|
||||
check_types(
|
||||
|
|
Loading…
Reference in a new issue