]> git.lizzy.rs Git - rust.git/commitdiff
Update expect tests
authorJonas Schievink <jonasschievink@gmail.com>
Sun, 6 Dec 2020 00:39:52 +0000 (01:39 +0100)
committerJonas Schievink <jonasschievink@gmail.com>
Sun, 6 Dec 2020 00:39:52 +0000 (01:39 +0100)
crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt
crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt
crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt
crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt

index 72f6c5725476f05e8b895881a0d1fed9deec6c10..7576097b31f91ea5cb8a69b8fb79fb640988affa 100644 (file)
         },
         fixes: [],
     },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/compiler/lib.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 0,
+                    character: 8,
+                },
+                end: Position {
+                    line: 0,
+                    character: 19,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "trivially_copy_pass_by_ref",
+                ),
+            ),
+            code_description: Some(
+                CodeDescription {
+                    href: Url {
+                        scheme: "https",
+                        host: Some(
+                            Domain(
+                                "rust-lang.github.io",
+                            ),
+                        ),
+                        port: None,
+                        path: "/rust-clippy/master/index.html",
+                        query: None,
+                        fragment: Some(
+                            "trivially_copy_pass_by_ref",
+                        ),
+                    },
+                },
+            ),
+            source: Some(
+                "clippy",
+            ),
+            message: "lint level defined here",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/compiler/mir/tagset.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 41,
+                                    character: 23,
+                                },
+                                end: Position {
+                                    line: 41,
+                                    character: 28,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [],
+    },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/compiler/mir/tagset.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 41,
+                    character: 23,
+                },
+                end: Position {
+                    line: 41,
+                    character: 28,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "trivially_copy_pass_by_ref",
+                ),
+            ),
+            code_description: Some(
+                CodeDescription {
+                    href: Url {
+                        scheme: "https",
+                        host: Some(
+                            Domain(
+                                "rust-lang.github.io",
+                            ),
+                        ),
+                        port: None,
+                        path: "/rust-clippy/master/index.html",
+                        query: None,
+                        fragment: Some(
+                            "trivially_copy_pass_by_ref",
+                        ),
+                    },
+                },
+            ),
+            source: Some(
+                "clippy",
+            ),
+            message: "consider passing by value instead",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/compiler/mir/tagset.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 41,
+                                    character: 23,
+                                },
+                                end: Position {
+                                    line: 41,
+                                    character: 28,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [],
+    },
 ]
index bbec6a7964ab3509ab989f34b313fdf4a4268692..8f8953cd2883e4fda1eaa4e52579b53a89b7edf3 100644 (file)
@@ -4,19 +4,19 @@
             scheme: "file",
             host: None,
             port: None,
-            path: "/test/crates/hir_def/src/data.rs",
+            path: "/test/crates/hir_def/src/path.rs",
             query: None,
             fragment: None,
         },
         diagnostic: Diagnostic {
             range: Range {
                 start: Position {
-                    line: 79,
-                    character: 15,
+                    line: 264,
+                    character: 8,
                 },
                 end: Position {
-                    line: 79,
-                    character: 41,
+                    line: 264,
+                    character: 76,
                 },
             },
             severity: Some(
                                 scheme: "file",
                                 host: None,
                                 port: None,
-                                path: "/test/crates/hir_def/src/path.rs",
+                                path: "/test/crates/hir_def/src/data.rs",
                                 query: None,
                                 fragment: None,
                             },
                             range: Range {
                                 start: Position {
-                                    line: 264,
-                                    character: 8,
+                                    line: 79,
+                                    character: 15,
                                 },
                                 end: Position {
-                                    line: 264,
-                                    character: 76,
+                                    line: 79,
+                                    character: 41,
                                 },
                             },
                         },
-                        message: "Error originated from macro here",
+                        message: "Exact error occured here",
                     },
                 ],
             ),
             scheme: "file",
             host: None,
             port: None,
