{"$message_type":"diagnostic","message":"expected `{closure@routing.rs:1230:50}` to return `Id<RouteKind>`, but it returns `Id<RouteLabelKind>`","code":{"code":"E0271","explanation":"A type mismatched an associated type of a trait.\n\nErroneous code example:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n//                    ~~~~~~~~ ~~~~~~~~~~~~~~~~~~\n//                        |            |\n//         This says `foo` can         |\n//           only be used with         |\n//              some type that         |\n//         implements `Trait`.         |\n//                                     |\n//                             This says not only must\n//                             `T` be an impl of `Trait`\n//                             but also that the impl\n//                             must assign the type `u32`\n//                             to the associated type.\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n//~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n//      |                             |\n// `i8` does have                     |\n// implementation                     |\n// of `Trait`...                      |\n//                     ... but it is an implementation\n//                     that assigns `&'static str` to\n//                     the associated type.\n\nfoo(3_i8);\n// Here, we invoke `foo` with an `i8`, which does not satisfy\n// the constraint `<i8 as Trait>::AssociatedType=u32`, and\n// therefore the type-checker complains with this error code.\n```\n\nThe issue can be resolved by changing the associated type:\n1) in the `foo` implementation:\n```\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType = &'static str> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n```\n\n2) in the `Trait` implementation for `i8`:\n```\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType = u32> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = u32; }\n\nfoo(3_i8);\n```\n"},"level":"error","spans":[{"file_name":"crates/editor/src/widget/routing.rs","byte_start":53912,"byte_end":53923,"line_start":1230,"line_end":1230,"column_start":50,"column_end":61,"is_primary":false,"text":[{"text":"            .routes_previewed(relayed.iter().map(|&(id, ..)| id), &scope);","highlight_start":50,"highlight_end":61}],"label":"this closure","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"crates/editor/src/widget/routing.rs","byte_start":53924,"byte_end":53926,"line_start":1230,"line_end":1230,"column_start":62,"column_end":64,"is_primary":true,"text":[{"text":"            .routes_previewed(relayed.iter().map(|&(id, ..)| id), &scope);","highlight_start":62,"highlight_end":64}],"label":"expected `Id<RouteKind>`, found `Id<RouteLabelKind>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"crates/editor/src/widget/routing.rs","byte_start":53876,"byte_end":53892,"line_start":1230,"line_end":1230,"column_start":14,"column_end":30,"is_primary":false,"text":[{"text":"            .routes_previewed(relayed.iter().map(|&(id, ..)| id), &scope);","highlight_start":14,"highlight_end":30}],"label":"required by a bound introduced by this call","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `blockworx_doc::id::Id<RouteKind>`\n   found struct `blockworx_doc::id::Id<RouteLabelKind>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for `Map<Iter<'_, (Id<RouteLabelKind>, FracVal)>, {closure@...}>` to implement `Iterator`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by a bound in `Presentation::routes_previewed`","code":null,"level":"note","spans":[{"file_name":"crates/editor/src/presentation/mod.rs","byte_start":7087,"byte_end":7103,"line_start":164,"line_end":164,"column_start":12,"column_end":28,"is_primary":false,"text":[{"text":"    pub fn routes_previewed(","highlight_start":12,"highlight_end":28}],"label":"required by a bound in this associated function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"crates/editor/src/presentation/mod.rs","byte_start":7158,"byte_end":7172,"line_start":166,"line_end":166,"column_start":35,"column_end":49,"is_primary":true,"text":[{"text":"        routes: impl IntoIterator<Item = RouteId>,","highlight_start":35,"highlight_end":49}],"label":"required by this bound in `Presentation::routes_previewed`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"the full name for the type has been written to '/home/samitbasu/Devel/blockworx/target/debug/deps/blockworx_editor-5c68d813972e1c83.long-type-15478532404085033305.txt'","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider using `--verbose` to print the full type name to the console","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0271]\u001b[0m\u001b[1m: expected `{closure@routing.rs:1230:50}` to return `Id<RouteKind>`, but it returns `Id<RouteLabelKind>`\u001b[0m\n    \u001b[1m\u001b[94m--> \u001b[0mcrates/editor/src/widget/routing.rs:1230:62\n     \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m1230\u001b[0m \u001b[1m\u001b[94m|\u001b[0m             .routes_previewed(relayed.iter().map(|&(id, ..)| id), &scope);\n     \u001b[1m\u001b[94m|\u001b[0m              \u001b[1m\u001b[94m----------------\u001b[0m                    \u001b[1m\u001b[94m-----------\u001b[0m \u001b[1m\u001b[91m^^\u001b[0m \u001b[1m\u001b[91mexpected `Id<RouteKind>`, found `Id<RouteLabelKind>`\u001b[0m\n     \u001b[1m\u001b[94m|\u001b[0m              \u001b[1m\u001b[94m|\u001b[0m                                   \u001b[1m\u001b[94m|\u001b[0m\n     \u001b[1m\u001b[94m|\u001b[0m              \u001b[1m\u001b[94m|\u001b[0m                                   \u001b[1m\u001b[94mthis closure\u001b[0m\n     \u001b[1m\u001b[94m|\u001b[0m              \u001b[1m\u001b[94mrequired by a bound introduced by this call\u001b[0m\n     \u001b[1m\u001b[94m|\u001b[0m\n     \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: expected struct `blockworx_doc::id::Id<\u001b[1m\u001b[35mRouteKind\u001b[0m>`\n                found struct `blockworx_doc::id::Id<\u001b[1m\u001b[35mRouteLabelKind\u001b[0m>`\n     \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: required for `Map<Iter<'_, (Id<RouteLabelKind>, FracVal)>, {closure@...}>` to implement `Iterator`\n\u001b[1m\u001b[92mnote\u001b[0m: required by a bound in `Presentation::routes_previewed`\n    \u001b[1m\u001b[94m--> \u001b[0mcrates/editor/src/presentation/mod.rs:166:35\n     \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m 164\u001b[0m \u001b[1m\u001b[94m|\u001b[0m     pub fn routes_previewed(\n     \u001b[1m\u001b[94m|\u001b[0m            \u001b[1m\u001b[94m----------------\u001b[0m \u001b[1m\u001b[94mrequired by a bound in this associated function\u001b[0m\n\u001b[1m\u001b[94m 165\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         &mut self,\n\u001b[1m\u001b[94m 166\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         routes: impl IntoIterator<Item = RouteId>,\n     \u001b[1m\u001b[94m|\u001b[0m                                   \u001b[1m\u001b[92m^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[92mrequired by this bound in `Presentation::routes_previewed`\u001b[0m\n     \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: the full name for the type has been written to '/home/samitbasu/Devel/blockworx/target/debug/deps/blockworx_editor-5c68d813972e1c83.long-type-15478532404085033305.txt'\n     \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: consider using `--verbose` to print the full type name to the console\n\n"}
{"$message_type":"diagnostic","message":"this method takes 2 arguments but 0 arguments were supplied","code":{"code":"E0061","explanation":"An invalid number of arguments was passed when calling a function.\n\nErroneous code example:\n\n```compile_fail,E0061\nfn f(u: i32) {}\n\nf(); // error!\n```\n\nThe number of arguments passed to a function must match the number of arguments\nspecified in the function signature.\n\nFor example, a function like:\n\n```\nfn f(a: u16, b: &str) {}\n```\n\nMust always be called with exactly two arguments, e.g., `f(2, \"test\")`.\n\nNote that Rust does not have a notion of optional function arguments or\nvariadic functions (except for its C-FFI).\n"},"level":"error","spans":[{"file_name":"crates/editor/src/widget/routing.rs","byte_start":60891,"byte_end":60893,"line_start":1390,"line_end":1390,"column_start":43,"column_end":45,"is_primary":false,"text":[{"text":"        self.presentation.routes_previewed();","highlight_start":43,"highlight_end":45}],"label":"two arguments are missing","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"crates/editor/src/widget/routing.rs","byte_start":60875,"byte_end":60891,"line_start":1390,"line_end":1390,"column_start":27,"column_end":43,"is_primary":true,"text":[{"text":"        self.presentation.routes_previewed();","highlight_start":27,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"method defined here","code":null,"level":"note","spans":[{"file_name":"crates/editor/src/presentation/mod.rs","byte_start":7183,"byte_end":7216,"line_start":167,"line_end":167,"column_start":9,"column_end":42,"is_primary":false,"text":[{"text":"        in_scope: &crate::path::BlockPath,","highlight_start":9,"highlight_end":42}],"label":"","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"crates/editor/src/presentation/mod.rs","byte_start":7132,"byte_end":7173,"line_start":166,"line_end":166,"column_start":9,"column_end":50,"is_primary":false,"text":[{"text":"        routes: impl IntoIterator<Item = RouteId>,","highlight_start":9,"highlight_end":50}],"label":"","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"crates/editor/src/presentation/mod.rs","byte_start":7087,"byte_end":7103,"line_start":164,"line_end":164,"column_start":12,"column_end":28,"is_primary":true,"text":[{"text":"    pub fn routes_previewed(","highlight_start":12,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"provide the arguments","code":null,"level":"help","spans":[{"file_name":"crates/editor/src/widget/routing.rs","byte_start":60891,"byte_end":60893,"line_start":1390,"line_end":1390,"column_start":43,"column_end":45,"is_primary":true,"text":[{"text":"        self.presentation.routes_previewed();","highlight_start":43,"highlight_end":45}],"label":null,"suggested_replacement":"(/* routes */, /* &BlockPath */)","suggestion_applicability":"HasPlaceholders","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0061]\u001b[0m\u001b[1m: this method takes 2 arguments but 0 arguments were supplied\u001b[0m\n    \u001b[1m\u001b[94m--> \u001b[0mcrates/editor/src/widget/routing.rs:1390:27\n     \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m1390\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         self.presentation.routes_previewed();\n     \u001b[1m\u001b[94m|\u001b[0m                           \u001b[1m\u001b[91m^^^^^^^^^^^^^^^^\u001b[0m\u001b[1m\u001b[94m--\u001b[0m \u001b[1m\u001b[94mtwo arguments are missing\u001b[0m\n     \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[92mnote\u001b[0m: method defined here\n    \u001b[1m\u001b[94m--> \u001b[0mcrates/editor/src/presentation/mod.rs:164:12\n     \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m 164\u001b[0m \u001b[1m\u001b[94m|\u001b[0m     pub fn routes_previewed(\n     \u001b[1m\u001b[94m|\u001b[0m            \u001b[1m\u001b[92m^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m 165\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         &mut self,\n\u001b[1m\u001b[94m 166\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         routes: impl IntoIterator<Item = RouteId>,\n     \u001b[1m\u001b[94m|\u001b[0m         \u001b[1m\u001b[94m-----------------------------------------\u001b[0m\n\u001b[1m\u001b[94m 167\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         in_scope: &crate::path::BlockPath,\n     \u001b[1m\u001b[94m|\u001b[0m         \u001b[1m\u001b[94m---------------------------------\u001b[0m\n\u001b[1m\u001b[96mhelp\u001b[0m: provide the arguments\n     \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m1390\u001b[0m \u001b[1m\u001b[94m| \u001b[0m        self.presentation.routes_previewed(\u001b[92m/* routes */, /* &BlockPath */\u001b[0m);\n     \u001b[1m\u001b[94m|\u001b[0m                                            \u001b[92m++++++++++++++++++++++++++++++\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[1m\u001b[91merror\u001b[0m\u001b[1m: aborting due to 2 previous errors\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"Some errors have detailed explanations: E0061, E0271.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mSome errors have detailed explanations: E0061, E0271.\u001b[0m\n"}
{"$message_type":"diagnostic","message":"For more information about an error, try `rustc --explain E0061`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mFor more information about an error, try `rustc --explain E0061`.\u001b[0m\n"}
