Move target checking for #[lang] to the attribute parser#158223
Move target checking for #[lang] to the attribute parser#158223JonathanBrouwer wants to merge 3 commits into
Conversation
d920642 to
6f84b3b
Compare
|
Some changes occurred to diagnostic attributes. cc @mejrs Some changes occurred in compiler/rustc_attr_parsing |
6f84b3b to
dfb0455
Compare
This comment has been minimized.
This comment has been minimized.
dfb0455 to
9ad6dbf
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| let allowed_targets: &[_] = if lang_item == LangItem::PanicImpl { | ||
| &[Allow(Target::Fn), Allow(Target::ForeignFn)] | ||
| } else { | ||
| &[Allow(lang_item.target())] | ||
| }; |
There was a problem hiding this comment.
Thoughts on changing LangItem::target to return &[Target] so that we don't need to special case PanicImpl here? Although I think I can live with this if we aren't getting more multi target lang items.
There was a problem hiding this comment.
#[lang = "panic_impl"] may be gone in the near future. I have a branch to replace it with an EII. It is mostly blocked on some diagnostics improvements right now.
There was a problem hiding this comment.
I did it this way because the panicimpl lang item will probably soon be replaced with EEIs.
The fact that panic_impl is valid on foreign functions at all is already a complete hack, I hope this won't be used in more places
There was a problem hiding this comment.
Yeah, I expect that all future cases will either use EII or #[rustc_std_internal_symbol].
|
@bors r=mejrs rollup |
Move target checking for #[lang] to the attribute parser Work towards removing the `ALL_TARGETS` list. r? @mejrs
…uwer Rollup of 16 pull requests Successful merges: - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Move target checking for #[lang] to the attribute parser Work towards removing the `ALL_TARGETS` list. r? @mejrs
Move target checking for #[lang] to the attribute parser Work towards removing the `ALL_TARGETS` list. r? @mejrs
…uwer Rollup of 23 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158263 (Only load the feature list once in the entire resolver) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Move target checking for #[lang] to the attribute parser Work towards removing the `ALL_TARGETS` list. r? @mejrs
Rollup of 27 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Move target checking for #[lang] to the attribute parser Work towards removing the `ALL_TARGETS` list. r? @mejrs
Work towards removing the
ALL_TARGETSlist.r? @mejrs