aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/test/fixtures/rust-diagnostics/error/E0053.json
blob: ea5c976d1d4198f68a3cb07947625357884791cc (plain)
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
{
    "message": "method `next` has an incompatible type for trait",
    "code": {
        "code": "E0053",
        "explanation": "\nThe parameters of any trait method must match between a trait implementation\nand the trait definition.\n\nHere are a couple examples of this error:\n\n```compile_fail,E0053\ntrait Foo {\n    fn foo(x: u16);\n    fn bar(&self);\n}\n\nstruct Bar;\n\nimpl Foo for Bar {\n    // error, expected u16, found i16\n    fn foo(x: i16) { }\n\n    // error, types differ in mutability\n    fn bar(&mut self) { }\n}\n```\n"
    },
    "level": "error",
    "spans": [
        {
            "file_name": "compiler/ty/list_iter.rs",
            "byte_start": 1307,
            "byte_end": 1350,
            "line_start": 52,
            "line_end": 52,
            "column_start": 5,
            "column_end": 48,
            "is_primary": true,
            "text": [
                {
                    "text": "    fn next(&self) -> Option<&'list ty::Ref<M>> {",
                    "highlight_start": 5,
                    "highlight_end": 48
                }
            ],
            "label": "types differ in mutability",
            "suggested_replacement": null,
            "suggestion_applicability": null,
            "expansion": null
        }
    ],
    "children": [
        {
            "message": "expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>`\n   found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>`",
            "code": null,
            "level": "note",
            "spans": [],
            "children": [],
            "rendered": null
        }
    ],
    "rendered": "error[E0053]: method `next` has an incompatible type for trait\n  --> compiler/ty/list_iter.rs:52:5\n   |\n52 |     fn next(&self) -> Option<&'list ty::Ref<M>> {\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability\n   |\n   = note: expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>`\n              found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>`\n\n"
}