mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rename #[rustc_hidden_type_of_opaques] to #[rustc_dump_hidden_type_of_opaques]
This commit is contained in:
committed by
Jonathan Brouwer
parent
7025605b8c
commit
dda1ea0c43
@@ -24,6 +24,15 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpDefParentsParser {
|
||||
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpDefParents;
|
||||
}
|
||||
|
||||
pub(crate) struct RustcDumpHiddenTypeOfOpaquesParser;
|
||||
|
||||
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpHiddenTypeOfOpaquesParser {
|
||||
const PATH: &[Symbol] = &[sym::rustc_dump_hidden_type_of_opaques];
|
||||
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
|
||||
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
|
||||
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpHiddenTypeOfOpaques;
|
||||
}
|
||||
|
||||
pub(crate) struct RustcDumpInferredOutlivesParser;
|
||||
|
||||
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpInferredOutlivesParser {
|
||||
|
||||
@@ -680,14 +680,6 @@ impl<S: Stage> NoArgsAttributeParser<S> for PanicHandlerParser {
|
||||
const CREATE: fn(Span) -> AttributeKind = |span| AttributeKind::Lang(LangItem::PanicImpl, span);
|
||||
}
|
||||
|
||||
pub(crate) struct RustcHiddenTypeOfOpaquesParser;
|
||||
|
||||
impl<S: Stage> NoArgsAttributeParser<S> for RustcHiddenTypeOfOpaquesParser {
|
||||
const PATH: &[Symbol] = &[sym::rustc_hidden_type_of_opaques];
|
||||
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
|
||||
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
|
||||
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcHiddenTypeOfOpaques;
|
||||
}
|
||||
pub(crate) struct RustcNounwindParser;
|
||||
|
||||
impl<S: Stage> NoArgsAttributeParser<S> for RustcNounwindParser {
|
||||
|
||||
@@ -285,6 +285,7 @@ mod late {
|
||||
Single<WithoutArgs<RustcDenyExplicitImplParser>>,
|
||||
Single<WithoutArgs<RustcDoNotConstCheckParser>>,
|
||||
Single<WithoutArgs<RustcDumpDefParentsParser>>,
|
||||
Single<WithoutArgs<RustcDumpHiddenTypeOfOpaquesParser>>,
|
||||
Single<WithoutArgs<RustcDumpInferredOutlivesParser>>,
|
||||
Single<WithoutArgs<RustcDumpItemBoundsParser>>,
|
||||
Single<WithoutArgs<RustcDumpObjectLifetimeDefaultsParser>>,
|
||||
@@ -298,7 +299,6 @@ mod late {
|
||||
Single<WithoutArgs<RustcEiiForeignItemParser>>,
|
||||
Single<WithoutArgs<RustcEvaluateWhereClausesParser>>,
|
||||
Single<WithoutArgs<RustcHasIncoherentInherentImplsParser>>,
|
||||
Single<WithoutArgs<RustcHiddenTypeOfOpaquesParser>>,
|
||||
Single<WithoutArgs<RustcInheritOverflowChecksParser>>,
|
||||
Single<WithoutArgs<RustcInsignificantDtorParser>>,
|
||||
Single<WithoutArgs<RustcIntrinsicConstStableIndirectParser>>,
|
||||
|
||||
@@ -1449,7 +1449,7 @@ pub struct BuiltinAttribute {
|
||||
WarnFollowing, EncodeCrossCrate::No
|
||||
),
|
||||
rustc_attr!(
|
||||
TEST, rustc_hidden_type_of_opaques, Normal, template!(Word),
|
||||
TEST, rustc_dump_hidden_type_of_opaques, Normal, template!(Word),
|
||||
WarnFollowing, EncodeCrossCrate::No
|
||||
),
|
||||
rustc_attr!(
|
||||
|
||||
@@ -1371,6 +1371,9 @@ pub enum AttributeKind {
|
||||
/// Represents `#[rustc_dump_def_parents]`
|
||||
RustcDumpDefParents,
|
||||
|
||||
/// Represents `#[rustc_dump_hidden_type_of_opaques]`
|
||||
RustcDumpHiddenTypeOfOpaques,
|
||||
|
||||
/// Represents `#[rustc_dump_inferred_outlives]`
|
||||
RustcDumpInferredOutlives,
|
||||
|
||||
@@ -1412,9 +1415,6 @@ pub enum AttributeKind {
|
||||
|
||||
RustcHasIncoherentInherentImpls,
|
||||
|
||||
/// Represents `#[rustc_hidden_type_of_opaques]`
|
||||
RustcHiddenTypeOfOpaques,
|
||||
|
||||
/// Represents `#[rustc_if_this_changed]`
|
||||
RustcIfThisChanged(Span, Option<Symbol>),
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ pub fn encode_cross_crate(&self) -> EncodeCrossCrate {
|
||||
RustcDocPrimitive(..) => Yes,
|
||||
RustcDummy => No,
|
||||
RustcDumpDefParents => No,
|
||||
RustcDumpHiddenTypeOfOpaques => No,
|
||||
RustcDumpInferredOutlives => No,
|
||||
RustcDumpItemBounds => No,
|
||||
RustcDumpLayout(..) => No,
|
||||
@@ -139,7 +140,6 @@ pub fn encode_cross_crate(&self) -> EncodeCrossCrate {
|
||||
RustcEiiForeignItem => No,
|
||||
RustcEvaluateWhereClauses => Yes,
|
||||
RustcHasIncoherentInherentImpls => Yes,
|
||||
RustcHiddenTypeOfOpaques => No,
|
||||
RustcIfThisChanged(..) => No,
|
||||
RustcInheritOverflowChecks => No,
|
||||
RustcInsignificantDtor => Yes,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
use rustc_span::sym;
|
||||
|
||||
pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) {
|
||||
if !find_attr!(tcx, crate, RustcHiddenTypeOfOpaques) {
|
||||
if !find_attr!(tcx, crate, RustcDumpHiddenTypeOfOpaques) {
|
||||
return;
|
||||
}
|
||||
for id in tcx.hir_crate_items(()).opaques() {
|
||||
|
||||
@@ -311,6 +311,7 @@ fn check_attributes(
|
||||
| AttributeKind::RustcDocPrimitive(..)
|
||||
| AttributeKind::RustcDummy
|
||||
| AttributeKind::RustcDumpDefParents
|
||||
| AttributeKind::RustcDumpHiddenTypeOfOpaques
|
||||
| AttributeKind::RustcDumpInferredOutlives
|
||||
| AttributeKind::RustcDumpItemBounds
|
||||
| AttributeKind::RustcDumpLayout(..)
|
||||
@@ -324,7 +325,6 @@ fn check_attributes(
|
||||
| AttributeKind::RustcEiiForeignItem
|
||||
| AttributeKind::RustcEvaluateWhereClauses
|
||||
| AttributeKind::RustcHasIncoherentInherentImpls
|
||||
| AttributeKind::RustcHiddenTypeOfOpaques
|
||||
| AttributeKind::RustcIfThisChanged(..)
|
||||
| AttributeKind::RustcInheritOverflowChecks
|
||||
| AttributeKind::RustcInsignificantDtor
|
||||
|
||||
@@ -1721,6 +1721,7 @@
|
||||
rustc_driver,
|
||||
rustc_dummy,
|
||||
rustc_dump_def_parents,
|
||||
rustc_dump_hidden_type_of_opaques,
|
||||
rustc_dump_inferred_outlives,
|
||||
rustc_dump_item_bounds,
|
||||
rustc_dump_layout,
|
||||
@@ -1737,7 +1738,6 @@
|
||||
rustc_expected_cgu_reuse,
|
||||
rustc_force_inline,
|
||||
rustc_has_incoherent_inherent_impls,
|
||||
rustc_hidden_type_of_opaques,
|
||||
rustc_if_this_changed,
|
||||
rustc_inherit_overflow_checks,
|
||||
rustc_insignificant_dtor,
|
||||
|
||||
@@ -275,6 +275,7 @@ Here are some notable ones:
|
||||
|----------------|-------------|
|
||||
| `rustc_def_path` | Dumps the [`def_path_str`] of an item. |
|
||||
| `rustc_dump_def_parents` | Dumps the chain of `DefId` parents of certain definitions. |
|
||||
| `rustc_dump_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. |
|
||||
| `rustc_dump_inferred_outlives` | Dumps implied bounds of an item. More precisely, the [`inferred_outlives_of`] an item. |
|
||||
| `rustc_dump_item_bounds` | Dumps the [`item_bounds`] of an item. |
|
||||
| `rustc_dump_layout` | [See this section](#debugging-type-layouts). |
|
||||
@@ -282,7 +283,6 @@ Here are some notable ones:
|
||||
| `rustc_dump_predicates` | Dumps the [`predicates_of`] an item. |
|
||||
| `rustc_dump_variances` | Dumps the [variances] of an item. |
|
||||
| `rustc_dump_vtable` | Dumps the vtable layout of an impl, or a type alias of a dyn type. |
|
||||
| `rustc_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. |
|
||||
| `rustc_regions` | Dumps NLL closure region requirements. |
|
||||
| `rustc_symbol_name` | Dumps the mangled & demangled [`symbol_name`] of an item. |
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//@ normalize-stderr: "DefId\([^\)]+\)" -> "DefId(..)"
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
#![rustc_hidden_type_of_opaques]
|
||||
#![rustc_dump_hidden_type_of_opaques]
|
||||
|
||||
// Make sure that the compiler can handle `ReErased` in the hidden type of an opaque.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//@ compile-flags: -Zverbose-internals
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
#![rustc_hidden_type_of_opaques]
|
||||
#![rustc_dump_hidden_type_of_opaques]
|
||||
|
||||
trait Foo {
|
||||
fn hello(&self) -> impl Sized;
|
||||
|
||||
Reference in New Issue
Block a user