fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error: use of a def path to a diagnostic item 2 --> $DIR/unnecessary_def_path.rs:36:13 3 | 4LL | let _ = match_type(cx, ty, &OPTION); 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)` 6 | 7note: the lint level is defined here 8 --> $DIR/unnecessary_def_path.rs:2:9 9 | 10LL | #![deny(clippy::internal)] 11 | ^^^^^^^^^^^^^^^^ 12 = note: `#[deny(clippy::unnecessary_def_path)]` implied by `#[deny(clippy::internal)]` 13 14error: use of a def path to a diagnostic item 15 --> $DIR/unnecessary_def_path.rs:37:13 16 | 17LL | let _ = match_type(cx, ty, RESULT); 18 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)` 19 20error: use of a def path to a diagnostic item 21 --> $DIR/unnecessary_def_path.rs:38:13 22 | 23LL | let _ = match_type(cx, ty, &["core", "result", "Result"]); 24 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)` 25 26error: use of a def path to a diagnostic item 27 --> $DIR/unnecessary_def_path.rs:42:13 28 | 29LL | let _ = clippy_utils::ty::match_type(cx, ty, rc_path); 30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Rc)` 31 32error: use of a def path to a diagnostic item 33 --> $DIR/unnecessary_def_path.rs:44:13 34 | 35LL | let _ = match_type(cx, ty, &paths::OPTION); 36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)` 37 38error: use of a def path to a diagnostic item 39 --> $DIR/unnecessary_def_path.rs:45:13 40 | 41LL | let _ = match_type(cx, ty, paths::RESULT); 42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)` 43 44error: use of a def path to a `LangItem` 45 --> $DIR/unnecessary_def_path.rs:47:13 46 | 47LL | let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]); 48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_lang_item(cx, ty, LangItem::OwnedBox)` 49 50error: use of a def path to a diagnostic item 51 --> $DIR/unnecessary_def_path.rs:48:13 52 | 53LL | let _ = match_type(cx, ty, &["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"]); 54 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::maybe_uninit_uninit)` 55 56error: use of a def path to a `LangItem` 57 --> $DIR/unnecessary_def_path.rs:50:13 58 | 59LL | let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]); 60 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did)` 61 62error: use of a def path to a diagnostic item 63 --> $DIR/unnecessary_def_path.rs:51:13 64 | 65LL | let _ = match_def_path(cx, did, &["core", "option", "Option"]); 66 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.is_diagnostic_item(sym::Option, did)` 67 68error: use of a def path to a `LangItem` 69 --> $DIR/unnecessary_def_path.rs:52:13 70 | 71LL | let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]); 72 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OptionSome) == Some(did)` 73 | 74 = help: if this `DefId` came from a constructor expression or pattern then the parent `DefId` should be used instead 75 76error: use of a def path to a diagnostic item 77 --> $DIR/unnecessary_def_path.rs:54:13 78 | 79LL | let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]); 80 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_trait_method(cx, expr, sym::AsRef)` 81 82error: use of a def path to a diagnostic item 83 --> $DIR/unnecessary_def_path.rs:56:13 84 | 85LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]); 86 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_path_diagnostic_item(cx, expr, sym::Option)` 87 88error: use of a def path to a `LangItem` 89 --> $DIR/unnecessary_def_path.rs:57:13 90 | 91LL | let _ = is_expr_path_def_path(cx, expr, &["core", "iter", "traits", "Iterator", "next"]); 92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path_res(cx, expr).opt_def_id().map_or(false, |id| cx.tcx.lang_items().get(LangItem::IteratorNext) == Some(id))` 93 94error: use of a def path to a `LangItem` 95 --> $DIR/unnecessary_def_path.rs:58:13 96 | 97LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option", "Some"]); 98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_res_lang_ctor(cx, path_res(cx, expr), LangItem::OptionSome)` 99 100error: aborting due to 15 previous errors 101