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

ices/85031-1.sh: fixed with errors #905

Merged
merged 1 commit into from
Aug 23, 2021
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#85031

#!/bin/bash

rustc --edition 2018 -C incremental=foo --crate-type lib - <<'EOF'
#![allow(incomplete_features)]
#![feature(const_generics, const_evaluatable_checked)]

pub struct Ref<'a>(&'a i32);

impl<'a> Ref<'a> {
    pub fn foo<const A: usize>() -> [(); A - 0] {
        Self::foo()
    }
}

EOF

=== stdout ===
=== stderr ===
error[E0284]: type annotations needed: cannot satisfy `the constant `Ref::<'_>::foo::<{_: usize}>::{constant#0}` can be evaluated`
 --> <anon>:8:9
  |
8 |         Self::foo()
  |         ^^^^^^^^^ cannot satisfy `the constant `Ref::<'_>::foo::<{_: usize}>::{constant#0}` can be evaluated`
  |
note: required by a bound in `Ref::<'a>::foo`
 --> <anon>:7:42
  |
7 |     pub fn foo<const A: usize>() -> [(); A - 0] {
  |                                          ^^^^^ required by this bound in `Ref::<'a>::foo`

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0284]: type annotations needed: cannot satisfy `the constant `Ref::<'_>::foo::<{_: usize}>::{constant#0}` can be evaluated`
 --> <anon>:8:9
  |
8 |         Self::foo()
  |         ^^^^^^^^^ cannot satisfy `the constant `Ref::<'_>::foo::<{_: usize}>::{constant#0}` can be evaluated`
  |
note: required by a bound in `Ref::<'a>::foo`
 --> <anon>:7:42
  |
7 |     pub fn foo<const A: usize>() -> [(); A - 0] {
  |                                          ^^^^^ required by this bound in `Ref::<'a>::foo`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0284`.
==============
@Alexendoo Alexendoo merged commit 01ae5d6 into master Aug 23, 2021
@Alexendoo Alexendoo deleted the autofix/ices/85031-1.sh branch August 23, 2021 13:39
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