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

ices/79674.rs: fixed with errors #726

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#79674

#![feature(const_generics)]
#![feature(const_evaluatable_checked)]
#![feature(const_fn)]

trait MiniTypeId {
    const TYPE_ID: u64;
}

impl<T> MiniTypeId for T {
    const TYPE_ID: u64 = 0;
}

enum Lift<const V: bool> {}

trait IsFalse {}
impl IsFalse for Lift<false> {}

const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
    T::TYPE_ID == U::TYPE_ID
}

fn requires_distinct<A, B>(_a: A, _b: B) where
    A: MiniTypeId, B: MiniTypeId,
    Lift<{is_same_type::<A, B>()}>: IsFalse {}

fn main() {
    requires_distinct("str", 12);
}
=== stdout ===
=== stderr ===
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/79674.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

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

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
  --> /home/runner/work/glacier/glacier/ices/79674.rs:18:23
   |
18 | const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
   |                       ^
   |
   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
  --> /home/runner/work/glacier/glacier/ices/79674.rs:18:38
   |
18 | const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
   |                                      ^
   |
   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error: aborting due to 2 previous errors; 2 warnings emitted

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

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

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

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
  --> /home/runner/work/glacier/glacier/ices/79674.rs:18:23
   |
18 | const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
   |                       ^
   |
   = note: see issue #57563 <rust-lang/rust#57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
  --> /home/runner/work/glacier/glacier/ices/79674.rs:18:38
   |
18 | const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
   |                                      ^
   |
   = note: see issue #57563 <rust-lang/rust#57563> for more information
   = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error: aborting due to 2 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0658`.
==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It now requires the const_fn_trait_bound feature gate.

@JohnTitor JohnTitor deleted the autofix/ices/79674.rs branch April 27, 2021 13:29
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