File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
crates/ide/src/syntax_highlighting Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1028,6 +1028,26 @@ macro_rules! test {}
10281028 let _ = analysis. highlight ( HL_CONFIG , file_id) . unwrap ( ) ;
10291029}
10301030
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+
10311051/// Highlights the code given by the `ra_fixture` argument, renders the
10321052/// result as HTML, and compares it with the HTML file given as `snapshot`.
10331053/// Note that the `snapshot` file is overwritten by the rendered HTML.
You can’t perform that action at this time.
0 commit comments