-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Check RPIT and AFIT hidden types are well-formed considering regions #114740
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit fa1e4ba with merge d809384186eaa72b56b7b956dcf0837de4a00262... |
hir::OpaqueTyOrigin::TyAlias { .. } | ||
if tcx.def_kind(tcx.parent(def_id.to_def_id())) == DefKind::OpaqueTy => {} | ||
// Can have different predicates to their defining use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, perhaps, define the assumed wf types of a TAIT to be any types that show up in the bounds of a parent TAIT.
Don't think it's worth unless someone can come up with an unsoundness test here, though.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (d809384186eaa72b56b7b956dcf0837de4a00262): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 631.671s -> 631.783s (0.02%) |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
r? @lcnr @rust-lang/types we previously did not regionck RPITs and async function return types because we assumed that they would already be checked by their parent function. This is not the case in case we end up "subtyping" into an RPIT, see #114728. This PR causes us to now always check regions for RPITs as well. @rfcbot fcp merge |
This comment was marked as outdated.
This comment was marked as outdated.
sorry @rfcbot cancel |
@lcnr proposal cancelled. |
@rfcbot fcp merge |
Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Here is a couple of what I think are unnecessary breakages of this implementation:
struct Static<T: 'static>(T);
fn test<' a>(s: Static<&'static u8>) -> impl Sized + 'a { s }
trait Id<X> { type Ty; }
impl<X> Id<X> for () { type Ty = X; }
fn test() -> impl Id<&'static T, Ty = impl Sized> {} Both are valid patterns that predate #94081. I believe we can keep supporting them by doing the WF check where subtyping is involved, namely in nll_relate and higher-ranked equality (which involves mutual subtyping). |
🎉 Experiment
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
I'm gonna close this in favor of the other |
Fixes #114728
r? @aliemjay @lcnr or @oli-obk (who's on vacation but he shall see it when he gets back 🌴)