Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
use crate::{Diagnostic, DiagnosticCode, DiagnosticsContext};
use hir::HirDisplay;

// Diagnostic: moved-out-of-ref
//
// This diagnostic is triggered on moving non copy things out of references.
pub(crate) fn moved_out_of_ref(
    ctx: &DiagnosticsContext<'_>,
    d: &hir::MovedOutOfRef<'_>,
) -> Diagnostic {
    Diagnostic::new_with_syntax_node_ptr(
        ctx,
        DiagnosticCode::RustcHardError("E0507"),
        format!("cannot move `{}` out of reference", d.ty.display(ctx.sema.db, ctx.display_target)),
        d.span,
    )
    // spans are broken, and I'm not sure how precise we can detect copy types
}

#[cfg(test)]
mod tests {
    use crate::tests::check_diagnostics;

    #[test]
    fn operand_field_span_respected() {
        check_diagnostics(
            r#"
struct NotCopy;
struct S {
    field: NotCopy,
}

fn f(s: &S) -> S {
    S { field: s.field }
             //^^^^^^^ error: cannot move `NotCopy` out of reference
}
            "#,
        );
    }

    #[test]
    fn move_by_explicit_deref() {
        check_diagnostics(
            r#"
struct X;
fn main() {
    let a = &X;
    let b = *a;
      //^ error: cannot move `X` out of reference
    _ = b;
}
"#,
        );
    }

    #[test]
    fn move_out_of_field() {
        check_diagnostics(
            r#"
//- minicore: copy
struct X;
struct Y(X, i32);
fn main() {
    let a = &Y(X, 5);
    let b = a.0;
      //^ error: cannot move `X` out of reference
    let y = a.1;
    _ = (b, y);
}
"#,
        );
    }

    #[test]
    fn move_out_of_static() {
        check_diagnostics(
            r#"
//- minicore: copy
struct X;
fn main() {
    static S: X = X;
    let _s = S;
      //^^ error: cannot move `X` out of reference
}
"#,
        );
    }

    #[test]
    fn generic_types() {
        check_diagnostics(
            r#"
//- minicore: derive, copy

#[derive(Copy)]
struct X<T>(T);
struct Y;

fn consume<T>(_: X<T>) {

}

fn main() {
    let a = &X(Y);
    consume(*a);
          //^^ error: cannot move `X<Y>` out of reference
    let a = &X(5);
    consume(*a);
}
"#,
        );
    }

    #[test]
    fn no_false_positive_simple() {
        check_diagnostics(
            r#"
//- minicore: copy
fn f(_: i32) {}
fn main() {
    let x = &2;
    f(*x);
}
"#,
        );
    }

    #[test]
    fn no_false_positive_unknown_type() {
        check_diagnostics(
            r#"
//- minicore: derive, copy
fn f(x: &Unknown) -> Unknown {
    *x
}

#[derive(Copy)]
struct X<T>(T);

struct Y<T>(T);

fn g(x: &X<Unknown>) -> X<Unknown> {
    *x
}

fn h(x: &Y<Unknown>) -> Y<Unknown> {
    // FIXME: we should show error for this, as `Y` is not copy
    // regardless of its generic parameter.
    *x
}

"#,
        );
    }

