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

ices/79674.rs: fixed with errors #1036

Merged
merged 1 commit into from
Dec 6, 2021
Merged

ices/79674.rs: fixed with errors #1036

merged 1 commit into from
Dec 6, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 6, 2021

Issue: rust-lang/rust#79674

#![feature(generic_const_exprs, const_fn_trait_bound)]
#![allow(incomplete_features)]

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 ===
error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/79674.rs:26:5
   |
26 |     requires_distinct("str", 12);
   |     ^^^^^^^^^^^^^^^^^ expected `true`, found `false`
   |
   = note: expected type `true`
              found type `false`

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/79674.rs:26:5
   |
26 |     requires_distinct("str", 12);
   |     ^^^^^^^^^^^^^^^^^ expected `true`, found `false`
   |
   = note: expected type `true`
              found type `false`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
==============
@Alexendoo Alexendoo merged commit ac8fefe into master Dec 6, 2021
@Alexendoo Alexendoo deleted the autofix/ices/79674.rs branch December 6, 2021 13:42
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants