Do not report overflow errors on ConstArgHasType goals
This commit is contained in:
parent
340bb19fea
commit
01c974ff98
3 changed files with 54 additions and 12 deletions
28
tests/ui/codegen/overflow-during-mono.rs
Normal file
28
tests/ui/codegen/overflow-during-mono.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
// build-fail
|
||||
//~^ ERROR overflow evaluating the requirement
|
||||
|
||||
#![recursion_limit = "32"]
|
||||
|
||||
fn quicksort<It: Clone + Iterator<Item = T>, I: IntoIterator<IntoIter = It>, T: Ord>(
|
||||
i: I,
|
||||
) -> Vec<T> {
|
||||
let mut i = i.into_iter();
|
||||
|
||||
match i.next() {
|
||||
Some(x) => {
|
||||
let less = i.clone().filter(|y| y < &x);
|
||||
let greater = i.filter(|y| &x <= y);
|
||||
|
||||
let mut v = quicksort(less);
|
||||
let u = quicksort(greater);
|
||||
v.push(x);
|
||||
v.extend(u);
|
||||
v
|
||||
}
|
||||
None => vec![],
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", quicksort([5i32, 1, 6, 3, 6, 1, 9, 0, -1, 6, 8]));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue