diff options
| author | jumbatm <30644300+jumbatm@users.noreply.github.com> | 2020-08-25 23:41:13 +1000 |
|---|---|---|
| committer | jumbatm <30644300+jumbatm@users.noreply.github.com> | 2020-08-26 00:19:45 +1000 |
| commit | 352df40df53e0b559ecefcd5a4409ec43143c645 (patch) | |
| tree | 5db7165a09604fd8a193dbd073edb1baedecea5f | |
| parent | 2ea86af1eaed20227a6176995aa6c082f245924c (diff) | |
| download | rust-352df40df53e0b559ecefcd5a4409ec43143c645.tar.gz rust-352df40df53e0b559ecefcd5a4409ec43143c645.zip | |
Remove unnecessary assert.
| -rw-r--r-- | src/librustc_lint/builtin.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 593d4802704..f8d30ebb0b1 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -2180,11 +2180,12 @@ impl ClashingExternDeclarations { if is_transparent && !is_non_null { debug_assert!(def.variants.len() == 1); let v = &def.variants[VariantIdx::new(0)]; - assert!( - v.fields.len() > 0, - "single-variant transparent structure with zero-sized field" - ); - ty = v.transparent_newtype_field(tcx).unwrap().ty(tcx, substs); + ty = v + .transparent_newtype_field(tcx) + .expect( + "single-variant transparent structure with zero-sized field", + ) + .ty(tcx, substs); continue; } } |
