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

ices/71381.rs: fixed with errors #413

Merged
merged 1 commit into from
Jun 24, 2020
Merged

ices/71381.rs: fixed with errors #413

merged 1 commit into from
Jun 24, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#71381

#![feature(const_generics, const_compare_raw_pointers)]
#![allow(incomplete_features)]

struct Test(*const usize);

type PassArg = ();

unsafe extern "C" fn pass(args: PassArg) {
    ()
}

impl Test {
    pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) {
        self.0 = Self::trampiline::<Args, IDX, FN> as _
    }

    unsafe extern "C" fn trampiline<
        Args: Sized,
        const IDX: usize,
        const FN: unsafe extern "C" fn(Args),
    >(
        args: Args,
    ) {
        FN(args)
    }
}

fn main() {
    let x = Test();
    x.call_me::<PassArg, 30, pass>()
}
=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> /home/runner/work/glacier/glacier/ices/71381.rs:1:28
  |
1 | #![feature(const_generics, const_compare_raw_pointers)]
  |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
  |
  = note: cannot be allowed in const eval in any meaningful way

error: using function pointers as const generic parameters is forbidden
  --> /home/runner/work/glacier/glacier/ices/71381.rs:13:61
   |
13 |     pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) {
   |                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: using function pointers as const generic parameters is forbidden
  --> /home/runner/work/glacier/glacier/ices/71381.rs:20:19
   |
20 |         const FN: unsafe extern "C" fn(Args),
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> /home/runner/work/glacier/glacier/ices/71381.rs:1:28
  |
1 | #![feature(const_generics, const_compare_raw_pointers)]
  |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
  |
  = note: cannot be allowed in const eval in any meaningful way

error: using function pointers as const generic parameters is forbidden
  --> /home/runner/work/glacier/glacier/ices/71381.rs:13:61
   |
13 |     pub fn call_me<Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args)>(&self) {
   |                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: using function pointers as const generic parameters is forbidden
  --> /home/runner/work/glacier/glacier/ices/71381.rs:20:19
   |
20 |         const FN: unsafe extern "C" fn(Args),
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0557`.
==============
@JohnTitor JohnTitor merged commit 9ca5ec5 into master Jun 24, 2020
@JohnTitor JohnTitor deleted the autofix/ices/71381.rs branch June 24, 2020 12:57
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