diff options
| author | Avi Dessauer <avi.the.coder@gmail.com> | 2020-07-08 15:32:58 -0400 |
|---|---|---|
| committer | Jacob Hughes <j@jacobhughes.me> | 2020-09-22 21:55:35 -0400 |
| commit | 25dba40cbee4161709fba653c5f3915a7ac87537 (patch) | |
| tree | 2d2852f31ce5c0b3a7366da93298d5197e7182f5 | |
| parent | 9eb595705e754c970de76375060455bc3f576296 (diff) | |
| download | rust-25dba40cbee4161709fba653c5f3915a7ac87537.tar.gz rust-25dba40cbee4161709fba653c5f3915a7ac87537.zip | |
Update src/librustc_middle/middle/stability.rs
Co-authored-by: varkor <github@varkor.com>
| -rw-r--r-- | compiler/rustc_middle/src/middle/stability.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs index 28d139faa59..7e2415fd544 100644 --- a/compiler/rustc_middle/src/middle/stability.rs +++ b/compiler/rustc_middle/src/middle/stability.rs @@ -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, |
