From cef97bce7b2a0e6ef2208aaa1ec267b800d646af Mon Sep 17 00:00:00 2001 From: FedericoBruzzone Date: Mon, 6 Jan 2025 11:39:07 +0100 Subject: Add `TooGeneric` variant to `LayoutError` and emit `Unknown` one - `check-pass` test for a MRE of #135020 - fail test for #135138 - switch to `TooGeneric` for checking CMSE fn signatures - switch to `TooGeneric` for compute `SizeSkeleton` (for transmute) - fix broken tests --- src/librustdoc/html/templates/type_layout.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/librustdoc/html/templates/type_layout.html b/src/librustdoc/html/templates/type_layout.html index aee96fb8c41..9c62826ccc2 100644 --- a/src/librustdoc/html/templates/type_layout.html +++ b/src/librustdoc/html/templates/type_layout.html @@ -28,13 +28,11 @@ {% endfor %} {% endif %} - {# This kind of layout error can occur with valid code, e.g. if you try to - get the layout of a generic type such as `Vec`. #} + {# This kind of layout error can occur with valid code, for example + if there are trivial bounds: `struct Foo(str, str) where str: Sized;`. #} {% when Err(LayoutError::Unknown(_)) %}

{# #} - Note: Unable to compute type layout, {#+ #} - possibly due to this type having generic parameters. {#+ #} - Layout can only be computed for concrete, fully-instantiated types. {# #} + Note: Unable to compute type layout. {# #}

{# This kind of error probably can't happen with valid code, but we don't want to panic and prevent the docs from building, so we just let the @@ -44,6 +42,14 @@ Note: Encountered an error during type layout; {#+ #} the type was too big. {# #}

+ {# This kind of layout error can occur with valid code, e.g. if you try to + get the layout of a generic type such as `Vec`. #} + {% when Err(LayoutError::TooGeneric(_)) %} +

{# #} + Note: Unable to compute type layout, {#+ #} + possibly due to this type having generic parameters. {#+ #} + Layout can only be computed for concrete, fully-instantiated types. {# #} +

{% when Err(LayoutError::ReferencesError(_)) %}

{# #} Note: Encountered an error during type layout; {#+ #} -- cgit 1.4.1-3-g733a5