Add fatal overflow test
This commit is contained in:
parent
a884a9e634
commit
9decfff6f8
2 changed files with 41 additions and 0 deletions
19
src/test/ui/typeck/hang-in-overflow.rs
Normal file
19
src/test/ui/typeck/hang-in-overflow.rs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
// normalize-stderr-test "the requirement `.*`" -> "the requirement `...`"
|
||||||
|
// normalize-stderr-test "required for `.*` to implement `.*`" -> "required for `...` to implement `...`"
|
||||||
|
// normalize-stderr-test: ".*the full type name has been written to.*\n" -> ""
|
||||||
|
|
||||||
|
// Currently this fatally aborts instead of hanging.
|
||||||
|
// Make sure at least that this doesn't turn into a hang.
|
||||||
|
|
||||||
|
fn f() {
|
||||||
|
foo::<_>();
|
||||||
|
//~^ ERROR overflow evaluating the requirement
|
||||||
|
}
|
||||||
|
|
||||||
|
fn foo<B>()
|
||||||
|
where
|
||||||
|
Vec<[[[B; 1]; 1]; 1]>: PartialEq<B>,
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
22
src/test/ui/typeck/hang-in-overflow.stderr
Normal file
22
src/test/ui/typeck/hang-in-overflow.stderr
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
error[E0275]: overflow evaluating the requirement `...`
|
||||||
|
--> $DIR/hang-in-overflow.rs:9:5
|
||||||
|
|
|
||||||
|
LL | foo::<_>();
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hang_in_overflow`)
|
||||||
|
= note: required for `...` to implement `...`
|
||||||
|
= note: 127 redundant requirements hidden
|
||||||
|
= note: required for `...` to implement `...`
|
||||||
|
note: required by a bound in `foo`
|
||||||
|
--> $DIR/hang-in-overflow.rs:15:28
|
||||||
|
|
|
||||||
|
LL | fn foo<B>()
|
||||||
|
| --- required by a bound in this
|
||||||
|
LL | where
|
||||||
|
LL | Vec<[[[B; 1]; 1]; 1]>: PartialEq<B>,
|
||||||
|
| ^^^^^^^^^^^^ required by this bound in `foo`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0275`.
|
Loading…
Add table
Add a link
Reference in a new issue