Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5e2ccb2
stabilize optimize attribute (size, speed, and none)
veluca93 Jun 1, 2026
3b3ba8b
peel_transparent_wrappers only works on non-1ZST
RalfJung Aug 30, 2026
6e8947a
leave a comment for some sve hacks
RalfJung Sep 4, 2026
5e9dca9
cache results in improper_ctypes lint
xonx4l Sep 25, 2026
30c3ff8
abby: ensure forall where clause lhs is alias, placeholder, or lifetime
khyperia Oct 1, 2026
fa3bfde
fix build errors
xonx4l Oct 1, 2026
e733825
On name resolution error in parameter list, suggest possible `const` …
estebank Dec 8, 2025
80f91df
Do not emit E0747 if a resolve error was already emitted
estebank Dec 8, 2025
8652467
review comment: move change of path source to smart_resolve_report_er…
estebank Jul 29, 2026
7a1ec8e
check is_indirect_first_projection when replacing in RefProp
saethlin Oct 5, 2026
66c7ec6
Avoid `as_c_char_ptr` in debuginfo
Zalathar Oct 5, 2026
891c24d
Avoid `as_c_char_ptr` in `declare.rs`
Zalathar Oct 5, 2026
ae54544
Avoid `as_c_char_ptr` in `write.rs`
Zalathar Oct 5, 2026
0f7320c
Use target_family = "wasm" instead of target_arch = "wasm32"
madsmtm Oct 5, 2026
54bdb68
Add `has_reliable_f16b` for Arm
Jamesbarford Oct 5, 2026
9837aeb
Update books
rustbot Oct 5, 2026
e779bd7
oneshot `is_ready`
connortsui20 Feb 3, 2026
54a6d2e
factor out as check_ffi_type method
xonx4l Oct 5, 2026
9de9ceb
Move more tests around in `rustdoc-html`
GuillaumeGomez Oct 4, 2026
78aa1c8
Replace some `!has` checks in `rustdoc-html` test
GuillaumeGomez Oct 4, 2026
60afb41
ci: update to PowerShell 7.6.6
cuviper Oct 6, 2026
f57e16d
add `required_python_version` to jobs
Walnut356 Sep 21, 2026
9109556
run LLDB debuginfo tests on Windows CI
Walnut356 Oct 6, 2026
e1a95eb
use the type name instead of `Self` in constructor paths again
cyrgani Oct 6, 2026
aec15ee
Remove CLAUDE.md
jyn514 Oct 6, 2026
2553cca
add if-installed:auto:spellcheck to pre-push script
bb1yd Oct 6, 2026
b71426d
Add regression test for duplicated rustdoc search results between std…
GuillaumeGomez Oct 6, 2026
87ec21a
Adjust the adjustment to wasi TLS to no longer adjust
maxdexh Oct 5, 2026
3bc8827
continue next-solver crashes triage
lcnr Oct 5, 2026
5c5254e
cont tests/crashes migration
lcnr Oct 5, 2026
ee6d48c
remove duplicate test
lcnr Oct 5, 2026
d84ec36
more things which no longer ICE
lcnr Oct 5, 2026
b7763ca
more next-solver crashes migration
lcnr Oct 5, 2026
e79214f
more crashes tests
lcnr Oct 5, 2026
be29dc2
more tests :3
lcnr Oct 5, 2026
88cd166
one more crashes test
lcnr Oct 5, 2026
24adadc
remove duplicate test
lcnr Oct 5, 2026
9bf73a1
more crashes tests
lcnr Oct 5, 2026
c930405
remove duplicate crashes test
lcnr Oct 5, 2026
7400ef0
continue crashes triage
lcnr Oct 5, 2026
c984192
crashes issue triage
lcnr Oct 5, 2026
5975e49
add crashes test
lcnr Oct 5, 2026
d0acaae
more crashes tests
lcnr Oct 5, 2026
dcde4ee
more crashes triage
lcnr Oct 6, 2026
905891e
remove duplicate test
lcnr Oct 6, 2026
9be63df
more crashes tests
lcnr Oct 6, 2026
7b5a600
yeet duplicate test
lcnr Oct 6, 2026
9883d34
yeet duplicate test
lcnr Oct 6, 2026
743fe79
add regression test
lcnr Oct 6, 2026
60e0ae0
more crashes tests
lcnr Oct 6, 2026
9e42fc7
add crashes test
lcnr Oct 6, 2026
baa2503
yeet duplicate test
lcnr Oct 6, 2026
89242d8
yeet duplicate test
lcnr Oct 6, 2026
ab3e7ce
crashes migration
lcnr Oct 6, 2026
b1a3475
`unit` and `[1 x unit]` layouts are incompatible on `aarch64_be`
folkertdev Sep 25, 2026
579a6bd
review
lcnr Oct 6, 2026
a2ca8f2
INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section
ognevny Oct 6, 2026
ea97485
Document the `rustc_on_unimplemented` attribute.
mejrs Sep 29, 2026
aaa57c9
Shrink `PartialRes` and its alignment
joshtriplett Oct 7, 2026
fe421b4
Rollup merge of #163090 - Walnut356:windows_debuginfo, r=Kobzol,jieyouxu
JonathanBrouwer Oct 7, 2026
7b33779
Rollup merge of #163806 - lcnr:crashes-migration-cont, r=lqd
JonathanBrouwer Oct 7, 2026
bd95aa2
Rollup merge of #163508 - mejrs:rustc_on_unimplemented_docs, r=boxyuwu
JonathanBrouwer Oct 7, 2026
1359357
Rollup merge of #163794 - madsmtm:target_family_wasm, r=alexcrichton
JonathanBrouwer Oct 7, 2026
66f85b3
Rollup merge of #163863 - cyrgani:annoying-attr-macros, r=nnethercote
JonathanBrouwer Oct 7, 2026
403be99
Rollup merge of #163864 - jyn514:remove-claude, r=Turbo87
JonathanBrouwer Oct 7, 2026
08f47fe
Rollup merge of #163877 - GuillaumeGomez:duplicated-std-core, r=notri…
JonathanBrouwer Oct 7, 2026
19197d1
Rollup merge of #163916 - joshtriplett:partialres-shrink, r=lqd
JonathanBrouwer Oct 7, 2026
ec2dfaa
Rollup merge of #149753 - estebank:issue-149660, r=chenyukang
JonathanBrouwer Oct 7, 2026
b2f3685
Rollup merge of #152557 - connortsui20:oneshot-is-ready, r=clarfonthey
JonathanBrouwer Oct 7, 2026
e65b369
Rollup merge of #157273 - veluca93:optimize-attribte, r=wesleywiser
JonathanBrouwer Oct 7, 2026
4546423
Rollup merge of #162000 - RalfJung:peel_transparent_wrappers, r=folke…
JonathanBrouwer Oct 7, 2026
d4ae140
Rollup merge of #163257 - khyperia:abby-check-where-clause, r=BoxyUwU…
JonathanBrouwer Oct 7, 2026
44a3f1d
Rollup merge of #163343 - folkertdev:abi-array-incompatible, r=beetrees
JonathanBrouwer Oct 7, 2026
15e7e28
Rollup merge of #163348 - xonx4l:improper_ctypes-lint-cache, r=nnethe…
JonathanBrouwer Oct 7, 2026
fbedeb5
Rollup merge of #163768 - GuillaumeGomez:clean-rustdoc-html-tests, r=…
JonathanBrouwer Oct 7, 2026
24a8718
Rollup merge of #163778 - saethlin:refprop-indirect-places, r=dianqk
JonathanBrouwer Oct 7, 2026
b7b41e2
Rollup merge of #163789 - Zalathar:as-c-char-ptr, r=hanna-kruppe
JonathanBrouwer Oct 7, 2026
bc4b0c1
Rollup merge of #163807 - Jamesbarford:fix/reliable-f16b-arm, r=folke…
JonathanBrouwer Oct 7, 2026
9066e5d
Rollup merge of #163809 - maxdexh:destroy-the-locals, r=alexcrichton
JonathanBrouwer Oct 7, 2026
3e28cc7
Rollup merge of #163826 - rustbot:docs-update, r=traviscross
JonathanBrouwer Oct 7, 2026
840c8de
Rollup merge of #163849 - cuviper:pwsh-7.6.6, r=ubiratansoares
JonathanBrouwer Oct 7, 2026
e4ed632
Rollup merge of #163869 - ognevny:install.md-ucrt64, r=mati865
JonathanBrouwer Oct 7, 2026
b48cef9
Rollup merge of #163870 - bb1yd:enable-auto-spellcheck, r=Kobzol
JonathanBrouwer Oct 7, 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: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ jobs:
- name: install ninja
run: src/ci/scripts/install-ninja.sh

- name: install required Python version
# LLDB on Windows requires the same Python version it was built against to be the first
# discoverable Python in $env:PATH. Only install if we're actually running Windows tests
# that use LLDB
if: ${{ startsWith(matrix.os, 'windows') && matrix.required_python_version}}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.required_python_version }}

- name: enable ipv6 on Docker
# Don't run on codebuild because systemctl is not available
if: ${{ !matrix.codebuild }}
Expand Down
1 change: 0 additions & 1 deletion CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4339,6 +4339,7 @@ dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hashes",
"rustc_hir",
"rustc_index",
"rustc_infer",
Expand Down
20 changes: 10 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ toolchain.

2. Download and install [Git for Windows](https://git-scm.com/download/win).
Make sure that it's in your Windows PATH. To enable access to it from within
MSYS2, edit the relevant `mingw[32|64].ini` file in your MSYS2 installation
MSYS2, edit the relevant `[mingw32|ucrt64].ini` file in your MSYS2 installation
directory and uncomment the line `MSYS2_PATH_TYPE=inherit`.

You could install and use MSYS2's version of git instead with `pacman`,
however this is not recommended as it's excruciatingly slow, and not frequently
tested for compatibility.

3. Start a MINGW64 or MINGW32 shell (depending on whether you want 32-bit
or 64-bit Rust) either from your start menu, or by running `mingw64.exe`
3. Start a UCRT64 or MINGW32 shell (depending on whether you want 32-bit
or 64-bit Rust) either from your start menu, or by running `ucrt64.exe`
or `mingw32.exe` from your MSYS2 installation directory (e.g. `C:\msys64`).

4. From this terminal, install the required tools:
Expand All @@ -202,17 +202,17 @@ toolchain.
pacman -Sy pacman-mirrors

# Install build tools needed for Rust. If you're building a 32-bit compiler,
# then replace "x86_64" below with "i686".
# Note that it is important that you do **not** use the 'python2', 'cmake',
# then replace "ucrt-x86_64" below with "i686".
# Note that it is important that you do **not** use the 'python', 'cmake',
# and 'ninja' packages from the 'msys2' subsystem.
# The build has historically been known to fail with these packages.
pacman -S make \
pacman -S --needed make \
diffutils \
tar \
mingw-w64-x86_64-python \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-ninja
mingw-w64-ucrt-x86_64-python \
mingw-w64-ucrt-x86_64-cmake \
mingw-w64-ucrt-x86_64-gcc \
mingw-w64-ucrt-x86_64-ninja
```

5. Navigate to Rust's source code (or clone it), then build it:
Expand Down
19 changes: 15 additions & 4 deletions compiler/rustc_abi/src/layout/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,25 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
where
Ty: TyAbiInterface<'a, C> + Copy,
{
let base = self.peel_transparent_wrappers(cx);
// FIXME: Peeling the wrappers above would not work correctly if we are a 1-ZST. So we make
// `#[rustc_pass_indirectly_in_non_rustic_abis]` a NOP on 1-ZST. In the future,
// `non_1zst_field` should become `non_trivial_abi_field` and
// `#[rustc_pass_indirectly_in_non_rustic_abis]` should make a type have non-trivial ABI.
if self.is_1zst() {
return false;
}

let base = self.peel_transparent_wrappers_from_non_1zst(cx);
Ty::is_pass_indirectly_in_non_rustic_abis_flag_set(base)
}

