Skip to content

Commit 5ece1be

Browse files
Rollup merge of rust-lang#157602 - fmease:rustdoc-rm-unnecessary-fast-path, r=mu001999
rustdoc: Remove unnecessary fast path I added this "fast path" prematurely in PR rust-lang#116882. It's not actually necessary as this perf run shows: rust-lang#146483 (comment) (https://perf.rust-lang.org/compare.html?start=40ace17fc3891155bad26a50d60a9ab07b83bf8e&end=a77816d56c8fdadab64ae3f9fe1a653bfdb975a8&stat=instructions:u). Let's remove it since makes it slightly more annoying to add new reprs (one would need to update two places).
2 parents f370bf0 + 09c0629 commit 5ece1be

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

  • src/librustdoc/html/render

src/librustdoc/html/render/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,18 +3061,6 @@ fn repr_attribute<'tcx>(
30613061
return is_public.then(|| "#[repr(transparent)]".into());
30623062
}
30633063

3064-
// Fast path which avoids looking through the variants and fields in
3065-
// the common case of no `#[repr]` or in the case of `#[repr(Rust)]`.
3066-
// FIXME: This check is not very robust / forward compatible!
3067-
if !repr.c()
3068-
&& !repr.simd()
3069-
&& repr.int.is_none()
3070-
&& repr.pack.is_none()
3071-
&& repr.align.is_none()
3072-
{
3073-
return None;
3074-
}
3075-
30763064
// The repr is public iff all components are public and visible.
30773065
let is_public = adt
30783066
.variants()

0 commit comments

Comments
 (0)