Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_attr_parsing/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl<'sess> AttributeParser<'sess, Early> {
sym,
target_span,
target_node_id,
Target::Crate, // Does not matter, we're not going to emit errors anyways
features,
ShouldEmit::Nothing,
)
Expand All @@ -79,14 +80,15 @@ impl<'sess> AttributeParser<'sess, Early> {
sym: Symbol,
target_span: Span,
target_node_id: NodeId,
target: Target,
features: Option<&'sess Features>,
should_emit: ShouldEmit,
) -> Option<Attribute> {
let mut parsed = Self::parse_limited_all(
sess,
attrs,
Some(sym),
Target::Crate, // Does not matter, we're not going to emit errors anyways
target,
target_span,
target_node_id,
features,
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_interface/src/passes.rs
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the changes in this file are for crate-level attributes, hence the Target::crate.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use rustc_hir::def_id::{LOCAL_CRATE, StableCrateId, StableCrateIdMap};
use rustc_hir::definitions::Definitions;
use rustc_hir::limit::Limit;
use rustc_hir::lints::DelayedLint;
use rustc_hir::{Attribute, MaybeOwner, find_attr};
use rustc_hir::{Attribute, MaybeOwner, Target, find_attr};
use rustc_incremental::setup_dep_graph;
use rustc_lint::{
BufferedEarlyLint, DecorateAttrLint, EarlyCheckNode, LintStore, unerased_lint_store,
Expand Down Expand Up @@ -1372,6 +1372,7 @@ pub(crate) fn parse_crate_name(
sym::crate_name,
DUMMY_SP,
rustc_ast::node_id::CRATE_NODE_ID,
Target::Crate,
None,
emit_errors,
)?
Expand Down Expand Up @@ -1421,6 +1422,7 @@ pub fn collect_crate_types(
sym::crate_type,
crate_span,
CRATE_NODE_ID,
Target::Crate,
None,
ShouldEmit::EarlyFatal { also_emit_lints: false },
)
Expand Down Expand Up @@ -1477,6 +1479,7 @@ fn get_recursion_limit(krate_attrs: &[ast::Attribute], sess: &Session) -> Limit
sym::recursion_limit,
DUMMY_SP,
rustc_ast::node_id::CRATE_NODE_ID,
Target::Crate,
None,
// errors are fatal here, but lints aren't.
// If things aren't fatal we continue, and will parse this again.
Expand Down
Loading