Datasets:

Languages:
code
ArXiv:
Tags:
code
License:
Muennighoff commited on
Commit
78e747a
·
1 Parent(s): a62d662

Fix Rust compilation

Browse files
Files changed (1) hide show
  1. data/rust/data/humanevalbugs.jsonl +1 -1
data/rust/data/humanevalbugs.jsonl CHANGED
@@ -30,7 +30,7 @@
30
  {"task_id": "Rust/29", "prompt": "\n/*\n Filter an input list of strings only for ones that start with a given prefix.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn filter_by_prefix(strings:Vec<String>, prefix:String)-> Vec<String>{\n\n", "canonical_solution": "\n return strings.into_iter().filter(|s| s.starts_with(&prefix)).collect();\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n#[test]\n fn test_filter_by_prefix() {\n let v_empty: Vec<String> = vec![];\n assert!(filter_by_prefix(vec![], \"john\".to_string()) == v_empty);\n assert!(\n filter_by_prefix(\n vec![\n \"xxx\".to_string(),\n \"asd\".to_string(),\n \"xxy\".to_string(),\n \"john doe\".to_string(),\n \"xxxAAA\".to_string(),\n \"xxx\".to_string()\n ],\n \"xxx\".to_string()\n ) == vec![\"xxx\", \"xxxAAA\", \"xxx\"]\n );\n }\n\n\n}\n", "example_test": "None", "buggy_solution": "\n return strings.into_iter().filter(|s| s.ends_with(&prefix)).collect();\n}\n", "bug_type": "function misuse", "failure_symptoms": "incorrect output", "entry_point": "filter_by_prefix"}
31
  {"task_id": "Rust/30", "prompt": "\n/*\nReturn only positive numbers in the list.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn get_positive(numbers:Vec<i32>) -> Vec<i32>{\n\n", "canonical_solution": "\n return numbers.into_iter().filter(|n| n.is_positive()).collect();\n\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_get_positive() {\n assert!(get_positive(vec![-1, -2, 4, 5, 6]) == [4, 5, 6]);\n assert!(\n get_positive(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1]\n );\n assert!(get_positive(vec![-1, -2]) == []);\n assert!(get_positive(vec![]) == []);\n }\n\n}\n", "example_test": "None", "buggy_solution": "\n return numbers.into_iter().filter(|n| n.is_negative()).collect();\n\n}\n", "bug_type": "operator misuse", "failure_symptoms": "incorrect output", "entry_point": "get_positive"}
32
  {"task_id": "Rust/31", "prompt": "\n/*\nReturn true if a given number is prime, and false otherwise.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn is_prime(n:i32) -> bool{\n\n", "canonical_solution": "\n if n < 2{\n return false;\n}\nfor k in 2..n-1 {\n if n % k == 0{\n return false;\n }\n}\nreturn true;\n\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_is_prime() {\n assert!(is_prime(6) == false);\n assert!(is_prime(101) == true);\n assert!(is_prime(11) == true);\n assert!(is_prime(13441) == true);\n assert!(is_prime(61) == true);\n assert!(is_prime(4) == false);\n assert!(is_prime(1) == false);\n assert!(is_prime(5) == true);\n assert!(is_prime(11) == true);\n assert!(is_prime(17) == true);\n assert!(is_prime(5 * 17) == false);\n assert!(is_prime(11 * 7) == false);\n assert!(is_prime(13441 * 19) == false);\n }\n\n}\n", "example_test": "None", "buggy_solution": "\n if n < 1{\n return false;\n}\nfor k in 1..n-1 {\n if n % k == 0{\n return false;\n }\n}\nreturn true;\n\n}\n", "bug_type": "value misuse", "failure_symptoms": "incorrect output", "entry_point": "is_prime"}