/// Recursively peel away transparent wrappers, returning the inner value.
/// Will not peel anything if `self` is a 1-ZST! Callers need to either check
/// that the result is not a 1-ZST, or have separate logic for that.
///
/// The return value is not `repr(transparent)` and/or does
/// not have a non-1zst field.
pub fn peel_transparent_wrappers<C>(mut self, cx: &C) -> Self
pub fn peel_transparent_wrappers_from_non_1zst<C>(mut self, cx: &C) -> Self
where
Ty: TyAbiInterface<'a, C> + Copy,
{
Expand Down Expand Up @@ -321,12 +331,13 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
where
Ty: TyAbiInterface<'a, C> + Copy,
{
let complex = self.peel_transparent_wrappers(cx);
// We're checking for scalar repr below which excludes 1-ZST.
let complex = self.peel_transparent_wrappers_from_non_1zst(cx);
if !Ty::is_complex_number_lang_item(complex, cx) {
return None;
}

let component = complex.field(cx, 0).peel_transparent_wrappers(cx);
let component = complex.field(cx, 0).peel_transparent_wrappers_from_non_1zst(cx);

let BackendRepr::Scalar(scalar) = component.backend_repr else {
return None;
Expand Down
111 changes: 111 additions & 0 deletions compiler/rustc_attr_ir/src/attribute_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,114 @@ const _: () = ();
/// [`mem::type_info`]: std::mem::type_info
/// [reflection and comptime project goal]: https://goals.rust-lang.org/2026/reflection-and-comptime.html
const _: () = ();

#[doc(attribute = "rustc_on_unimplemented")]
/// Customize the error message when a trait is not implemented.
///
/// It must be used on the declaration of said trait.
///
/// # Syntax
///
/// ```grammar
/// RustcOnUnimplementedAttribute ->
/// rustc_on_unimplemented ( ( Directive ),+ )
///
/// Directive ->
/// on ( Filter, ( DirectiveOption ),+ )
/// | ( DirectiveOption ),*
///
/// DirectiveOption ->
/// message = STRING_LITERAL
/// | label = STRING_LITERAL
/// | note = STRING_LITERAL
///
/// Filter ->
/// FilterAll
/// | FilterAny
/// | FilterNot
/// | FilterOption
///
/// FilterAll ->
/// all ( ( Filter ),* )
///
/// FilterAny ->
/// any ( ( Filter ),* )
///
/// FilterNot ->
/// not ( Filter )
///
/// FilterOption ->
/// crate_local
/// | direct
/// | from_desugaring ( = STRING_LITERAL )?
/// | cause = STRING_LITERAL
/// | IDENTIFIER = STRING_LITERAL
///
/// ```
///
/// The following keys have the given meaning. At least one must be specified.
/// - `on` - filters the application of the attribute. See [#Filters](#filters).
/// - `message` — The text for the top level error message. May only be specified at most once.
/// - `label` — The text for the label shown inline in the broken code in the error message.
/// May only be specified at most once.
/// - `note` — Provides additional note(s)
///
/// `message`, `label`, and `note` are available with the [`diagnostic::on_unimplemented`]
/// attribute. If possible, use that instead.
///
/// # Example
///
#[doc = include_example!("rustc_on_unimplemented")]
///
/// # Filters
///
/// To allow more targeted error messages, it is possible to filter the
/// application of these keys with `on`.
///
/// You can filter on the following boolean flags:
/// - `crate_local`: whether the code causing the trait bound to not be
/// fulfilled is part of the user's crate.
/// This is used to avoid suggesting code changes that would require modifying a dependency.
/// - `direct`: whether this is a user-specified rather than derived obligation.
/// - `from_desugaring`: whether we are in some kind of desugaring, like `?`
/// or a `try` block for example.
/// This flag can also be matched on, see below.
///
/// You can match on the following names and values, using `name = "value"`:
/// - `cause`: Match against one variant of the `ObligationCauseCode` enum.
/// Only `"MainFunctionType"` is supported.
/// - `from_desugaring`: Match against a particular variant of the `DesugaringKind` enum.
/// The desugaring is identified by its variant name, for example
/// `"QuestionMark"` for `?` desugaring, or `"TryBlock"` for `try` blocks.
/// - `Self` and any generic arguments of the trait, like `Self = "alloc::string::String"`
/// or `Rhs="i32"`.
///
/// The compiler provides several values to match on, for example:
/// - the self_ty, pretty printed with and without type arguments resolved.
/// - `"{integral}"`, if self_ty is an integral of which the type is known.
/// - `"[]"`, `"[{ty}]"`, `"[{ty}; _]"`, `"[{ty}; $N]"` when applicable.
/// - references to said slices and arrays.
/// - `"fn"`, `"unsafe fn"` or `"#[target_feature] fn"` when self is a function.
/// - `"{integer}"` and `"{float}"` if the type is a number but we haven't inferred it yet.
/// - `"{struct}"`, `"{enum}"` and `"{union}"` to match self as an ADT
/// - combinations of the above, like `"[{integral}; _]"`.
///
#[doc = include_example!("rustc_on_unimplemented_filter")]
///
/// # Formatting
///
/// The string literals are format strings that accept parameters wrapped in braces -
/// positional and listed parameters are not accepted.
/// The following parameter names are valid:
/// - `Self` and all generic parameters of the trait.
/// - `This`: the name of the trait the attribute is on, without generics.
/// - `This:path`: the full path of the trait the attribute is on, with unresolved generics.
/// - `This:resolved`: the full path of the trait the attribute is on, with resolved generics.
/// Additionally, this will "sugar" the `Fn(...)` traits.
/// - `ItemContext`: the kind of `hir::Node` we're in, things like `"an async block"`,
/// `"a function"`, `"an async function"`, etc.
///
#[doc = include_example!("rustc_on_unimplemented_format")]
///
/// [`diagnostic::on_unimplemented`]: https://doc.rust-lang.org/nightly/reference/attributes/diagnostics.html#the-diagnosticon_unimplemented-attribute
const _: () = ();
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl SingleAttributeParser for OptimizeParser {
Allow(Target::Method(MethodKind::Inherent)),
]);
const TEMPLATE: AttributeTemplate = template!(List: &["size", "speed", "none"]);
const STABILITY: AttributeStability = unstable!(optimize_attribute);
const STABILITY: AttributeStability = AttributeStability::Stable;

fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option<AttributeKind> {
let single = cx.expect_single_element_list(args, cx.attr_span)?;
Expand Down
9 changes: 4 additions & 5 deletions compiler/rustc_builtin_macros/src/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn cs_clone_simple(
&[sym::clone, sym::AssertParamIsCopy],
);
} else {
match substr {
match substr.fields {
StaticStruct(vdata, ..) => {
process_variant(vdata);
}
Expand All @@ -169,18 +169,17 @@ fn cs_clone(cx: &ExtCtxt<'_>, trait_span: Span, substr: Substructure<'_>) -> Blo
cx.expr_call_global(field.span, fn_path.clone(), args)
};

let self_ident = Ident::new(kw::SelfUpper, trait_span);
let ctor_path;
let all_fields;
let vdata;
match substr {
match substr.fields {
Struct(vdata_, af) => {
ctor_path = cx.path(trait_span, vec![self_ident]);
ctor_path = cx.path(trait_span, vec![substr.type_ident]);
all_fields = af;
vdata = vdata_;
}
EnumMatching(.., variant, af) => {
ctor_path = cx.path(trait_span, vec![self_ident, variant.ident]);
ctor_path = cx.path(trait_span, vec![substr.type_ident, variant.ident]);
all_fields = af;
vdata = &variant.data;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn show_substructure(
return BlockOrExpr::new_expr(cx.expr_ok(span, cx.expr_tuple(span, ThinVec::new())));
}

let (ident, vdata, fields) = match substr {
let (ident, vdata, fields) = match substr.fields {
Struct(vdata, fields) => (type_ident, vdata, fields),
EnumMatching(v, fields) => (v.ident, &v.data, fields),
AllFieldlessEnum(enum_def) => return show_fieldless_enum(cx, span, enum_def, type_ident),
Expand Down
11 changes: 6 additions & 5 deletions compiler/rustc_builtin_macros/src/deriving/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub(crate) fn expand_deriving_default(
attributes: thin_vec![cx.attr_word(sym::inline, span)],
fieldless_variants_strategy: FieldlessVariantsStrategy::Default,
combine_substructure: combine_substructure(|cx, trait_span, substr| {
match substr {
match substr.fields {
StaticStruct(variant_data) => {
default_struct_substructure(cx, trait_span, variant_data)
default_struct_substructure(cx, trait_span, variant_data, substr.type_ident)
}
StaticEnum(enum_def) => {
default_enum_substructure(cx, trait_span, enum_def, item.span)
Expand Down Expand Up @@ -67,15 +67,16 @@ fn default_struct_substructure(
cx: &ExtCtxt<'_>,
trait_span: Span,
variant_data: &VariantData,
type_ident: Ident,
) -> BlockOrExpr {
let expr = match variant_data {
VariantData::Unit(_) => cx.expr_ident(trait_span, Ident::new(kw::SelfUpper, trait_span)),
VariantData::Unit(_) => cx.expr_ident(trait_span, type_ident),
VariantData::Tuple(fields, _) => {
let exprs = fields
.iter()
.map(|field| default_call(cx, field.span.with_ctxt(trait_span.ctxt())))
.collect();
cx.expr_call_ident(trait_span, Ident::new(kw::SelfUpper, trait_span), exprs)
cx.expr_call_ident(trait_span, type_ident, exprs)
}
VariantData::Struct { fields, .. } => {
let default_fields = fields
Expand All @@ -95,7 +96,7 @@ fn default_struct_substructure(
cx.field_imm(span, field.ident.unwrap(), value)
})
.collect();
cx.expr_struct_ident(trait_span, Ident::new(kw::SelfUpper, trait_span), default_fields)
cx.expr_struct_ident(trait_span, type_ident, default_fields)
}
};
BlockOrExpr::new_expr(expr)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn cs_total_eq_assert(cx: &ExtCtxt<'_>, trait_span: Span, substr: Substructure<'
}
};

match substr {
match substr.fields {
StaticStruct(vdata, ..) => {
process_variant(vdata);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub(crate) fn expand_deriving_from(
};

let self_kw = Ident::new(kw::SelfUpper, span);
let expr: Box<ast::Expr> = match substructure {
let expr: Box<ast::Expr> = match substructure.fields {
StaticStruct(variant) => match variant {
// Self { field: value }
VariantData::Struct { .. } => cx.expr_struct_ident(
Expand Down
Loading
Loading