    #[test]
    fn no_false_positive_dyn_fn() {
        check_diagnostics(
            r#"
//- minicore: copy, fn, dispatch_from_dyn
fn f(x: &mut &mut dyn Fn()) {
    x();
}

struct X<'a> {
    field: &'a mut dyn Fn(),
}

fn g(x: &mut X<'_>) {
    (x.field)();
}
"#,
        );
    }

    #[test]
    fn no_false_positive_match_and_closure_capture() {
        check_diagnostics(
            r#"
//- minicore: copy, fn
enum X {
    Foo(u16),
    Bar,
}

fn main() {
    let x = &X::Bar;
    let _c = || match *x {
        X::Foo(t) => t,
        _ => 5,
    };
}
            "#,
        );
    }

    #[test]
    fn regression_15787() {
        check_diagnostics(
            r#"
//- minicore: coerce_unsized, slice, copy
fn foo(mut slice: &[u32]) -> usize {
    slice = match slice {
        [0, rest @ ..] | rest => rest,
    };
    slice.len()
}
"#,
        );
    }

    #[test]
    fn regression_16564() {
        check_diagnostics(
            r#"
//- minicore: copy
fn test() {
    let _x = (&(&mut (),)).0 as *const ();
}
            "#,
        )
    }

    #[test]
    fn regression_18201() {
        check_diagnostics(
            r#"
//- minicore: copy
struct NotCopy;
struct S(NotCopy);
impl S {
    fn f(&mut self) {
        || {
            if let ref mut _cb = self.0 {
            }
        };
    }
}
"#,
        )
    }

    #[test]
    fn regression_20155() {
        check_diagnostics(
            r#"
//- minicore: copy, option
struct Box(i32);
fn test() {
    let b = Some(Box(0));
    || {
        if let Some(b) = b {
            let _move = b;
        }
    };
}
"#,
        )
    }
}
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236
[
    (
        Module {
            id: ModuleIdLt {
                [salsa id]: Id(3800),
            },
        },
        [
            FileSymbol {
                name: "A",
                def: Variant(
                    Variant {
                        id: EnumVariantId(
                            7c00,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: VARIANT,
                        range: 201..202,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 201..202,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "Enum",
                ),
                is_alias: false,
                is_assoc: true,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Alias",
                def: TypeAlias(
                    TypeAlias {
                        id: TypeAliasId(
                            7000,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: TYPE_ALIAS,
                        range: 470..490,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 475..480,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "B",
                def: Variant(
                    Variant {
                        id: EnumVariantId(
                            7c01,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: VARIANT,
                        range: 204..205,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 204..205,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "Enum",
                ),
                is_alias: false,
                is_assoc: true,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "CONST",
                def: Const(
                    Const {
                        id: ConstId(
                            6800,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: CONST,
                        range: 413..434,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 419..424,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "CONST_WITH_INNER",
                def: Const(
                    Const {
                        id: ConstId(
                            6802,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: CONST,
                        range: 593..665,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 599..615,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Enum",
                def: Adt(
                    Enum(
                        Enum {
                            id: EnumId(
                                5400,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: ENUM,
                        range: 185..207,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 190..194,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "ItemLikeMacro",
                def: Macro(
                    Macro {
                        id: Macro2Id(
                            Macro2Id(
                                5000,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 727..749,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 736..749,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Macro",
                def: Macro(
                    Macro {
                        id: Macro2Id(
                            Macro2Id(
                                5000,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: MACRO_DEF,
                        range: 153..168,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 159..164,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "STATIC",
                def: Static(
                    Static {
                        id: StaticId(
                            6c00,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STATIC,
                        range: 435..469,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 442..448,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Struct",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c01,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 170..184,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 177..183,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "StructFromMacro",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c00,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: MacroFile(
                        MacroCallId(
                            Id(4400),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 0..22,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 6..21,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "StructInFn",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c05,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 391..409,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 398..408,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "main",
                ),
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "StructInNamedConst",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c06,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 628..654,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 635..653,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "CONST_WITH_INNER",
                ),
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "StructInUnnamedConst",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c07,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 552..580,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 559..579,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "StructT",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c02,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 261..279,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 268..275,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Trait",
                def: Trait(
                    Trait {
                        id: TraitId(
                            6000,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: TRAIT,
                        range: 334..373,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 340..345,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Trait",
                def: Macro(
                    Macro {
                        id: Macro2Id(
                            Macro2Id(
                                5000,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 755..769,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 764..769,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "Union",
                def: Adt(
                    Union(
                        Union {
                            id: UnionId(
                                5800,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: UNION,
                        range: 208..222,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 214..219,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "a_mod",
                def: Module(
                    Module {
                        id: ModuleIdLt {
                            [salsa id]: Id(3801),
                        },
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: MODULE,
                        range: 492..530,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 496..501,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "b_mod",
                def: Module(
                    Module {
                        id: ModuleIdLt {
                            [salsa id]: Id(3802),
                        },
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: MODULE,
                        range: 667..677,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 671..676,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "define_struct",
                def: Macro(
                    Macro {
                        id: MacroRulesId(
                            MacroRulesId(
                                4001,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: MACRO_RULES,
                        range: 51..131,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 64..77,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "generic_impl_fn",
                def: Function(
                    FunctionId(
                        FunctionId(
                            6402,
                        ),
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: FN,
                        range: 307..330,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 310..325,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "StructT<T>",
                ),
                is_alias: false,
                is_assoc: true,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "impl_fn",
                def: Function(
                    FunctionId(
                        FunctionId(
                            6401,
                        ),
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: FN,
                        range: 242..257,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 245..252,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "Struct",
                ),
                is_alias: false,
                is_assoc: true,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "macro_rules_macro",
                def: Macro(
                    Macro {
                        id: MacroRulesId(
                            MacroRulesId(
                                4000,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: MACRO_RULES,
                        range: 1..48,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 14..31,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "main",
                def: Function(
                    FunctionId(
                        FunctionId(
                            6400,
                        ),
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: FN,
                        range: 375..411,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 378..382,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "really_define_struct",
                def: Macro(
                    Macro {
                        id: MacroRulesId(
                            MacroRulesId(
                                4001,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 684..721,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 701..721,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "trait_fn",
                def: Function(
                    FunctionId(
                        FunctionId(
                            6403,
                        ),
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: FN,
                        range: 352..371,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 355..363,
                            },
                        ),
                    ),
                },
                container_name: Some(
                    "Trait",
                ),
                is_alias: false,
                is_assoc: true,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
        ],
    ),
    (
        Module {
            id: ModuleIdLt {
                [salsa id]: Id(3801),
            },
        },
        [
            FileSymbol {
                name: "StructInModA",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c03,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3000),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 508..528,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 515..527,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
        ],
    ),
    (
        Module {
            id: ModuleIdLt {
                [salsa id]: Id(3802),
            },
        },
        [
            FileSymbol {
                name: "IsThisJustATrait",
                def: Trait(
                    Trait {
                        id: TraitId(
                            6000,
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3001),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 141..173,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 157..173,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "IsThisJustATrait",
                def: Macro(
                    Macro {
                        id: Macro2Id(
                            Macro2Id(
                                5000,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3001),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 141..173,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 157..173,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "StructInModB",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c04,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3001),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: STRUCT,
                        range: 0..20,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 7..19,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: false,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "SuperItemLikeMacro",
                def: Macro(
                    Macro {
                        id: Macro2Id(
                            Macro2Id(
                                5000,
                            ),
                        ),
                    },
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3001),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 35..69,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 51..69,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
            FileSymbol {
                name: "ThisStruct",
                def: Adt(
                    Struct(
                        Struct {
                            id: StructId(
                                4c04,
                            ),
                        },
                    ),
                ),
                loc: DeclarationLocation {
                    hir_file_id: FileId(
                        EditionedFileId(
                            Id(3001),
                        ),
                    ),
                    ptr: SyntaxNodePtr {
                        kind: USE_TREE,
                        range: 85..125,
                    },
                    name_ptr: Some(
                        AstPtr(
                            SyntaxNodePtr {
                                kind: NAME,
                                range: 115..125,
                            },
                        ),
                    ),
                },
                container_name: None,
                is_alias: false,
                is_assoc: false,
                is_import: true,
                do_not_complete: Yes,
                _marker: PhantomData<&()>,
            },
        ],
    ),
]