Skip to content

Commit a413f77

Browse files
committed
Auto merge of rust-lang#143363 - jdonszelmann:rollup-7cv1kql, r=jdonszelmann
Rollup of 6 pull requests Successful merges: - rust-lang#134006 (setup typos check in CI) - rust-lang#142876 (Port `#[target_feature]` to new attribute parsing infrastructure) - rust-lang#143038 (avoid suggesting traits from private dependencies) - rust-lang#143083 (Fix rustdoc not correctly showing attributes on re-exports) - rust-lang#143283 (document optional jobs) - rust-lang#143329 (minicore: use core's `diagnostic::on_unimplemented` messages) Failed merges: - rust-lang#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9e64506 + f85283b commit a413f77

File tree

170 files changed

+951
-518
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+951
-518
lines changed

.github/workflows/spellcheck.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This workflow runs spellcheck job
2+
3+
name: Spellcheck
4+
on:
5+
pull_request:
6+
branches:
7+
- "**"
8+
9+
jobs:
10+
spellcheck:
11+
name: run spellchecker
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the source code
15+
uses: actions/checkout@v4
16+
17+
- name: check typos
18+
# sync version with src/tools/tidy/src/ext_tool_checks.rs in spellcheck_runner
19+
uses: crate-ci/typos@v1.34.0
20+
with:
21+
# sync target files with src/tools/tidy/src/ext_tool_checks.rs in check_impl
22+
files: ./compiler ./library ./src/bootstrap ./src/librustdoc
23+
config: ./typos.toml

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,6 +4629,7 @@ dependencies = [
46294629
"itertools",
46304630
"rustc_abi",
46314631
"rustc_ast",
4632+
"rustc_attr_data_structures",
46324633
"rustc_data_structures",
46334634
"rustc_errors",
46344635
"rustc_fluent_macro",

REUSE.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ path = [
3636
"rustfmt.toml",
3737
"rust-bors.toml",
3838
"triagebot.toml",
39+
"typos.toml",
3940
"x",
4041
"x.ps1",
4142
"x.py",

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ impl Expr {
13441344
}
13451345
}
13461346

1347-
/// Returns an expression with (when possible) *one* outter brace removed
1347+
/// Returns an expression with (when possible) *one* outer brace removed
13481348
pub fn maybe_unwrap_block(&self) -> &Expr {
13491349
if let ExprKind::Block(block, None) = &self.kind
13501350
&& let [stmt] = block.stmts.as_slice()

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ macro_rules! common_visitor_and_walkers {
142142
)?
143143

144144
// Methods in this trait have one of three forms, with the last two forms
145-
// only occuring on `MutVisitor`:
145+
// only occurring on `MutVisitor`:
146146
//
147147
// fn visit_t(&mut self, t: &mut T); // common
148148
// fn flat_map_t(&mut self, t: T) -> SmallVec<[T; 1]>; // rare

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use rustc_abi::ExternAbi;
22
use rustc_ast::ptr::P;
33
use rustc_ast::visit::AssocCtxt;
44
use rustc_ast::*;
5+
use rustc_attr_data_structures::{AttributeKind, find_attr};
56
use rustc_errors::{E0570, ErrorGuaranteed, struct_span_code_err};
67
use rustc_hir::def::{DefKind, PerNS, Res};
78
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
@@ -1621,7 +1622,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
16211622
let safety = self.lower_safety(h.safety, default_safety);
16221623

16231624
// Treat safe `#[target_feature]` functions as unsafe, but also remember that we did so.
1624-
let safety = if attrs.iter().any(|attr| attr.has_name(sym::target_feature))
1625+
let safety = if find_attr!(attrs, AttributeKind::TargetFeature { .. })
16251626
&& safety.is_safe()
16261627
&& !self.tcx.sess.target.is_like_wasm
16271628
{

compiler/rustc_ast_passes/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ast_passes_abi_cannot_be_coroutine =
22
functions with the {$abi} ABI cannot be `{$coroutine_kind_str}`
3-
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definiton
3+
.suggestion = remove the `{$coroutine_kind_str}` keyword from this definition
44
55
ast_passes_abi_custom_safe_foreign_function =
66
foreign functions with the "custom" ABI cannot be safe

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ pub enum AttributeKind {
198198
Align { align: Align, span: Span },
199199

200200
/// Represents `#[rustc_allow_const_fn_unstable]`.
201-
AllowConstFnUnstable(ThinVec<Symbol>),
201+
AllowConstFnUnstable(ThinVec<Symbol>, Span),
202202

203203
/// Represents `#[allow_internal_unstable]`.
204-
AllowInternalUnstable(ThinVec<(Symbol, Span)>),
204+
AllowInternalUnstable(ThinVec<(Symbol, Span)>, Span),
205205

206206
/// Represents `#[rustc_as_ptr]` (used by the `dangling_pointers_from_temporaries` lint).
207207
AsPtr(Span),
@@ -309,6 +309,9 @@ pub enum AttributeKind {
309309
span: Span,
310310
},
311311

312+
/// Represents `#[target_feature(enable = "...")]`
313+
TargetFeature(ThinVec<(Symbol, Span)>, Span),
314+
312315
/// Represents `#[track_caller]`
313316
TrackCaller(Span),
314317

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ impl AttributeKind {
4242
RustcLayoutScalarValidRangeStart(..) => Yes,
4343
RustcObjectLifetimeDefault => No,
4444
SkipDuringMethodDispatch { .. } => No,
45+
TargetFeature(..) => No,
4546
TrackCaller(..) => Yes,
4647
Used { .. } => No,
4748
}

compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ pub(crate) struct AllowInternalUnstableParser;
1313
impl<S: Stage> CombineAttributeParser<S> for AllowInternalUnstableParser {
1414
const PATH: &[Symbol] = &[sym::allow_internal_unstable];
1515
type Item = (Symbol, Span);
16-
const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowInternalUnstable;
16+
const CONVERT: ConvertFn<Self::Item> =
17+
|items, span| AttributeKind::AllowInternalUnstable(items, span);
1718
const TEMPLATE: AttributeTemplate = template!(Word, List: "feat1, feat2, ...");
1819

1920
fn extend<'c>(
@@ -30,7 +31,8 @@ pub(crate) struct AllowConstFnUnstableParser;
3031
impl<S: Stage> CombineAttributeParser<S> for AllowConstFnUnstableParser {
3132
const PATH: &[Symbol] = &[sym::rustc_allow_const_fn_unstable];
3233
type Item = Symbol;
33-
const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowConstFnUnstable;
34+
const CONVERT: ConvertFn<Self::Item> =
35+
|items, first_span| AttributeKind::AllowConstFnUnstable(items, first_span);
3436
const TEMPLATE: AttributeTemplate = template!(Word, List: "feat1, feat2, ...");
3537

3638
fn extend<'c>(

0 commit comments

Comments
 (0)