File tree 1 file changed +20
-0
lines changed
crates/ide/src/syntax_highlighting
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1028,6 +1028,26 @@ macro_rules! test {}
1028
1028
let _ = analysis. highlight ( HL_CONFIG , file_id) . unwrap ( ) ;
1029
1029
}
1030
1030
1031
+ #[ test]
1032
+ fn highlight_callable_no_crash ( ) {
1033
+ // regression test for #13838.
1034
+ let ( analysis, file_id) = fixture:: file (
1035
+ r#"
1036
+ //- minicore: fn, sized
1037
+ impl<A, F: ?Sized> FnOnce<A> for &F
1038
+ where
1039
+ F: Fn<A>,
1040
+ {
1041
+ type Output = F::Output;
1042
+ }
1043
+
1044
+ trait Trait {}
1045
+ fn foo(x: &fn(&dyn Trait)) {}
1046
+ "# ,
1047
+ ) ;
1048
+ let _ = analysis. highlight ( HL_CONFIG , file_id) . unwrap ( ) ;
1049
+ }
1050
+
1031
1051
/// Highlights the code given by the `ra_fixture` argument, renders the
1032
1052
/// result as HTML, and compares it with the HTML file given as `snapshot`.
1033
1053
/// Note that the `snapshot` file is overwritten by the rendered HTML.
You can’t perform that action at this time.
0 commit comments