Update rust-profiler sanity test
Desugar the for-loop to minimize ambiguity when testing the profiler. The original regression is tracked upstream as rust#151554. For: RUST-52
This commit is contained in:
parent
1e333e6189
commit
e071728eed
2 changed files with 14 additions and 12 deletions
|
|
@ -1,10 +1,11 @@
|
|||
1| 1|fn main(){
|
||||
1| 1|fn main() {
|
||||
2| 1| let mut sum: u32 = 0;
|
||||
3| 10| for i in 1..10 {
|
||||
4| 9| sum += i;
|
||||
5| 9| }
|
||||
6| 1| if false{
|
||||
7| 0| println!("This code can't be reached");
|
||||
8| 1| }
|
||||
9| 1| println!("Sum: {}", sum);
|
||||
10| 1|}
|
||||
3| 1| let mut iter = 1..10;
|
||||
4| 10| while let Some(i) = iter.next() {
|
||||
5| 9| sum += i;
|
||||
6| 9| }
|
||||
7| 1| if false {
|
||||
8| 0| println!("This code can't be reached");
|
||||
9| 1| }
|
||||
10| 1| println!("Sum: {}", sum);
|
||||
11| 1|}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
fn main(){
|
||||
fn main() {
|
||||
let mut sum: u32 = 0;
|
||||
for i in 1..10 {
|
||||
let mut iter = 1..10;
|
||||
while let Some(i) = iter.next() {
|
||||
sum += i;
|
||||
}
|
||||
if false{
|
||||
if false {
|
||||
println!("This code can't be reached");
|
||||
}
|
||||
println!("Sum: {}", sum);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue