We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e9c4d5 commit c6f53aaCopy full SHA for c6f53aa
crates/ra_hir_ty/src/tests/traits.rs
@@ -1991,6 +1991,29 @@ fn test() {
1991
);
1992
}
1993
1994
+#[test]
1995
+fn fn_item_fn_trait() {
1996
+ check_types(
1997
+ r#"
1998
+//- /main.rs
1999
+#[lang = "fn_once"]
2000
+trait FnOnce<Args> {
2001
+ type Output;
2002
+}
2003
+
2004
+struct S;
2005
2006
+fn foo() -> S {}
2007
2008
+fn takes_closure<U, F: FnOnce() -> U>(f: F) -> U { f() }
2009
2010
+fn test() {
2011
+ takes_closure(foo);
2012
+} //^^^^^^^^^^^^^^^^^^ S
2013
+"#,
2014
+ );
2015
2016
2017
#[test]
2018
fn unselected_projection_in_trait_env_1() {
2019
check_types(
0 commit comments