File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
ide_diagnostics/src/handlers Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -673,7 +673,12 @@ impl Module {
673
673
674
674
pub fn declarations ( self , db : & dyn HirDatabase ) -> Vec < ModuleDef > {
675
675
let def_map = self . id . def_map ( db. upcast ( ) ) ;
676
- def_map[ self . id . local_id ] . scope . declarations ( ) . map ( ModuleDef :: from) . collect ( )
676
+ let scope = & def_map[ self . id . local_id ] . scope ;
677
+ scope
678
+ . declarations ( )
679
+ . map ( ModuleDef :: from)
680
+ . chain ( scope. unnamed_consts ( ) . map ( |id| ModuleDef :: Const ( Const :: from ( id) ) ) )
681
+ . collect ( )
677
682
}
678
683
679
684
pub fn impl_defs ( self , db : & dyn HirDatabase ) -> Vec < Impl > {
Original file line number Diff line number Diff line change @@ -185,7 +185,16 @@ static A: Option<()> = {($0)};
185
185
r#"
186
186
static A: Option<()> = {Some(())};
187
187
"# ,
188
- )
188
+ ) ;
189
+ check_fix (
190
+ r#"
191
+ //- minicore: option, result
192
+ const _: Option<()> = {($0)};
193
+ "# ,
194
+ r#"
195
+ const _: Option<()> = {Some(())};
196
+ "# ,
197
+ ) ;
189
198
}
190
199
191
200
#[ test]
You can’t perform that action at this time.
0 commit comments