Check elaborated projections from dyn don't mention unconstrained late bound lifetimes by compiler-errors · Pull Request #130367 · rust-lang/rust (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

compiler-errors

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Sep 14, 2024

@rustbot rustbot added the T-types

Relevant to the types team, which will review and decide on the PR/issue.

label

Sep 14, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Sep 14, 2024

@bors

… r=

Check elaborated projections from dyn don't mention unconstrained late bound lifetimes

Check that the projections that are not explicitly written but which we deduce from elaborating the principal of a dyn also do not reference unconstrained late-bound lifetimes, just like the ones that the user writes by hand.

Fixes rust-lang#130347

bors added a commit to rust-lang-ci/rust that referenced this pull request

Sep 14, 2024

@bors

[CRATER] Crater rollup

This is a crater rollup of:

What is a crater rollup? It's simply a (manually set-up) crater job that is run on all of the containing PRs together, and then we can set the crates list for each of these jobs to just the list of failures after it's done. It should cut out on the bulk of "normal" crates that do nothing and simply just waste time to build without being affected by the union of all of these changes.

After this is finished, I will adjust all of the jobs to use only the list of failed crates. That should significantly speed up these jobs from taking like ~6 days to taking ~2. See the last time I did this: rust-lang#129660.

Given that rust-lang#130285 is running in build-and-test mode, let's run all of them in build-and-test mode.

spastorino

@compiler-errors

@compiler-errors

@bors bors 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 4, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Oct 5, 2024

@bors

…kingjubilee

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Oct 5, 2024

@rust-timer

Rollup merge of rust-lang#130367 - compiler-errors:super-unconstrained, r=spastorino

Check elaborated projections from dyn don't mention unconstrained late bound lifetimes

Check that the projections that are not explicitly written but which we deduce from elaborating the principal of a dyn also do not reference unconstrained late-bound lifetimes, just like the ones that the user writes by hand.

That is to say, given:

trait Foo<T>: Bar<Assoc = T> {}

trait Bar {
    type Assoc;
}

The type dyn for<'a> Foo<&'a T> (basically) elaborates to dyn for<'a> Foo<&'a T> + for<'a> Bar<Assoc = &'a T>[^1]. However, the Bar projection predicate is not well-formed, since 'a must show up in the trait's arguments to be referenced in the term of a projection. We must error in this situation[^well], or else dyn for<'a> Foo<&'a T> is unsound.

We already detect this for user-written projections during HIR->rustc_middle conversion, so this largely replicates that logic using the helper functions that were already conveniently defined.


I'm cratering this first to see the fallout; if it's minimal or zero, then let's land it as-is. If not, the way that this is implemented is very conducive to an FCW.


Fixes rust-lang#130347

[^1]: We don't actually elaborate it like that in rustc; we only keep the principal trait ref Foo<&'a T> and the projection part of Bar<Assoc = ...>, but it's useful to be a bit verbose here for the purpose of explaining the issue. [^well]: Well, we could also make dyn for<'a> Foo<&'a T> not implement for<'a> Bar<Assoc = &'a T>, but this is inconsistent with the case where the user writes Assoc = ... in the type itself, and it overly complicates the implementation of trait objects' built-in impls.

@Mark-Simulacrum Mark-Simulacrum added the relnotes

Marks issues that should be documented in the release notes of the next release.

label

Nov 22, 2024

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Nov 30, 2024

@he32

Pkgsrc changes compared to rust182:

TODO:

Upstream changes:

Version 1.83.0 (2024-11-28)

Language

Compiler

Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Rustdoc

Compatibility Notes

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

Dec 5, 2024

@tmeijn

This MR contains the following updates:

Package Update Change
rust minor 1.82.0 -> 1.83.0

MR created with the help of el-capitano/tools/renovate-bot.

Proposed changes to behavior should be submitted there as MRs.


Release Notes

rust-lang/rust (rust)

v1.83.0

Compare Source

==========================

Language

Compiler

Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Rustdoc

Compatibility Notes


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.



This MR has been generated by Renovate Bot.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Feb 24, 2025

@he32

Pkgsrc changes:

Upstream changes:

Version 1.83.0 (2024-11-28)

Language

Compiler

Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Rustdoc

Compatibility Notes