Skip to content

Commit 57cdd33

Browse files
committed
Ignore unmarked generic params
1 parent 6452165 commit 57cdd33

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/librustc/middle/stability.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,11 @@ impl<'tcx> TyCtxt<'tcx> {
393393
/// Additionally, this function will also check if the item is deprecated. If so, and `id` is
394394
/// not `None`, a deprecated lint attached to `id` will be emitted.
395395
pub fn check_stability(self, def_id: DefId, id: Option<HirId>, span: Span) {
396-
self.check_stability_internal(def_id, id, span, true)
396+
self.check_stability_internal(def_id, id, span, true, |span, def_id| {
397+
// The API could be uncallable for other reasons, for example when a private module
398+
// was referenced.
399+
self.sess.delay_span_bug(span, &format!("encountered unmarked API: {:?}", def_id));
400+
})
397401
}
398402

399403
/// Checks if an item is stable or error out.
@@ -409,6 +413,7 @@ impl<'tcx> TyCtxt<'tcx> {
409413
id: Option<HirId>,
410414
span: Span,
411415
inherit_dep: bool,
416+
unmarked: impl FnOnce(Span, DefId) -> (),
412417
) {
413418
let soft_handler =
414419
|lint, span, msg: &_| self.lint_hir(lint, id.unwrap_or(hir::CRATE_HIR_ID), span, msg);
@@ -417,11 +422,7 @@ impl<'tcx> TyCtxt<'tcx> {
417422
EvalResult::Deny { feature, reason, issue, is_soft } => {
418423
report_unstable(self.sess, feature, reason, issue, is_soft, span, soft_handler)
419424
}
420-
EvalResult::Unmarked => {
421-
// The API could be uncallable for other reasons, for example when a private module
422-
// was referenced.
423-
self.sess.delay_span_bug(span, &format!("encountered unmarked API: {:?}", def_id));
424-
}
425+
EvalResult::Unmarked => unmarked(span, def_id),
425426
}
426427
}
427428

src/librustc_typeck/astconv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
705705
Some(arg.id()),
706706
arg.span(),
707707
false,
708+
|_, _| (),
708709
);
709710
}
710711

0 commit comments

Comments
 (0)