.or_else(|| attr::find_crate_name(attrs).map(|n| n.to_string()))
.unwrap_or_else(|| input.filestem().to_owned());
- OutputFilenames {
- out_directory: dirpath,
- out_filestem: stem,
- single_output_file: None,
- extra: sess.opts.cg.extra_filename.clone(),
- outputs: sess.opts.output_types.clone(),
- }
+ OutputFilenames::new(
+ dirpath,
+ stem,
+ None,
+ sess.opts.cg.extra_filename.clone(),
+ sess.opts.output_types.clone(),
+ )
}
Some(ref out_file) => {
sess.warn("ignoring --out-dir flag due to -o flag");
}
- OutputFilenames {
- out_directory: out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(),
- out_filestem: out_file
- .file_stem()
- .unwrap_or_default()
- .to_str()
- .unwrap()
- .to_string(),
- single_output_file: ofile,
- extra: sess.opts.cg.extra_filename.clone(),
- outputs: sess.opts.output_types.clone(),
- }
+ OutputFilenames::new(
+ out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(),
+ out_file.file_stem().unwrap_or_default().to_str().unwrap().to_string(),
+ ofile,
+ sess.opts.cg.extra_filename.clone(),
+ sess.opts.output_types.clone(),
+ )
}
}
}
self.run(is_const, |s| noop_visit_item_kind(i, s))
}
- fn flat_map_trait_item(&mut self, i: ast::AssocItem) -> SmallVec<[ast::AssocItem; 1]> {
+ fn flat_map_trait_item(&mut self, i: P<ast::AssocItem>) -> SmallVec<[P<ast::AssocItem>; 1]> {
let is_const = match i.kind {
ast::AssocItemKind::Const(..) => true,
ast::AssocItemKind::Fn(ref sig, _) => Self::is_sig_const(sig),
self.run(is_const, |s| noop_flat_map_assoc_item(i, s))
}
- fn flat_map_impl_item(&mut self, i: ast::AssocItem) -> SmallVec<[ast::AssocItem; 1]> {
+ fn flat_map_impl_item(&mut self, i: P<ast::AssocItem>) -> SmallVec<[P<ast::AssocItem>; 1]> {
self.flat_map_trait_item(i)
}