{ "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> {", "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>`\n found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref>`", "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> {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability\n |\n = note: expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref>`\n found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref>`\n\n" }