diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2024-10-08 14:25:39 +0300 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2024-10-08 14:25:39 +0300 |
| commit | 4316afffd9390bdac1d3bd5e5398c65d6e9bb150 (patch) | |
| tree | 9d5b39941405bec4b7c4571606df8b88850325e9 /compiler/rustc_mir_dataflow/src/framework | |
| parent | 537fb8d1bb2405b118898c663bc076815a1762c7 (diff) | |
| parent | cf24c73141a77db730f4b7fda69dcd7e8b113b51 (diff) | |
| download | rust-4316afffd9390bdac1d3bd5e5398c65d6e9bb150.tar.gz rust-4316afffd9390bdac1d3bd5e5398c65d6e9bb150.zip | |
Merge from rust-lang/rust
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/framework')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/engine.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_mir_dataflow/src/framework/engine.rs b/compiler/rustc_mir_dataflow/src/framework/engine.rs index 947bdf860b5..9d50e57d668 100644 --- a/compiler/rustc_mir_dataflow/src/framework/engine.rs +++ b/compiler/rustc_mir_dataflow/src/framework/engine.rs @@ -266,7 +266,7 @@ where A::Domain: DebugWithContext<A>, { use std::fs; - use std::io::{self, Write}; + use std::io::Write; let def_id = body.source.def_id(); let Ok(attrs) = RustcMirAttrs::parse(tcx, def_id) else { @@ -281,12 +281,11 @@ where if let Some(parent) = path.parent() { fs::create_dir_all(parent)?; } - let f = fs::File::create(&path)?; - io::BufWriter::new(f) + fs::File::create_buffered(&path)? } None if dump_enabled(tcx, A::NAME, def_id) => { - create_dump_file(tcx, ".dot", false, A::NAME, &pass_name.unwrap_or("-----"), body)? + create_dump_file(tcx, "dot", false, A::NAME, &pass_name.unwrap_or("-----"), body)? } _ => return (Ok(()), results), @@ -368,7 +367,7 @@ impl RustcMirAttrs { fn set_field<T>( field: &mut Option<T>, tcx: TyCtxt<'_>, - attr: &ast::NestedMetaItem, + attr: &ast::MetaItemInner, mapper: impl FnOnce(Symbol) -> Result<T, ()>, ) -> Result<(), ()> { if field.is_some() { |
