Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/79494.sh: fixed with errors #1272

Merged
merged 1 commit into from
May 28, 2022
Merged

ices/79494.sh: fixed with errors #1272

merged 1 commit into from
May 28, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#79494

#!/bin/bash

cat > out.rs <<'EOF'

const ZST1: &[u8] = unsafe { std::mem::transmute(1usize) };
pub const ZST2: u8 = std::mem::transmute(1usize);

EOF

rustdoc --edition=2021 out.rs
=== stdout ===
=== stderr ===
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
 --> out.rs:2:30
  |
2 | const ZST1: &[u8] = unsafe { std::mem::transmute(1usize) };
  |                              ^^^^^^^^^^^^^^^^^^^
  |
  = note: source type: `usize` (64 bits)
  = note: target type: `&[u8]` (128 bits)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
 --> out.rs:3:22
  |
3 | pub const ZST2: u8 = std::mem::transmute(1usize);
  |                      ^^^^^^^^^^^^^^^^^^^
  |
  = note: source type: `usize` (64 bits)
  = note: target type: `u8` (8 bits)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0512`.
==============

=== stdout ===
=== stderr ===
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
 --> out.rs:2:30
  |
2 | const ZST1: &[u8] = unsafe { std::mem::transmute(1usize) };
  |                              ^^^^^^^^^^^^^^^^^^^
  |
  = note: source type: `usize` (64 bits)
  = note: target type: `&[u8]` (128 bits)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
 --> out.rs:3:22
  |
3 | pub const ZST2: u8 = std::mem::transmute(1usize);
  |                      ^^^^^^^^^^^^^^^^^^^
  |
  = note: source type: `usize` (64 bits)
  = note: target type: `u8` (8 bits)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0512`.
==============
@JohnTitor JohnTitor merged commit 355856c into master May 28, 2022
@JohnTitor JohnTitor deleted the autofix/ices/79494.sh branch May 28, 2022 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants