1
Fork 0

fixes post rebase

This commit is contained in:
Jane Losare-Lusby 2022-07-07 22:29:38 +00:00
parent 87eafe82e8
commit e4e6b1ebc6
9 changed files with 7 additions and 21 deletions

View file

@ -465,7 +465,7 @@ where
struct_span_err!( struct_span_err!(
diagnostic, diagnostic,
item_sp, item_sp,
E0788, E0789,
"`rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute" "`rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute"
) )
.emit(); .emit();

View file

@ -644,5 +644,5 @@ E0788: include_str!("./error_codes/E0788.md"),
// E0721, // `await` keyword // E0721, // `await` keyword
// E0723, // unstable feature in `const` context // E0723, // unstable feature in `const` context
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`. // E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
E0788, // rustc_allowed_through_unstable_modules without stability attribute E0789, // rustc_allowed_through_unstable_modules without stability attribute
} }

View file

@ -492,6 +492,8 @@ impl<'tcx> TyCtxt<'tcx> {
/// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted. /// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted.
/// ///
/// Pass `AllowUnstable::Yes` to `allow_unstable` to force an unstable item to be allowed. Deprecation warnings will be emitted normally. /// Pass `AllowUnstable::Yes` to `allow_unstable` to force an unstable item to be allowed. Deprecation warnings will be emitted normally.
///
/// Returns `true` if item is allowed aka, stable or unstable under an enabled feature.
pub fn check_stability_allow_unstable( pub fn check_stability_allow_unstable(
self, self,
def_id: DefId, def_id: DefId,

View file

@ -858,7 +858,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> {
} else { } else {
AllowUnstable::No AllowUnstable::No
}, },
) );
} }
} }
} }

View file

@ -1,8 +0,0 @@
#![crate_type = "lib"]
#![feature(staged_api)]
#![feature(rustc_attrs)]
#![stable(feature = "foo", since = "1.0.0")]
#[unstable(feature = "bar", issue = "none")]
#[rustc_allowed_through_unstable_modules]
pub struct UnstableType(());

View file

@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'unstable_test_feature' error[E0658]: use of unstable library feature 'unstable_test_feature'
--> $DIR/allowed-through-unstable.rs:10:5 --> $DIR/allowed-through-unstable.rs:9:5
| |
LL | use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowedThroughUnstable; LL | use allowed_through_unstable_core::unstable_module::NewStableTraitNotAllowedThroughUnstable;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,8 +0,0 @@
// edition:2018
#![allow(deprecated)]
extern crate rustc_serialize;
#[derive(RustcDecodable, RustcEncodable)]
struct ArbitraryTestType(());
fn main() {}

View file

@ -11,7 +11,7 @@ use regex::Regex;
// A few of those error codes can't be tested but all the others can and *should* be tested! // A few of those error codes can't be tested but all the others can and *should* be tested!
const EXEMPTED_FROM_TEST: &[&str] = &[ const EXEMPTED_FROM_TEST: &[&str] = &[
"E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0490", "E0514", "E0519", "E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0490", "E0514", "E0519",
"E0523", "E0554", "E0640", "E0717", "E0729", "E0523", "E0554", "E0640", "E0717", "E0729", "E0789",
]; ];
// Some error codes don't have any tests apparently... // Some error codes don't have any tests apparently...