33
- {"task_id": "Rust/32", "prompt": "\n/*\n xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn poly(xs: &Vec<f64>, x: f64) -> f64 {\n\n", "canonical_solution": "\n let mut sum = 0.0;\n for i in 0..xs.len() {\n sum += xs[i] * x.powi(i as i32);\n }\n sum\n }\n \n fn find_zero(xs: &Vec<f64>) -> f64 {\n let mut ans = 0.0;\n let mut value = poly(xs, ans);\n while value.abs() > 1e-6 {\n let mut driv = 0.0;\n for i in 1..xs.len() {\n driv += xs[i] * ans.powi((i - 1) as i32) * (i as f64);\n }\n ans = ans - value / driv;\n value = poly(xs, ans);\n }\n ans\n }\n", "test": "\n/*\n#[cfg(test)]\nmod tests {\n use super::*;\n\n#[test]\n fn test_poly() {\n let mut rng = rand::thread_rng();\n let mut solution: f64;\n let mut ncoeff: i32;\n for _ in 0..100 {\n ncoeff = 2 * (1 + rng.gen_range(0, 4));\n let mut coeffs = vec![];\n for _ in 0..ncoeff {\n let coeff = -10 + rng.gen_range(0, 21);\n if coeff == 0 {\n coeffs.push(1.0);\n } else {\n coeffs.push(coeff as f64);\n }\n }\n solution = find_zero(&coeffs);\n assert!(poly(&coeffs, solution).abs() < 1e-3);\n }\n }\n\n}\n*/\n", "example_test": "None", "buggy_solution": "\n let mut sum = 0.0;\n for i in 0..xs.len() {\n sum += xs[i] * x.powi(i as i32);\n }\n sum\n }\n \n fn find_zero(xs: &Vec<f64>) -> f64 {\n let mut driv = 0.0;\n let mut ans = 0.0;\n let mut value = poly(xs, ans);\n while value.abs() > 1e-6 {\n for i in 1..xs.len() {\n driv += xs[i] * ans.powi((i - 1) as i32) * (i as f64);\n }\n ans = ans - value / driv;\n value = poly(xs, ans);\n }\n 0.00001\n }\n", "bug_type": "variable misuse", "failure_symptoms": "incorrect output", "entry_point": "find_zero"}
34
  {"task_id": "Rust/33", "prompt": "\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn sort_third(l: Vec<i32>) -> Vec<i32> {\n\n", "canonical_solution": "\n let mut third = vec![];\n let mut out:Vec<i32> = vec![];\n\n for (indx,elem) in l.iter().enumerate(){\n if indx%3 == 0 && indx != 0{\n third.push(elem)\n }\n }\n third.sort();\n let mut indx_t:usize = 0;\n\n for i in 0..l.len() {\n if i%3 == 0 && i != 0{\n if indx_t < third.len(){\n out.push(*third[indx_t]);\n indx_t += 1;\n }\n }else{\n out.push(l[i]);\n }\n \n }\n return out;\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_sort_third() {\n let mut l = vec![1, 2, 3];\n assert_eq!(sort_third(l), vec![1, 2, 3]);\n l = vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10];\n assert_eq!(sort_third(l), vec![5, 3, -5, 1, -3, 3, 2, 0, 123, 9, -10]);\n l = vec![5, 8, -12, 4, 23, 2, 3, 11, 12, -10];\n assert_eq!(sort_third(l), vec![5, 8, -12, -10, 23, 2, 3, 11, 12, 4]);\n l = vec![5, 6, 3, 4, 8, 9, 2];\n assert_eq!(sort_third(l), vec![5, 6, 3, 2, 8, 9, 4]);\n l = vec![5, 8, 3, 4, 6, 9, 2];\n assert_eq!(sort_third(l), vec![5, 8, 3, 2, 6, 9, 4]);\n l = vec![5, 6, 9, 4, 8, 3, 2];\n assert_eq!(sort_third(l), vec![5, 6, 9, 2, 8, 3, 4]);\n l = vec![5, 6, 3, 4, 8, 9, 2, 1];\n assert_eq!(sort_third(l), vec![5, 6, 3, 2, 8, 9, 4, 1]);\n }\n\n}\n", "example_test": "None", "buggy_solution": "\n let mut third = vec![];\n let mut out:Vec<i32> = vec![];\n\n for (indx,elem) in l.iter().enumerate(){\n if indx%3 == 0 && indx != 0{\n third.push(elem)\n }\n }\n let mut indx_t:usize = 0;\n\n for i in 0..l.len() {\n if i%3 == 0 && i != 0{\n if indx_t < third.len(){\n out.push(*third[indx_t]);\n indx_t += 1;\n }\n }else{\n out.push(l[i]);\n }\n \n }\n return out;\n}\n", "bug_type": "missing logic", "failure_symptoms": "incorrect output", "entry_point": "sort_third"}
35
  {"task_id": "Rust/34", "prompt": "\n/*\nReturn sorted unique elements in a list\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn unique(nmbs:Vec<i32>) -> Vec<i32>{\n\n", "canonical_solution": "\n let mut res:Vec<i32> = nmbs.clone();\n res.sort();\n res.dedup();\n return res;\n }\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_unique() {\n assert!(unique(vec![5, 3, 5, 2, 3, 3, 9, 0, 123]) == vec![0, 2, 3, 5, 9, 123]);\n }\n\n\n}\n", "example_test": "None", "buggy_solution": "\n let mut res:Vec<i32> = nmbs.clone();\n res.sort();\n return res;\n }\n", "bug_type": "missing logic", "failure_symptoms": "incorrect output", "entry_point": "unique"}
36
  {"task_id": "Rust/35", "prompt": "\n/*\nReturn maximum element in the list.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn maximum(nmbs:Vec<i32>) -> i32{\n\n", "canonical_solution": "\n return *nmbs.iter().max().unwrap();\n }\n\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_maximum() {\n assert!(maximum(vec![1, 2, 3]) == 3);\n assert!(maximum(vec![5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124);\n }\n\n\n}\n", "example_test": "None", "buggy_solution": "\n return *nmbs.iter().min().unwrap();\n }\n\n", "bug_type": "operator misuse", "failure_symptoms": "incorrect output", "entry_point": "max_element"}
 
30
  {"task_id": "Rust/29", "prompt": "\n/*\n Filter an input list of strings only for ones that start with a given prefix.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn filter_by_prefix(strings:Vec<String>, prefix:String)-> Vec<String>{\n\n", "canonical_solution": "\n return strings.into_iter().filter(|s| s.starts_with(&prefix)).collect();\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n#[test]\n fn test_filter_by_prefix() {\n let v_empty: Vec<String> = vec![];\n assert!(filter_by_prefix(vec![], \"john\".to_string()) == v_empty);\n assert!(\n filter_by_prefix(\n vec![\n \"xxx\".to_string(),\n \"asd\".to_string(),\n \"xxy\".to_string(),\n \"john doe\".to_string(),\n \"xxxAAA\".to_string(),\n \"xxx\".to_string()\n ],\n \"xxx\".to_string()\n ) == vec![\"xxx\", \"xxxAAA\", \"xxx\"]\n );\n }\n\n\n}\n", "example_test": "None", "buggy_solution": "\n return strings.into_iter().filter(|s| s.ends_with(&prefix)).collect();\n}\n", "bug_type": "function misuse", "failure_symptoms": "incorrect output", "entry_point": "filter_by_prefix"}
31
  {"task_id": "Rust/30", "prompt": "\n/*\nReturn only positive numbers in the list.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn get_positive(numbers:Vec<i32>) -> Vec<i32>{\n\n", "canonical_solution": "\n return numbers.into_iter().filter(|n| n.is_positive()).collect();\n\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_get_positive() {\n assert!(get_positive(vec![-1, -2, 4, 5, 6]) == [4, 5, 6]);\n assert!(\n get_positive(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1]\n );\n assert!(get_positive(vec![-1, -2]) == []);\n assert!(get_positive(vec![]) == []);\n }\n\n}\n", "example_test": "None", "buggy_solution": "\n return numbers.into_iter().filter(|n| n.is_negative()).collect();\n\n}\n", "bug_type": "operator misuse", "failure_symptoms": "incorrect output", "entry_point": "get_positive"}
