Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
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
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
10100f2
Update wasm-component-ld to 0.5.27
alexcrichton Jul 21, 2026
66d0fb8
stepping into `NormalizesTo` where-clauses may be productive
lcnr Apr 16, 2026
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
8242b33
document #[global_allocator] constraints
RalfJung 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
1bd4fa0
Add tuple never coercion collection regression test
chenyukang 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
8aafa5e
[rustdoc] Correctly handle output options with `--show-coverage`
GuillaumeGomez Jul 16, 2026
f545db6
Add regression test for `--show-coverage` output
GuillaumeGomez Jul 16, 2026
65b6e98
Add small message to say where the output was generated
GuillaumeGomez Jul 16, 2026
854bbe7
Fix `tests/run-make/rustdoc-show-coverage/rmake.rs` by requiring `nee…
GuillaumeGomez Jul 23, 2026
098056a
Move `rustdoc-ui` `--show-coverage` tests into the `coverage` folder
GuillaumeGomez Jul 24, 2026
f8711a1
reuse regular exported_non_generic_symbols logic in Miri
RalfJung Jul 22, 2026
c680b50
Mention how the `-o` option behaves with the `--show-coverage` option
GuillaumeGomez Jul 24, 2026
4bd52e9
Remove redundant `#[rustc_paren_sugar]` feature gate
mejrs Jul 24, 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
a32fa44
Updated expect messages for CString struct and method documentation
asder8215 Jul 24, 2026
c9e2429
Remove obsolete option `build.compiletest-use-stage0-libtest`
Zalathar Jul 25, 2026
36ef11a
Update expect messages in library/alloc/boxed.rs and library/alloc/st…
Colepng Jul 25, 2026
99ff7d2
bootstrap: use cc::Tool for compiler detection.
paradoxicalguy Jul 21, 2026
05bb184
sembr src/variance.md
tshepang Jul 25, 2026
5d19c92
Prepare for merging from rust-lang/rust
invalid-email-address Jul 25, 2026
bb4b62b
Merge ref 'da86f4d0726b' from rust-lang/rust
invalid-email-address Jul 25, 2026
acb9407
Split multiline derives into std/rustc macros
mejrs Jul 25, 2026
d57ee22
improve variance.md
tshepang Jul 25, 2026
e481f48
Correctly handle path comparison on windows
GuillaumeGomez Jul 25, 2026
4196283
Add warning for breakage hazard for introducing new builtin attrs
jieyouxu Jul 25, 2026
d44d12d
Merge pull request #2944 from jieyouxu/builtin_attr
jieyouxu Jul 25, 2026
f36f2b9
sembr src/rustdoc-internals/rustdoc-gui-test-suite.md
tshepang Jul 25, 2026
0d9c6a4
overlong
tshepang Jul 25, 2026
c565998
punctuation
tshepang Jul 25, 2026
54c2643
sembr src/rustdoc-internals/search.md
tshepang Jul 25, 2026
71f1401
typo
tshepang Jul 25, 2026
19ec811
sembr src/stability-guarantees.md
tshepang Jul 25, 2026
2500a68
sembr src/pat-exhaustive-checking.md
tshepang Jul 25, 2026
72da0f5
improve pat-exhaustive-checking.md
tshepang Jul 25, 2026
a477499
sembr src/ast-validation.md
tshepang Jul 25, 2026
8da4c50
sembr src/notification-groups/gpu-target.md
tshepang Jul 25, 2026
a88b4f0
improve notification-groups/gpu-target.md
tshepang Jul 25, 2026
be78fc8
sembr src/notification-groups/wasm.md
tshepang Jul 25, 2026
01f3867
select the right text to link
tshepang Jul 25, 2026
5c30492
sembr src/const-eval.md
tshepang Jul 25, 2026
721d2b3
Merge pull request #2945 from rust-lang/tshepang/misc
tshepang Jul 25, 2026
ac7ecbd
Merge pull request #2943 from rust-lang/rustc-pull
tshepang Jul 25, 2026
6ce8067
sembr src/attributes.md
tshepang Jul 25, 2026
0dc322b
reflow
tshepang Jul 25, 2026
67e048e
sembr src/tests/autodiff-ci-job.md
tshepang Jul 25, 2026
b5803d3
sembr src/profiling/with-perf.md
tshepang Jul 25, 2026
b7f7f0d
improve profiling/with-perf.md
tshepang Jul 25, 2026
c39587c
Merge pull request #2946 from rust-lang/tshepang/misc
tshepang Jul 25, 2026
d122223
Rollup merge of #159673 - paradoxicalguy:fix-cc-debuginfo-map-detecti…
GuillaumeGomez Jul 25, 2026
74729bb
Rollup merge of #159720 - RalfJung:global-allocator-opsem-magic, r=aa…
GuillaumeGomez Jul 25, 2026
ab5f063
Rollup merge of #159732 - mejrs:attribute_crawler, r=nnethercote
GuillaumeGomez Jul 25, 2026
88965dd
Rollup merge of #159738 - WaffleLapkin:covariant-unsafe-cell, r=jhpratt
GuillaumeGomez Jul 25, 2026
433a86e
Rollup merge of #159740 - RalfJung:miri-dedup-exported-symbols, r=bjorn3
GuillaumeGomez Jul 25, 2026
8d65678
Rollup merge of #159780 - folkertdev:extern-custom-check-fn-ptrs, r=W…
GuillaumeGomez Jul 25, 2026
21fad7d
Rollup merge of #159786 - AayushMainali-Github:fix-142648-ignore-hidd…
GuillaumeGomez Jul 25, 2026
e421ea2
Rollup merge of #159819 - Vastargazing:fix/poison-error-auto-cfg-note…
GuillaumeGomez Jul 25, 2026
c2cebb9
Rollup merge of #155388 - lcnr:norm-where-bounds-may-be-productive, r…
GuillaumeGomez Jul 25, 2026
66026da
Rollup merge of #155914 - lcnr:search-graph-bail-on-ambig, r=BoxyUwU
GuillaumeGomez Jul 25, 2026
654f278
Rollup merge of #159204 - celinval:feat/caller_location, r=makai410
GuillaumeGomez Jul 25, 2026
fab6c8d
Rollup merge of #159411 - GuillaumeGomez:show-coverage, r=Urgau,aDotI…
GuillaumeGomez Jul 25, 2026
af44ea5
Rollup merge of #159439 - PaulDance:patches/fix-win7-dir-remove-file,…
GuillaumeGomez Jul 25, 2026
08a41e1
Rollup merge of #159676 - alexcrichton:update-wasm-component-ld, r=Ma…
GuillaumeGomez Jul 25, 2026
ebd0d5f
Rollup merge of #159730 - RalfJung:unsafe-cell, r=jhpratt
GuillaumeGomez Jul 25, 2026
0b10a4e
Rollup merge of #159809 - nnethercote:fix-target_features-messages, r…
GuillaumeGomez Jul 25, 2026
4674360
Rollup merge of #159810 - chenyukang:yukang-fix-100727-tuple-never-co…
GuillaumeGomez Jul 25, 2026
1fb9e72
Rollup merge of #159826 - mejrs:sugar_parens, r=JonathanBrouwer
GuillaumeGomez Jul 25, 2026
78825ae
Rollup merge of #159853 - asder8215:cstr_expect, r=fee1-dead
GuillaumeGomez Jul 25, 2026
a844883
Rollup merge of #159878 - Zalathar:stage0-libtest, r=Kobzol
GuillaumeGomez Jul 25, 2026
0d6bc75
Rollup merge of #159882 - Colepng:main, r=Darksonn
GuillaumeGomez Jul 25, 2026
89ca13e
Rollup merge of #159891 - mejrs:split_derives, r=JonathanBrouwer
GuillaumeGomez Jul 25, 2026
3a6add9
Rollup merge of #159895 - tshepang:rdg-sync, r=tshepang
GuillaumeGomez Jul 25, 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
56 changes: 28 additions & 28 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6336,9 +6336,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 +6347,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 +6384,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 +6406,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 +6450,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 +6463,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 +6926,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 +6937,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 +6963,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 +6977,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-ident",
"wasmparser 0.253.0",
"wasmparser 0.254.0",
]

[[package]]
Expand Down
69 changes: 48 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 @@ -3836,6 +3839,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