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

ices/53092.rs: fixed with errors #744

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#53092

#![feature(const_fn)]
#![feature(const_fn_union)]
#![feature(impl_trait_in_bindings)]
#![feature(min_type_alias_impl_trait)]
#![feature(type_alias_impl_trait)]
#![feature(untagged_unions)]

const fn transmute<T, U>(from: T) -> U {
    use std::mem::ManuallyDrop;

    union Transform<FROM, INTO> {
        from: ManuallyDrop<FROM>,
        into: ManuallyDrop<INTO>,
    }

    let transformer = Transform {
        from: ManuallyDrop::new(from),
    };

    unsafe { ManuallyDrop::into_inner(transformer.into) }
}

type Bug<T, U> = impl Fn(T) -> U + Copy;

const CONST_BUG: Bug<u8, ()> = transmute(|_: u8| ());

fn make_bug<T, U: From<T>>() -> Bug<T, U> {
    |x| x.into()
}

fn main() {
    let x = CONST_BUG(0);
}
=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> /home/runner/work/glacier/glacier/ices/53092.rs:1:12
  |
1 | #![feature(const_fn)]
  |            ^^^^^^^^ feature has been removed
  |
  = note: split into finer-grained feature gates

warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/53092.rs:3:12
  |
3 | #![feature(impl_trait_in_bindings)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information

warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/53092.rs:5:12
  |
5 | #![feature(type_alias_impl_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information

error: aborting due to previous error; 2 warnings emitted

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

=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> /home/runner/work/glacier/glacier/ices/53092.rs:1:12
  |
1 | #![feature(const_fn)]
  |            ^^^^^^^^ feature has been removed
  |
  = note: split into finer-grained feature gates

warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/53092.rs:3:12
  |
3 | #![feature(impl_trait_in_bindings)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #63065 <rust-lang/rust#63065> for more information

warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/53092.rs:5:12
  |
5 | #![feature(type_alias_impl_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #63063 <rust-lang/rust#63063> for more information

error: aborting due to previous error; 2 warnings emitted

For more information about this error, try `rustc --explain E0557`.
==============
@Alexendoo Alexendoo closed this in 766410b May 12, 2021
@Alexendoo Alexendoo deleted the autofix/ices/53092.rs branch May 12, 2021 12:43
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.

1 participant