|
| 1 | +{ |
| 2 | + "message": "cannot find type `Display` in this scope", |
| 3 | + "code": { |
| 4 | + "code": "E0412", |
| 5 | + "explanation": "\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n type N;\n\n fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n // either\n use super::File;\n // or\n // use std::fs::File;\n fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n" |
| 6 | + }, |
| 7 | + "level": "error", |
| 8 | + "spans": [ |
| 9 | + { |
| 10 | + "file_name": "./tests/everything/skip-multi-option-lints.rs", |
| 11 | + "byte_start": 64, |
| 12 | + "byte_end": 71, |
| 13 | + "line_start": 3, |
| 14 | + "line_end": 3, |
| 15 | + "column_start": 13, |
| 16 | + "column_end": 20, |
| 17 | + "is_primary": true, |
| 18 | + "text": [ |
| 19 | + { |
| 20 | + "text": " let d: &Display = &xs;", |
| 21 | + "highlight_start": 13, |
| 22 | + "highlight_end": 20 |
| 23 | + } |
| 24 | + ], |
| 25 | + "label": "not found in this scope", |
| 26 | + "suggested_replacement": null, |
| 27 | + "expansion": null |
| 28 | + } |
| 29 | + ], |
| 30 | + "children": [ |
| 31 | + { |
| 32 | + "message": "possible candidates are found in other modules, you can import them into scope", |
| 33 | + "code": null, |
| 34 | + "level": "help", |
| 35 | + "spans": [ |
| 36 | + { |
| 37 | + "file_name": "./tests/everything/skip-multi-option-lints.rs", |
| 38 | + "byte_start": 0, |
| 39 | + "byte_end": 0, |
| 40 | + "line_start": 1, |
| 41 | + "line_end": 1, |
| 42 | + "column_start": 1, |
| 43 | + "column_end": 1, |
| 44 | + "is_primary": true, |
| 45 | + "text": [ |
| 46 | + { |
| 47 | + "text": "fn main() {", |
| 48 | + "highlight_start": 1, |
| 49 | + "highlight_end": 1 |
| 50 | + } |
| 51 | + ], |
| 52 | + "label": null, |
| 53 | + "suggested_replacement": "use std::fmt::Display;\n\n", |
| 54 | + "suggestion_applicability": "Unspecified", |
| 55 | + "expansion": null |
| 56 | + }, |
| 57 | + { |
| 58 | + "file_name": "./tests/everything/skip-multi-option-lints.rs", |
| 59 | + "byte_start": 0, |
| 60 | + "byte_end": 0, |
| 61 | + "line_start": 1, |
| 62 | + "line_end": 1, |
| 63 | + "column_start": 1, |
| 64 | + "column_end": 1, |
| 65 | + "is_primary": true, |
| 66 | + "text": [ |
| 67 | + { |
| 68 | + "text": "fn main() {", |
| 69 | + "highlight_start": 1, |
| 70 | + "highlight_end": 1 |
| 71 | + } |
| 72 | + ], |
| 73 | + "label": null, |
| 74 | + "suggested_replacement": "use std::path::Display;\n\n", |
| 75 | + "suggestion_applicability": "Unspecified", |
| 76 | + "expansion": null |
| 77 | + } |
| 78 | + ], |
| 79 | + "children": [], |
| 80 | + "rendered": null |
| 81 | + } |
| 82 | + ], |
| 83 | + "rendered": "error[E0412]: cannot find type `Display` in this scope\n --> ./tests/everything/skip-multi-option-lints.rs:3:13\n |\n3 | let d: &Display = &xs;\n | ^^^^^^^ not found in this scope\nhelp: possible candidates are found in other modules, you can import them into scope\n |\n1 | use std::fmt::Display;\n |\n1 | use std::path::Display;\n |\n\n" |
| 84 | +} |
| 85 | +{ |
| 86 | + "message": "aborting due to previous error", |
| 87 | + "code": null, |
| 88 | + "level": "error", |
| 89 | + "spans": [], |
| 90 | + "children": [], |
| 91 | + "rendered": "error: aborting due to previous error\n\n" |
| 92 | +} |
| 93 | +{ |
| 94 | + "message": "For more information about this error, try `rustc --explain E0412`.", |
| 95 | + "code": null, |
| 96 | + "level": "", |
| 97 | + "spans": [], |
| 98 | + "children": [], |
| 99 | + "rendered": "For more information about this error, try `rustc --explain E0412`.\n" |
| 100 | +} |
0 commit comments