Auto merge of #122571 - matthiaskrgr:rollup-36wwovk, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #122254 (Detect calls to .clone() on T: !Clone types on borrowck errors) - #122495 (Visually mark 👻hidden👻 items with document-hidden-items) - #122543 (Add `#![rustc_never_type_mode = "..."]` crate-level attribute to allow experimenting) - #122560 (Safe Transmute: Use 'not yet supported', not 'unspecified' in errors) - #122562 (Mention labelled blocks in `break` docs) - #122563 (CI: cache PR CI Docker builds) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
c67326b063
56 changed files with 711 additions and 362 deletions
|
@ -3073,29 +3073,29 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
let src = trait_ref.args.type_at(1);
|
||||
let err_msg = format!("`{src}` cannot be safely transmuted into `{dst}`");
|
||||
let safe_transmute_explanation = match reason {
|
||||
rustc_transmute::Reason::SrcIsUnspecified => {
|
||||
format!("`{src}` does not have a well-specified layout")
|
||||
rustc_transmute::Reason::SrcIsNotYetSupported => {
|
||||
format!("analyzing the transmutability of `{src}` is not yet supported.")
|
||||
}
|
||||
|
||||
rustc_transmute::Reason::DstIsUnspecified => {
|
||||
format!("`{dst}` does not have a well-specified layout")
|
||||
rustc_transmute::Reason::DstIsNotYetSupported => {
|
||||
format!("analyzing the transmutability of `{dst}` is not yet supported.")
|
||||
}
|
||||
|
||||
rustc_transmute::Reason::DstIsBitIncompatible => {
|
||||
format!("At least one value of `{src}` isn't a bit-valid value of `{dst}`")
|
||||
format!("at least one value of `{src}` isn't a bit-valid value of `{dst}`")
|
||||
}
|
||||
|
||||
rustc_transmute::Reason::DstMayHaveSafetyInvariants => {
|
||||
format!("`{dst}` may carry safety invariants")
|
||||
}
|
||||
rustc_transmute::Reason::DstIsTooBig => {
|
||||
format!("The size of `{src}` is smaller than the size of `{dst}`")
|
||||
format!("the size of `{src}` is smaller than the size of `{dst}`")
|
||||
}
|
||||
rustc_transmute::Reason::DstRefIsTooBig { src, dst } => {
|
||||
let src_size = src.size;
|
||||
let dst_size = dst.size;
|
||||
format!(
|
||||
"The referent size of `{src}` ({src_size} bytes) is smaller than that of `{dst}` ({dst_size} bytes)"
|
||||
"the referent size of `{src}` ({src_size} bytes) is smaller than that of `{dst}` ({dst_size} bytes)"
|
||||
)
|
||||
}
|
||||
rustc_transmute::Reason::SrcSizeOverflow => {
|
||||
|
@ -3113,7 +3113,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
dst_min_align,
|
||||
} => {
|
||||
format!(
|
||||
"The minimum alignment of `{src}` ({src_min_align}) should be greater than that of `{dst}` ({dst_min_align})"
|
||||
"the minimum alignment of `{src}` ({src_min_align}) should be greater than that of `{dst}` ({dst_min_align})"
|
||||
)
|
||||
}
|
||||
rustc_transmute::Reason::DstIsMoreUnique => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue