Skip to content

Commit 091b300

Browse files
ZuseZ4oli-obk
andauthored
Apply suggestions from code review
Co-authored-by: Oli Scherer <[email protected]>
1 parent e16de5d commit 091b300

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,10 @@ fn autodiff_attrs(tcx: TyCtxt<'_>, id: DefId) -> Option<AutoDiffAttrs> {
823823
}
824824
};
825825

826-
let width: u32;
827-
match width_meta {
826+
let width: u32 = match width_meta {
828827
MetaItemInner::MetaItem(MetaItem { path: p1, .. }) => {
829828
let w = p1.segments.first().unwrap().ident;
830-
width = match w.as_str().parse() {
829+
match w.as_str().parse() {
831830
Ok(val) => val,
832831
Err(_) => {
833832
span_bug!(w.span, "rustc_autodiff width should fit u32");
@@ -836,7 +835,7 @@ fn autodiff_attrs(tcx: TyCtxt<'_>, id: DefId) -> Option<AutoDiffAttrs> {
836835
}
837836
MetaItemInner::Lit(lit) => {
838837
if let LitKind::Int(val, _) = lit.kind {
839-
width = match val.get().try_into() {
838+
match val.get().try_into() {
840839
Ok(val) => val,
841840
Err(_) => {
842841
span_bug!(lit.span, "rustc_autodiff width should fit u32");

0 commit comments

Comments
 (0)