Reintroduce accidentally deleted assertions. These were removed in https://github.com/rust-lang/rust/pull/50198