32
  {"task_id": "Rust/31", "prompt": "\n/*\nReturn true if a given number is prime, and false otherwise.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn is_prime(n:i32) -> bool{\n\n", "canonical_solution": "\n if n < 2{\n return false;\n}\nfor k in 2..n-1 {\n if n % k == 0{\n return false;\n }\n}\nreturn true;\n\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_is_prime() {\n assert!(is_prime(6) == false);\n assert!(is_prime(101) == true);\n assert!(is_prime(11) == true);\n assert!(is_prime(13441) == true);\n assert!(is_prime(61) == true);\n assert!(is_prime(4) == false);\n assert!(is_prime(1) == false);\n assert!(is_prime(5) == true);\n assert!(is_prime(11) == true);\n assert!(is_prime(17) == true);\n assert!(is_prime(5 * 17) == false);\n assert!(is_prime(11 * 7) == false);\n assert!(is_prime(13441 * 19) == false);\n }\n\n}\n", "example_test": "None", "buggy_solution": "\n if n < 1{\n return false;\n}\nfor k in 1..n-1 {\n if n % k == 0{\n return false;\n }\n}\nreturn true;\n\n}\n", "bug_type": "value misuse", "failure_symptoms": "incorrect output", "entry_point": "is_prime"}
33
+ {"task_id": "Rust/32", "prompt": "\n/*\n xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn poly(xs: &Vec<f64>, x: f64) -> f64 {\n\n", "canonical_solution": "\n let mut sum = 0.0;\n for i in 0..xs.len() {\n sum += xs[i] * x.powi(i as i32);\n }\n sum\n }\n \n fn find_zero(xs: &Vec<f64>) -> f64 {\n let mut ans = 0.0;\n let mut value = poly(xs, ans);\n while value.abs() > 1e-6 {\n let mut driv = 0.0;\n for i in 1..xs.len() {\n driv += xs[i] * ans.powi((i - 1) as i32) * (i as f64);\n }\n ans = ans - value / driv;\n value = poly(xs, ans);\n }\n ans\n }\n", "test": "\n\n#[cfg(test)]\nmod tests {\n use super::*;\n\n#[test]\n fn test_poly() {\n let mut rng = rand::thread_rng();\n let mut solution: f64;\n let mut ncoeff: i32;\n for _ in 0..100 {\n ncoeff = 2 * (1 + rng.gen_range(0, 4));\n let mut coeffs = vec![];\n for _ in 0..ncoeff {\n let coeff = -10 + rng.gen_range(0, 21);\n if coeff == 0 {\n coeffs.push(1.0);\n } else {\n coeffs.push(coeff as f64);\n }\n }\n solution = find_zero(&coeffs);\n assert!(poly(&coeffs, solution).abs() < 1e-3);\n }\n }\n\n}\n\n", "example_test": "None", "buggy_solution": "\n let mut sum = 0.0;\n for i in 0..xs.len() {\n sum += xs[i] * x.powi(i as i32);\n }\n sum\n }\n \n fn find_zero(xs: &Vec<f64>) -> f64 {\n let mut driv = 0.0;\n let mut ans = 0.0;\n let mut value = poly(xs, ans);\n while value.abs() > 1e-6 {\n for i in 1..xs.len() {\n driv += xs[i] * ans.powi((i - 1) as i32) * (i as f64);\n }\n ans = ans - value / driv;\n value = poly(xs, ans);\n }\n 0.00001\n }\n", "bug_type": "variable misuse", "failure_symptoms": "incorrect output", "entry_point": "find_zero"}
34
  {"task_id": "Rust/33", "prompt": "\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn sort_third(l: Vec<i32>) -> Vec<i32> {\n\n", "canonical_solution": "\n let mut third = vec![];\n let mut out:Vec<i32> = vec![];\n\n for (indx,elem) in l.iter().enumerate(){\n if indx%3 == 0 && indx != 0{\n third.push(elem)\n }\n }\n third.sort();\n let mut indx_t:usize = 0;\n\n for i in 0..l.len() {\n if i%3 == 0 && i != 0{\n if indx_t < third.len(){\n out.push(*third[indx_t]);\n indx_t += 1;\n }\n }else{\n out.push(l[i]);\n }\n \n }\n return out;\n}\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_sort_third() {\n let mut l = vec![1, 2, 3];\n assert_eq!(sort_third(l), vec![1, 2, 3]);\n l = vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10];\n assert_eq!(sort_third(l), vec![5, 3, -5, 1, -3, 3, 2, 0, 123, 9, -10]);\n l = vec![5, 8, -12, 4, 23, 2, 3, 11, 12, -10];\n assert_eq!(sort_third(l), vec![5, 8, -12, -10, 23, 2, 3, 11, 12, 4]);\n l = vec![5, 6, 3, 4, 8, 9, 2];\n assert_eq!(sort_third(l), vec![5, 6, 3, 2, 8, 9, 4]);\n l = vec![5, 8, 3, 4, 6, 9, 2];\n assert_eq!(sort_third(l), vec![5, 8, 3, 2, 6, 9, 4]);\n l = vec![5, 6, 9, 4, 8, 3, 2];\n assert_eq!(sort_third(l), vec![5, 6, 9, 2, 8, 3, 4]);\n l = vec![5, 6, 3, 4, 8, 9, 2, 1];\n assert_eq!(sort_third(l), vec![5, 6, 3, 2, 8, 9, 4, 1]);\n }\n\n}\n", "example_test": "None", "buggy_solution": "\n let mut third = vec![];\n let mut out:Vec<i32> = vec![];\n\n for (indx,elem) in l.iter().enumerate(){\n if indx%3 == 0 && indx != 0{\n third.push(elem)\n }\n }\n let mut indx_t:usize = 0;\n\n for i in 0..l.len() {\n if i%3 == 0 && i != 0{\n if indx_t < third.len(){\n out.push(*third[indx_t]);\n indx_t += 1;\n }\n }else{\n out.push(l[i]);\n }\n \n }\n return out;\n}\n", "bug_type": "missing logic", "failure_symptoms": "incorrect output", "entry_point": "sort_third"}
