forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#100437 - compiler-errors:better-const-misma…
…tch-err, r=oli-obk Improve const mismatch `FulfillmentError` Fixes rust-lang#100414
- Loading branch information
Showing
16 changed files
with
194 additions
and
45 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
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
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
24 changes: 24 additions & 0 deletions
24
src/test/ui/const-generics/generic_const_exprs/obligation-cause.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,24 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
trait True {} | ||
|
||
struct Is<const V: bool>; | ||
|
||
impl True for Is<true> {} | ||
|
||
fn g<T>() | ||
//~^ NOTE required by a bound in this | ||
where | ||
Is<{ std::mem::size_of::<T>() == 0 }>: True, | ||
//~^ NOTE required by a bound in `g` | ||
//~| NOTE required by this bound in `g` | ||
{ | ||
} | ||
|
||
fn main() { | ||
g::<usize>(); | ||
//~^ ERROR mismatched types | ||
//~| NOTE expected `false`, found `true` | ||
//~| NOTE expected constant `false` | ||
} |
20 changes: 20 additions & 0 deletions
20
src/test/ui/const-generics/generic_const_exprs/obligation-cause.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,20 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/obligation-cause.rs:20:5 | ||
| | ||
LL | g::<usize>(); | ||
| ^^^^^^^^^^ expected `false`, found `true` | ||
| | ||
= note: expected constant `false` | ||
found constant `true` | ||
note: required by a bound in `g` | ||
--> $DIR/obligation-cause.rs:13:44 | ||
| | ||
LL | fn g<T>() | ||
| - required by a bound in this | ||
... | ||
LL | Is<{ std::mem::size_of::<T>() == 0 }>: True, | ||
| ^^^^ required by this bound in `g` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
Oops, something went wrong.