| ... | ... | @@ -812,7 +812,6 @@ pub const Scope = struct { |
| 812 | 812 | .block => scope.cast(Block).?.sema.owner_decl, |
| 813 | 813 | .file => null, |
| 814 | 814 | .namespace => null, |
| 815 | | .decl_ref => scope.cast(DeclRef).?.decl, |
| 816 | 815 | }; |
| 817 | 816 | } |
| 818 | 817 | |
| ... | ... | @@ -821,7 +820,6 @@ pub const Scope = struct { |
| 821 | 820 | .block => scope.cast(Block).?.src_decl, |
| 822 | 821 | .file => null, |
| 823 | 822 | .namespace => scope.cast(Namespace).?.getDecl(), |
| 824 | | .decl_ref => scope.cast(DeclRef).?.decl, |
| 825 | 823 | }; |
| 826 | 824 | } |
| 827 | 825 | |
| ... | ... | @@ -831,7 +829,6 @@ pub const Scope = struct { |
| 831 | 829 | .block => return scope.cast(Block).?.sema.owner_decl.namespace, |
| 832 | 830 | .file => return scope.cast(File).?.root_decl.?.namespace, |
| 833 | 831 | .namespace => return scope.cast(Namespace).?, |
| 834 | | .decl_ref => return scope.cast(DeclRef).?.decl.namespace, |
| 835 | 832 | } |
| 836 | 833 | } |
| 837 | 834 | |
| ... | ... | @@ -854,7 +851,6 @@ pub const Scope = struct { |
| 854 | 851 | .namespace => return @fieldParentPtr(Namespace, "base", cur).file_scope, |
| 855 | 852 | .file => return @fieldParentPtr(File, "base", cur), |
| 856 | 853 | .block => return @fieldParentPtr(Block, "base", cur).src_decl.namespace.file_scope, |
| 857 | | .decl_ref => return @fieldParentPtr(DeclRef, "base", cur).decl.namespace.file_scope, |
| 858 | 854 | }; |
| 859 | 855 | } |
| 860 | 856 | } |
| ... | ... | @@ -1403,12 +1399,6 @@ pub const Scope = struct { |
| 1403 | 1399 | return &inst.base; |
| 1404 | 1400 | } |
| 1405 | 1401 | }; |
| 1406 | | |
| 1407 | | pub const DeclRef = struct { |
| 1408 | | pub const base_tag: Tag = .decl_ref; |
| 1409 | | base: Scope = Scope{ .tag = base_tag }, |
| 1410 | | decl: *Decl, |
| 1411 | | }; |
| 1412 | 1402 | }; |
| 1413 | 1403 | |
| 1414 | 1404 | /// This struct holds data necessary to construct API-facing `AllErrors.Message`. |
| ... | ... | @@ -4012,12 +4002,6 @@ pub fn failWithOwnedErrorMsg(mod: *Module, scope: *Scope, err_msg: *ErrorMsg) In |
| 4012 | 4002 | }, |
| 4013 | 4003 | .file => unreachable, |
| 4014 | 4004 | .namespace => unreachable, |
| 4015 | | .decl_ref => { |
| 4016 | | const decl_ref = scope.cast(Scope.DeclRef).?; |
| 4017 | | decl_ref.decl.analysis = .sema_failure; |
| 4018 | | decl_ref.decl.generation = mod.generation; |
| 4019 | | mod.failed_decls.putAssumeCapacityNoClobber(decl_ref.decl, err_msg); |
| 4020 | | }, |
| 4021 | 4005 | } |
| 4022 | 4006 | return error.AnalysisFail; |
| 4023 | 4007 | } |