Update src/librustc_middle/middle/stability.rs

Co-authored-by: varkor <github@varkor.com>
This commit is contained in:
Avi Dessauer 2020-07-08 15:32:58 -04:00 committed by Jacob Hughes
parent 9eb595705e
commit 25dba40cbe

View File

@ -402,16 +402,10 @@ impl<'tcx> TyCtxt<'tcx> {
})
}
/// Checks if an item is stable or error out.
///
/// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
/// exist, emits an error.
///
/// This function will also check if the item is deprecated.
/// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted.
///
/// The `unmarked` closure is called definitions without a stability annotation.
/// This is needed for generic parameters, since they may not be marked when used in a staged_api crate.
/// Like `check_stability`, except that we permit items to have custom behaviour for
/// missing stability attributes (not necessarily just emit a `bug!`). This is necessary
/// for default generic parameters, which only have stability attributes if they were
/// added after the type on which they're defined.
pub fn check_optional_stability(
self,
def_id: DefId,