-            path: "/test/crates/hir_def/src/path.rs",
+            path: "/test/crates/hir_def/src/data.rs",
             query: None,
             fragment: None,
         },
         diagnostic: Diagnostic {
             range: Range {
                 start: Position {
-                    line: 264,
-                    character: 8,
+                    line: 79,
+                    character: 15,
                 },
                 end: Position {
-                    line: 264,
-                    character: 76,
+                    line: 79,
+                    character: 41,
                 },
             },
             severity: Some(
                 "rustc",
             ),
             message: "Please register your known path in the path module",
-            related_information: Some(
-                [
-                    DiagnosticRelatedInformation {
-                        location: Location {
-                            uri: Url {
-                                scheme: "file",
-                                host: None,
-                                port: None,
-                                path: "/test/crates/hir_def/src/data.rs",
-                                query: None,
-                                fragment: None,
-                            },
-                            range: Range {
-                                start: Position {
-                                    line: 79,
-                                    character: 15,
-                                },
-                                end: Position {
-                                    line: 79,
-                                    character: 41,
-                                },
-                            },
-                        },
-                        message: "Exact error occured here",
-                    },
-                ],
-            ),
+            related_information: None,
             tags: None,
             data: None,
         },
index c709de95ffb18054b1068dca1563e6041d28a439..23d42b4d08b8a057c4ebe2fb60fb40b3acee29e3 100644 (file)
                 "rustc",
             ),
             message: "unused variable: `foo`\n#[warn(unused_variables)] on by default",
-            related_information: None,
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/driver/subcommand/repl.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "consider prefixing with an underscore",
+                    },
+                ],
+            ),
             tags: Some(
                 [
                     Unnecessary,
             },
         ],
     },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/driver/subcommand/repl.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 290,
+                    character: 8,
+                },
+                end: Position {
+                    line: 290,
+                    character: 11,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "unused_variables",
+                ),
+            ),
+            code_description: None,
+            source: Some(
+                "rustc",
+            ),
+            message: "consider prefixing with an underscore",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/driver/subcommand/repl.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [
+            CodeAction {
+                title: "consider prefixing with an underscore",
+                group: None,
+                kind: Some(
+                    CodeActionKind(
+                        "quickfix",
+                    ),
+                ),
+                edit: Some(
+                    SnippetWorkspaceEdit {
+                        changes: Some(
+                            {
+                                Url {
+                                    scheme: "file",
+                                    host: None,
+                                    port: None,
+                                    path: "/test/driver/subcommand/repl.rs",
+                                    query: None,
+                                    fragment: None,
+                                }: [
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 290,
+                                                character: 8,
+                                            },
+                                            end: Position {
+                                                line: 290,
+                                                character: 11,
+                                            },
+                                        },
+                                        new_text: "_foo",
+                                    },
+                                ],
+                            },
+                        ),
+                        document_changes: None,
+                    },
+                ),
+                is_preferred: Some(
+                    true,
+                ),
+                data: None,
+            },
+        ],
+    },
 ]
index 632f438d7ad0b59884886bfd06882547bfc611f7..4e428bedcbf3d46088f8c480302773d1d8cd32ec 100644 (file)
                 "rustc",
             ),
             message: "unused variable: `foo`\n#[warn(unused_variables)] on by default",
-            related_information: None,
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/driver/subcommand/repl.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "consider prefixing with an underscore",
+                    },
+                ],
+            ),
             tags: Some(
                 [
                     Unnecessary,
             },
         ],
     },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/driver/subcommand/repl.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 290,
+                    character: 8,
+                },
+                end: Position {
+                    line: 290,
+                    character: 11,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "unused_variables",
+                ),
+            ),
+            code_description: None,
+            source: Some(
+                "rustc",
+            ),
+            message: "consider prefixing with an underscore",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/driver/subcommand/repl.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [
+            CodeAction {
+                title: "consider prefixing with an underscore",
+                group: None,
+                kind: Some(
+                    CodeActionKind(
+                        "quickfix",
+                    ),
+                ),
+                edit: Some(
+                    SnippetWorkspaceEdit {
+                        changes: Some(
+                            {
+                                Url {
+                                    scheme: "file",
+                                    host: None,
+                                    port: None,
+                                    path: "/test/driver/subcommand/repl.rs",
+                                    query: None,
+                                    fragment: None,
+                                }: [
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 290,
+                                                character: 8,
+                                            },
+                                            end: Position {
+                                                line: 290,
+                                                character: 11,
+                                            },
+                                        },
+                                        new_text: "_foo",
+                                    },
+                                ],
+                            },
+                        ),
+                        document_changes: None,
+                    },
+                ),
+                is_preferred: Some(
+                    true,
+                ),
+                data: None,
+            },
+        ],
+    },
 ]
