Skip to content

Commit

Permalink
fix miri-opt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Jul 6, 2022
1 parent 0541b4e commit b730bc9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
16 changes: 6 additions & 10 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-6252.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b730bc9

Please sign in to comment.