Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
c6cb702
constify `From` impls for the `Cow::Borrowed` variant
npmccallum Sep 13, 2025
1a43039
Fix typos and grammar in library documentation
him2him2 Feb 10, 2026
3ffc0fb
rustdoc: warn on improperly interleaved HTML/MD
notriddle Jul 2, 2026
cb61eb4
rustdoc: add tests for MD/HTML interleaving
notriddle Jul 2, 2026
c9be91c
Clean up and test paragraph and table warn
notriddle Jul 9, 2026
d062ad2
Fix implicit_provenance_casts warnings on Xous
bjorn3 Jul 12, 2026
60f100b
Add Instance::requires_caller_location to rustc_public
celinval Jul 12, 2026
a924b6d
Add Span::caller_location to rustc_public
celinval Jul 12, 2026
e91e00f
enable UNREACHABLE_CFG_SELECT_PREDICATES lint
hkBst Jul 12, 2026
9bc15a8
html_tags: remove `in_code_block` no-op branch
notriddle Jul 16, 2026
047068a
html_tags: rename tags based on camelid's nit
notriddle Jul 16, 2026
fe11f5e
rustdoc: lint MD in HTML script/style
notriddle Jul 16, 2026
1e452c3
Fix(lib/fs/win): Fall back on Win32 delete for Dir::remove_file
PaulDance Jul 17, 2026
5c88a1c
[rpub] Replace Span::caller_location by Body's one
celinval Jul 16, 2026
d3e8e6b
Get rid of expose_provenance on Xous
bjorn3 Jul 20, 2026
7b0af92
Review comments
bjorn3 Jul 21, 2026
10100f2
Update wasm-component-ld to 0.5.27
alexcrichton Jul 21, 2026
ebbdcf0
Split non-local `semicolon_in_expressions_from_macros` into a separat…
joshtriplett Jul 22, 2026
c1a4b72
Add (manual) example for `semicolon_in_expressions_from_non_local_mac…
joshtriplett Jul 22, 2026
66d0fb8
stepping into `NormalizesTo` where-clauses may be productive
lcnr Apr 16, 2026
4233b3b
Collect constants within `global_asm!` in collector
nbdd0121 Mar 12, 2025
f44536c
Add FnDef/Closure -> FnPtr coercion for inline asm const operand
nbdd0121 Dec 5, 2025
bf74b6c
Give global_asm symbol names
nbdd0121 Dec 15, 2025
b44bea2
Delay stringification of const to backend
nbdd0121 Dec 18, 2025
ca40339
Unify handling of asm const and sym using CTFE
nbdd0121 Dec 18, 2025
4c39d62
Unify handling of `GlobalAlloc` inside backend
nbdd0121 Dec 19, 2025
338d560
Handle pointers with offset for asm const
nbdd0121 Dec 18, 2025
6deaed5
Support codegen of asm const pointers without provenance
nbdd0121 Dec 18, 2025
1fd34e4
Give codegen units symbol names that backend can use
nbdd0121 Jun 10, 2026
c95d35e
Generate unique symbol names if const pointers refer to promoted static
nbdd0121 Dec 19, 2025
aabf824
optimization: don't look for diagnostic/canonical items without rustc…
mejrs Jul 22, 2026
77977f9
implement `CovariantUnsafeCell`
WaffleLapkin Jul 22, 2026
c37239a
add a test checking that `CovariantUnsafeCell` is covariant
WaffleLapkin Jul 22, 2026
e3712ee
x test cargo-miri: run all subcrate tests as well
RalfJung Jul 22, 2026
b7973ab
clarify some potentially-confusing parts of the UnsafeCell docs
RalfJung Jul 22, 2026
678de5f
allow accessing the contents of UnsafeCell without going through get …
RalfJung Jul 22, 2026
8ed6fff
Previously both free functions and associated functions creates a FnD…
Shourya742 Jul 11, 2026
ff7f240
emit error for both AssocFn and Fn const lowering and add fixme
Shourya742 Jul 23, 2026
421d5f5
bless the fallout
Shourya742 Jul 23, 2026
8242b33
document #[global_allocator] constraints
RalfJung Jul 22, 2026
73ff59f
Implement asm_const_ptr feature
nbdd0121 Oct 24, 2024
5d22dac
Add test if asm const are MIR inlined and monomorphized twice
nbdd0121 Apr 22, 2026
0316085
Expand invalid-const-operand test case to cover &str and &CStr
nbdd0121 Jul 22, 2026
a14d50a
rustdoc-js: ignore editor temp files in test folder discovery
AayushMainali-Github Jul 23, 2026
af56582
Avoid `#[target_features]`
nnethercote Jul 24, 2026
ef765ba
rustdoc: use `to_ascii_lowercase` for HTML tags
notriddle Jul 24, 2026
ef33862
rustdoc: helper method for generating doc comments
notriddle Jul 24, 2026
158fdbf
when bailing on ambiguity, don't force other results to ambig
lcnr Apr 28, 2026
f176d8b
std::sync::poison: disable auto_cfg on PoisonError::new
Vastargazing Jul 24, 2026
f8711a1
reuse regular exported_non_generic_symbols logic in Miri
RalfJung Jul 22, 2026
2dc6470
add `FnHeader::span`
folkertdev Jul 23, 2026
b16960f
make `ident` optional in `check_extern_fn_signature`
folkertdev Jul 23, 2026
180f48d
add `BorrowedFnSig` to prevent a clone down the road
folkertdev Jul 23, 2026
f7a98cb
add `FnPtrTy::header`
folkertdev Jul 23, 2026
152ac58
run ABI checks on function pointer types
folkertdev Jul 23, 2026
55c729f
disallow `!` (i.e. `Never`) as a `extern "custom"` return type
folkertdev Jul 23, 2026
a2c59e9
test `extern "custom"` restrictions on function pointers
folkertdev Jul 23, 2026
d0dde60
improve suggestion when `safe` is used on function pointers
folkertdev Jul 23, 2026
99ff7d2
bootstrap: use cc::Tool for compiler detection.
paradoxicalguy Jul 21, 2026
1f8b15f
Fix cfg_attr inner attributes in file modules
Dnreikronos Jul 25, 2026
dcc9c46
iter: extend step_by specialization to cover StepBy<RangeIter<{intege…
Lfan-ke Jul 25, 2026
920e05e
Rollup merge of #138618 - nbdd0121:asm_const_ptr, r=bjorn3
jhpratt Jul 26, 2026
5c2feae
Rollup merge of #157962 - Shourya742:2026-06-16-function-x-cannot-be-…
jhpratt Jul 26, 2026
65d66a6
Rollup merge of #158709 - notriddle:html-lint-interleaving, r=camelid…
jhpratt Jul 26, 2026
256a9cc
Rollup merge of #159174 - bjorn3:fix_xous_warnings, r=Darksonn
jhpratt Jul 26, 2026
e1d138a
Rollup merge of #159179 - hkBst:patch-7, r=davidtwco
jhpratt Jul 26, 2026
8faaea1
Rollup merge of #159518 - Lfan-ke:fix/step-by-range-iter-specializati…
jhpratt Jul 26, 2026
37b47bd
Rollup merge of #159673 - paradoxicalguy:fix-cc-debuginfo-map-detecti…
jhpratt Jul 26, 2026
6317ca2
Rollup merge of #159700 - joshtriplett:semicolon-in-expressions-from-…
jhpratt Jul 26, 2026
96dd5a8
Rollup merge of #159720 - RalfJung:global-allocator-opsem-magic, r=aa…
jhpratt Jul 26, 2026
c5e9c91
Rollup merge of #159732 - mejrs:attribute_crawler, r=nnethercote
jhpratt Jul 26, 2026
6cbc5a2
Rollup merge of #159738 - WaffleLapkin:covariant-unsafe-cell, r=jhpratt
jhpratt Jul 26, 2026
d1b8ea5
Rollup merge of #159740 - RalfJung:miri-dedup-exported-symbols, r=bjorn3
jhpratt Jul 26, 2026
aa1dbb7
Rollup merge of #159780 - folkertdev:extern-custom-check-fn-ptrs, r=W…
jhpratt Jul 26, 2026
91bac28
Rollup merge of #159786 - AayushMainali-Github:fix-142648-ignore-hidd…
jhpratt Jul 26, 2026
a8eb2a7
Rollup merge of #159819 - Vastargazing:fix/poison-error-auto-cfg-note…
jhpratt Jul 26, 2026
64193c4
Rollup merge of #146525 - npmccallum:cow2, r=clarfonthey
jhpratt Jul 26, 2026
26f533d
Rollup merge of #152439 - him2him2:fix-typos-libs, r=clarfonthey
jhpratt Jul 26, 2026
af6a00a
Rollup merge of #155388 - lcnr:norm-where-bounds-may-be-productive, r…
jhpratt Jul 26, 2026
3f4f25b
Rollup merge of #155914 - lcnr:search-graph-bail-on-ambig, r=BoxyUwU
jhpratt Jul 26, 2026
f7cd634
Rollup merge of #159204 - celinval:feat/caller_location, r=makai410
jhpratt Jul 26, 2026
2871847
Rollup merge of #159439 - PaulDance:patches/fix-win7-dir-remove-file,…
jhpratt Jul 26, 2026
f15fdcd
Rollup merge of #159676 - alexcrichton:update-wasm-component-ld, r=Ma…
jhpratt Jul 26, 2026
5700c74
Rollup merge of #159695 - Dnreikronos:proc_macro/cfg_attr_file_mod_in…
jhpratt Jul 26, 2026
e6ed354
Rollup merge of #159730 - RalfJung:unsafe-cell, r=jhpratt
jhpratt Jul 26, 2026
40d68ec
Rollup merge of #159809 - nnethercote:fix-target_features-messages, r…
jhpratt Jul 26, 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
57 changes: 29 additions & 28 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4509,6 +4509,7 @@ dependencies = [
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_symbol_mangling",
"rustc_target",
"serde",
"serde_json",
Expand Down Expand Up @@ -6336,9 +6337,9 @@ dependencies = [

[[package]]
name = "wasm-component-ld"
version = "0.5.26"
version = "0.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51a12709376d4ce64f472699500db3b0e5902cc2bef16fb6ca3098bfdac032fa"
checksum = "5fd1ba338b2c06654988a76b13f38cad9a1c738e3275bf71ecf70eeac5d98eb4"
dependencies = [
"anyhow",
"clap",
Expand All @@ -6347,12 +6348,12 @@ dependencies = [
"libc",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.253.0",
"wasmparser 0.254.0",
"wat",
"windows-sys 0.61.2",
"winsplit",
"wit-component 0.253.0",
"wit-parser 0.253.0",
"wit-component 0.254.0",
"wit-parser 0.254.0",
]

[[package]]
Expand Down Expand Up @@ -6384,12 +6385,12 @@ dependencies = [

[[package]]
name = "wasm-encoder"
version = "0.253.0"
version = "0.254.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59972d6cd272259de647b7c1f1912e45e289c75ffd4be04e10695507cd7e1b59"
checksum = "09480d646178e5fdd12bb06e812d0af9a3a191dbc9cd697fdc86687beade7393"
dependencies = [
"leb128fmt",
"wasmparser 0.253.0",
"wasmparser 0.254.0",
]

[[package]]
Expand All @@ -6406,14 +6407,14 @@ dependencies = [

[[package]]
name = "wasm-metadata"
version = "0.253.0"
version = "0.254.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3f45816ef616806f48498bcd831377de578c4fa51db0c83ab8ceb78cc13523b"
checksum = "b01df5f3b4ca7881e843f3bc0fb8a3905d79c68692250dcb8e33e698705ccdb6"
dependencies = [
"anyhow",
"indexmap",
"wasm-encoder 0.253.0",
"wasmparser 0.253.0",
"wasm-encoder 0.254.0",
"wasmparser 0.254.0",
]

[[package]]
Expand Down Expand Up @@ -6450,9 +6451,9 @@ dependencies = [

[[package]]
name = "wasmparser"
version = "0.253.0"
version = "0.254.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19db11f87d2486580e1e8b6f494c54df7e0566b87d0b599db843c24019667339"
checksum = "d5769a29f799fbab136aaf65b4fe5384cd7d93fe6fc9ba0dcb6c8382a1f16e27"
dependencies = [
"bitflags",
"hashbrown 0.17.0",
Expand All @@ -6463,22 +6464,22 @@ dependencies = [

[[package]]
name = "wast"
version = "253.0.0"
version = "254.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3264542f8965c5d84fb1085d924bfba9a6314bb228eff13a2de14d7627664d0"
checksum = "e7ed4dfc8f6b9fc38b231065e2cdfbf7359af5ab945990abf09658dcc63c3e32"
dependencies = [
"bumpalo",
"leb128fmt",
"memchr",
"unicode-width 0.2.2",
"wasm-encoder 0.253.0",
"wasm-encoder 0.254.0",
]

[[package]]
name = "wat"
version = "1.253.0"
version = "1.254.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bfc5ce906144200c972ec617470aa35bd847472e170b26dde3e80541c674055"
checksum = "7127f7f9b8f127c879991cecd35f494e4628bae1b0874c681414d8d8831e952c"
dependencies = [
"wast",
]
Expand Down Expand Up @@ -6926,9 +6927,9 @@ dependencies = [

[[package]]
name = "wit-component"
version = "0.253.0"
version = "0.254.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbbd2500ac3488489ee8c6e59b79d7e47e6da5bfb019efd35d5dca57b78af624"
checksum = "b0e65bb94c369b3c4741ce3d1d2704b1fec93db7c540df0e521a097e7ceeb5be"
dependencies = [
"anyhow",
"bitflags",
Expand All @@ -6937,10 +6938,10 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"wasm-encoder 0.253.0",
"wasm-metadata 0.253.0",
"wasmparser 0.253.0",
"wit-parser 0.253.0",
"wasm-encoder 0.254.0",
"wasm-metadata 0.254.0",
"wasmparser 0.254.0",
"wit-parser 0.254.0",
]

[[package]]
Expand All @@ -6963,9 +6964,9 @@ dependencies = [

[[package]]
name = "wit-parser"
version = "0.253.0"
version = "0.254.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d997b8e5920fcbeec742b58e583325d6419a6aca617ae8075c406a61c65ba8a"
checksum = "1655131e4f7d3f0cb141f6eca71315ca40eff0f3d4de7cff0a82bacedd8c89b4"
dependencies = [
"anyhow",
"hashbrown 0.17.0",
Expand All @@ -6977,7 +6978,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-ident",
"wasmparser 0.253.0",
"wasmparser 0.254.0",
]

[[package]]
Expand Down
78 changes: 57 additions & 21 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2339,27 +2339,7 @@ pub struct FnSig {
impl FnSig {
/// Return a span encompassing the header, or where to insert it if empty.
pub fn header_span(&self) -> Span {
match self.header.ext {
Extern::Implicit(span) | Extern::Explicit(_, span) => {
return self.span.with_hi(span.hi());
}
Extern::None => {}
}

match self.header.safety {
Safety::Unsafe(span) | Safety::Safe(span) => return self.span.with_hi(span.hi()),
Safety::Default => {}
};

if let Some(coroutine_kind) = self.header.coroutine_kind {
return self.span.with_hi(coroutine_kind.span().hi());
}

if let Const::Yes(span) = self.header.constness {
return self.span.with_hi(span.hi());
}

self.span.shrink_to_lo()
self.header.span().unwrap_or(self.span.shrink_to_lo())
}

/// The span of the header's safety, or where to insert it if empty.
Expand All @@ -2382,6 +2362,19 @@ impl FnSig {
pub fn extern_span(&self) -> Span {
self.header.ext.span().unwrap_or(self.safety_span().shrink_to_hi())
}

pub fn as_borrowed(&self) -> BorrowedFnSig<'_> {
BorrowedFnSig { header: self.header, decl: &self.decl, span: self.span }
}
}

/// A borrowed version of `FnSig`, used to share logic between function declarations and function
/// pointer types.
#[derive(Clone, Debug)]
pub struct BorrowedFnSig<'a> {
pub header: FnHeader,
pub decl: &'a FnDecl,
pub span: Span,
}

/// A constraint on an associated item.
Expand Down Expand Up @@ -2487,6 +2480,16 @@ pub struct FnPtrTy {
pub decl_span: Span,
}

impl FnPtrTy {
pub fn header(&self) -> FnHeader {
FnHeader { constness: Const::No, coroutine_kind: None, safety: self.safety, ext: self.ext }
}

pub fn as_borrowed_fn_sig<'a>(&'a self) -> BorrowedFnSig<'a> {
BorrowedFnSig { header: self.header(), decl: &self.decl, span: self.decl_span }
}
}

#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
pub struct UnsafeBinderTy {
pub generic_params: ThinVec<GenericParam>,
Expand Down Expand Up @@ -3402,6 +3405,15 @@ pub enum AttrStyle {
Inner,
}

impl AttrStyle {
pub fn line_doc_comment_prefix(self) -> &'static str {
match self {
AttrStyle::Outer => "///",
AttrStyle::Inner => "//!",
}
}
}

/// A list of attributes.
pub type AttrVec = ThinVec<Attribute>;

Expand Down Expand Up @@ -3836,6 +3848,30 @@ impl FnHeader {
|| matches!(constness, Const::Yes(_))
|| !matches!(ext, Extern::None)
}

pub fn span(&self) -> Option<Span> {
let mut spans = smallvec::SmallVec::<[Span; 4]>::new();

match self.ext {
Extern::Implicit(span) | Extern::Explicit(_, span) => spans.push(span),
Extern::None => {}
}

match self.safety {
Safety::Unsafe(span) | Safety::Safe(span) => spans.push(span),
Safety::Default => {}
};

if let Some(coroutine_kind) = self.coroutine_kind {
spans.push(coroutine_kind.span());
}

if let Const::Yes(span) = self.constness {
spans.push(span)
}

spans.into_iter().reduce(Span::to)
}
}

impl Default for FnHeader {
Expand Down
Loading
Loading