Skip to content

Commit d16e9c3

Browse files
Noratriebfmease
andcommitted
Convert it into a warning
Co-authored-by: León Orell Valerian Liehr <[email protected]>
1 parent 1b9159e commit d16e9c3

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_index/src

1 file changed

+6
-1
lines changed

compiler/rustc_index/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ pub use {idx::Idx, slice::IndexSlice, vec::IndexVec};
2929
pub use rustc_macros::newtype_index;
3030

3131
/// Type size assertion. The first argument is a type and the second argument is its expected size.
32-
/// Note to the reader: Emitting hard errors from size assertions like this is generally not
32+
///
33+
/// <div class="warning">
34+
///
35+
/// Emitting hard errors from size assertions like this is generally not
3336
/// recommended, especially in libraries, because they can cause build failures if the layout
3437
/// algorithm or dependencies change. Here in rustc we control the toolchain and layout algorithm,
3538
/// so the former is not a problem. For the latter we have a lockfile as rustc is an application and
3639
/// precompiled library.
3740
///
3841
/// Short version: Don't copy this macro into your own code. Use a `#[test]` instead.
42+
///
43+
/// </div>
3944
#[macro_export]
4045
macro_rules! static_assert_size {
4146
($ty:ty, $size:expr) => {

0 commit comments

Comments
 (0)