Skip to content

Commit b730bc9

Browse files
committed
fix miri-opt tests
1 parent 0541b4e commit b730bc9

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

compiler/rustc_lint/src/builtin.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -577,16 +577,12 @@ impl MissingDoc {
577577
let attrs = cx.tcx.hir().attrs(cx.tcx.hir().local_def_id_to_hir_id(def_id));
578578
let has_doc = attrs.iter().any(has_doc);
579579
if !has_doc {
580-
cx.struct_span_lint(
581-
MISSING_DOCS,
582-
cx.tcx.sess.source_map().guess_head_span(sp),
583-
|lint| {
584-
lint.build(fluent::lint::builtin_missing_doc)
585-
.set_arg("article", article)
586-
.set_arg("desc", desc)
587-
.emit();
588-
},
589-
);
580+
cx.struct_span_lint(MISSING_DOCS, cx.tcx.def_span(def_id), |lint| {
581+
lint.build(fluent::lint::builtin_missing_doc)
582+
.set_arg("article", article)
583+
.set_arg("desc", desc)
584+
.emit();
585+
});
590586
}
591587
}
592588
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// MIR for `Test::X` 0 mir_map
22

33
fn Test::X(_1: usize) -> Test {
4-
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
4+
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
55

66
bb0: {
7-
Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
8-
((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
9-
discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
10-
return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
7+
Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
8+
((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
9+
discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
10+
return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
1111
}
1212
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// MIR for `Test::X` 0 mir_map
22

33
fn Test::X(_1: usize) -> Test {
4-
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
4+
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
55

66
bb0: {
7-
Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
8-
((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
9-
discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
10-
return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
7+
Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
8+
((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
9+
discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
10+
return; // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:6
1111
}
1212
}

src/tools/clippy/tests/ui/crashes/ice-6252.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LL | const VAL: T;
2828
| ------------ `VAL` from trait
2929
...
3030
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation
3232

3333
error: constant expression depends on a generic parameter
3434
--> $DIR/ice-6252.rs:13:9

0 commit comments

Comments
 (0)