Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
840ff78
library: optimize truncate method
xtqqczze Mar 28, 2026
dfa6584
ping me for layout invariant changes
RalfJung Oct 18, 2026
bbcf01e
genmc/build,cpp: Update GenMC version to 0.19.0
michaliskok Oct 17, 2026
cd09392
diagnostics,genmc*: Support the failure ordering of CASes
michaliskok Oct 17, 2026
c26810b
diagnostics,genmc*: Support weak CASes
michaliskok Oct 17, 2026
0fc7ab9
Update subtree sync docs
Kobzol Oct 19, 2026
6034ed9
Use `eval_context_ref` and `&self` where mutable access is not needed
programskillforverification Oct 19, 2026
a80cbc8
do not call pthread dtors on main thread return
RalfJung Oct 19, 2026
6807931
test suite: also check output of native runs
RalfJung Oct 19, 2026
1bc78f2
add support for __cxa_thread_atexit_impl
RalfJung Oct 19, 2026
4f3cf97
Document updating the `gcc` submodule
Kobzol Oct 19, 2026
7a7967b
Merge pull request #5441 from programskillforverification/eval-contex…
RalfJung Oct 19, 2026
5893562
Merge pull request #1007 from Kobzol/sync-docs
antoyo Oct 19, 2026
3d8756a
run the thread exit hooks also when exit() is called
RalfJung Oct 19, 2026
9f0b0f6
allow leaks of pthread keys in the thread that calls exit
RalfJung Oct 19, 2026
b4b59b0
make windows tests cover the exit case as well
RalfJung Oct 19, 2026
e4d6be4
proper test for yield-before-exit
RalfJung Oct 19, 2026
faa74c1
work around a genmc problem
RalfJung Oct 19, 2026
dcee488
Merge pull request #5442 from RalfJung/main-thread-dtors
RalfJung Oct 19, 2026
dbe4ef7
Merge pull request #5437 from michaliskok/genmc-cas
RalfJung Oct 19, 2026
7a6d062
macOS shims: migrate to check_shim_sig
programskillforverification Oct 20, 2026
6776628
Prepare for merging from rust-lang/rust
RalfJung Oct 20, 2026
09c1669
Merge ref '8144389c895d' from rust-lang/rust
RalfJung Oct 20, 2026
f61ab11
fix windows tls native tests
RalfJung Oct 20, 2026
38d78d6
also make __dso_handle available as weak symbol and remove std work-a…
RalfJung Oct 20, 2026
f282af4
Merge pull request #5446 from RalfJung/rustup
RalfJung Oct 20, 2026
b0d3a65
Merge pull request #5445 from programskillforverification/macos-check…
RalfJung Oct 20, 2026
e8f4356
migrate linux shim checks from using `check_shim_sig_deprecated` to `…
Hamdan-Khan Oct 20, 2026
750d8d3
Remove /tmp workaround now that rustdoc fixed the disk usage issue
antoyo Oct 20, 2026
712fb6a
Merge pull request #1008 from rust-lang/fix/remove-tmp-workaround
antoyo Oct 20, 2026
5953e0a
math shims: migrate to check_shim_sig
programskillforverification Oct 20, 2026
2cedfc1
Merge pull request #5450 from programskillforverification/math-check-…
RalfJung Oct 20, 2026
c4f2dfe
Merge pull request #5448 from Hamdan-Khan/linux-shims-sig
RalfJung Oct 20, 2026
8a301c0
Android shims: migrate to check_shim_sig
mehmettoplu-rs Oct 20, 2026
6e8e699
Use correct alignment for global variables
antoyo Oct 20, 2026
a4f5320
Remove integer packing workaround and replace by the new_array_from_b…
antoyo Oct 20, 2026
33b571c
Merge pull request #1009 from rust-lang/fix/ram-usage
antoyo Oct 21, 2026
0c80051
Merge pull request #1010 from rust-lang/fix/alignment
antoyo Oct 21, 2026
ff7732f
FLS dtors registered in a dtor might get called
ohadravid Oct 20, 2026
a4caed6
unix shims: migrate to check_shim_sig
programskillforverification Oct 21, 2026
1024673
Merge pull request #5449 from ohadravid/fls-dtor-miri-test-fix
RalfJung Oct 21, 2026
1f552e8
Merge pull request #5451 from mehmettoplu-rs/android-shim-sig
RalfJung Oct 21, 2026
c865473
fix comment in GetConsoleScreenBufferInfo
RalfJung Oct 21, 2026
9eb9a68
update shim example
RalfJung Oct 21, 2026
57ea3a3
Merge pull request #5452 from programskillforverification/unix-check-…
RalfJung Oct 21, 2026
f6847e1
Merge pull request #5456 from RalfJung/shim-tweaks
RalfJung Oct 21, 2026
a14fcb3
[Miri] Build Priroda from the main package
moabo3li Oct 11, 2026
8b6b82f
[Priroda] Fix rustc-internal lint warnings
moabo3li Oct 11, 2026
bb2e56e
[Priroda] Rename the UI test harness
moabo3li Oct 19, 2026
7a039bd
[Priroda] Update the VS Code task for the Miri package
moabo3li Oct 19, 2026
c5b2fab
[Miri] Add ./miri test-priroda
moabo3li Oct 11, 2026
8000713
[Miri] Run the Priroda suite in CI
moabo3li Oct 11, 2026
a51d3d5
[Miri] Document the Priroda test workflow
moabo3li Oct 11, 2026
d0bbba6
freebsd shims: migrate to check_shim_sig
mehmettoplu-rs Oct 21, 2026
264347b
resolving old FIXME in random
josetorrs Oct 22, 2026
f862e9f
solarish shims: migrate to check_shim_sig
programskillforverification Oct 22, 2026
d978f0b
NetBSD test filters no longer matched anything
programskillforverification Oct 22, 2026
4a0caf7
Prepare for merging from rust-lang/rust
Oct 22, 2026
c436399
Merge ref '1a2c4797ef25' from rust-lang/rust
Oct 22, 2026
318ee5a
Merge pull request #5464 from rust-lang/rustup-2026-10-22
RalfJung Oct 22, 2026
22bfd4f
Merge pull request #5463 from programskillforverification/fix-netbsd-…
RalfJung Oct 22, 2026
49b48b4
Merge pull request #5459 from mehmettoplu-rs/freebsd-shim-sig
RalfJung Oct 22, 2026
0030e82
Merge pull request #5462 from programskillforverification/solarish-ch…
RalfJung Oct 22, 2026
bbc40ba
get rid of check_shim_sig_deprecated
RalfJung Oct 22, 2026
fa2da38
Merge pull request #5466 from RalfJung/check_shim_sig_deprecated
RalfJung Oct 22, 2026
46c36e8
Merge pull request #5461 from josetorrs/remove-fixme-in-random
RalfJung Oct 22, 2026
aea90b8
Update dependency jinja2 to v3.1.6 [SECURITY]
renovate-bot Oct 22, 2026
1c1dedc
Merge pull request #5443 from moabo3li/priroda-test-workflow
RalfJung Oct 22, 2026
fccc8a7
Prepare for merging from rust-lang/rust
RalfJung Oct 23, 2026
760bd03
Merge ref '7189d39d9ce9' from rust-lang/rust
RalfJung Oct 23, 2026
8563ecf
rustfmt got better at dealing with cfg_select
RalfJung Oct 23, 2026
07ae050
Merge pull request #5471 from RalfJung/rustup
RalfJung Oct 23, 2026
84173ce
Safely convert `socket2::Socket` into mio `TcpStream` and `TcpListener`
WhySoBad Oct 21, 2026
f02b7f1
update no direct test FIXMEs on shims
programskillforverification Oct 22, 2026
f232305
Add support for creating and closing a UDP socket
WhySoBad Oct 3, 2026
30a8a24
Add `bind` support for UDP sockets
WhySoBad Oct 3, 2026
5c4888b
Add `connect` support for UDP sockets
WhySoBad Oct 3, 2026
39dee5f
Add basic `setsockopt` support for UDP sockets
WhySoBad Oct 3, 2026
e9fb3f9
Add basic `getsockopt` support for UDP sockets
WhySoBad Oct 3, 2026
ff92522
Add `getsockname` support for UDP sockets
WhySoBad Oct 3, 2026
9c9b03a
Add `getpeername` support for UDP sockets
WhySoBad Oct 3, 2026
bff372e
Integrate UDP socket into readiness management system
WhySoBad Oct 3, 2026
fd4473c
Allow successful write after short write in non-blocking TCP send test
WhySoBad Oct 22, 2026
29cdf75
Merge pull request #5467 from programskillforverification/update-shim…
RalfJung Oct 23, 2026
b5ba9d6
Merge pull request #5395 from WhySoBad/upd-socket-start
RalfJung Oct 23, 2026
ed6cf83
Merge pull request #5457 from WhySoBad/tcp-socket-from-ownedfd
RalfJung Oct 23, 2026
c9bdc9a
ensure that readdir returns race-free d_type
RalfJung Oct 23, 2026
c22297e
Merge pull request #5458 from WhySoBad/fix-write-after-short-write
RalfJung Oct 23, 2026
56e6ce4
Merge pull request #5472 from RalfJung/dir-entry-type
RalfJung Oct 23, 2026
f65e06b
Fix sysroot path for ui tests
GuillaumeGomez Oct 23, 2026
adc83fa
Merge pull request #1013 from GuillaumeGomez/const-str-fixes
GuillaumeGomez Oct 23, 2026
41be5c0
Make const strings readonly and remove the pointer indirection
GuillaumeGomez Oct 21, 2026
2452094
Fix to use target features from a target spec
antoyo Oct 20, 2026
83a5618
Merge pull request #1012 from rust-lang/fix/target-spec-features
antoyo Oct 24, 2026
e034607
specialize str.escape_default().{to_string, collect::<String>}()
the8472 Jul 25, 2026
195573d
partially revert "Optimize escape_string_symbol()"
the8472 Jul 25, 2026
678690c
Prepare for merging from rust-lang/rust
Oct 24, 2026
821f2c1
Merge ref '9cd159cfa5b5' from rust-lang/rust
Oct 24, 2026
3872943
fmt
Oct 24, 2026
3281573
Merge pull request #5476 from rust-lang/rustup-2026-10-24
RalfJung Oct 24, 2026
8fac7ef
update lockfile
RalfJung Oct 24, 2026
bfb9ed3
bootstrap: make priroda check and test again
RalfJung Oct 24, 2026
cbf6e4a
Do not checkout Cargo for bootstrap tests
Kobzol Oct 24, 2026
59a2d73
Fix path setup for panic messages
GuillaumeGomez Oct 23, 2026
bd872a0
Remove non-failing ui test from the failing ui tests list
GuillaumeGomez Oct 24, 2026
e02f4fd
Prepare for merging from rust-lang/rust
antoyo Oct 24, 2026
5f15550
Merge ref '48f4b05538b8' (nightly-2026-10-24) from rust-lang/rust
antoyo Oct 24, 2026
b1cdfff
Enable `--generate-link-to-definition` rustdoc option on std docs
GuillaumeGomez Sep 15, 2026
c91c9a1
Merge pull request #1016 from rust-lang/sync_from_rust_2026_10_24
antoyo Oct 24, 2026
660b88a
Merge pull request #1015 from GuillaumeGomez/const-str-fixes
GuillaumeGomez Oct 24, 2026
2bd0528
Create new builtin rustc macro `rustdoc_skip_body` and replace the `s…
GuillaumeGomez Oct 14, 2026
a956015
temporarily disable a test in Miri
RalfJung Oct 24, 2026
cdcaab7
Update gcc submodule
GuillaumeGomez Oct 24, 2026
bb4f948
cg_llvm: clarify Send / Sync story for modules
hanna-kruppe Oct 24, 2026
127a5d9
rustdoc: Correctly handle reexports when `--document-private-items` i…
GuillaumeGomez Aug 19, 2026
f87a2da
Add rustdoc-html regression test for reexports when `--document-priva…
GuillaumeGomez Aug 19, 2026
a62d6d8
Disable `unused_macros` check on `rustdoc_skip_body`
GuillaumeGomez Oct 24, 2026
072ded8
Add FIXME comments to `from_ascii_bytes_radix_impl`
sorairolake Oct 25, 2026
7477619
Rollup merge of #161362 - GuillaumeGomez:reexports-document-private, …
jhpratt Oct 25, 2026
bf860e7
Rollup merge of #162808 - GuillaumeGomez:std-link-to-def, r=Amanieu
jhpratt Oct 25, 2026
11d2d62
Rollup merge of #164834 - RalfJung:miri, r=oli-obk
jhpratt Oct 25, 2026
64bb23b
Rollup merge of #164869 - GuillaumeGomez:cg_gcc-subtree-sync, r=Guill…
jhpratt Oct 25, 2026
0f23e2e
Rollup merge of #157123 - xtqqczze:truncate, r=Mark-Simulacrum
jhpratt Oct 25, 2026
58766e0
Rollup merge of #159916 - the8472:escape-default-to-string, r=Mark-Si…
jhpratt Oct 25, 2026
1acd06d
Rollup merge of #164508 - RalfJung:layout-invariant-ping, r=jieyouxu
jhpratt Oct 25, 2026
e3a8d22
Rollup merge of #164758 - renovate-bot:renovate/pypi-jinja2-vulnerabi…
jhpratt Oct 25, 2026
32fa4d0
Rollup merge of #164857 - Kobzol:bootstrap-no-cargo-checkout, r=jieyouxu
jhpratt Oct 25, 2026
50ab5ef
Rollup merge of #164872 - hanna-kruppe:llvm-send-sync, r=bjorn3
jhpratt Oct 25, 2026
5336ec9
Rollup merge of #164881 - sorairolake:nonzero-from-ascii-const-hack, …
jhpratt Oct 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
12 changes: 12 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,17 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"

[[package]]
name = "emmy_dap_types"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2310ff06ab812a0332ffa037bbda9d994b3721a7f8a308ff38c28bdb20c37f56"
dependencies = [
"serde",
"serde_json",
"thiserror 1.0.69",
]

[[package]]
name = "ena"
version = "0.14.4"
Expand Down Expand Up @@ -2551,6 +2562,7 @@ dependencies = [
"chrono-tz",
"colored",
"directories",
"emmy_dap_types",
"genmc-sys",
"getrandom 0.4.3",
"ipc-channel",
Expand Down
16 changes: 2 additions & 14 deletions compiler/rustc_ast/src/util/literal.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Code related to parsing literals.

use std::fmt::Write as _;
use std::{ascii, fmt, str};

use rustc_literal_escaper::{
Expand Down Expand Up @@ -38,19 +37,8 @@ pub fn escape_string_symbol(symbol: Symbol) -> Symbol {
let mut escaped = String::with_capacity(s.len() + 1);
escaped.push_str(prefix);

// Don't use escape_default() here, because using it is slower than escaping manually.
for c in suffix.chars() {
match c {
'\t' => escaped.push_str("\\t"),
'\r' => escaped.push_str("\\r"),
'\n' => escaped.push_str("\\n"),
'\\' => escaped.push_str("\\\\"),
'\'' => escaped.push_str("\\'"),
'\"' => escaped.push_str("\\\""),
'\x20'..='\x7e' => escaped.push(c),
c => write!(escaped, "\\u{{{:x}}}", c as u32).unwrap(),
}
}
escaped.extend(suffix.escape_default());

Symbol::intern(&escaped)
}

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_builtin_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ mod iter;
mod log_syntax;
mod offload;
mod pattern_type;
mod rustdoc_skip_body;
mod source_util;
mod test;
mod test_binder_constraints;
Expand Down Expand Up @@ -125,6 +126,7 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
eii_shared_macro: eii::eii_shared_macro,
global_allocator: global_allocator::expand,
offload_kernel: offload::expand_kernel,
rustdoc_skip_body: rustdoc_skip_body::expand,
test: test::expand_test,
test_case: test::expand_test_case,
unsafe_eii: eii::unsafe_eii,
Expand Down
93 changes: 93 additions & 0 deletions compiler/rustc_builtin_macros/src/rustdoc_skip_body.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
//! The expansion from a function when the code would not compile with rustdoc: so if `cfg(doc)`,
//! expands to a `loop {}`.

use rustc_ast::token::{self, Delimiter, IdentKind};
use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree};
use rustc_ast::{
AssocItemKind, AttrArgs, AttrItem, Attribute, DelimArgs, ExprKind, Fn, ItemKind, MetaItem,
Safety,
};
use rustc_expand::base::*;
use rustc_span::{Ident, Span, sym};
use thin_vec::ThinVec;

pub(crate) fn expand(
cx: &mut ExtCtxt<'_>,
attr_path_sp: Span,
meta_item: &MetaItem,
mut item: Annotatable,
) -> Vec<Annotatable> {
if !meta_item.is_word() {
cx.dcx().struct_span_err(attr_path_sp, "`rustdoc_skip_body` doesn't take arguments").emit();
}
let mut is_expected_item = false;
match item {
Annotatable::Item(ref mut item) => {
if let ItemKind::Fn(ref mut fn_) = item.kind {
expand_macro(cx, attr_path_sp, fn_);
is_expected_item = true;
}
}
Annotatable::AssocItem(ref mut item, _) => {
if let AssocItemKind::Fn(ref mut fn_) = item.kind {
expand_macro(cx, attr_path_sp, fn_);
is_expected_item = true;
}
}
_ => {}
}
if !is_expected_item {
cx.dcx()
.struct_span_err(attr_path_sp, "`rustdoc_skip_body` can only be used on functions")
.emit();
}
vec![item]
}

fn cfg_not_doc(cx: &mut ExtCtxt<'_>, sp: Span) -> Attribute {
// `not(doc)`
let not_doc = TokenStream::new(vec![
TokenTree::token_alone(token::Ident(sym::not, IdentKind::Normal), sp),
TokenTree::Delimited(
DelimSpan::from_single(sp),
DelimSpacing::new(Spacing::JointHidden, Spacing::Alone),
Delimiter::Parenthesis,
TokenStream::token_alone(token::Ident(sym::doc, IdentKind::Normal), sp),
),
]);

cx.attr_nested(
AttrItem {
unsafety: Safety::Default,
path: cx.path_ident(sp, Ident::new(sym::cfg, sp)),
args: AttrArgs::Delimited(DelimArgs {
dspan: DelimSpan::from_single(sp),
delim: Delimiter::Parenthesis,
tokens: not_doc,
}),
span: sp,
},
sp,
)
}

fn expand_macro(cx: &mut ExtCtxt<'_>, sp: Span, fn_: &mut Fn) {
let Some(old_body) = fn_.body.take() else {
// No body... Well, no possibility to not compile I guess so all good.
return;
};
let mut old_body = cx.expr_block(old_body);
// We add on the function's body `#[cfg(not(doc))]`.
old_body.attrs.push(cfg_not_doc(cx, sp));

// We create the `#[cfg(doc)] loop {}` "block".
let mut loop_expr = cx.expr(sp, ExprKind::Loop(cx.block(sp, ThinVec::new()), None, sp));
loop_expr.attrs.push(cx.attr_nested_word(sym::cfg, sym::doc, sp));

let mut stmts = ThinVec::new();
stmts.push(cx.stmt_expr(loop_expr));
stmts.push(cx.stmt_expr(old_body));

// We create a new function body containing both blocks.
fn_.body = Some(cx.block(sp, stmts));
}
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ jobs:
- name: Set env
run: |
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
# /tmp is a small tmpfs, and rustdoc keeps every compiled doctest there until the run ends.
echo "TMPDIR=$RUNNER_TEMP" >> $GITHUB_ENV

#- name: Cache rust repository
## We only clone the rust repository for rustc tests
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/rustup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ jobs:
- name: Set env
run: |
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
# /tmp is a small tmpfs, and rustdoc keeps every compiled doctest there until the run ends.
echo "TMPDIR=$RUNNER_TEMP" >> $GITHUB_ENV

- name: Prepare
if: ${{ matrix.run_cargo_tests }}
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_gcc/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ dependencies = [

[[package]]
name = "gccjit"
version = "7.2.0"
version = "7.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27cd340f3c265988de3379689cbbd103c25b1f8a3d0cc73f91a49083e899d3e1"
checksum = "ea1820165dfb376a3bbfe8b69628d9e5a851c423e0480a666f71f560e2d0a924"
dependencies = [
"gccjit_sys",
]

[[package]]
name = "gccjit_sys"
version = "4.2.0"
version = "4.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da2d9d74572f004908f17ec1bd0af071e5db63a12c3335c9651a6125593951c6"
checksum = "a6091291fc118448b91df5b662d20564020198fee46d8445a6aa0c25b6b435be"
dependencies = [
"libc",
]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ default = ["master"]
[dependencies]
object = { version = "0.39.0", default-features = false, features = ["std", "read"] }
tempfile = "3.20"
gccjit = { version = "7.2.0", features = ["dlopen"] }
gccjit = { version = "7.3.0", features = ["dlopen"] }
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] }

