Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ca1104f
Revert "Reimplement _mm_mulhi_epi16, _mm_mulhi_epu16, _mm256_mulhi_ep…
RalfJung Sep 5, 2026
be4e271
de-constify dependent intrinsics and tests
RalfJung Sep 5, 2026
33d0f26
fmt
RalfJung Sep 5, 2026
38dff1e
also adjust AVX512 intrinsics
RalfJung Sep 5, 2026
c76d283
loongarch: Use LLVM intrinsics for vdiv/vmod
heiher Sep 18, 2026
bb19e48
Merge pull request #2219 from RalfJung/mulhi
Amanieu Sep 29, 2026
84ed32a
Revert "Reimplement _mm_avg_epu8, _mm_avg_epu16, _mm256_avg_epu8 and …
RalfJung Sep 29, 2026
9bdda89
also adjust AVX512 intrinsics
RalfJung Sep 29, 2026
bd9f2cf
Prepare for merging from rust-lang/rust
folkertdev Sep 30, 2026
4aaa01d
Merge ref '21b707e3f97e' from rust-lang/rust
folkertdev Sep 30, 2026
1eb4d21
Merge pull request #2236 from folkertdev/main
folkertdev Sep 30, 2026
98af179
Add libs-nominated triagebot config
clarfonthey Sep 30, 2026
64b1d91
Merge pull request #2235 from clarfonthey/triagebot-libs
clarfonthey Sep 30, 2026
42f00d9
Don't ping
clarfonthey Sep 30, 2026
cd4b552
Merge pull request #2237 from clarfonthey/triagebot-libs
nia-e Sep 30, 2026
5a39683
Fix the nvptx f16x2 intrinsic annotations
Liberxue Oct 2, 2026
e054f1e
Merge pull request #2229 from heiher/revert-vidv-vmod
folkertdev Oct 3, 2026
a2b94fe
Merge pull request #2238 from Liberxue/fix/nvptx-f16x2-annotations
folkertdev Oct 3, 2026
edcf15a
Prepare for merging from rust-lang/rust
invalid-email-address Oct 5, 2026
72de1f0
Merge ref '260f1acad9d7' from rust-lang/rust
invalid-email-address Oct 5, 2026
d1492dc
Merge pull request #2240 from rust-lang/rustc-pull
adamgemmell Oct 7, 2026
6b36af2
ci: Ignore `unpinned-uses` for `josh-sync/rustc-pull`
hashcatHitman Oct 7, 2026
7345c38
ci: Pin `actions/checkout` to 6.1.0 hash
hashcatHitman Oct 7, 2026
d1a8643
Merge pull request #2234 from RalfJung/avg
Amanieu Oct 10, 2026
2f1130c
Remove myself from the review rotation
sayantn Oct 13, 2026
5858358
Merge pull request #2255 from sayantn/hiatus
Amanieu Oct 13, 2026
eb5b2a3
Merge pull request #2244 from hashcatHitman/ref-version-mismatch_and_…
folkertdev Oct 13, 2026
8a61540
breakpoint: more explicit guidance regarding SIGTRAP handling
RalfJung Oct 3, 2026
99af695
edits by Josh
RalfJung Oct 14, 2026
2cabd11
Add the `Dyn Compatibility` heading all the time in the sidebar since…
GuillaumeGomez Oct 13, 2026
c7ea602
add test for literals in lint attributes
annieversary Oct 17, 2026
7142f9a
improve diagnostic for literals in lint attributes
annieversary Oct 17, 2026
1cb7727
rename sub to kind in attribute diagnostics
annieversary Oct 17, 2026
3c7ed77
Add more syscall doc aliases to std docs
SabrinaJewson Oct 18, 2026
4245f27
change label in BadAttributeLit to be more descriptive
annieversary Oct 18, 2026
1c9a4b7
change t/u/l/lint-attribute-literals to not deduplicate-diagnostics
annieversary Oct 18, 2026
db8f02f
Generate redirect pages for hidden modules
notriddle Oct 18, 2026
7213e55
abort_on_unwind: clarify docs
RalfJung Oct 18, 2026
f9d044c
simplify BadAttributeLit diagnostic message
annieversary Oct 18, 2026
31b27ab
add test for the BadAttributeLitHelp::Other case
annieversary Oct 18, 2026
1df92e9
Rollup merge of #164518 - folkertdev:stdarch-sync-2026-10-18, r=folke…
JonathanBrouwer Oct 18, 2026
15ed485
Rollup merge of #164497 - notriddle:broken-rustdoc-link, r=GuillaumeG…
JonathanBrouwer Oct 18, 2026
e3537f8
Rollup merge of #113891 - SabrinaJewson:more-syscall-aliases, r=clarf…
JonathanBrouwer Oct 18, 2026
8d4a9d0
Rollup merge of #163692 - RalfJung:backtrace-sigtrap, r=clarfonthey
JonathanBrouwer Oct 18, 2026
fe7c43e
Rollup merge of #164268 - GuillaumeGomez:dyn-compatibility, r=lolbina…
JonathanBrouwer Oct 18, 2026
71cdde5
Rollup merge of #164486 - annieversary:bad-attribute-lit, r=JonathanB…
JonathanBrouwer Oct 18, 2026
2d7b05a
Rollup merge of #164511 - RalfJung:abort_on_unwind, r=hanna-kruppe
JonathanBrouwer Oct 18, 2026
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
114 changes: 63 additions & 51 deletions compiler/rustc_attr_parsing/src/attributes/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use thin_vec::ThinVec;

