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

ices/93578.sh: fixed with errors #1126

Merged
merged 1 commit into from
Feb 9, 2022
Merged

ices/93578.sh: fixed with errors #1126

merged 1 commit into from
Feb 9, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 9, 2022

Issue: rust-lang/rust#93578

rustc -Zsave-analysis - 2>&1 << EOF

#![feature(associated_const_equality)]
#![allow(unused)]

pub trait Foo {
  const N: usize;
}

pub struct Bar;

impl Foo for Bar {
  const N: usize = 3;
}


fn foo<F: Foo<N=usize>>() {}
//~^ ERROR mismatch in

fn main() {
  foo::<Bar>();
}

EOF
=== stdout ===
error: mismatch in bind of associated constant, got type
  --> <anon>:16:15
   |
16 | fn foo<F: Foo<N=usize>>() {}
   |               ^^^^^^^
   |
note: associated constant defined here does not match type
  --> <anon>:6:3
   |
6  |   const N: usize;
   |   ^^^^^^^^^^^^^^^

error[E0271]: type mismatch resolving `<Bar as Foo>::N == usize`
  --> <anon>:20:3
   |
20 |   foo::<Bar>();
   |   ^^^^^^^^^^ types differ
   |
   = note: expected type `usize`
              found type `3_usize`
note: required by a bound in `foo`
  --> <anon>:16:15
   |
16 | fn foo<F: Foo<N=usize>>() {}
   |               ^^^^^^^ required by this bound in `foo`

error: aborting due to 2 previous errors

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

=== stdout ===
error: mismatch in bind of associated constant, got type
  --> <anon>:16:15
   |
16 | fn foo<F: Foo<N=usize>>() {}
   |               ^^^^^^^
   |
note: associated constant defined here does not match type
  --> <anon>:6:3
   |
6  |   const N: usize;
   |   ^^^^^^^^^^^^^^^

error[E0271]: type mismatch resolving `<Bar as Foo>::N == usize`
  --> <anon>:20:3
   |
20 |   foo::<Bar>();
   |   ^^^^^^^^^^ types differ
   |
   = note: expected type `usize`
              found type `3_usize`
note: required by a bound in `foo`
  --> <anon>:16:15
   |
16 | fn foo<F: Foo<N=usize>>() {}
   |               ^^^^^^^ required by this bound in `foo`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
=== stderr ===
==============
@Alexendoo Alexendoo merged commit 68630fb into master Feb 9, 2022
@Alexendoo Alexendoo deleted the autofix/ices/93578.sh branch February 9, 2022 12:41
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.

None yet

2 participants