Port rustc_if_this_changed/rustc_then_this_would_need to attr parser

This commit is contained in:
Jamie Hill-Daniel 2026-02-04 02:22:48 +00:00
parent 94a0ba50e1
commit de7067938d
21 changed files with 256 additions and 175 deletions

View file

@ -4039,7 +4039,6 @@ name = "rustc_incremental"
version = "0.0.0"
dependencies = [
"rand 0.9.2",
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_fs_util",

View file

@ -6,6 +6,7 @@ use rustc_hir::attrs::{
RustcMirKind,
};
use rustc_session::errors;
use rustc_span::Symbol;
use super::prelude::*;
use super::util::parse_single_integer;
@ -237,7 +238,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcLintUntrackedQueryInformationPa
pub(crate) struct RustcObjectLifetimeDefaultParser;
impl<S: Stage> SingleAttributeParser<S> for RustcObjectLifetimeDefaultParser {
const PATH: &[rustc_span::Symbol] = &[sym::rustc_object_lifetime_default];
const PATH: &[Symbol] = &[sym::rustc_object_lifetime_default];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Struct)]);
@ -274,7 +275,7 @@ impl<S: Stage> SingleAttributeParser<S> for RustcSimdMonomorphizeLaneLimitParser
pub(crate) struct RustcScalableVectorParser;
impl<S: Stage> SingleAttributeParser<S> for RustcScalableVectorParser {
const PATH: &[rustc_span::Symbol] = &[sym::rustc_scalable_vector];
const PATH: &[Symbol] = &[sym::rustc_scalable_vector];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Struct)]);
@ -347,7 +348,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcOffloadKernelParser {
pub(crate) struct RustcLayoutParser;
impl<S: Stage> CombineAttributeParser<S> for RustcLayoutParser {
const PATH: &[rustc_span::Symbol] = &[sym::rustc_layout];
const PATH: &[Symbol] = &[sym::rustc_layout];
type Item = RustcLayoutType;
@ -404,7 +405,7 @@ impl<S: Stage> CombineAttributeParser<S> for RustcLayoutParser {
pub(crate) struct RustcMirParser;
impl<S: Stage> CombineAttributeParser<S> for RustcMirParser {
const PATH: &[rustc_span::Symbol] = &[sym::rustc_mir];
const PATH: &[Symbol] = &[sym::rustc_mir];
type Item = RustcMirKind;
@ -599,13 +600,115 @@ impl<S: Stage> CombineAttributeParser<S> for RustcCleanParser {
return None;
};
Some(RustcCleanAttribute {
// Used for checking that all attributes have been checked
id: cx.cx.sess.psess.attr_id_generator.mk_attr_id(),
span: cx.attr_span,
cfg,
except,
loaded_from_disk,
})
Some(RustcCleanAttribute { span: cx.attr_span, cfg, except, loaded_from_disk })
}
}
pub(crate) struct RustcIfThisChangedParser;
impl<S: Stage> SingleAttributeParser<S> for RustcIfThisChangedParser {
const PATH: &[Symbol] = &[sym::rustc_if_this_changed];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
// tidy-alphabetical-start
Allow(Target::AssocConst),
Allow(Target::AssocTy),
Allow(Target::Const),
Allow(Target::Enum),
Allow(Target::Expression),
Allow(Target::Field),
Allow(Target::Fn),
Allow(Target::ForeignMod),
Allow(Target::Impl { of_trait: false }),
Allow(Target::Impl { of_trait: true }),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: false })),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::Mod),
Allow(Target::Static),
Allow(Target::Struct),
Allow(Target::Trait),
Allow(Target::TyAlias),
Allow(Target::Union),
// tidy-alphabetical-end
]);
const TEMPLATE: AttributeTemplate = template!(Word, List: &["DepNode"]);
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option<AttributeKind> {
match args {
ArgParser::NoArgs => Some(AttributeKind::RustcIfThisChanged(cx.attr_span, None)),
ArgParser::List(list) => {
let Some(item) = list.single() else {
cx.expected_single_argument(list.span);
return None;
};
let Some(ident) = item.meta_item().and_then(|item| item.ident()) else {
cx.expected_identifier(item.span());
return None;
};
Some(AttributeKind::RustcIfThisChanged(cx.attr_span, Some(ident.name)))
}
ArgParser::NameValue(_) => {
cx.expected_list_or_no_args(cx.inner_span);
None
}
}
}
}
pub(crate) struct RustcThenThisWouldNeedParser;
impl<S: Stage> CombineAttributeParser<S> for RustcThenThisWouldNeedParser {
const PATH: &[Symbol] = &[sym::rustc_then_this_would_need];
type Item = Ident;
const CONVERT: ConvertFn<Self::Item> =
|items, span| AttributeKind::RustcThenThisWouldNeed(span, items);
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
// tidy-alphabetical-start
Allow(Target::AssocConst),
Allow(Target::AssocTy),
Allow(Target::Const),
Allow(Target::Enum),
Allow(Target::Expression),
Allow(Target::Field),
Allow(Target::Fn),
Allow(Target::ForeignMod),
Allow(Target::Impl { of_trait: false }),
Allow(Target::Impl { of_trait: true }),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: false })),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::Mod),
Allow(Target::Static),
Allow(Target::Struct),
Allow(Target::Trait),
Allow(Target::TyAlias),
Allow(Target::Union),
// tidy-alphabetical-end
]);
const TEMPLATE: AttributeTemplate = template!(List: &["DepNode"]);
fn extend(
cx: &mut AcceptContext<'_, '_, S>,
args: &ArgParser,
) -> impl IntoIterator<Item = Self::Item> {
let Some(item) = args.list().and_then(|l| l.single()) else {
cx.expected_single_argument(cx.inner_span);
return None;
};
let Some(ident) = item.meta_item().and_then(|item| item.ident()) else {
cx.expected_identifier(item.span());
return None;
};
Some(ident)
}
}