use crate::attributes::{AcceptMapping, AttributeParser, AttributeStability};
use crate::context::{AcceptContext, ExpectStringLiteral, FinalizeContext};
use crate::parser::ArgParser;
use crate::parser::{ArgParser, MetaItemOrLitParser};
use crate::target_checking::AllowedTargets;
use crate::target_checking::Policy::{Allow, Warn};
use crate::{AttributeTemplate, diagnostics, template};
Expand Down Expand Up @@ -37,7 +37,7 @@ impl LintParser {
if !p.path().word_is(sym::reason) {
cx.emit_err(diagnostics::MalformedAttribute {
span: p.span(),
sub: diagnostics::MalformedAttributeSub::BadAttributeArgument(p.span()),
kind: diagnostics::MalformedAttributeKind::BadAttributeArgument(p.span()),
});
} else {
parsers = &parsers[..(parsers.len() - 1)];
Expand All @@ -48,58 +48,70 @@ impl LintParser {
};

for item in parsers {
if let Some(p) = item.meta_item() {
match p.args() {
ArgParser::NoArgs => {
let (tool, lint_name, rest) = match &*p.path().0.segments {
[] => unreachable!(),
[lint_name] => (None, lint_name.ident.name, None),
[tool, lint_name] => (Some(tool.ident), lint_name.ident.name, None),
[tool, lint_name, rest @ ..] => {
let rest = rest
.iter()
.map(|s| s.ident.name)
.collect::<Vec<_>>()
.into();
(Some(tool.ident), lint_name.ident.name, Some(rest))
}
};
match item {
MetaItemOrLitParser::MetaItemParser(p) => {
match p.args() {
ArgParser::NoArgs => {
let (tool, lint_name, rest) = match &*p.path().0.segments {
[] => unreachable!(),
[lint_name] => (None, lint_name.ident.name, None),
[tool, lint_name] => {
(Some(tool.ident), lint_name.ident.name, None)
}
[tool, lint_name, rest @ ..] => {
let rest = rest
.iter()
.map(|s| s.ident.name)
.collect::<Vec<_>>()
.into();
(Some(tool.ident), lint_name.ident.name, Some(rest))
}
};

self.lints.push(LintCheck {
tool,
lint_name,
lint_span: p.span(),
kind,
attr_id,
reason,
attr_span,
rest,
})
}
// We're found a `reason = "reason"` but we're not the last element.
ArgParser::NameValue(nv) if p.path().word_is(sym::reason) => {
cx.emit_err(diagnostics::MalformedAttribute {
span: p.span(),
sub: diagnostics::MalformedAttributeSub::ReasonMustComeLast(
item.span(),
),
});
nv.expect_string_literal(cx);
}
ArgParser::NameValue(_) | ArgParser::List(_) => {
cx.emit_err(diagnostics::MalformedAttribute {
span: p.span(),
sub: diagnostics::MalformedAttributeSub::BadAttributeArgument(
item.span(),
),
});
self.lints.push(LintCheck {
tool,
lint_name,
lint_span: p.span(),
kind,
attr_id,
reason,
attr_span,
rest,
})
}
// We've found a `reason = "reason"` but we're not the last element.
ArgParser::NameValue(nv) if p.path().word_is(sym::reason) => {
cx.emit_err(diagnostics::MalformedAttribute {
span: p.span(),
kind: diagnostics::MalformedAttributeKind::ReasonMustComeLast(
item.span(),
),
});
nv.expect_string_literal(cx);
}
ArgParser::NameValue(_) | ArgParser::List(_) => {
cx.emit_err(diagnostics::MalformedAttribute {
span: p.span(),
kind: diagnostics::MalformedAttributeKind::BadAttributeArgument(
item.span(),
),
});
}
}
}
} else {
cx.emit_err(diagnostics::MalformedAttribute {
span: item.span(),
sub: diagnostics::MalformedAttributeSub::BadAttributeArgument(item.span()),
});
MetaItemOrLitParser::Lit(lit) => {
cx.emit_err(diagnostics::BadAttributeLit {
span: item.span(),
help: if lit.kind.is_str() {
diagnostics::BadAttributeLitHelp::StrLit {
sym: lit.symbol,
kind: kind.sym(),
}
} else {
diagnostics::BadAttributeLitHelp::Other { kind: kind.sym() }
},
});
}
}
}
if parsers.is_empty() {
Expand Down
22 changes: 20 additions & 2 deletions compiler/rustc_attr_parsing/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2139,17 +2139,35 @@ pub(crate) struct MalformedAttribute {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub sub: MalformedAttributeSub,
pub kind: MalformedAttributeKind,
}

#[derive(Subdiagnostic)]
pub(crate) enum MalformedAttributeSub {
pub(crate) enum MalformedAttributeKind {
#[label("bad attribute argument")]
BadAttributeArgument(#[primary_span] Span),
#[label("reason in lint attribute must come last")]
ReasonMustComeLast(#[primary_span] Span),
}

#[derive(Diagnostic)]
#[diag("expected a lint, found literal")]
pub(crate) struct BadAttributeLit {
#[primary_span]
#[label("not the name of a lint")]
pub span: Span,
#[subdiagnostic]
pub help: BadAttributeLitHelp,
}

#[derive(Subdiagnostic)]
pub(crate) enum BadAttributeLitHelp {
#[help("try using `#[{$kind}({$sym})]`")]
StrLit { sym: Symbol, kind: Symbol },
#[help("for example, write `#[{$kind}(dead_code)]` for `dead_code`")]
Other { kind: Symbol },
}

#[derive(Subdiagnostic)]
pub(crate) enum UnusedNote {
#[note("attribute `{$name}` with an empty list has no effect")]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/io/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub enum CopyState {
/// descriptors if possible.
///
/// Note that platform-specific behavior may change in the future.
#[doc(alias = "copy_file_range", alias = "sendfile", alias = "splice")]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> Result<u64>
where
Expand Down
7 changes: 6 additions & 1 deletion library/core/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ pub macro global_asm("assembly template", $(operands,)* $(options($(option),*))?
/// The precise behavior is not guaranteed, it depends on the architecture and operating system.
/// Not all architectures guarantee that a breakpoint instruction interrupts execution in the absence
/// of a debugger, and not all operating systems and execution environments guarantee that such an
/// interrupt aborts the current process.
/// interrupt aborts the current process. On operating systems where the behavior of the interrupt
/// can be overwritten by the application (e.g. via a SIGTRAP signal handler), the application
/// *should* make sure to still abort the process. However, code not fully in control of that
/// application state (e.g. signal handlers) cannot always rely on that for soundness.
/// If you do rely on this, such that your code's soundness requires applications to not continue
/// from your breakpoints, please document that for your users.
///
/// The precise instruction is guaranteed only on the following targets:
/// - On x86 targets, this produces an `int3` instruction.
Expand Down
7 changes: 4 additions & 3 deletions library/core/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ pub macro unreachable_2021 {
/// Invokes a closure, aborting if the closure unwinds.
///
/// When compiled with aborting panics, this function is effectively a no-op.
/// With unwinding panics, an unwind results in another call into the panic
/// hook followed by a process abort.
/// With unwinding panics, an unwind that would leave the closure results in another call into the
/// panic handler / panic hook followed by a process abort. (Locals in the closure get dropped as
/// usual.) Unwinds that get caught inside the closure still behave as normal.
///
/// # Notes
///
Expand All @@ -114,7 +115,7 @@ pub macro unreachable_2021 {
/// to prevent unwinds. However, note that `extern "C" fn` will automatically
/// convert unwinds to aborts, so using this function isn't necessary for FFI.
#[unstable(feature = "abort_unwind", issue = "130338")]
#[rustc_nounwind]
#[rustc_nounwind] // this attribute does all the actual work here
pub fn abort_on_unwind<F: FnOnce() -> R, R>(f: F) -> R {
f()
}
Expand Down
7 changes: 5 additions & 2 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3039,7 +3039,7 @@ pub fn remove_file<P: AsRef<Path>>(path: P) -> io::Result<()> {
/// Ok(())
/// }
/// ```
#[doc(alias = "stat")]
#[doc(alias = "stat", alias = "GetFileAttributes", alias = "GetFileAttributesEx")]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "fs_metadata")]
pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
Expand Down Expand Up @@ -3080,7 +3080,7 @@ pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
/// Ok(())
/// }
/// ```
#[doc(alias = "lstat")]
#[doc(alias = "lstat", alias = "GetFileAttributes", alias = "GetFileAttributesEx")]
#[stable(feature = "symlink_metadata", since = "1.1.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "fs_symlink_metadata")]
pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
Expand Down Expand Up @@ -3262,6 +3262,7 @@ pub fn rename_noreplace<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::R
/// }
/// ```
#[doc(alias = "cp")]
#[doc(alias = "copy_file_range")]
#[doc(alias = "CopyFile", alias = "CopyFileEx")]
#[doc(alias = "fclonefileat", alias = "fcopyfile")]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -3511,6 +3512,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
/// Ok(())
/// }
/// ```
#[doc(alias = "mkdir", alias = "CreateDirectory")]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "fs_create_dir_all")]
pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
Expand Down Expand Up @@ -3626,6 +3628,7 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
/// Ok(())
/// }
/// ```
#[doc(alias = "rm")]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "fs_remove_dir_all")]
pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/os/windows/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ impl FileTimesExt for fs::FileTimes {
/// the process as an administrator.
///
/// [symlink-security]: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
#[doc(alias = "CreateSymbolicLink", alias = "CreateSymbolicLinkW")]
#[stable(feature = "symlink", since = "1.1.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "fs_symlink_file")]
pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
Expand Down Expand Up @@ -949,6 +950,7 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
/// the process as an administrator.
///
/// [symlink-security]: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
#[doc(alias = "CreateSymbolicLink", alias = "CreateSymbolicLinkW")]
#[stable(feature = "symlink", since = "1.1.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "fs_symlink_dir")]
pub fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
Expand Down
14 changes: 7 additions & 7 deletions library/stdarch/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: ci/style.sh
Expand All @@ -18,7 +18,7 @@ jobs:
needs: [ style ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: ci/dox.sh
Expand All @@ -30,7 +30,7 @@ jobs:
needs: [ style ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo test --manifest-path crates/stdarch-verify/Cargo.toml
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
# build_std: true

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: |
rustup update nightly --no-self-update
Expand Down Expand Up @@ -298,7 +298,7 @@ jobs:
- target: armv7-unknown-linux-gnueabihf
cc: gcc
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: |
rustup update nightly --no-self-update
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
env:
STDARCH_GEN_MODE: check
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- name: Check arm spec
Expand All @@ -352,7 +352,7 @@ jobs:
name: Run some tests with miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install Rust
run: rustup update nightly && rustup default nightly && rustup component add miri
- name: Run miri tests
Expand Down
1 change: 1 addition & 0 deletions library/stdarch/.github/workflows/rustc-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
pull:
if: github.repository == 'rust-lang/stdarch'
# zizmor: ignore[unpinned-uses] We explicitly want to track the main branch.
uses: rust-lang/josh-sync/.github/workflows/rustc-pull.yml@main
with:
github-app-id: ${{ vars.APP_CLIENT_ID }}
Expand Down
Loading
Loading