Skip to content

[pull] master from rust-lang:master#72

Merged
pull[bot] merged 5 commits into
asukaminato0721:masterfrom
rust-lang:master
Jun 4, 2026
Merged

[pull] master from rust-lang:master#72
pull[bot] merged 5 commits into
asukaminato0721:masterfrom
rust-lang:master

Conversation

@pull

@pull pull Bot commented Jun 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

A4-Tacks and others added 5 commits June 3, 2026 16:02
Example
---
```rust
struct Foo<T, const N: usize>([T; N]);

impl<T, const N: usize> F$0oo<T, N> {
    fn spec_len(&self) -> usize {
        N
    }
}
```

**Before this PR**

```rust
struct Foo<T, const N: usize>([T; N]);

trait SpecLen<T, const N: usize> {
    fn spec_len(&self) -> usize;
}

impl<T, const N: usize> SpecLen<T, N> for Foo<T, N> {
    fn spec_len(&self) -> usize {
        N
    }
}
```

**After this PR**

```rust
struct Foo<T, const N: usize>([T; N]);

trait SpecLen {
    fn spec_len(&self) -> usize;
}

impl<T, const N: usize> SpecLen for Foo<T, N> {
    fn spec_len(&self) -> usize {
        N
    }
}
```
This is needed so that IDE features can find their anon consts and work with them. We lower them in `field_types()`, which seemed appropriate (we need to know the type for the const, and creating another query doesn't seem worth it).

We'll also need them for const eval, but currently default expressions are not handled in MIR.
feat: Lower field defaults to `rustc_type_ir::Const`s
fix: no generate unused generic params in trait sign
@pull pull Bot locked and limited conversation to collaborators Jun 4, 2026
@pull pull Bot added the ⤵️ pull label Jun 4, 2026
@pull pull Bot merged commit aadee11 into asukaminato0721:master Jun 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants