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

ices/61455.rs: fixed with errors #241

Merged
merged 1 commit into from
Dec 28, 2019
Merged

ices/61455.rs: fixed with errors #241

merged 1 commit into from
Dec 28, 2019

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#61455

#![feature(const_generics)]
#![feature(const_compare_raw_pointers)]

use std::mem::transmute;

struct Bug<const N: fn(usize)>;

fn main() {
    let x = Bug::<{
        unsafe { transmute(|x: u8| {}) }
        
    }>;
}
=== stdout ===
=== stderr ===
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
 --> /home/runner/work/glacier/glacier/ices/61455.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default

error: `std::intrinsics::transmute` is not yet stable as a const fn
  --> /home/runner/work/glacier/glacier/ices/61455.rs:10:18
   |
10 |         unsafe { transmute(|x: u8| {}) }
   |                  ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(const_transmute)]` to the crate attributes to enable

error[E0080]: evaluation of constant value failed
  --> /home/runner/work/glacier/glacier/ices/61455.rs:10:18
   |
10 |         unsafe { transmute(|x: u8| {}) }
   |                  ^^^^^^^^^^^^^^^^^^^^^ tried to transmute from [closure@/home/runner/work/glacier/glacier/ices/61455.rs:10:28: 10:38] to fn(usize), but their sizes differed

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
 --> /home/runner/work/glacier/glacier/ices/61455.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default

error: `std::intrinsics::transmute` is not yet stable as a const fn
  --> /home/runner/work/glacier/glacier/ices/61455.rs:10:18
   |
10 |         unsafe { transmute(|x: u8| {}) }
   |                  ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(const_transmute)]` to the crate attributes to enable

error[E0080]: evaluation of constant value failed
  --> /home/runner/work/glacier/glacier/ices/61455.rs:10:18
   |
10 |         unsafe { transmute(|x: u8| {}) }
   |                  ^^^^^^^^^^^^^^^^^^^^^ tried to transmute from [closure@/home/runner/work/glacier/glacier/ices/61455.rs:10:28: 10:38] to fn(usize), but their sizes differed

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.
==============
@JohnTitor JohnTitor merged commit e6f35bd into master Dec 28, 2019
@JohnTitor JohnTitor deleted the autofix/ices/61455.rs branch December 28, 2019 12:11
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