Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b5b31a1
Replace `CrateDump` with the Debug impl from `CStore`
blyxyas Jul 2, 2026
da005a1
tests/ui/union/union-nodrop.rs: fix typo "expressios"
DanielEScherzer Aug 12, 2026
7c88962
add crashtests, remove unused aux files
cyrgani Aug 16, 2026
5e123fc
test aarch64 Complex
folkertdev Jul 13, 2026
1115605
test arm Complex
folkertdev Jul 13, 2026
097db24
test riscv/loongarch Complex
folkertdev Jul 13, 2026
67f7dd4
_Complex for s390x
folkertdev Jul 25, 2026
d27bb7c
_Complex for wasm
folkertdev Jul 25, 2026
1fb3384
_Complex for csky
folkertdev Jul 26, 2026
5e226be
Put back `tests/rustdoc-gui/search-result-display.goml`
GuillaumeGomez Aug 22, 2026
84ba90f
Unify the "wait search results" approach by reusing the same function
GuillaumeGomez Aug 22, 2026
b14b89f
Bump cfg_aliases to 0.2.2
zachs18 Aug 23, 2026
0d74fb7
re-bless `pretty-std` on windows
Walnut356 Aug 23, 2026
615e6d1
update eyre
RalfJung Aug 23, 2026
00be974
std: reduce visibility of some internal OsStr related types
pacak Aug 3, 2026
8662be8
core: refactor tests/pattern.rs tests
pacak Aug 3, 2026
1867b66
Add test for attribute in use tree
scrabsha Aug 23, 2026
e6e1f04
Recover on attribute in use tree
scrabsha Apr 10, 2026
1333ad7
Small tweaks to parse error recovery code
fmease Aug 23, 2026
1bb1610
[Bootstrap] Use full exact CI `llvm-config` executable path
jieyouxu Aug 23, 2026
3dee3c5
Path: use optimized is_empty() method
GTimothy Aug 23, 2026
2ea2b40
Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`
GuillaumeGomez Aug 23, 2026
6bc1b1b
-Ctarget-feature is not unsafe (any more)
RalfJung Aug 3, 2026
df3653a
coretests: Add a few tests for backward multibyte predicate
pacak Aug 11, 2026
7ba1be5
fix the reporting of layout normalization failures in transmute checks
meta-legend Jul 17, 2026
23e5d16
Rollup merge of #161187 - folkertdev:complex-layout-simple-targets, r…
JonathanBrouwer Aug 23, 2026
1787168
Rollup merge of #161524 - GuillaumeGomez:flaky-gui-back, r=urgau
JonathanBrouwer Aug 23, 2026
e33c715
Rollup merge of #161592 - pacak:change-pattern-tests, r=nia-e
JonathanBrouwer Aug 23, 2026
4b2e227
Rollup merge of #161602 - GuillaumeGomez:fix-flaky-test, r=Urgau
JonathanBrouwer Aug 23, 2026
2d17210
Rollup merge of #155254 - scrabsha:push-qlmmuuwqnoqv, r=fmease
JonathanBrouwer Aug 23, 2026
6eab1a6
Rollup merge of #158695 - blyxyas:remove-cratedump, r=fmease
JonathanBrouwer Aug 23, 2026
e1d48aa
Rollup merge of #159456 - meta-legend:fix-149588, r=cjgillot
JonathanBrouwer Aug 23, 2026
88c1d54
Rollup merge of #160452 - RalfJung:target-feature-safe, r=bjorn3
JonathanBrouwer Aug 23, 2026
78f3d8b
Rollup merge of #161007 - DanielEScherzer:union-nodrop-typo, r=fmease
JonathanBrouwer Aug 23, 2026
ccc50d0
Rollup merge of #161166 - cyrgani:tests-5, r=fmease
JonathanBrouwer Aug 23, 2026
780a8a1
Rollup merge of #161569 - zachs18:bump-cfg_aliases, r=hanna-kruppe
JonathanBrouwer Aug 23, 2026
eae5c4a
Rollup merge of #161573 - Walnut356:pretty_std_msvc, r=jieyouxu
JonathanBrouwer Aug 23, 2026
35bc2a7
Rollup merge of #161588 - RalfJung:eyre, r=jieyouxu
JonathanBrouwer Aug 23, 2026
6a4f647
Rollup merge of #161589 - pacak:private-osstr, r=clarfonthey
JonathanBrouwer Aug 23, 2026
67760a2
Rollup merge of #161598 - jieyouxu:jieyouxu/fix/bootstrap-ci-llvm-con…
JonathanBrouwer Aug 23, 2026
3bab4d4
Rollup merge of #161601 - GTimothy:empty-path-optim, r=fmease
JonathanBrouwer Aug 23, 2026
2897969
Rollup merge of #161604 - pacak:test-multibyte, r=nia-e
JonathanBrouwer Aug 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
9 changes: 5 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"

[[package]]
name = "cfg_aliases"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"

[[package]]
name = "chacha20"
Expand Down Expand Up @@ -1400,10 +1400,11 @@ dependencies = [

[[package]]
name = "eyre"
version = "0.6.12"
version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec"
checksum = "c08309dbcc659c5549a24ddb9b27027640641b282ef5768267c7e675558986a3"
dependencies = [
"autocfg",
"indenter",
"once_cell",
]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/rpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ fn get_rpath_relative_to_output(config: &RPathConfig<'_>, lib: &Path) -> OsStrin
let output = config.out_filename.parent().unwrap();

// If output or lib is empty, just assume it locates in current path
let lib = if lib == Path::new("") { Path::new(".") } else { lib };
let output = if output == Path::new("") { Path::new(".") } else { output };
let lib = if lib.is_empty() { Path::new(".") } else { lib };
let output = if output.is_empty() { Path::new(".") } else { output };

let lib = try_canonicalize(lib).unwrap();
let output = try_canonicalize(output).unwrap();
Expand Down
19 changes: 7 additions & 12 deletions compiler/rustc_hir_typeck/src/intrinsicck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,15 @@ fn check_transmute<'tcx>(
hir_id: HirId,
) -> Result<(), ErrorGuaranteed> {
let span = tcx.hir_span(hir_id);
let normalize = |ty| {
if let Ok(ty) = tcx.try_normalize_erasing_regions(typing_env, ty) {
ty
} else {
Ty::new_error_with_message(
tcx,
span,
format!("tried to normalize non-wf type {ty:#?} in check_transmute"),
)
}
let normalize = |ty: Unnormalized<'tcx, Ty<'tcx>>| -> Result<Ty<'tcx>, ErrorGuaranteed> {
tcx.try_normalize_erasing_regions(typing_env, ty).map_err(|err| {
let err = LayoutError::NormalizationFailure(ty.skip_normalization(), err);
tcx.dcx().struct_span_err(span, err.to_string()).emit()
})
};

let from = normalize(from);
let to = normalize(to);
let from = normalize(from)?;
let to = normalize(to)?;
trace!(?from, ?to);

// Transmutes that are only changing lifetimes are always ok.
Expand Down
14 changes: 3 additions & 11 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ pub struct CStore {
has_crate_resolve_with_fail: bool,
}

impl std::fmt::Debug for CStore {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CStore").finish_non_exhaustive()
}
}

pub enum LoadedMacro {
MacroDef {
def: MacroDef,
Expand All @@ -113,12 +107,10 @@ enum LoadResult {
Loaded(Library),
}

struct CrateDump<'a>(&'a CStore);

impl<'a> std::fmt::Debug for CrateDump<'a> {
impl std::fmt::Debug for CStore {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(fmt, "resolved crates:")?;
for (cnum, data) in self.0.iter_crate_data() {
for (cnum, data) in self.iter_crate_data() {
writeln!(fmt, " name: {}", data.name())?;
writeln!(fmt, " cnum: {cnum}")?;
writeln!(fmt, " hash: {}", data.hash())?;
Expand Down Expand Up @@ -1288,7 +1280,7 @@ impl CStore {
self.report_unused_deps_in_crate(tcx, krate);
self.report_future_incompatible_deps(tcx, krate);

info!("{:?}", CrateDump(self));
info!("{:?}", self);
}

/// Process an `extern crate foo` AST node.
Expand Down
21 changes: 21 additions & 0 deletions compiler/rustc_parse/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,27 @@ pub(crate) struct ArrayBracketsInsteadOfBracesSugg {
pub right: Span,
}

#[derive(Diagnostic)]
#[diag("attributes are not allowed inside imports")]
pub(crate) struct AttrInUseTree {
#[primary_span]
pub attr_span: Span,
#[subdiagnostic]
pub sub: Option<AttrInUseTreeSugg>,
}

#[derive(Subdiagnostic)]
#[multipart_suggestion("move the import to its own item", style = "verbose")]
pub(crate) struct AttrInUseTreeSugg {
#[suggestion_part(code = "{code}")]
pub use_lo: Span,
#[suggestion_part(code = "")]
pub attr_span: Span,
#[suggestion_part(code = "")]
pub tree_span: Span,
pub code: String,
}

#[derive(Diagnostic)]
#[diag("`match` arm body without braces")]
pub(crate) struct MatchArmBodyWithoutBraces {
Expand Down
14 changes: 9 additions & 5 deletions compiler/rustc_parse/src/parser/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,15 @@ impl<'a> Parser<'a> {
/// Parses an inner part of an attribute (the path and following tokens).
/// The tokens must be either a delimited token stream, or empty token stream,
/// or the "legacy" key-value form.
/// PATH `(` TOKEN_STREAM `)`
/// PATH `[` TOKEN_STREAM `]`
/// PATH `{` TOKEN_STREAM `}`
/// PATH
/// PATH `=` UNSUFFIXED_LIT
///
/// ```text
/// PATH `(` TOKEN_STREAM `)`
/// PATH `[` TOKEN_STREAM `]`
/// PATH `{` TOKEN_STREAM `}`
/// PATH
/// PATH `=` UNSUFFIXED_LIT
/// ```
///
/// The delimiters or `=` are still put into the resulting token stream.
pub fn parse_attr_item(
&mut self,
Expand Down
103 changes: 95 additions & 8 deletions compiler/rustc_parse/src/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ impl<'a> Parser<'a> {
}

fn parse_use_item(&mut self) -> PResult<'a, ItemKind> {
let tree = self.parse_use_tree()?;
let use_token_span = self.prev_token.span;
let tree = self.parse_use_tree(use_token_span, None)?;
if let Err(mut e) = self.expect_semi() {
match tree.kind {
UseTreeKind::Glob(_) => {
Expand Down Expand Up @@ -1317,7 +1318,11 @@ impl<'a> Parser<'a> {
/// PATH `::` `{` USE_TREE_LIST `}` |
/// PATH [`as` IDENT]
/// ```
fn parse_use_tree(&mut self) -> PResult<'a, UseTree> {
fn parse_use_tree<'b>(
&mut self,
use_token_span: Span,
use_path: Option<&'b UsePathList<'b>>,
) -> PResult<'a, UseTree> {
let lo = self.token.span;

let mut prefix = ast::Path { segments: ThinVec::new(), span: lo.shrink_to_lo() };
Expand All @@ -1331,13 +1336,14 @@ impl<'a> Parser<'a> {
.push(PathSegment::path_root(lo.shrink_to_lo().with_ctxt(mod_sep_ctxt)));
}

self.parse_use_tree_glob_or_nested()?
self.parse_use_tree_glob_or_nested(use_token_span, use_path)?
} else {
// `use path::*;` or `use path::{...};` or `use path;` or `use path as bar;`
prefix = self.parse_path(PathStyle::Mod)?;

if self.eat_path_sep() {
self.parse_use_tree_glob_or_nested()?
let use_path = UsePathList { elements: &prefix.segments, prev: use_path };
self.parse_use_tree_glob_or_nested(use_token_span, Some(&use_path))?
} else {
// Recover from using a colon as path separator.
while self.eat_noexpect(&token::Colon) {
Expand All @@ -1358,13 +1364,17 @@ impl<'a> Parser<'a> {
}

/// Parses `*` or `{...}`.
fn parse_use_tree_glob_or_nested(&mut self) -> PResult<'a, UseTreeKind> {
fn parse_use_tree_glob_or_nested<'b>(
&mut self,
use_token_span: Span,
use_path: Option<&'b UsePathList<'b>>,
) -> PResult<'a, UseTreeKind> {
Ok(if self.eat(exp!(Star)) {
UseTreeKind::Glob(self.prev_token.span)
} else {
let lo = self.token.span;
UseTreeKind::Nested {
items: self.parse_use_tree_list()?,
items: self.parse_use_tree_list(use_token_span, use_path)?,
span: lo.to(self.prev_token.span),
}
})
Expand All @@ -1375,14 +1385,85 @@ impl<'a> Parser<'a> {
/// ```text
/// USE_TREE_LIST = ∅ | (USE_TREE `,`)* USE_TREE [`,`]
/// ```
fn parse_use_tree_list(&mut self) -> PResult<'a, ThinVec<(UseTree, ast::NodeId)>> {
fn parse_use_tree_list<'b>(
&mut self,
use_token_span: Span,
prefix: Option<&'b UsePathList<'b>>,
) -> PResult<'a, ThinVec<(UseTree, ast::NodeId)>> {
self.parse_delim_comma_seq(exp!(OpenBrace), exp!(CloseBrace), |p| {
p.recover_vcs_conflict_marker();
Ok((p.parse_use_tree()?, DUMMY_NODE_ID))

let mut attr_span = None;
let attrs = p.parse_outer_attributes()?;
if !attrs.is_empty() {
let raw_attrs = attrs.take_for_recovery(&p.psess);
attr_span =
Some(raw_attrs.first().unwrap().span.to(raw_attrs.last().unwrap().span));
}

let use_tree = p.parse_use_tree(use_token_span, prefix)?;

if let Some(attr_span) = attr_span {
p.emit_error_attr_in_use_tree(use_token_span, prefix, use_tree.span(), attr_span);
}

Ok((use_tree, DUMMY_NODE_ID))
})
.map(|(r, _)| r)
}

fn emit_error_attr_in_use_tree(
&self,
use_token_span: Span,
mut prefix: Option<&UsePathList<'_>>,
use_tree_span: Span,
attr_span: Span,
) {
let Ok(attr) = self.psess.source_map().span_to_snippet(attr_span) else { return };

let prefix: Vec<_> = {
let mut tmp = Vec::new();
while let Some(prefix_) = prefix {
tmp.push(prefix_.elements);
prefix = prefix_.prev;
}
tmp.reverse();
tmp.into_iter().flatten().collect()
};

let prefix: String = prefix
.iter()
.map(|seg| if seg.ident.name == kw::PathRoot { "" } else { seg.ident.as_str() })
.intersperse("::")
.collect();

let mut comma_reached = false;
let Ok(tree_span) = self.psess.source_map().span_extend_while(use_tree_span, |c| {
if comma_reached {
return false;
}
comma_reached = c == ',';
c.is_whitespace() || comma_reached
}) else {
return;
};

let Ok(use_tree) = self.psess.source_map().span_to_snippet(use_tree_span) else { return };

// FIXME: duplicate the attributes that are at the root of the initial use-item.
let code = format!("{attr}\nuse {prefix}::{use_tree};\n");

self.dcx().emit_err(crate::diagnostics::AttrInUseTree {
attr_span,
sub: Some(crate::diagnostics::AttrInUseTreeSugg {
use_lo: use_token_span.shrink_to_lo(),
attr_span,
tree_span,
code,
}),
});
}

fn parse_rename(&mut self) -> PResult<'a, Option<Ident>> {
if self.eat_keyword(exp!(As)) {
self.parse_ident_or_underscore().map(Some)
Expand Down Expand Up @@ -2737,7 +2818,13 @@ impl<'a> Parser<'a> {
}
}
}

enum IsMacroRulesItem {
Yes { has_bang: bool },
No,
}

struct UsePathList<'a> {
elements: &'a [ast::PathSegment],
prev: Option<&'a Self>,
}
8 changes: 5 additions & 3 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2335,10 +2335,12 @@ options! {
parse_symbol_mangling_version, [TRACKED],
"which mangling version to use for symbol names ('legacy', 'v0' (default), or 'hashed')"),
target_cpu: Option<String> = (None, parse_opt_string, [TRACKED] { TARGET_MODIFIER: TargetCpu },
"select target processor (`rustc --print target-cpus` for details)"),
"select target processor (`rustc --print target-cpus` for details) \
The resulting binary must only be executed on CPUs that have all the features \
of the given CPU."),
target_feature: String = (String::new(), parse_target_feature, [TRACKED],
"target specific attributes. (`rustc --print target-features` for details). \
This feature is unsafe."),
"target-specific attributes (`rustc --print target-features` for details). \
The resulting binary must only be executed on CPUs that have all the given features."),
unsafe_allow_abi_mismatch: Vec<String> = (Vec::new(), parse_comma_list, [UNTRACKED],
"Allow incompatible target modifiers in dependency crates (comma separated list)"),
// tidy-alphabetical-end
Expand Down
10 changes: 7 additions & 3 deletions compiler/rustc_span/src/source_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,13 @@ impl SourceMap {
/// Extracts the source surrounding the given `Span` using the `extract_source` function. The
/// extract function takes three arguments: a string slice containing the source, an index in
/// the slice for the beginning of the span and an index in the slice for the end of the span.
pub fn span_to_source<F, T>(&self, sp: Span, extract_source: F) -> Result<T, SpanSnippetError>
pub fn span_to_source<F, T>(
&self,
sp: Span,
mut extract_source: F,
) -> Result<T, SpanSnippetError>
where
F: Fn(&str, usize, usize) -> Result<T, SpanSnippetError>,
F: FnMut(&str, usize, usize) -> Result<T, SpanSnippetError>,
{
let local_begin = self.lookup_byte_offset(sp.lo());
let local_end = self.lookup_byte_offset(sp.hi());
Expand Down Expand Up @@ -753,7 +757,7 @@ impl SourceMap {
pub fn span_extend_while(
&self,
span: Span,
f: impl Fn(char) -> bool,
mut f: impl FnMut(char) -> bool,
) -> Result<Span, SpanSnippetError> {
self.span_to_source(span, |s, _start, end| {
let n = s[end..].char_indices().find(|&(_, c)| !f(c)).map_or(s.len() - end, |(i, _)| i);
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_target/src/callconv/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ where
return;
}

if arg.layout.is_complex_number(cx) {
arg.make_indirect();
return;
}

let size = arg.layout.size;
if size.bits() <= 128 {
if let BackendRepr::SimdVector { .. } = arg.layout.backend_repr {
Expand Down
Loading
Loading