mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 21:23:20 +00:00
trait selection errors should poison the typeck results, too, so that const eval can avoid running at all
This commit is contained in:
parent
b2eba058e6
commit
31e0bf7891
@ -273,6 +273,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||
error: &SelectionError<'tcx>,
|
||||
fallback_has_occurred: bool,
|
||||
) {
|
||||
self.set_tainted_by_errors();
|
||||
let tcx = self.tcx;
|
||||
let mut span = obligation.cause.span;
|
||||
|
||||
|
@ -2,5 +2,4 @@ fn main() {
|
||||
[9; [[9E; h]]];
|
||||
//~^ ERROR: expected at least one digit in exponent
|
||||
//~| ERROR: cannot find value `h` in this scope [E0425]
|
||||
//~| ERROR: constant expression depends on a generic parameter
|
||||
}
|
||||
|
@ -10,14 +10,6 @@ error[E0425]: cannot find value `h` in this scope
|
||||
LL | [9; [[9E; h]]];
|
||||
| ^ not found in this scope
|
||||
|
||||
error: constant expression depends on a generic parameter
|
||||
--> $DIR/issue-91434.rs:2:9
|
||||
|
|
||||
LL | [9; [[9E; h]]];
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: this may fail depending on what value the parameter takes
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
||||
|
4
src/test/ui/consts/nested_erroneous_ctfe.rs
Normal file
4
src/test/ui/consts/nested_erroneous_ctfe.rs
Normal file
@ -0,0 +1,4 @@
|
||||
fn main() {
|
||||
[9; || [9; []]];
|
||||
//~^ ERROR: mismatched types
|
||||
}
|
12
src/test/ui/consts/nested_erroneous_ctfe.stderr
Normal file
12
src/test/ui/consts/nested_erroneous_ctfe.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/nested_erroneous_ctfe.rs:2:16
|
||||
|
|
||||
LL | [9; || [9; []]];
|
||||
| ^^ expected `usize`, found array of 0 elements
|
||||
|
|
||||
= note: expected type `usize`
|
||||
found array `[_; 0]`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
Reference in New Issue
Block a user