Skip to content

only make RustaceansAreAwesome satisfy trait clauses - #163958

Open
dianne wants to merge 1 commit into
rust-lang:mainfrom
dianne:fix-rustaceansareawesome-take-2-partial
Open

dianne wants to merge 1 commit into
rust-lang:mainfrom
dianne:fix-rustaceansareawesome-take-2-partial

Conversation

@dianne

@dianne dianne commented Oct 7, 2026

Copy link
Copy Markdown
Member

Fixes #163550 but unfortunately partially un-fixes a variant of #161621 that hadn't been reported. I have a followup to re-fix that, but I ended up deciding that it would probably be easier to review separately; I'll open a PR for that later.

The variant in question:

trait HasAssoc {
    type Assoc;
}

trait Parent<T> {}

trait Trait
where
    (Self,): HasAssoc<Assoc = str>,
    Self: Parent<<<(Self,) as HasAssoc>::Assoc as ToOwned>::Owned>,
{
    fn f(&self);
    //~^ ERROR: the trait bound `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Clone` is not satisfied
    //~| NOTE: required for `<(RustaceansAreAwesome,) as HasAssoc>::Assoc` to implement `ToOwned`
}

This fails to prove <(RustaceansAreAwesome,) as HasAssoc>::Assoc: Owned because it can't normalize that alias to str. The followup will re-add projections as necessary for this in a hopefully-non-breaking way.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 7, 2026
//! Tests for specific instances of <https://github.com/rust-lang/rust/issues/161621> that don't
//! pass yet. See `dispatchability-placeholder-satisfies-bounds.rs` for context.
// FIXME(@dianne): this should be gone soon
//@ known-bug: unknown

@dianne dianne Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left this as unknown for now since the issue is currently marked as closed and this issue is significantly more specific than what was reported there. not sure if it should be reopened until the followup to this lands or a new issue is warranted

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you're following up immediately, this is fine

@dianne dianne Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've dumped all the passing tests in this file since they share a significant amount of context, especially when adding in the tests I've written for the followup to this, where many tests build on concepts that were set up in previous tests. maybe some of them should be split apart though?

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine this way. A little bit more annoying to debug when only one of them breaks, but they are all very related

@dianne

dianne commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

this is a fix for #163200, so r? @oli-obk or reassign

@dianne
dianne marked this pull request as ready for review October 8, 2026 00:08
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 8, 2026

@oli-obk oli-obk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit df42c7b has been approved by oli-obk

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…ke-2-partial, r=oli-obk

only make `RustaceansAreAwesome` satisfy trait clauses

Fixes rust-lang#163550 but unfortunately partially un-fixes a variant of rust-lang#161621 that hadn't been reported. I have a followup to re-fix that, but I ended up deciding that it would probably be easier to review separately; I'll open a PR for that later.

The variant in question:
```rust
trait HasAssoc {
    type Assoc;
}

trait Parent<T> {}

trait Trait
where
    (Self,): HasAssoc<Assoc = str>,
    Self: Parent<<<(Self,) as HasAssoc>::Assoc as ToOwned>::Owned>,
{
    fn f(&self);
    //~^ ERROR: the trait bound `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Clone` is not satisfied
    //~| NOTE: required for `<(RustaceansAreAwesome,) as HasAssoc>::Assoc` to implement `ToOwned`
}
```
This fails to prove `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Owned` because it can't normalize that alias to `str`. The followup will re-add projections as necessary for this in a hopefully-non-breaking way.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…ke-2-partial, r=oli-obk

only make `RustaceansAreAwesome` satisfy trait clauses

Fixes rust-lang#163550 but unfortunately partially un-fixes a variant of rust-lang#161621 that hadn't been reported. I have a followup to re-fix that, but I ended up deciding that it would probably be easier to review separately; I'll open a PR for that later.

The variant in question:
```rust
trait HasAssoc {
    type Assoc;
}

trait Parent<T> {}

trait Trait
where
    (Self,): HasAssoc<Assoc = str>,
    Self: Parent<<<(Self,) as HasAssoc>::Assoc as ToOwned>::Owned>,
{
    fn f(&self);
    //~^ ERROR: the trait bound `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Clone` is not satisfied
    //~| NOTE: required for `<(RustaceansAreAwesome,) as HasAssoc>::Assoc` to implement `ToOwned`
}
```
This fails to prove `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Owned` because it can't normalize that alias to `str`. The followup will re-add projections as necessary for this in a hopefully-non-breaking way.
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163462 (Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports)
 - #163855 (Include enclosing item's context on const errors)
 - #163861 (Run LLDB debuginfo tests on `x86_64-mingw`)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163617 (mips: make `Complex<T>` ABI match GCC)
 - #163832 (reject non-async coroutine closures as async callables)
 - #163958 (only make `RustaceansAreAwesome` satisfy trait clauses)
 - #163974 (Condense AdtDef lang item checks into one match)
 - #163979 (Add `bf16` to arm features)

Failed merges:

 - #163972 (const-eval: ICE when we hit a non-const fn)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…ke-2-partial, r=oli-obk

only make `RustaceansAreAwesome` satisfy trait clauses

Fixes rust-lang#163550 but unfortunately partially un-fixes a variant of rust-lang#161621 that hadn't been reported. I have a followup to re-fix that, but I ended up deciding that it would probably be easier to review separately; I'll open a PR for that later.

The variant in question:
```rust
trait HasAssoc {
    type Assoc;
}

trait Parent<T> {}

trait Trait
where
    (Self,): HasAssoc<Assoc = str>,
    Self: Parent<<<(Self,) as HasAssoc>::Assoc as ToOwned>::Owned>,
{
    fn f(&self);
    //~^ ERROR: the trait bound `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Clone` is not satisfied
    //~| NOTE: required for `<(RustaceansAreAwesome,) as HasAssoc>::Assoc` to implement `ToOwned`
}
```
This fails to prove `<(RustaceansAreAwesome,) as HasAssoc>::Assoc: Owned` because it can't normalize that alias to `str`. The followup will re-add projections as necessary for this in a hopefully-non-breaking way.
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #163462 (Fix COFF renaming of decorated (stdcall/fastcall/vectorcall) exports)
 - #163855 (Include enclosing item's context on const errors)
 - #163861 (Run LLDB debuginfo tests on `x86_64-mingw`)
 - #161201 (Speed up tidy again)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163617 (mips: make `Complex<T>` ABI match GCC)
 - #163772 (comptime fn error: suggest wrapping in const block)
 - #163832 (reject non-async coroutine closures as async callables)
 - #163958 (only make `RustaceansAreAwesome` satisfy trait clauses)
 - #163974 (Condense AdtDef lang item checks into one match)
 - #163979 (Add `bf16` to arm features)
 - #163989 (Revert "compiletest: stream output of executor process when --no-capture is set")

Failed merges:

 - #163972 (const-eval: ICE when we hit a non-const fn)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly associated types regression E0284

3 participants