diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-07-06 10:47:29 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-07-06 19:09:50 +0900 |
| commit | b730bc9f20d9f88972ad13ccdf88b56d8164aeb3 (patch) | |
| tree | 31cec2ae1c67e41e7adcd16ee9a76d71365b13b4 | |
| parent | 0541b4e03469ea5d3f9ce131a270d49e4a7363ff (diff) | |
| download | rust-b730bc9f20d9f88972ad13ccdf88b56d8164aeb3.tar.gz rust-b730bc9f20d9f88972ad13ccdf88b56d8164aeb3.zip | |
fix miri-opt tests
4 files changed, 17 insertions, 21 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index de25baf5b14..95afbbe01db 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -577,16 +577,12 @@ impl MissingDoc { let attrs = cx.tcx.hir().attrs(cx.tcx.hir().local_def_id_to_hir_id(def_id)); let has_doc = attrs.iter().any(has_doc); if !has_doc { - cx.struct_span_lint( - MISSING_DOCS, - cx.tcx.sess.source_map().guess_head_span(sp), - |lint| { - lint.build(fluent::lint::builtin_missing_doc) - .set_arg("article", article) - .set_arg("desc", desc) - .emit(); - }, - ); + cx.struct_span_lint(MISSING_DOCS, cx.tcx.def_span(def_id), |lint| { + lint.build(fluent::lint::builtin_missing_doc) + .set_arg("article", article) + .set_arg("desc", desc) + .emit(); + }); } } } diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir index d106da84fc7..028281ba450 100644 --- a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir +++ b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir @@ -1,12 +1,12 @@ // MIR for `Test::X` 0 mir_map fn Test::X(_1: usize) -> Test { - let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 + let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 bb0: { - Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 - ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 - discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 - return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 + Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 + ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 + discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 + return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 } } diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir index d106da84fc7..028281ba450 100644 --- a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir +++ b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir @@ -1,12 +1,12 @@ // MIR for `Test::X` 0 mir_map fn Test::X(_1: usize) -> Test { - let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 + let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 bb0: { - Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 - ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 - discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 - return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13 + Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 + ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 + discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 + return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6 } } diff --git a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr index a6a767483ed..a1e37e7317b 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr @@ -28,7 +28,7 @@ LL | const VAL: T; | ------------ `VAL` from trait ... LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation error: constant expression depends on a generic parameter --> $DIR/ice-6252.rs:13:9 |