index c0b79428d89b7bf342ab8cdf6ca31d4aef6049b0..4ddd7efae366eb9f7e46f1bd72da8c2e23a71490 100644 (file)
                 "rustc",
             ),
             message: "unused variable: `foo`\n#[warn(unused_variables)] on by default",
-            related_information: None,
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/driver/subcommand/repl.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "consider prefixing with an underscore",
+                    },
+                ],
+            ),
             tags: Some(
                 [
                     Unnecessary,
             },
         ],
     },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/driver/subcommand/repl.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 290,
+                    character: 8,
+                },
+                end: Position {
+                    line: 290,
+                    character: 11,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "unused_variables",
+                ),
+            ),
+            code_description: None,
+            source: Some(
+                "rustc",
+            ),
+            message: "consider prefixing with an underscore",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/driver/subcommand/repl.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 290,
+                                    character: 8,
+                                },
+                                end: Position {
+                                    line: 290,
+                                    character: 11,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [
+            CodeAction {
+                title: "consider prefixing with an underscore",
+                group: None,
+                kind: Some(
+                    CodeActionKind(
+                        "quickfix",
+                    ),
+                ),
+                edit: Some(
+                    SnippetWorkspaceEdit {
+                        changes: Some(
+                            {
+                                Url {
+                                    scheme: "file",
+                                    host: None,
+                                    port: None,
+                                    path: "/test/driver/subcommand/repl.rs",
+                                    query: None,
+                                    fragment: None,
+                                }: [
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 290,
+                                                character: 8,
+                                            },
+                                            end: Position {
+                                                line: 290,
+                                                character: 11,
+                                            },
+                                        },
+                                        new_text: "_foo",
+                                    },
+                                ],
+                            },
+                        ),
+                        document_changes: None,
+                    },
+                ),
+                is_preferred: Some(
+                    true,
+                ),
+                data: None,
+            },
+        ],
+    },
 ]
index b9650f3e45ebb47a6eda20b178e5221b3d432c33..f455cf25efbd60dfe9f12f86312d25437e9c9884 100644 (file)
         },
         fixes: [],
     },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/compiler/ty/select.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 218,
+                    character: 4,
+                },
+                end: Position {
+                    line: 230,
+                    character: 5,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "E0061",
+                ),
+            ),
+            code_description: Some(
+                CodeDescription {
+                    href: Url {
+                        scheme: "https",
+                        host: Some(
+                            Domain(
+                                "doc.rust-lang.org",
+                            ),
+                        ),
+                        port: None,
+                        path: "/error-index.html",
+                        query: None,
+                        fragment: Some(
+                            "E0061",
+                        ),
+                    },
+                },
+            ),
+            source: Some(
+                "rustc",
+            ),
+            message: "defined here",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/compiler/ty/select.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 103,
+                                    character: 17,
+                                },
+                                end: Position {
+                                    line: 103,
+                                    character: 29,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [],
+    },
 ]
