• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 extern crate autocfg;
2 
main()3 fn main() {
4     // Normally, cargo will set `OUT_DIR` for build scripts.
5     let ac = autocfg::AutoCfg::with_dir("target").unwrap();
6 
7     // When this feature was stabilized, it also renamed the method to
8     // `chunk_by`, so it's important to *use* the feature in your probe.
9     let code = r#"
10         #![feature(slice_group_by)]
11         pub fn probe(slice: &[i32]) -> impl Iterator<Item = &[i32]> {
12             slice.group_by(|a, b| a == b)
13         }
14     "#;
15     if ac.probe_raw(code).is_ok() {
16         autocfg::emit("has_slice_group_by");
17     }
18 }
19