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

ices/78520.sh: fixed with errors #948

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 1, 2021

Issue: rust-lang/rust#78520

#!/bin/bash

rustc -Zdump-mir=all - <<EOF
// build-pass

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

struct Bug<const S: &'static str>;

fn main() {
    let b: Bug::<{
        unsafe {
            // FIXME(const_generics): Decide on how to deal with invalid values as const params.
            std::mem::transmute::<&[u8], &str>(&[0xC0, 0xC1, 0xF5])
        }
    }>;
}
EOF
=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> <anon>:4:12
  |
4 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^ feature has been removed
  |
  = note: removed in favor of `#![feature(adt_const_params]` and `#![feature(generic_const_exprs)]`

error: `&'static str` is forbidden as the type of a const generic parameter
 --> <anon>:6:21
  |
6 | struct Bug<const S: &'static str>;
  |                     ^^^^^^^^^^^^
  |
  = note: the only supported types are integers, `bool` and `char`
  = help: more complex types are supported with `#![feature(adt_const_params)]`

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> <anon>:4:12
  |
4 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^ feature has been removed
  |
  = note: removed in favor of `#![feature(adt_const_params]` and `#![feature(generic_const_exprs)]`

error: `&'static str` is forbidden as the type of a const generic parameter
 --> <anon>:6:21
  |
6 | struct Bug<const S: &'static str>;
  |                     ^^^^^^^^^^^^
  |
  = note: the only supported types are integers, `bool` and `char`
  = help: more complex types are supported with `#![feature(adt_const_params)]`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0557`.
==============
@Alexendoo Alexendoo closed this Sep 1, 2021
@Alexendoo Alexendoo deleted the autofix/ices/78520.sh branch September 1, 2021 16:26
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