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

"x.py check" shows error twice #76822

Closed
RalfJung opened this issue Sep 17, 2020 · 3 comments
Closed

"x.py check" shows error twice #76822

RalfJung opened this issue Sep 17, 2020 · 3 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

I just got this output from ./x.py check:

error[E0277]: the trait bound `&rustc_hir::def_id::DefId: rustc_middle::ty::query::sealed::IntoQueryParam<rustc_hir::def_id::DefId>` is not satisfied
   --> compiler/rustc_mir/src/transform/promote_consts.rs:748:53
    |
748 |                 if !self.tcx.is_promotable_const_fn(def_id) {
    |                                                     ^^^^^^ the trait `rustc_middle::ty::query::sealed::IntoQueryParam<rustc_hir::def_id::DefId>` is not implemented for `&rustc_hir::def_id::DefId`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustc_mir`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0277]: the trait bound `&rustc_hir::def_id::DefId: rustc_middle::ty::query::sealed::IntoQueryParam<rustc_hir::def_id::DefId>` is not satisfied
   --> compiler/rustc_mir/src/transform/promote_consts.rs:748:53
    |
748 |                 if !self.tcx.is_promotable_const_fn(def_id) {
    |                                                     ^^^^^^ the trait `rustc_middle::ty::query::sealed::IntoQueryParam<rustc_hir::def_id::DefId>` is not implemented for `&rustc_hir::def_id::DefId`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: build failed

I also noticed that the cargo "status bar" will show things like rustc_mir, rustc_mir or rustc_driver, rustc_driver. Is it building everything twice?

Cc @Mark-Simulacrum

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Sep 17, 2020
@ehuss
Copy link
Contributor

ehuss commented Sep 17, 2020

This is likely a consequence of #76258. Cargo checks the library and unit test in parallel, which can result in duplicate messages. This is a cargo issue (tracked in rust-lang/cargo#5128). I'm thinking about adding a hash to track duplicates, but it will likely be a little tricky.

@RalfJung
Copy link
Member Author

Ah that makes sense... closing in favor of rust-lang/cargo#5128 then.

@Mark-Simulacrum
Copy link
Member

FWIW we could "fix" this by running first the regular check and then the all-target check, but that would likely be a slowdown on most systems as you lose a bunch of potential parallelism.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Oct 3, 2020
This matches Cargo behavior and avoids the (somewhat expensive) double checking,
as well as the unfortunate duplicate error messages (rust-lang#76822,
rust-lang/cargo#5128).
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 4, 2020
…static-morse

Make --all-targets in x.py check opt-in

In particular due to rust-lang#76822, making this the default is currently suboptimal.

r? @ecstatic-morse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants