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

[WIP] some mir typeck cleanup #95763

Closed
wants to merge 6 commits into from
Closed

[WIP] some mir typeck cleanup #95763

wants to merge 6 commits into from

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Apr 7, 2022

TODO: write this

r? @nikomatsakis

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 7, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 7, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc-demangle v0.1.21
error: lifetime may not live long enough
    --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/rustc-demangle-0.1.21/src/v0.rs:954:21
     |
632  |   impl<'a, 'b, 's> Printer<'a, 'b, 's> {
     |        --      -- lifetime `'s` defined here
     |        |
     |        lifetime `'a` defined here
...
954  |               b'F' => self.in_binder(|this| {
     |  _____________________^
955  | |                 let is_unsafe = this.eat(b'U');
956  | |                 let abi = if this.eat(b'K') {
957  | |                     if this.eat(b'C') {
1000 | |                 Ok(())
1001 | |             })?,
1001 | |             })?,
     | |______________^ argument requires that `'a` must outlive `'s`
     |
     = help: consider adding the following bound: `'a: 's`
     = note: requirement occurs because of a mutable reference to `Printer<'_, '_, '_>`
     = note: mutable references are invariant over their type parameter
     = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: lifetime may not live long enough
    --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/rustc-demangle-0.1.21/src/v0.rs:954:21
     |
     |
632  |   impl<'a, 'b, 's> Printer<'a, 'b, 's> {
     |        --      -- lifetime `'s` defined here
     |        |
     |        lifetime `'a` defined here
...
954  |               b'F' => self.in_binder(|this| {
     |  _____________________^
955  | |                 let is_unsafe = this.eat(b'U');
956  | |                 let abi = if this.eat(b'K') {
957  | |                     if this.eat(b'C') {
1000 | |                 Ok(())
1001 | |             })?,
1001 | |             })?,
     | |______________^ argument requires that `'s` must outlive `'a`
     |
     = help: consider adding the following bound: `'s: 'a`
     = note: requirement occurs because of a mutable reference to `Printer<'_, '_, '_>`
     = note: mutable references are invariant over their type parameter
     = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: lifetime may not live long enough
   --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/rustc-demangle-0.1.21/src/v0.rs:990:17
    |
    |
632 | impl<'a, 'b, 's> Printer<'a, 'b, 's> {
    |          --  -- lifetime `'s` defined here
    |          |
    |          lifetime `'b` defined here
...
990 |                 this.print_sep_list(Self::print_type, ", ")?;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'b` must outlive `'s`
    |
    = help: consider adding the following bound: `'b: 's`
help: the following changes may resolve your lifetime errors
  |
  |
  = help: `'a` and `'s` must be the same: replace one with the other
  = help: add bound `'b: 's`
error: lifetime may not live long enough
    --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/rustc-demangle-0.1.21/src/v0.rs:1094:46
     |
     |
632  |   impl<'a, 'b, 's> Printer<'a, 'b, 's> {
     |            --  -- lifetime `'s` defined here
     |            |
     |            lifetime `'b` defined here
...
1094 |           let mut open_brace_if_outside_expr = |this: &mut Self| {
     |  ______________________________________________^
1095 | |             // If this expression is nested in another, braces aren't required.
1096 | |             if in_value {
1097 | |                 return Ok(());
...    |
1101 | |             this.print("{")
1102 | |         };
     | |_________^ assignment requires that `'b` must outlive `'s`
     |
     = help: consider adding the following bound: `'b: 's`
     = note: requirement occurs because of a mutable reference to `Printer<'_, '_, '_>`
     = note: mutable references are invariant over their type parameter
     = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: lifetime may not live long enough
    --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/rustc-demangle-0.1.21/src/v0.rs:1135:17
     |
     |
632  | impl<'a, 'b, 's> Printer<'a, 'b, 's> {
     |      --      -- lifetime `'s` defined here
     |      |
     |      lifetime `'a` defined here
...
1135 |                 open_brace_if_outside_expr(self)?;
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'s`
     |
     = help: consider adding the following bound: `'a: 's`
     = note: requirement occurs because of a mutable reference to `Printer<'_, '_, '_>`
     = note: mutable references are invariant over their type parameter
     = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: lifetime may not live long enough
    --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/rustc-demangle-0.1.21/src/v0.rs:1135:17
     |
     |
632  | impl<'a, 'b, 's> Printer<'a, 'b, 's> {
     |      --      -- lifetime `'s` defined here
     |      |
     |      lifetime `'a` defined here
...
1135 |                 open_brace_if_outside_expr(self)?;
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'s` must outlive `'a`
     |
     = help: consider adding the following bound: `'s: 'a`
     = note: requirement occurs because of a mutable reference to `Printer<'_, '_, '_>`
     = note: mutable references are invariant over their type parameter
     = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: could not compile `rustc-demangle` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:03:47

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

looks good to me so far! is this still a WIP?

))
.to_predicate(self.tcx()),
location.to_locations(),
ConstraintCategory::Boring,
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have a known bug that is affected by this?

.to_predicate(self.tcx()),
location.to_locations(),
ConstraintCategory::Boring,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

didn't we file a bug about this?

@bors
Copy link
Contributor

bors commented Apr 28, 2022

☔ The latest upstream changes (presumably #96528) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix pnkfelix changed the title some mir typeck cleanup [WIP] some mir typeck cleanup May 19, 2022
@lcnr lcnr marked this pull request as draft May 19, 2022 14:52
@pnkfelix
Copy link
Member

lcnr reports that this still has a nasty bug that they need to work out.

@rustbot label: +S-waiting-on-author -S-waiting-on-review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 19, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Aug 19, 2022

closing in favor of #100761, I intend to work on the the refactorings I've dropped at a later date

@lcnr lcnr closed this Aug 19, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…r-errors

some general mir typeck cleanup

this pr contains the parts of rust-lang#95763 which already work correctly.

the remaining commits of that PR have some issues which are more complex to fix.

r? types
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…r-errors

some general mir typeck cleanup

this pr contains the parts of rust-lang#95763 which already work correctly.

the remaining commits of that PR have some issues which are more complex to fix.

r? types
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…r-errors

some general mir typeck cleanup

this pr contains the parts of rust-lang#95763 which already work correctly.

the remaining commits of that PR have some issues which are more complex to fix.

r? types
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…r-errors

some general mir typeck cleanup

this pr contains the parts of rust-lang#95763 which already work correctly.

the remaining commits of that PR have some issues which are more complex to fix.

r? types
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…r-errors

some general mir typeck cleanup

this pr contains the parts of rust-lang#95763 which already work correctly.

the remaining commits of that PR have some issues which are more complex to fix.

r? types
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…r-errors

some general mir typeck cleanup

this pr contains the parts of rust-lang#95763 which already work correctly.

the remaining commits of that PR have some issues which are more complex to fix.

r? types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants