Skip to content

Commit 25dba40

Browse files
Avi-D-codervarkor
authored andcommitted
Update src/librustc_middle/middle/stability.rs
Co-authored-by: varkor <[email protected]>
1 parent 9eb5957 commit 25dba40

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,16 +402,10 @@ impl<'tcx> TyCtxt<'tcx> {
402402
})
403403
}
404404

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

0 commit comments

Comments
 (0)