35
  {"task_id": "Rust/34", "prompt": "\n/*\nReturn sorted unique elements in a list\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn unique(nmbs:Vec<i32>) -> Vec<i32>{\n\n", "canonical_solution": "\n let mut res:Vec<i32> = nmbs.clone();\n res.sort();\n res.dedup();\n return res;\n }\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_unique() {\n assert!(unique(vec![5, 3, 5, 2, 3, 3, 9, 0, 123]) == vec![0, 2, 3, 5, 9, 123]);\n }\n\n\n}\n", "example_test": "None", "buggy_solution": "\n let mut res:Vec<i32> = nmbs.clone();\n res.sort();\n return res;\n }\n", "bug_type": "missing logic", "failure_symptoms": "incorrect output", "entry_point": "unique"}
36
  {"task_id": "Rust/35", "prompt": "\n/*\nReturn maximum element in the list.\n \n*/\n", "declaration": "\nuse std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};\nuse rand::Rng;\nuse regex::Regex;\nuse md5;\nuse std::any::{Any, TypeId};\n\nfn maximum(nmbs:Vec<i32>) -> i32{\n\n", "canonical_solution": "\n return *nmbs.iter().max().unwrap();\n }\n\n", "test": "\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn test_maximum() {\n assert!(maximum(vec![1, 2, 3]) == 3);\n assert!(maximum(vec![5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124);\n }\n\n\n}\n", "example_test": "None", "buggy_solution": "\n return *nmbs.iter().min().unwrap();\n }\n\n", "bug_type": "operator misuse", "failure_symptoms": "incorrect output", "entry_point": "max_element"}