Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a0f9a15
Fix is_ascii performance regression on AVX-512 CPUs
bonega Jan 17, 2026
08432c8
Optimize small input path for is_ascii on x86_64
bonega Jan 18, 2026
cb4c9d3
Use allocator_shim_contents in allocator_shim_symbols
bjorn3 Oct 15, 2025
03fa11a
Remove a couple of unnecessary impls
bjorn3 Oct 3, 2025
c65076a
Handle FreeFunctions outside with_api_handle_types
bjorn3 Oct 3, 2025
5dd7c0b
Rationalise the Armv7-A, Armv7-R and Armv8-R bare-metal target configs
thejpster Dec 31, 2025
96647dd
Add Thumb-mode targets for Armv7-R, Armv7-A and Armv8-R.
thejpster Dec 31, 2025
fb05cac
Update SUMMARY.md too
thejpster Jan 1, 2026
1652f3f
Expand with_api_handle_types
bjorn3 Oct 3, 2025
d3b5f72
Move all bridge methods into a single type
bjorn3 Jan 22, 2026
31c696d
Various simplifications after moving all bridge methods to a single type
bjorn3 Jan 22, 2026
5c2052a
Merge FreeFunctions trait into Server trait
bjorn3 Jan 22, 2026
44fcd04
Get rid of MarkedTypes
bjorn3 Oct 3, 2025
76f9a90
Use rustc_proc_macro in rust-analyzer-proc-macro-srv
bjorn3 Jan 22, 2026
0a2bb4b
Ensure armv7a-none-eabi.md mentions all four targets
thejpster Jan 22, 2026
19d1be5
Ensure armv7r-none-eabi.md mentions all four targets
thejpster Jan 22, 2026
fa526c4
Update armv8r-none-eabi.md - note both targets are hardfloat
thejpster Jan 22, 2026
c609cce
Merge is_ascii codegen tests using revisions
bonega Jan 22, 2026
890c0fd
Make is_ascii_sse2 a safe function
bonega Jan 22, 2026
ff9c5cf
Enable reproducible binary builds with debuginfo on Linux
paradoxicalguy Jan 22, 2026
1e8ffd9
Removed comment on reproducibility issue #89911
paradoxicalguy Jan 23, 2026
78afe87
Add 'Skip to main content' link for keyboard navigation in rustdoc
ThanhNguyxn Jan 23, 2026
e47138f
Fix review comments
bjorn3 Jan 23, 2026
58dd2e5
Tweak bounds check in `DepNodeColorMap.get`
Zoxc Jan 23, 2026
afd03f6
Rollup merge of #149848 - bjorn3:alloc_shim_rework2, r=jackh726
JonathanBrouwer Jan 23, 2026
8632d67
Rollup merge of #150556 - thejpster:add-thumbv7a-thumbv7r-thumbv8r, r…
JonathanBrouwer Jan 23, 2026
8929005
Rollup merge of #151259 - bonega:fix-is-ascii-avx512, r=folkertdev
JonathanBrouwer Jan 23, 2026
b1e6882
Rollup merge of #151482 - ThanhNguyxn:fix/rustdoc-skip-nav, r=Guillau…
JonathanBrouwer Jan 23, 2026
ba88790
Rollup merge of #151505 - bjorn3:proc_macro_refactors, r=petrochenkov
JonathanBrouwer Jan 23, 2026
cc2dcfe
Rollup merge of #151517 - paradoxicalguy:enable-debuginfo-tests-linux…
JonathanBrouwer Jan 23, 2026
20ae8d8
Rollup merge of #151540 - Zoxc:color-get-opt, r=jieyouxu
JonathanBrouwer Jan 23, 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
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1827,9 +1827,9 @@ fn exported_symbols_for_non_proc_macro(
// Mark allocator shim symbols as exported only if they were generated.
if export_threshold == SymbolExportLevel::Rust
&& needs_allocator_shim_for_linking(tcx.dependency_formats(()), crate_type)
&& tcx.allocator_kind(()).is_some()
&& let Some(kind) = tcx.allocator_kind(())
{
symbols.extend(allocator_shim_symbols(tcx));
symbols.extend(allocator_shim_symbols(tcx, kind));
}

symbols
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ pub(super) fn exported_symbols_for_lto(
}

// Mark allocator shim symbols as exported only if they were generated.
if export_threshold == SymbolExportLevel::Rust && allocator_kind_for_codegen(tcx).is_some() {
symbols_below_threshold.extend(allocator_shim_symbols(tcx).map(|(name, _kind)| name));
if export_threshold == SymbolExportLevel::Rust
&& let Some(kind) = allocator_kind_for_codegen(tcx)
{
symbols_below_threshold.extend(allocator_shim_symbols(tcx, kind).map(|(name, _kind)| name));
}

symbols_below_threshold
Expand Down
15 changes: 6 additions & 9 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use std::collections::hash_map::Entry::*;

use rustc_abi::{CanonAbi, X86Call};
use rustc_ast::expand::allocator::{
ALLOC_ERROR_HANDLER, ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE, global_fn_name,
};
use rustc_ast::expand::allocator::{AllocatorKind, NO_ALLOC_SHIM_IS_UNSTABLE, global_fn_name};
use rustc_data_structures::unord::UnordMap;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE, LocalDefId};
Expand All @@ -21,6 +19,7 @@ use rustc_target::spec::{Arch, Os, TlsModel};
use tracing::debug;

use crate::back::symbol_export;
use crate::base::allocator_shim_contents;

fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
crates_export_threshold(tcx.crate_types())
Expand Down Expand Up @@ -490,14 +489,12 @@ pub(crate) fn provide(providers: &mut Providers) {

pub(crate) fn allocator_shim_symbols(
tcx: TyCtxt<'_>,
kind: AllocatorKind,
) -> impl Iterator<Item = (String, SymbolExportKind)> {
ALLOCATOR_METHODS
.iter()
allocator_shim_contents(tcx, kind)
.into_iter()
.map(move |method| mangle_internal_symbol(tcx, global_fn_name(method.name).as_str()))
.chain([
mangle_internal_symbol(tcx, global_fn_name(ALLOC_ERROR_HANDLER).as_str()),
mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE),
])
.chain([mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE)])
.map(move |symbol_name| {
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, &symbol_name));

Expand Down
103 changes: 50 additions & 53 deletions compiler/rustc_expand/src/proc_macro_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,6 @@ impl ToInternal<rustc_errors::Level> for Level {
}
}

pub(crate) struct FreeFunctions;

pub(crate) struct Rustc<'a, 'b> {
ecx: &'a mut ExtCtxt<'b>,
def_site: Span,
Expand Down Expand Up @@ -461,13 +459,28 @@ impl<'a, 'b> Rustc<'a, 'b> {
}

impl server::Types for Rustc<'_, '_> {
type FreeFunctions = FreeFunctions;
type TokenStream = TokenStream;
type Span = Span;
type Symbol = Symbol;
}

impl server::FreeFunctions for Rustc<'_, '_> {
impl server::Server for Rustc<'_, '_> {
fn globals(&mut self) -> ExpnGlobals<Self::Span> {
ExpnGlobals {
def_site: self.def_site,
call_site: self.call_site,
mixed_site: self.mixed_site,
}
}

fn intern_symbol(string: &str) -> Self::Symbol {
Symbol::intern(string)
}

fn with_symbol_string(symbol: &Self::Symbol, f: impl FnOnce(&str)) {
f(symbol.as_str())
}

fn injected_env_var(&mut self, var: &str) -> Option<String> {
self.ecx.sess.opts.logical_env.get(var).cloned()
}
Expand Down Expand Up @@ -552,14 +565,20 @@ impl server::FreeFunctions for Rustc<'_, '_> {
}
diag.emit();
}
}

impl server::TokenStream for Rustc<'_, '_> {
fn is_empty(&mut self, stream: &Self::TokenStream) -> bool {
fn ts_drop(&mut self, stream: Self::TokenStream) {
drop(stream);
}

fn ts_clone(&mut self, stream: &Self::TokenStream) -> Self::TokenStream {
stream.clone()
}

fn ts_is_empty(&mut self, stream: &Self::TokenStream) -> bool {
stream.is_empty()
}

fn from_str(&mut self, src: &str) -> Self::TokenStream {
fn ts_from_str(&mut self, src: &str) -> Self::TokenStream {
unwrap_or_emit_fatal(source_str_to_stream(
self.psess(),
FileName::proc_macro_source_code(src),
Expand All @@ -568,11 +587,11 @@ impl server::TokenStream for Rustc<'_, '_> {
))
}

fn to_string(&mut self, stream: &Self::TokenStream) -> String {
fn ts_to_string(&mut self, stream: &Self::TokenStream) -> String {
pprust::tts_to_string(stream)
}

fn expand_expr(&mut self, stream: &Self::TokenStream) -> Result<Self::TokenStream, ()> {
fn ts_expand_expr(&mut self, stream: &Self::TokenStream) -> Result<Self::TokenStream, ()> {
// Parse the expression from our tokenstream.
let expr: PResult<'_, _> = try {
let mut p = Parser::new(self.psess(), stream.clone(), Some("proc_macro expand expr"));
Expand Down Expand Up @@ -633,14 +652,14 @@ impl server::TokenStream for Rustc<'_, '_> {
}
}

fn from_token_tree(
fn ts_from_token_tree(
&mut self,
tree: TokenTree<Self::TokenStream, Self::Span, Self::Symbol>,
) -> Self::TokenStream {
Self::TokenStream::new((tree, &mut *self).to_internal().into_iter().collect::<Vec<_>>())
}

fn concat_trees(
fn ts_concat_trees(
&mut self,
base: Option<Self::TokenStream>,
trees: Vec<TokenTree<Self::TokenStream, Self::Span, Self::Symbol>>,
Expand All @@ -654,7 +673,7 @@ impl server::TokenStream for Rustc<'_, '_> {
stream
}

fn concat_streams(
fn ts_concat_streams(
&mut self,
base: Option<Self::TokenStream>,
streams: Vec<Self::TokenStream>,
Expand All @@ -666,24 +685,22 @@ impl server::TokenStream for Rustc<'_, '_> {
stream
}

fn into_trees(
fn ts_into_trees(
&mut self,
stream: Self::TokenStream,
) -> Vec<TokenTree<Self::TokenStream, Self::Span, Self::Symbol>> {
FromInternal::from_internal((stream, self))
}
}

impl server::Span for Rustc<'_, '_> {
fn debug(&mut self, span: Self::Span) -> String {
fn span_debug(&mut self, span: Self::Span) -> String {
if self.ecx.ecfg.span_debug {
format!("{span:?}")
} else {
format!("{:?} bytes({}..{})", span.ctxt(), span.lo().0, span.hi().0)
}
}

fn file(&mut self, span: Self::Span) -> String {
fn span_file(&mut self, span: Self::Span) -> String {
self.psess()
.source_map()
.lookup_char_pos(span.lo())
Expand All @@ -693,7 +710,7 @@ impl server::Span for Rustc<'_, '_> {
.to_string()
}

fn local_file(&mut self, span: Self::Span) -> Option<String> {
fn span_local_file(&mut self, span: Self::Span) -> Option<String> {
self.psess()
.source_map()
.lookup_char_pos(span.lo())
Expand All @@ -708,41 +725,41 @@ impl server::Span for Rustc<'_, '_> {
})
}

fn parent(&mut self, span: Self::Span) -> Option<Self::Span> {
fn span_parent(&mut self, span: Self::Span) -> Option<Self::Span> {
span.parent_callsite()
}

fn source(&mut self, span: Self::Span) -> Self::Span {
fn span_source(&mut self, span: Self::Span) -> Self::Span {
span.source_callsite()
}

fn byte_range(&mut self, span: Self::Span) -> Range<usize> {
fn span_byte_range(&mut self, span: Self::Span) -> Range<usize> {
let source_map = self.psess().source_map();

let relative_start_pos = source_map.lookup_byte_offset(span.lo()).pos;
let relative_end_pos = source_map.lookup_byte_offset(span.hi()).pos;

Range { start: relative_start_pos.0 as usize, end: relative_end_pos.0 as usize }
}
fn start(&mut self, span: Self::Span) -> Self::Span {
fn span_start(&mut self, span: Self::Span) -> Self::Span {
span.shrink_to_lo()
}

fn end(&mut self, span: Self::Span) -> Self::Span {
fn span_end(&mut self, span: Self::Span) -> Self::Span {
span.shrink_to_hi()
}

fn line(&mut self, span: Self::Span) -> usize {
fn span_line(&mut self, span: Self::Span) -> usize {
let loc = self.psess().source_map().lookup_char_pos(span.lo());
loc.line
}

fn column(&mut self, span: Self::Span) -> usize {
fn span_column(&mut self, span: Self::Span) -> usize {
let loc = self.psess().source_map().lookup_char_pos(span.lo());
loc.col.to_usize() + 1
}

fn join(&mut self, first: Self::Span, second: Self::Span) -> Option<Self::Span> {
fn span_join(&mut self, first: Self::Span, second: Self::Span) -> Option<Self::Span> {
let self_loc = self.psess().source_map().lookup_char_pos(first.lo());
let other_loc = self.psess().source_map().lookup_char_pos(second.lo());

Expand All @@ -753,7 +770,7 @@ impl server::Span for Rustc<'_, '_> {
Some(first.to(second))
}

fn subspan(
fn span_subspan(
&mut self,
span: Self::Span,
start: Bound<usize>,
Expand Down Expand Up @@ -789,11 +806,11 @@ impl server::Span for Rustc<'_, '_> {
Some(span.with_lo(new_lo).with_hi(new_hi))
}

fn resolved_at(&mut self, span: Self::Span, at: Self::Span) -> Self::Span {
fn span_resolved_at(&mut self, span: Self::Span, at: Self::Span) -> Self::Span {
span.with_ctxt(at.ctxt())
}

fn source_text(&mut self, span: Self::Span) -> Option<String> {
fn span_source_text(&mut self, span: Self::Span) -> Option<String> {
self.psess().source_map().span_to_snippet(span).ok()
}

Expand Down Expand Up @@ -821,41 +838,21 @@ impl server::Span for Rustc<'_, '_> {
/// span from the metadata of `my_proc_macro` (which we have access to,
/// since we've loaded `my_proc_macro` from disk in order to execute it).
/// In this way, we have obtained a span pointing into `my_proc_macro`
fn save_span(&mut self, span: Self::Span) -> usize {
fn span_save_span(&mut self, span: Self::Span) -> usize {
self.psess().save_proc_macro_span(span)
}

fn recover_proc_macro_span(&mut self, id: usize) -> Self::Span {
fn span_recover_proc_macro_span(&mut self, id: usize) -> Self::Span {
let (resolver, krate, def_site) = (&*self.ecx.resolver, self.krate, self.def_site);
*self.rebased_spans.entry(id).or_insert_with(|| {
// FIXME: `SyntaxContext` for spans from proc macro crates is lost during encoding,
// replace it with a def-site context until we are encoding it properly.
resolver.get_proc_macro_quoted_span(krate, id).with_ctxt(def_site.ctxt())
})
}
}

impl server::Symbol for Rustc<'_, '_> {
fn normalize_and_validate_ident(&mut self, string: &str) -> Result<Self::Symbol, ()> {
fn symbol_normalize_and_validate_ident(&mut self, string: &str) -> Result<Self::Symbol, ()> {
let sym = nfc_normalize(string);
if rustc_lexer::is_ident(sym.as_str()) { Ok(sym) } else { Err(()) }
}
}

impl server::Server for Rustc<'_, '_> {
fn globals(&mut self) -> ExpnGlobals<Self::Span> {
ExpnGlobals {
def_site: self.def_site,
call_site: self.call_site,
mixed_site: self.mixed_site,
}
}

fn intern_symbol(string: &str) -> Self::Symbol {
Symbol::intern(string)
}

fn with_symbol_string(symbol: &Self::Symbol, f: impl FnOnce(&str)) {
f(symbol.as_str())
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ impl DepNodeColorMap {
let value = self.values[index].load(Ordering::Acquire);
// Green is by far the most common case. Check for that first so we can succeed with a
// single comparison.
if value < COMPRESSED_RED {
if value <= DepNodeIndex::MAX_AS_U32 {
DepNodeColor::Green(DepNodeIndex::from_u32(value))
} else if value == COMPRESSED_RED {
DepNodeColor::Red
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,8 +1596,11 @@ supported_targets! {
("armebv7r-none-eabi", armebv7r_none_eabi),
("armebv7r-none-eabihf", armebv7r_none_eabihf),
("armv7r-none-eabi", armv7r_none_eabi),
("thumbv7r-none-eabi", thumbv7r_none_eabi),
("armv7r-none-eabihf", armv7r_none_eabihf),
("thumbv7r-none-eabihf", thumbv7r_none_eabihf),
("armv8r-none-eabihf", armv8r_none_eabihf),
("thumbv8r-none-eabihf", thumbv8r_none_eabihf),

("armv7-rtems-eabihf", armv7_rtems_eabihf),

Expand Down Expand Up @@ -1649,7 +1652,9 @@ supported_targets! {
("thumbv8m.main-none-eabihf", thumbv8m_main_none_eabihf),

("armv7a-none-eabi", armv7a_none_eabi),
("thumbv7a-none-eabi", thumbv7a_none_eabi),
("armv7a-none-eabihf", armv7a_none_eabihf),
("thumbv7a-none-eabihf", thumbv7a_none_eabihf),
("armv7a-nuttx-eabi", armv7a_nuttx_eabi),
("armv7a-nuttx-eabihf", armv7a_nuttx_eabihf),
("armv7a-vex-v5", armv7a_vex_v5),
Expand Down
Loading
Loading