Skip to content

Rollup of 14 pull requests #144261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
b23df61
fix box destructor generation
beepster4096 Jul 8, 2025
e84f2a2
async drop tests for box
beepster4096 Jul 8, 2025
eda2d0d
fix typos
ffengyu Jul 18, 2025
de3578a
Merge pull request #2511 from ffengyu/errata
tshepang Jul 18, 2025
b2e94bf
Add test demonstrating current beta `#[align]` name resolution regres…
jieyouxu Jul 17, 2025
69b71e4
Mitigate `#[align]` name resolution ambiguity regression with a rename
jieyouxu Jul 17, 2025
966fc57
`SmirCtxt` to `CompilerCtxt`, `SmirInterface` to `CompilerInterface`
makai410 Jul 15, 2025
7f22e88
`SmirContainer` to `Container`
makai410 Jul 15, 2025
ad0de06
use "helper" as a more descriptive name
makai410 Jul 15, 2025
08e3cf5
rename `ui-fulldeps/stable-mir`
makai410 Jul 15, 2025
9a37aab
rename `ui/stable-mir-print`
makai410 Jul 15, 2025
a1deaa7
`SmirError` to `Error`
makai410 Jul 15, 2025
9533871
Update docs in `rustc_public_bridge`
makai410 Jul 15, 2025
483877a
Update docs in `rustc_public`
makai410 Jul 15, 2025
4d79328
use `RustcPublic` instead of `StableMir`
makai410 Jul 15, 2025
20a7f72
fix `ui/rustc_public-ir-print` outputs
makai410 Jul 17, 2025
4f5f34c
span_bug instead of handling currently impossible drop case
beepster4096 Jul 18, 2025
3fb1af3
enzyme submodule update
ZuseZ4 Jul 18, 2025
42d6b0d
make more builder functions generic
ZuseZ4 Jun 18, 2025
6340164
add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (h…
ZuseZ4 Jun 18, 2025
5958ebe
add various wrappers for gpu code generation
ZuseZ4 Jul 2, 2025
4a1a5a4
gpu host code generation
ZuseZ4 Jul 2, 2025
e2ab312
add gpu offload codegen host side test
ZuseZ4 Jul 18, 2025
c068599
add unstable-books doc for offload
ZuseZ4 Jul 18, 2025
196833c
Fix ide-assist: Deref transtive
A4-Tacks Jul 19, 2025
54d9743
Add Deref -> DerefMut for generate_mut_trait_impl
A4-Tacks Jul 19, 2025
2f46cde
minor: remove unused var
Young-Flash Jul 19, 2025
e49e107
Merge pull request #20258 from Young-Flash/remove_unused
lnicola Jul 19, 2025
bb46b8c
Allow selecting check tool `Mode` based on `Builder`
Kobzol Jul 11, 2025
245d2c9
Implement `check::Compiletest` using the `tool_check_step` macro
Kobzol Jul 11, 2025
fc74c22
Add approval blocking labels for new bors
Kobzol Jul 19, 2025
a6c7cea
Fix search of raw labels and lifetimes
ChayimFriedman2 Jul 19, 2025
8b6559b
Support `cfg_select!`
ChayimFriedman2 Jul 20, 2025
fdf8bdb
Remove the ptr_unique lang item
bjorn3 Jul 20, 2025
2eaba02
Merge pull request #20265 from ChayimFriedman2/cfg-select
lnicola Jul 20, 2025
fa0320d
Merge pull request #20255 from A4-Tacks/deref-intranstive
lnicola Jul 20, 2025
313dff1
Add test.
cjgillot Jul 4, 2025
7da6fd1
Lower extra lifetimes before normal generic params.
cjgillot Jul 4, 2025
3f9be40
fix handling of base address for TypeId allocations
RalfJung Jul 19, 2025
e68f5fe
Implement `check::RustAnalyzer` using the `tool_check_step` macro
Kobzol Jul 11, 2025
192efbb
clippy: make tests work in stage 1
RalfJung Jul 16, 2025
897d007
Prepare for merging from rust-lang/rust
invalid-email-address Jul 21, 2025
ad20b06
Merge ref '460259d14de0' from rust-lang/rust
invalid-email-address Jul 21, 2025
33d62b5
Merge pull request #20262 from ChayimFriedman2/goto-ref-raw
ShoyuVanilla Jul 21, 2025
4bbe74b
Merge pull request #20256 from A4-Tacks/gen-mut-trait-deref
ShoyuVanilla Jul 21, 2025
750c1e9
Preparing for merge from rust-lang/rust
lnicola Jul 21, 2025
2f14119
Merge from rust-lang/rust
lnicola Jul 21, 2025
1482809
Bump rustc crates
lnicola Jul 21, 2025
f263364
Bump rustc-literal-escaper
lnicola Jul 21, 2025
2050358
Revert "Bump rustc-literal-escaper"
lnicola Jul 21, 2025
da90db7
Downgrade ra-ap-rustc_parse_format
lnicola Jul 21, 2025
8f67bcf
Merge pull request #20268 from lnicola/sync-from-rust
lnicola Jul 21, 2025
1fd0697
Remove Retag for Unique
bjorn3 Jul 21, 2025
79e3c7d
fix some typos
tshepang Jul 21, 2025
4a45ab5
Merge pull request #2513 from rust-lang/tshepang/typos
tshepang Jul 21, 2025
62e3a05
Merge pull request #2512 from rust-lang/rustc-pull
tshepang Jul 21, 2025
3c76e3d
Constify Try, From, TryFrom
Randl Jul 21, 2025
c193f30
opt-dist: make `artifact-dir` an absolute path for `opt-dist local`
ognevny Jul 21, 2025
97dc234
Rollup merge of #142097 - ZuseZ4:offload-host1, r=oli-obk
jieyouxu Jul 21, 2025
713d04a
Rollup merge of #143430 - cjgillot:extra-lifetime-swap, r=oli-obk
jieyouxu Jul 21, 2025
33800e5
Rollup merge of #143672 - beepster4096:box_drop_flags_again, r=oli-obk
jieyouxu Jul 21, 2025
fcb6d9f
Rollup merge of #143768 - Randl:const-try, r=oli-obk
jieyouxu Jul 21, 2025
d6b5a6b
Rollup merge of #143816 - Kobzol:compiletest-check-macro, r=jieyouxu
jieyouxu Jul 21, 2025
76950ec
Rollup merge of #143985 - makai410:rp-rename, r=oli-obk
jieyouxu Jul 21, 2025
7037b88
Rollup merge of #144027 - RalfJung:clippy, r=Mark-Simulacrum
jieyouxu Jul 21, 2025
5f767f0
Rollup merge of #144080 - jieyouxu:realign, r=BoxyUwU
jieyouxu Jul 21, 2025
f653317
Rollup merge of #144176 - Kobzol:bors-labels-blocking, r=oli-obk
jieyouxu Jul 21, 2025
2aa92c9
Rollup merge of #144187 - RalfJung:type-id-base-addr, r=oli-obk
jieyouxu Jul 21, 2025
c497403
Rollup merge of #144212 - bjorn3:remove_unique_lang_item, r=oli-obk
jieyouxu Jul 21, 2025
d11d874
Rollup merge of #144243 - lnicola:sync-from-ra, r=lnicola
jieyouxu Jul 21, 2025
d074c50
Rollup merge of #144251 - tshepang:rdg-sync, r=jieyouxu
jieyouxu Jul 21, 2025
7954dd9
Rollup merge of #144254 - ognevny:opt-dist-artifact-dir, r=Kobzol
jieyouxu Jul 21, 2025
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
1 change: 1 addition & 0 deletions compiler/rustc_attr_data_structures/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ pub enum CfgEntry {
pub enum AttributeKind {
// tidy-alphabetical-start
/// Represents `#[align(N)]`.
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
Align { align: Align, span: Span },

/// Represents `#[rustc_allow_const_fn_unstable]`.
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ impl<S: Stage> AttributeParser<S> for NakedParser {
sym::instruction_set,
sym::repr,
sym::rustc_std_internal_symbol,
sym::align,
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
sym::rustc_align,
// obviously compatible with self
sym::naked,
// documentation
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ fn parse_alignment(node: &LitKind) -> Result<Align, &'static str> {
pub(crate) struct AlignParser(Option<(Align, Span)>);

impl AlignParser {
const PATH: &'static [Symbol] = &[sym::align];
const PATH: &'static [Symbol] = &[sym::rustc_align];
const TEMPLATE: AttributeTemplate = template!(List: "<alignment in bytes>");

fn parse<'c, S: Stage>(
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
),
ungated!(no_link, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, EncodeCrossCrate::No),
gated!(align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(align)),
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
gated!(rustc_align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(rustc_align)),
ungated!(unsafe(Edition2024) export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No),
ungated!(unsafe(Edition2024) link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No),
ungated!(unsafe(Edition2024) no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub struct CodegenFnAttrs {
/// switching between multiple instruction sets.
pub instruction_set: Option<InstructionSetAttr>,
/// The `#[align(...)]` attribute. Determines the alignment of the function body.
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
pub alignment: Option<Align>,
/// The `#[patchable_function_entry(...)]` attribute. Indicates how many nops should be around
/// the function entry.
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_parse/src/validate_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ pub fn check_builtin_meta_item(
| sym::rustc_paren_sugar
| sym::type_const
| sym::repr
| sym::align
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres
// ambiguity
| sym::rustc_align
| sym::deprecated
| sym::optimize
| sym::pointee
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ passes_abi_of =
fn_abi_of({$fn_name}) = {$fn_abi}

passes_align_attr_application =
`#[align(...)]` should be applied to a function item
`#[rustc_align(...)]` should be applied to a function item
.label = not a function item

passes_align_on_fields =
attribute should be applied to a function or method
.warn = {-passes_previously_accepted}

passes_align_should_be_repr_align =
`#[align(...)]` is not supported on {$item} items
`#[rustc_align(...)]` is not supported on {$item} items
.suggestion = use `#[repr(align(...))]` instead

passes_allow_incoherent_impl =
Expand Down Expand Up @@ -605,7 +605,7 @@ passes_repr_align_greater_than_target_max =

passes_repr_align_should_be_align =
`#[repr(align(...))]` is not supported on {$item} items
.help = use `#[align(...)]` instead
.help = use `#[rustc_align(...)]` instead

passes_repr_conflicting =
conflicting representation hints
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}

/// Checks if the `#[align]` attributes on `item` are valid.
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
fn check_align(
&self,
span: Span,
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,8 @@ symbols! {
rust_out,
rustc,
rustc_abi,
// FIXME(#82232, #143834): temporary name to mitigate `#[align]` nameres ambiguity
rustc_align,
rustc_allocator,
rustc_allocator_zeroed,
rustc_allow_const_fn_unstable,
Expand Down
10 changes: 7 additions & 3 deletions src/tools/miri/tests/pass/fn_align.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
//@compile-flags: -Zmin-function-alignment=8

// FIXME(rust-lang/rust#82232, rust-lang/rust#143834): temporarily renamed to mitigate `#[align]`
// nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]

// When a function uses `align(N)`, the function address should be a multiple of `N`.

#[align(256)]
#[rustc_align(256)]
fn foo() {}

#[align(16)]
#[rustc_align(16)]
fn bar() {}

#[align(4)]
#[rustc_align(4)]
fn baz() {}

fn main() {
Expand Down
54 changes: 28 additions & 26 deletions tests/codegen/align-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@
//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)

#![crate_type = "lib"]
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]

// CHECK: align 16
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
pub fn fn_align() {}

pub struct A;

impl A {
// CHECK: align 16
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
pub fn method_align(self) {}

// CHECK: align 16
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
pub fn associated_fn() {}
}

Expand All @@ -29,46 +31,46 @@ trait T: Sized {

fn trait_method(self) {}

#[align(8)]
#[rustc_align(8)]
fn trait_method_inherit_low(self);

#[align(32)]
#[rustc_align(32)]
fn trait_method_inherit_high(self);

#[align(32)]
#[rustc_align(32)]
fn trait_method_inherit_default(self) {}

#[align(4)]
#[align(128)]
#[align(8)]
#[rustc_align(4)]
#[rustc_align(128)]
#[rustc_align(8)]
fn inherit_highest(self) {}
}

impl T for A {
// CHECK-LABEL: trait_fn
// CHECK-SAME: align 16
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
fn trait_fn() {}

// CHECK-LABEL: trait_method
// CHECK-SAME: align 16
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
fn trait_method(self) {}

// The prototype's align is ignored because the align here is higher.
// CHECK-LABEL: trait_method_inherit_low
// CHECK-SAME: align 16
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
fn trait_method_inherit_low(self) {}

// The prototype's align is used because it is higher.
// CHECK-LABEL: trait_method_inherit_high
// CHECK-SAME: align 32
#[unsafe(no_mangle)]
#[align(16)]
#[rustc_align(16)]
fn trait_method_inherit_high(self) {}

// The prototype's align inherited.
Expand All @@ -81,16 +83,16 @@ impl T for A {
// CHECK-LABEL: inherit_highest
// CHECK-SAME: align 128
#[unsafe(no_mangle)]
#[align(32)]
#[align(64)]
#[rustc_align(32)]
#[rustc_align(64)]
fn inherit_highest(self) {}
}

trait HasDefaultImpl: Sized {
// CHECK-LABEL: inherit_from_default_method
// CHECK-LABEL: inherit_from_default_method
// CHECK-SAME: align 32
#[align(32)]
#[rustc_align(32)]
fn inherit_from_default_method(self) {}
}

Expand All @@ -101,41 +103,41 @@ impl HasDefaultImpl for InstantiateDefaultMethods {}
// CHECK-LABEL: align_specified_twice_1
// CHECK-SAME: align 64
#[unsafe(no_mangle)]
#[align(32)]
#[align(64)]
#[rustc_align(32)]
#[rustc_align(64)]
pub fn align_specified_twice_1() {}

// CHECK-LABEL: align_specified_twice_2
// CHECK-SAME: align 128
#[unsafe(no_mangle)]
#[align(128)]
#[align(32)]
#[rustc_align(128)]
#[rustc_align(32)]
pub fn align_specified_twice_2() {}

// CHECK-LABEL: align_specified_twice_3
// CHECK-SAME: align 256
#[unsafe(no_mangle)]
#[align(32)]
#[align(256)]
#[rustc_align(32)]
#[rustc_align(256)]
pub fn align_specified_twice_3() {}

const _: () = {
// CHECK-LABEL: align_unmangled
// CHECK-SAME: align 256
#[unsafe(no_mangle)]
#[align(32)]
#[align(256)]
#[rustc_align(32)]
#[rustc_align(256)]
extern "C" fn align_unmangled() {}
};

unsafe extern "C" {
#[align(256)]
#[rustc_align(256)]
fn align_unmangled();
}

// FIXME also check `gen` et al
// CHECK-LABEL: async_align
// CHECK-SAME: align 64
#[unsafe(no_mangle)]
#[align(64)]
#[rustc_align(64)]
pub async fn async_align() {}
6 changes: 4 additions & 2 deletions tests/codegen/min-function-alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)

#![crate_type = "lib"]
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]

// Functions without explicit alignment use the global minimum.
Expand All @@ -21,7 +23,7 @@ pub fn no_explicit_align() {}
// align16: align 16
// align1024: align 1024
#[no_mangle]
#[align(8)]
#[rustc_align(8)]
pub fn lower_align() {}

// the higher value of min-function-alignment and the align attribute wins out
Expand All @@ -30,7 +32,7 @@ pub fn lower_align() {}
// align16: align 32
// align1024: align 1024
#[no_mangle]
#[align(32)]
#[rustc_align(32)]
pub fn higher_align() {}

// cold functions follow the same rules as other functions
Expand Down
5 changes: 4 additions & 1 deletion tests/codegen/naked-fn/aligned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)

#![crate_type = "lib"]
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]

use std::arch::naked_asm;

// CHECK: .balign 16
// CHECK-LABEL: naked_empty:
#[align(16)]
#[rustc_align(16)]
#[no_mangle]
#[unsafe(naked)]
pub extern "C" fn naked_empty() {
Expand Down
6 changes: 4 additions & 2 deletions tests/codegen/naked-fn/min-function-alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//@ ignore-arm no "ret" mnemonic
//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)

// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]
#![crate_type = "lib"]

Expand All @@ -17,15 +19,15 @@ pub extern "C" fn naked_no_explicit_align() {

// CHECK: .balign 16
#[no_mangle]
#[align(8)]
#[rustc_align(8)]
#[unsafe(naked)]
pub extern "C" fn naked_lower_align() {
core::arch::naked_asm!("ret")
}

// CHECK: .balign 32
#[no_mangle]
#[align(32)]
#[rustc_align(32)]
#[unsafe(naked)]
pub extern "C" fn naked_higher_align() {
core::arch::naked_asm!("ret")
Expand Down
6 changes: 5 additions & 1 deletion tests/ui/asm/naked-with-invalid-repr-attr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//@ needs-asm-support

// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]

#![crate_type = "lib"]
use std::arch::naked_asm;

Expand All @@ -21,7 +25,7 @@ extern "C" fn example2() {

#[repr(C)]
//~^ ERROR attribute should be applied to a struct, enum, or union [E0517]
#[align(16)]
#[rustc_align(16)]
#[unsafe(naked)]
extern "C" fn example3() {
//~^ NOTE not a struct, enum, or union
Expand Down
Loading