@@ -104,6 +104,7 @@ diagnostics![AnyDiagnostic<'db> ->
104104 AwaitOutsideOfAsync ,
105105 BreakOutsideOfLoop ,
106106 CannotBeDereferenced <' db>,
107+ CannotIndexInto <' db>,
107108 CastToUnsized <' db>,
108109 ExpectedArrayOrSlicePat <' db>,
109110 ExpectedFunction <' db>,
@@ -327,6 +328,12 @@ pub struct CannotBeDereferenced<'db> {
327328 pub found : Type < ' db > ,
328329}
329330
331+ #[ derive( Debug ) ]
332+ pub struct CannotIndexInto < ' db > {
333+ pub expr : InFile < ExprOrPatPtr > ,
334+ pub found : Type < ' db > ,
335+ }
336+
330337#[ derive( Debug ) ]
331338pub struct ExplicitDropMethodUse {
332339 pub expr_or_path : Either < InFile < AstPtr < ast:: MethodCallExpr > > , InFile < AstPtr < ast:: Path > > > ,
@@ -947,6 +954,10 @@ impl<'db> AnyDiagnostic<'db> {
947954 let expr = expr_syntax ( * expr) ?;
948955 CannotBeDereferenced { expr, found : Type :: new ( db, def, found. as_ref ( ) ) } . into ( )
949956 }
957+ InferenceDiagnostic :: CannotIndexInto { expr, found } => {
958+ let expr = expr_syntax ( * expr) ?;
959+ CannotIndexInto { expr, found : Type :: new ( db, def, found. as_ref ( ) ) } . into ( )
960+ }
950961 InferenceDiagnostic :: TyDiagnostic { source, diag } => {
951962 let source_map = match source {
952963 InferenceTyDiagnosticSource :: Body => source_map,
0 commit comments