index c45f68a916d016b3b2d1433ca2459f8f5535d50c..4cbdb3b922f70c9c49fb001945dd1d089df50916 100644 (file)
                         },
                         message: "unnecessary let binding",
                     },
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/src/main.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 2,
+                                    character: 4,
+                                },
+                                end: Position {
+                                    line: 2,
+                                    character: 30,
+                                },
+                            },
+                        },
+                        message: "return the expression directly",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [
+            CodeAction {
+                title: "return the expression directly",
+                group: None,
+                kind: Some(
+                    CodeActionKind(
+                        "quickfix",
+                    ),
+                ),
+                edit: Some(
+                    SnippetWorkspaceEdit {
+                        changes: Some(
+                            {
+                                Url {
+                                    scheme: "file",
+                                    host: None,
+                                    port: None,
+                                    path: "/test/src/main.rs",
+                                    query: None,
+                                    fragment: None,
+                                }: [
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 2,
+                                                character: 4,
+                                            },
+                                            end: Position {
+                                                line: 2,
+                                                character: 30,
+                                            },
+                                        },
+                                        new_text: "",
+                                    },
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 3,
+                                                character: 4,
+                                            },
+                                            end: Position {
+                                                line: 3,
+                                                character: 5,
+                                            },
+                                        },
+                                        new_text: "(0..10).collect()",
+                                    },
+                                ],
+                            },
+                        ),
+                        document_changes: None,
+                    },
+                ),
+                is_preferred: Some(
+                    true,
+                ),
+                data: None,
+            },
+        ],
+    },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/src/main.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 2,
+                    character: 4,
+                },
+                end: Position {
+                    line: 2,
+                    character: 30,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "let_and_return",
+                ),
+            ),
+            code_description: Some(
+                CodeDescription {
+                    href: Url {
+                        scheme: "https",
+                        host: Some(
+                            Domain(
+                                "rust-lang.github.io",
+                            ),
+                        ),
+                        port: None,
+                        path: "/rust-clippy/master/index.html",
+                        query: None,
+                        fragment: Some(
+                            "let_and_return",
+                        ),
+                    },
+                },
+            ),
+            source: Some(
+                "clippy",
+            ),
+            message: "unnecessary let binding",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/src/main.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 3,
+                                    character: 4,
+                                },
+                                end: Position {
+                                    line: 3,
+                                    character: 5,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
+                ],
+            ),
+            tags: None,
+            data: None,
+        },
+        fixes: [
+            CodeAction {
+                title: "return the expression directly",
+                group: None,
+                kind: Some(
+                    CodeActionKind(
+                        "quickfix",
+                    ),
+                ),
+                edit: Some(
+                    SnippetWorkspaceEdit {
+                        changes: Some(
+                            {
+                                Url {
+                                    scheme: "file",
+                                    host: None,
+                                    port: None,
+                                    path: "/test/src/main.rs",
+                                    query: None,
+                                    fragment: None,
+                                }: [
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 2,
+                                                character: 4,
+                                            },
+                                            end: Position {
+                                                line: 2,
+                                                character: 30,
+                                            },
+                                        },
+                                        new_text: "",
+                                    },
+                                    TextEdit {
+                                        range: Range {
+                                            start: Position {
+                                                line: 3,
+                                                character: 4,
+                                            },
+                                            end: Position {
+                                                line: 3,
+                                                character: 5,
+                                            },
+                                        },
+                                        new_text: "(0..10).collect()",
+                                    },
+                                ],
+                            },
+                        ),
+                        document_changes: None,
+                    },
+                ),
+                is_preferred: Some(
+                    true,
+                ),
+                data: None,
+            },
+        ],
+    },
+    MappedRustDiagnostic {
+        url: Url {
+            scheme: "file",
+            host: None,
+            port: None,
+            path: "/test/src/main.rs",
+            query: None,
+            fragment: None,
+        },
+        diagnostic: Diagnostic {
+            range: Range {
+                start: Position {
+                    line: 2,
+                    character: 4,
+                },
+                end: Position {
+                    line: 2,
+                    character: 30,
+                },
+            },
+            severity: Some(
+                Hint,
+            ),
+            code: Some(
+                String(
+                    "let_and_return",
+                ),
+            ),
+            code_description: Some(
+                CodeDescription {
+                    href: Url {
+                        scheme: "https",
+                        host: Some(
+                            Domain(
+                                "rust-lang.github.io",
+                            ),
+                        ),
+                        port: None,
+                        path: "/rust-clippy/master/index.html",
+                        query: None,
+                        fragment: Some(
+                            "let_and_return",
+                        ),
+                    },
+                },
+            ),
+            source: Some(
+                "clippy",
+            ),
+            message: "return the expression directly",
+            related_information: Some(
+                [
+                    DiagnosticRelatedInformation {
+                        location: Location {
+                            uri: Url {
+                                scheme: "file",
+                                host: None,
+                                port: None,
+                                path: "/test/src/main.rs",
+                                query: None,
+                                fragment: None,
+                            },
+                            range: Range {
+                                start: Position {
+                                    line: 3,
+                                    character: 4,
+                                },
+                                end: Position {
+                                    line: 3,
+                                    character: 5,
+                                },
+                            },
+                        },
+                        message: "original diagnostic",
+                    },
                 ],
             ),
             tags: None,