Skip to content

Commit 07a1194

Browse files
debuginfo: Refactor debuginfo generation for types -- Run x.py fmt
1 parent 5144661 commit 07a1194

File tree

3 files changed

+13
-39
lines changed

3 files changed

+13
-39
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ in the middle of the prologue, however, they are ignored by LLVM's prologue
128128
detection. The `create_argument_metadata()` and related functions take care
129129
of linking the `llvm.dbg.declare` instructions to the correct source
130130
locations even while source location emission is still disabled, so there
131-
is no need to do anything special with source location handling here.
131+
is no need to do anything special with source location handling here.

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,11 @@ fn build_upvar_field_di_nodes<'ll, 'tcx>(
10221022
}
10231023
};
10241024

1025-
debug_assert!(up_var_tys
1026-
.iter()
1027-
.all(|&t| t == cx.tcx.normalize_erasing_regions(ParamEnv::reveal_all(), t)));
1025+
debug_assert!(
1026+
up_var_tys
1027+
.iter()
1028+
.all(|&t| t == cx.tcx.normalize_erasing_regions(ParamEnv::reveal_all(), t))
1029+
);
10281030

10291031
let capture_names = closure_saved_names_of_captured_variables(cx.tcx, def_id);
10301032
let layout = cx.layout_of(closure_or_generator_ty);

src/tools/compiletest/src/runtest.rs

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,11 @@ impl<'test> TestCx<'test> {
263263
Ui | MirOpt => false,
264264
mode => panic!("unimplemented for mode {:?}", mode),
265265
};
266-
if test_should_run {
267-
self.run_if_enabled()
268-
} else {
269-
WillExecute::No
270-
}
266+
if test_should_run { self.run_if_enabled() } else { WillExecute::No }
271267
}
272268

273269
fn run_if_enabled(&self) -> WillExecute {
274-
if self.config.run_enabled() {
275-
WillExecute::Yes
276-
} else {
277-
WillExecute::Disabled
278-
}
270+
if self.config.run_enabled() { WillExecute::Yes } else { WillExecute::Disabled }
279271
}
280272

281273
fn should_run_successfully(&self, pm: Option<PassMode>) -> bool {
@@ -2029,11 +2021,7 @@ impl<'test> TestCx<'test> {
20292021
Some(ref s) => s
20302022
.split(' ')
20312023
.filter_map(|s| {
2032-
if s.chars().all(|c| c.is_whitespace()) {
2033-
None
2034-
} else {
2035-
Some(s.to_owned())
2036-
}
2024+
if s.chars().all(|c| c.is_whitespace()) { None } else { Some(s.to_owned()) }
20372025
})
20382026
.collect(),
20392027
None => Vec::new(),
@@ -2092,11 +2080,7 @@ impl<'test> TestCx<'test> {
20922080
/// The revision, ignored for incremental compilation since it wants all revisions in
20932081
/// the same directory.
20942082
fn safe_revision(&self) -> Option<&str> {
2095-
if self.config.mode == Incremental {
2096-
None
2097-
} else {
2098-
self.revision
2099-
}
2083+
if self.config.mode == Incremental { None } else { self.revision }
21002084
}
21012085

21022086
/// Gets the absolute path to the directory where all output for the given
@@ -2251,11 +2235,7 @@ impl<'test> TestCx<'test> {
22512235

22522236
fn charset() -> &'static str {
22532237
// FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
2254-
if cfg!(target_os = "freebsd") {
2255-
"ISO-8859-1"
2256-
} else {
2257-
"UTF-8"
2258-
}
2238+
if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" }
22592239
}
22602240

22612241
fn run_rustdoc_test(&self) {
@@ -3045,11 +3025,7 @@ impl<'test> TestCx<'test> {
30453025
let (stderr_kind, stdout_kind) = match output_kind {
30463026
TestOutput::Compile => (
30473027
{
3048-
if self.props.stderr_per_bitwidth {
3049-
&stderr_bits
3050-
} else {
3051-
UI_STDERR
3052-
}
3028+
if self.props.stderr_per_bitwidth { &stderr_bits } else { UI_STDERR }
30533029
},
30543030
UI_STDOUT,
30553031
),
@@ -3746,11 +3722,7 @@ impl<'test> TestCx<'test> {
37463722
for output_file in files {
37473723
println!("Actual {} saved to {}", kind, output_file.display());
37483724
}
3749-
if self.config.bless {
3750-
0
3751-
} else {
3752-
1
3753-
}
3725+
if self.config.bless { 0 } else { 1 }
37543726
}
37553727

37563728
fn prune_duplicate_output(&self, mode: CompareMode, kind: &str, canon_content: &str) {

0 commit comments

Comments
 (0)