# Local copy.
Expand Down
22 changes: 11 additions & 11 deletions compiler/rustc_codegen_gcc/build_system/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use std::path::{Path, PathBuf};

use crate::config::{Channel, ConfigInfo};
use crate::utils::{
create_dir, get_sysroot_dir, run_command, run_command_with_output_and_env, walk_dir,
create_dir, get_sysroot_dir, run_command, run_command_with_output_and_env, rustc_version_info,
walk_dir,
};

#[derive(Default)]
Expand Down Expand Up @@ -137,17 +138,16 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
// Builds libs
let mut rustflags = env.get("RUSTFLAGS").cloned().unwrap_or_default();

// Record the sysroot sources under the path the `rust-src` component uses, which is where
// rustc looks for them to turn a sysroot span into `/rustc/$hash`. Without this, ui tests
// print the build path where they expect `$SRC_DIR`.
let sysroot_source_dir = lib_path.join("rustlib/src/rust/library");
// Remap both source spans and embedded panic locations to the standard virtual path.
let sysroot_source_dir = start_dir.join("sysroot_src");
let rustc_commit = rustc_version_info(env.get("RUSTC").map(String::as_str))?
.commit_hash
.ok_or_else(|| "Couldn't retrieve rustc commit hash".to_string())?;
// Cargo passes workspace-relative filenames, including those used by panic locations.
// Also: the `==` is intentional! The first `=` is "FROM" and the second `=` is for "TO".
rustflags.push_str(&format!(" --remap-path-prefix==/rustc/{rustc_commit}/library"));
rustflags.push_str(&format!(
" --remap-path-prefix={library_dir}={sysroot_source_dir}",
library_dir = std::path::absolute(&library_dir)
.map_err(|error| format!(
"Failed to get the absolute path of the sysroot sources: {error:?}"
))?
.display(),
" --remap-path-prefix={sysroot_source_dir}=/rustc/{rustc_commit}",
sysroot_source_dir = std::path::absolute(&sysroot_source_dir)
.map_err(|error| format!(
"Failed to get the absolute path of the sysroot sources: {error:?}"
Expand Down
55 changes: 7 additions & 48 deletions compiler/rustc_codegen_gcc/doc/subtree.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,13 @@
# git subtree sync
# Subtree sync procedure

`rustc_codegen_gcc` is a subtree of the rust compiler. As such, it needs to be
synced from time to time to ensure changes that happened on their side are also
included on our side.
`rustc_codegen_gcc` is using [Josh] to perform subtree synces with the `rust-lang/rust` repository.

### How to install a forked git-subtree
[Josh]: https://josh-project.dev/docs/intro.html

Using git-subtree with `rustc` requires a patched git to make it work.
The PR that is needed is [here](https://github.com/gitgitgadget/git/pull/493).
Use the following instructions to install it:
The procedure for performing subtree synchronizations is documented [here][rdg-josh].

```bash
git clone git@github.com:tqc/git.git
cd git
git checkout tqc/subtree
make
make install
cd contrib/subtree
make
cp git-subtree ~/bin
```
[rdg-josh]: https://rustc-dev-guide.rust-lang.org/external-repos.html#synchronizing-a-josh-subtree

### Syncing with rust compiler
## Pushing changes to `rust-lang/rust`

Do a sync with this command:

```bash
PATH="$HOME/bin:$PATH" ~/bin/git-subtree push -P compiler/rustc_codegen_gcc/ ../rustc_codegen_gcc/ sync_branch_name
cd ../rustc_codegen_gcc
git checkout master
git pull
git checkout sync_branch_name
git merge master
```

To send the changes to the rust repo:

```bash
cd ../rust
git pull origin master
git checkout -b subtree-update_cg_gcc_YYYY-MM-DD
PATH="$HOME/bin:$PATH" ~/bin/git-subtree pull --prefix=compiler/rustc_codegen_gcc/ https://github.com/rust-lang/rustc_codegen_gcc.git master
# Don't forget to update the `gcc` submodule to the same version as the
# one in `rustc_codegen_gcc/libgccjit.version`.
git push

# Immediately merge the merge commit into cg_gcc to prevent merge conflicts when syncing from rust-lang/rust later.
PATH="$HOME/bin:$PATH" ~/bin/git-subtree push -P compiler/rustc_codegen_gcc/ ../rustc_codegen_gcc/ sync_branch_name
```

FIXME: write a script that does the above.

https://rust-lang.zulipchat.com/#narrow/stream/301329-t-devtools/topic/subtree.20madness/near/258877725
If the used GCC commit (recorded in `libgccjit.version`) changed in `rustc_codegen_gcc`, then you will have to update the `gcc` submodule in the `rust-lang/rust` repository in the push sync PR. The CI in `rust-lang/rust` should ensure that these two commit references match. You can simply update the `gcc` submodule commit and push it to your push sync PR once it has been created.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/libgccjit.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
37ea7cd851f04ee6a313c5067c9fde9328f876aa
e1c6e07b095d091177376a163da44039475e05e3
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2026-10-19"
channel = "nightly-2026-10-24"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
17 changes: 2 additions & 15 deletions compiler/rustc_codegen_gcc/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::base;
use crate::context::CodegenCx;
#[cfg(feature = "master")]
use crate::gcc_util::to_gcc_aarch64_extension;
use crate::gcc_util::to_gcc_features;
use crate::gcc_util::{to_gcc_features, to_gcc_target_attribute_feature};

/// Checks if the function `instance` is recursively inline.
/// Returns `false` if a functions is guaranteed to be non-recursive, and `true` if it *might* be recursive.
Expand Down Expand Up @@ -192,20 +192,7 @@ pub fn from_fn_attrs<'gcc, 'tcx>(
}
let target_features = function_features
.iter()
.filter_map(|feature| {
// FIXME(antoyo): support soft-float.
if feature.contains("soft-float") {
return None;
}

if feature.starts_with('-') {
Some(format!("no{}", feature))
} else if let Some(stripped) = feature.strip_prefix('+') {
Some(stripped.to_string())
} else {
Some(feature.to_string())
}
})
.filter_map(|feature| to_gcc_target_attribute_feature(feature))
.collect::<Vec<_>>()
.join(",");
if !target_features.is_empty() {
Expand Down
Loading
Loading