-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler: Inform the solver of concurrency
Parallel compilation of a program can cause unexpected event sequencing. Inform the solver when this is true so it can skip invalid asserts.
- Loading branch information
1 parent
12b26c1
commit 73db8d6
Showing
6 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/ui/traits/next-solver/global-cache-and-parallel-frontend.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ compile-flags: -Zthreads=16 | ||
|
||
#[derive(Clone, Eq)] //~ ERROR [E0277] | ||
pub struct Struct<T>(T); | ||
|
||
impl<T: Clone, U> PartialEq<U> for Struct<T> | ||
where | ||
U: Into<Struct<T>> + Clone | ||
{ | ||
fn eq(&self, _other: &U) -> bool { | ||
todo!() | ||
} | ||
} | ||
|
||
fn main() {} |
24 changes: 24 additions & 0 deletions
24
tests/ui/traits/next-solver/global-cache-and-parallel-frontend.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
error[E0277]: the trait bound `T: Clone` is not satisfied | ||
--> $DIR/global-cache-and-parallel-frontend.rs:3:17 | ||
| | ||
LL | #[derive(Clone, Eq)] | ||
| ^^ the trait `Clone` is not implemented for `T`, which is required by `Struct<T>: PartialEq` | ||
| | ||
note: required for `Struct<T>` to implement `PartialEq` | ||
--> $DIR/global-cache-and-parallel-frontend.rs:6:19 | ||
| | ||
LL | impl<T: Clone, U> PartialEq<U> for Struct<T> | ||
| ----- ^^^^^^^^^^^^ ^^^^^^^^^ | ||
| | | ||
| unsatisfied trait bound introduced here | ||
note: required by a bound in `Eq` | ||
--> $SRC_DIR/core/src/cmp.rs:LL:COL | ||
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
help: consider restricting type parameter `T` | ||
| | ||
LL | pub struct Struct<T: std::clone::Clone>(T); | ||
| +++++++++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |