Skip to content
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

Make PlaceholderReplacer shallow_resolver and recur when infer vars #118261

Merged
merged 1 commit into from Nov 25, 2023

Conversation

spastorino
Copy link
Member

This makes resolve type and const infer vars resolve.

Given:

#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

struct Foo<T>(T);

impl<'a> Foo<fn(&'a ())> {
    type Assoc = &'a ();
}

fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)) {}

fn main() {}

We should normalize for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc) to for<'0> fn(&'1 ()) with '1 == '0 and '0 == 'static constraints. We have to resolve '1 to 'static in the infcx associated to PlaceholderReplacer.

This is part of #118118 but unrelated to that PR.

r? @compiler-errors @lcnr

@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 Nov 24, 2023
@compiler-errors
Copy link
Member

r=me with perf run

@spastorino
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 24, 2023
@bors
Copy link
Contributor

bors commented Nov 24, 2023

⌛ Trying commit f57e184 with merge 5567761...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 24, 2023
… r=<try>

Make PlaceholderReplacer shallow_resolver and recur when infer vars

This makes resolve type and const infer vars resolve.

Given:

```rust
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

struct Foo<T>(T);

impl<'a> Foo<fn(&'a ())> {
    type Assoc = &'a ();
}

fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)) {}

fn main() {}
```

We should normalize `for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)` to `for<'0> fn(&'1 ())` with `'1 == '0` and `'0 == 'static` constraints. We have to resolve `'1` to `'static` in the infcx associated to `PlaceholderReplacer`.

This is part of rust-lang#118118 but unrelated to that PR.

r? `@compiler-errors` `@lcnr`
@bors
Copy link
Contributor

bors commented Nov 24, 2023

☀️ Try build successful - checks-actions
Build commit: 5567761 (5567761f5b540b701b717b47271aadf924861f81)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5567761): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking 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
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
4.1% [4.1%, 4.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
-1.8% [-2.8%, -0.8%] 2
All ❌✅ (primary) 1.5% [-1.1%, 4.1%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 676.964s -> 673.318s (-0.54%)
Artifact size: 313.51 MiB -> 313.49 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 25, 2023
@spastorino
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Nov 25, 2023

📌 Commit f57e184 has been approved by compiler-errors

It is now in the queue for this repository.

@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 Nov 25, 2023
@bors
Copy link
Contributor

bors commented Nov 25, 2023

⌛ Testing commit f57e184 with merge b2e73e9...

@bors
Copy link
Contributor

bors commented Nov 25, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing b2e73e9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 25, 2023
@bors bors merged commit b2e73e9 into rust-lang:master Nov 25, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 25, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b2e73e9): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-3.9%, -1.1%] 4
All ❌✅ (primary) - - 0

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.4%, -2.0%] 4
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 673.904s -> 673.908s (0.00%)
Artifact size: 313.23 MiB -> 313.32 MiB (0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

None yet

5 participants