Skip to content

Commit e66f241

Browse files
committed
Update #83739 with type of the item specified
1 parent 9b6c7ff commit e66f241

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

compiler/rustc_typeck/src/collect.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,15 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
839839
if let hir::TyKind::TraitObject(..) = ty.kind {
840840
let mut visitor = PlaceholderHirTyCollector::default();
841841
visitor.visit_item(it);
842-
placeholder_type_error(tcx, None, &[], visitor.0, false, None);
842+
placeholder_type_error(
843+
tcx,
844+
None,
845+
&[],
846+
visitor.0,
847+
false,
848+
None,
849+
it.kind.descr(),
850+
);
843851
}
844852
}
845853
_ => (),

src/test/ui/typeck/issue-75889.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
1+
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constant items
22
--> $DIR/issue-75889.rs:3:24
33
|
44
LL | const FOO: dyn Fn() -> _ = "";
55
| ^ not allowed in type signatures
66

7-
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
7+
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static items
88
--> $DIR/issue-75889.rs:4:25
99
|
1010
LL | static BOO: dyn Fn() -> _ = "";

0 commit comments

Comments
 (0)