View file

@ -156,6 +156,7 @@ attribute_parsers!(
Combine<RustcCleanParser>,
Combine<RustcLayoutParser>,
Combine<RustcMirParser>,
Combine<RustcThenThisWouldNeedParser>,
Combine<TargetFeatureParser>,
Combine<UnstableFeatureBoundParser>,
// tidy-alphabetical-end
@ -192,6 +193,7 @@ attribute_parsers!(
Single<RustcAllocatorZeroedVariantParser>,
Single<RustcBuiltinMacroParser>,
Single<RustcForceInlineParser>,
Single<RustcIfThisChangedParser>,
Single<RustcLayoutScalarValidRangeEndParser>,
Single<RustcLayoutScalarValidRangeStartParser>,
Single<RustcLegacyConstGenericsParser>,

View file

@ -5,7 +5,7 @@ pub use ReprAttr::*;
use rustc_abi::Align;
pub use rustc_ast::attr::data_structures::*;
use rustc_ast::token::DocFragmentKind;
use rustc_ast::{AttrId, AttrStyle, ast};
use rustc_ast::{AttrStyle, ast};
use rustc_data_structures::fx::FxIndexMap;
use rustc_error_messages::{DiagArgValue, IntoDiagArg};
use rustc_macros::{Decodable, Encodable, HashStable_Generic, PrintAttribute};
@ -719,7 +719,6 @@ pub enum BorrowckGraphvizFormatKind {
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)]
pub struct RustcCleanAttribute {
pub id: AttrId,
pub span: Span,
pub cfg: Symbol,
pub except: Option<RustcCleanQueries>,
@ -1098,6 +1097,9 @@ pub enum AttributeKind {
/// Represents `#[rustc_hidden_type_of_opaques]`
RustcHiddenTypeOfOpaques,
/// Represents `#[rustc_if_this_changed]`
RustcIfThisChanged(Span, Option<Symbol>),
/// Represents `#[rustc_layout]`
RustcLayout(ThinVec<RustcLayoutType>),
@ -1199,6 +1201,9 @@ pub enum AttributeKind {
/// Represents `#[rustc_std_internal_symbol]`.
RustcStdInternalSymbol(Span),
/// Represents `#[rustc_then_this_would_need]`
RustcThenThisWouldNeed(Span, ThinVec<Ident>),
/// Represents `#[rustc_unsafe_specialization_marker]`.
RustcUnsafeSpecializationMarker(Span),

View file

@ -113,6 +113,7 @@ impl AttributeKind {
RustcDynIncompatibleTrait(..) => No,
RustcHasIncoherentInherentImpls => Yes,
RustcHiddenTypeOfOpaques => No,
RustcIfThisChanged(..) => No,
RustcLayout(..) => No,
RustcLayoutScalarValidRangeEnd(..) => Yes,
RustcLayoutScalarValidRangeStart(..) => Yes,
@ -145,6 +146,7 @@ impl AttributeKind {
RustcSkipDuringMethodDispatch { .. } => No,
RustcSpecializationTrait(..) => No,
RustcStdInternalSymbol(..) => No,
RustcThenThisWouldNeed(..) => No,
RustcUnsafeSpecializationMarker(..) => No,
RustcVariance => No,
RustcVarianceOfOpaques => No,

View file

@ -6,7 +6,6 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
rand = "0.9.0"
rustc_ast = { path = "../rustc_ast" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_fs_util = { path = "../rustc_fs_util" }

View file

@ -39,14 +39,16 @@ use std::io::Write;
use rustc_data_structures::fx::FxIndexSet;
use rustc_data_structures::graph::linked_graph::{Direction, INCOMING, NodeIndex, OUTGOING};
use rustc_hir::Attribute;
use rustc_hir::attrs::AttributeKind;
use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId};
use rustc_hir::intravisit::{self, Visitor};
use rustc_middle::bug;
use rustc_middle::dep_graph::{
DepGraphQuery, DepKind, DepNode, DepNodeExt, DepNodeFilter, EdgeFilter, dep_kinds,
};
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::TyCtxt;
use rustc_middle::{bug, span_bug};
use rustc_span::{Span, Symbol, sym};
use tracing::debug;
use {rustc_graphviz as dot, rustc_hir as hir};
@ -105,29 +107,13 @@ struct IfThisChanged<'tcx> {
}
impl<'tcx> IfThisChanged<'tcx> {
fn argument(&self, attr: &hir::Attribute) -> Option<Symbol> {
let mut value = None;
for list_item in attr.meta_item_list().unwrap_or_default() {
match list_item.ident() {
Some(ident) if list_item.is_word() && value.is_none() => value = Some(ident.name),
_ =>
// FIXME better-encapsulate meta_item (don't directly access `node`)
{
span_bug!(list_item.span(), "unexpected meta-item {:?}", list_item)
}
}
}
value
}
fn process_attrs(&mut self, def_id: LocalDefId) {
let def_path_hash = self.tcx.def_path_hash(def_id.to_def_id());
let hir_id = self.tcx.local_def_id_to_hir_id(def_id);
let attrs = self.tcx.hir_attrs(hir_id);
for attr in attrs {
if attr.has_name(sym::rustc_if_this_changed) {
let dep_node_interned = self.argument(attr);
let dep_node = match dep_node_interned {
if let Attribute::Parsed(AttributeKind::RustcIfThisChanged(span, dep_node)) = *attr {
let dep_node = match dep_node {
None => DepNode::from_def_path_hash(
self.tcx,
def_path_hash,
@ -136,36 +122,29 @@ impl<'tcx> IfThisChanged<'tcx> {
Some(n) => {
match DepNode::from_label_string(self.tcx, n.as_str(), def_path_hash) {
Ok(n) => n,
Err(()) => self.tcx.dcx().emit_fatal(errors::UnrecognizedDepNode {
span: attr.span(),
name: n,
}),
Err(()) => self
.tcx
.dcx()
.emit_fatal(errors::UnrecognizedDepNode { span, name: n }),
}
}
};
self.if_this_changed.push((attr.span(), def_id.to_def_id(), dep_node));
} else if attr.has_name(sym::rustc_then_this_would_need) {
let dep_node_interned = self.argument(attr);
let dep_node = match dep_node_interned {
Some(n) => {
match DepNode::from_label_string(self.tcx, n.as_str(), def_path_hash) {
Ok(n) => n,
Err(()) => self.tcx.dcx().emit_fatal(errors::UnrecognizedDepNode {
span: attr.span(),
name: n,
}),
}
}
None => {
self.tcx.dcx().emit_fatal(errors::MissingDepNode { span: attr.span() });
}
};
self.then_this_would_need.push((
attr.span(),
dep_node_interned.unwrap(),
hir_id,
dep_node,
));
self.if_this_changed.push((span, def_id.to_def_id(), dep_node));
} else if let Attribute::Parsed(AttributeKind::RustcThenThisWouldNeed(
_,
ref dep_nodes,
)) = *attr
{
for &n in dep_nodes {
let Ok(dep_node) =
DepNode::from_label_string(self.tcx, n.as_str(), def_path_hash)
else {
self.tcx
.dcx()
.emit_fatal(errors::UnrecognizedDepNode { span: n.span, name: n.name });
};
self.then_this_would_need.push((n.span, n.name, hir_id, dep_node));
}
}
}
}

View file

@ -11,13 +11,6 @@ pub(crate) struct UnrecognizedDepNode {
pub name: Symbol,
}
#[derive(Diagnostic)]
#[diag("missing `DepNode` variant")]
pub(crate) struct MissingDepNode {
#[primary_span]
pub span: Span,
}
#[derive(Diagnostic)]
#[diag("no `#[rustc_if_this_changed]` annotation detected")]
pub(crate) struct MissingIfThisChanged {

View file

@ -19,7 +19,6 @@
//! Errors are reported if we are in the suitable configuration but
//! the required condition is not met.
use rustc_ast::ast;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::unord::UnordSet;
use rustc_hir::attrs::{AttributeKind, RustcCleanAttribute};
@ -174,7 +173,7 @@ pub(crate) fn check_clean_annotations(tcx: TyCtxt<'_>) {
struct CleanVisitor<'tcx> {
tcx: TyCtxt<'tcx>,
checked_attrs: FxHashSet<ast::AttrId>,
checked_attrs: FxHashSet<Span>,
}
impl<'tcx> CleanVisitor<'tcx> {
@ -363,7 +362,7 @@ impl<'tcx> CleanVisitor<'tcx> {
let Some(assertion) = self.assertion_maybe(item_id, attr) else {
continue;
};
self.checked_attrs.insert(attr.id);
self.checked_attrs.insert(attr.span);
for label in assertion.clean.items().into_sorted_stable_ord() {
let dep_node = DepNode::from_label_string(self.tcx, label, def_path_hash).unwrap();
self.assert_clean(item_span, dep_node);
@ -412,11 +411,11 @@ impl<'tcx> FindAllAttrs<'tcx> {
self.tcx.sess.psess.config.contains(&(attr.cfg, None))
}
fn report_unchecked_attrs(&self, mut checked_attrs: FxHashSet<ast::AttrId>) {
fn report_unchecked_attrs(&self, mut checked_attrs: FxHashSet<Span>) {
for attr in &self.found_attrs {
if !checked_attrs.contains(&attr.id) {
if !checked_attrs.contains(&attr.span) {
self.tcx.dcx().emit_err(errors::UncheckedClean { span: attr.span });
checked_attrs.insert(attr.id);
checked_attrs.insert(attr.span);
}
}
}

View file

@ -235,6 +235,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
for attr in attrs {
self.check_rustc_clean(attr.span);
}
},
Attribute::Parsed(AttributeKind::RustcIfThisChanged(span, _) | AttributeKind::RustcThenThisWouldNeed(span, _)) => {
self.check_rustc_clean(*span);
}
Attribute::Parsed(
// tidy-alphabetical-start
@ -361,8 +364,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
[sym::diagnostic, sym::on_const, ..] => {
self.check_diagnostic_on_const(attr.span(), hir_id, target, item)
}
[sym::rustc_if_this_changed, ..]
| [sym::rustc_then_this_would_need, ..] => self.check_rustc_clean(attr.span()),
[sym::autodiff_forward, ..] | [sym::autodiff_reverse, ..] => {
self.check_autodiff(hir_id, attr, span, target)
}

View file

@ -1331,7 +1331,6 @@ impl Default for Span {
rustc_index::newtype_index! {
#[orderable]
#[debug_format = "AttrId({})"]
#[derive(HashStable_Generic)]
pub struct AttrId {}
}

View file

@ -1,8 +1,8 @@
error: OK
--> $DIR/dep-graph-assoc-type-codegen.rs:29:5
--> $DIR/dep-graph-assoc-type-codegen.rs:29:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 1 previous error

View file

@ -1,14 +1,14 @@
error: OK
--> $DIR/dep-graph-caller-callee.rs:21:5
--> $DIR/dep-graph-caller-callee.rs:21:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `x` to `typeck`
--> $DIR/dep-graph-caller-callee.rs:32:5
--> $DIR/dep-graph-caller-callee.rs:32:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 2 previous errors

View file

@ -8,7 +8,7 @@
#[rustc_clean(cfg = "foo")] //~ ERROR attribute requires -Z query-dep-graph
fn main() {}
#[rustc_if_this_changed(hir_owner)] //~ ERROR attribute requires -Z query-dep-graph
#[rustc_if_this_changed] //~ ERROR attribute requires -Z query-dep-graph
struct Foo<T> {
f: T,
}

View file

@ -7,8 +7,8 @@ LL | #[rustc_clean(cfg = "foo")]
error: attribute requires -Z query-dep-graph to be enabled
--> $DIR/dep-graph-check-attr.rs:11:1
|
LL | #[rustc_if_this_changed(hir_owner)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[rustc_if_this_changed]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: attribute requires -Z query-dep-graph to be enabled
--> $DIR/dep-graph-check-attr.rs:16:1

View file

@ -1,134 +1,134 @@
error: no path from `WillChange` to `type_of`
--> $DIR/dep-graph-struct-signature.rs:28:5
--> $DIR/dep-graph-struct-signature.rs:28:34
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `WillChange` to `associated_item`
--> $DIR/dep-graph-struct-signature.rs:29:5
--> $DIR/dep-graph-struct-signature.rs:29:34
|
LL | #[rustc_then_this_would_need(associated_item)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^
error: no path from `WillChange` to `trait_def`
--> $DIR/dep-graph-struct-signature.rs:30:5
--> $DIR/dep-graph-struct-signature.rs:30:34
|
LL | #[rustc_then_this_would_need(trait_def)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:36:5
--> $DIR/dep-graph-struct-signature.rs:36:34
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:37:5
--> $DIR/dep-graph-struct-signature.rs:37:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:40:5
--> $DIR/dep-graph-struct-signature.rs:40:34
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:41:5
--> $DIR/dep-graph-struct-signature.rs:41:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:46:5
--> $DIR/dep-graph-struct-signature.rs:46:34
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:53:5
--> $DIR/dep-graph-struct-signature.rs:53:34
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:61:9
--> $DIR/dep-graph-struct-signature.rs:61:38
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:63:9
--> $DIR/dep-graph-struct-signature.rs:63:38
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `WillChange` to `type_of`
--> $DIR/dep-graph-struct-signature.rs:68:5
--> $DIR/dep-graph-struct-signature.rs:68:34
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `WillChange` to `type_of`
--> $DIR/dep-graph-struct-signature.rs:75:5
--> $DIR/dep-graph-struct-signature.rs:75:34
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:81:5
--> $DIR/dep-graph-struct-signature.rs:81:34
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:84:5
--> $DIR/dep-graph-struct-signature.rs:84:34
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `WillChange` to `typeck`
--> $DIR/dep-graph-struct-signature.rs:85:5
--> $DIR/dep-graph-struct-signature.rs:85:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:32:9
--> $DIR/dep-graph-struct-signature.rs:32:38
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:77:9
--> $DIR/dep-graph-struct-signature.rs:77:38
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:48:9
--> $DIR/dep-graph-struct-signature.rs:48:38
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:49:9
--> $DIR/dep-graph-struct-signature.rs:49:38
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:55:9
--> $DIR/dep-graph-struct-signature.rs:55:38
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-struct-signature.rs:56:9
--> $DIR/dep-graph-struct-signature.rs:56:38
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 22 previous errors

View file

@ -1,14 +1,14 @@
error: OK
--> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:33:5
--> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:33:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `x::<impl Foo for u32>` to `typeck`
--> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:42:5
--> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:42:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 2 previous errors

View file

@ -1,14 +1,14 @@
error: no path from `x::<impl Foo for char>` to `typeck`
--> $DIR/dep-graph-trait-impl-two-traits.rs:32:5
--> $DIR/dep-graph-trait-impl-two-traits.rs:32:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `x::<impl Foo for char>` to `typeck`
--> $DIR/dep-graph-trait-impl-two-traits.rs:41:5
--> $DIR/dep-graph-trait-impl-two-traits.rs:41:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 2 previous errors

View file

@ -1,32 +1,32 @@
error: OK
--> $DIR/dep-graph-trait-impl.rs:28:5
--> $DIR/dep-graph-trait-impl.rs:28:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-trait-impl.rs:33:5
--> $DIR/dep-graph-trait-impl.rs:33:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-trait-impl.rs:38:5
--> $DIR/dep-graph-trait-impl.rs:38:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-trait-impl.rs:43:5
--> $DIR/dep-graph-trait-impl.rs:43:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: no path from `x::<impl Foo for char>` to `typeck`
--> $DIR/dep-graph-trait-impl.rs:56:5
--> $DIR/dep-graph-trait-impl.rs:56:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 5 previous errors

View file

@ -1,74 +1,74 @@
error: no path from `TypeAlias` to `type_of`
--> $DIR/dep-graph-type-alias.rs:18:1
--> $DIR/dep-graph-type-alias.rs:18:30
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:20:5
--> $DIR/dep-graph-type-alias.rs:20:34
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `TypeAlias` to `type_of`
--> $DIR/dep-graph-type-alias.rs:25:1
--> $DIR/dep-graph-type-alias.rs:25:30
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:28:9
--> $DIR/dep-graph-type-alias.rs:28:38
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `TypeAlias` to `type_of`
--> $DIR/dep-graph-type-alias.rs:34:1
--> $DIR/dep-graph-type-alias.rs:34:30
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: no path from `TypeAlias` to `type_of`
--> $DIR/dep-graph-type-alias.rs:42:1
--> $DIR/dep-graph-type-alias.rs:42:30
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:49:1
--> $DIR/dep-graph-type-alias.rs:49:30
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:52:1
--> $DIR/dep-graph-type-alias.rs:52:30
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:53:1
--> $DIR/dep-graph-type-alias.rs:53:30
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:36:5
--> $DIR/dep-graph-type-alias.rs:36:34
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:44:5
--> $DIR/dep-graph-type-alias.rs:44:34
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: OK
--> $DIR/dep-graph-type-alias.rs:45:5
--> $DIR/dep-graph-type-alias.rs:45:34
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
error: aborting due to 12 previous errors

View file

@ -1,8 +1,8 @@
error: OK
--> $DIR/dep-graph-variance-alias.rs:19:1
--> $DIR/dep-graph-variance-alias.rs:19:30
|
LL | #[rustc_then_this_would_need(variances_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^
error: aborting due to 1 previous error