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

ices/92626.rs: fixed with errors #1094

Merged
merged 1 commit into from
Jan 19, 2022
Merged

ices/92626.rs: fixed with errors #1094

merged 1 commit into from
Jan 19, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#92626

struct Test<T, const N: usize>([T; N]);

impl<T, const N: usize> std::ops::Deref for Test<T, N> {
    type Target = [T; N];
    
    fn deref(&self) -> &[T; N] {
        &self.0
    }
}

fn test() {
    let mut out = Test(todo!());
    let blah = out.len();
}

pub fn main() {}
=== stdout ===
=== stderr ===
warning: unreachable call
  --> /home/runner/work/glacier/glacier/ices/92626.rs:12:19
   |
12 |     let mut out = Test(todo!());
   |                   ^^^^ ------- any code following this expression is unreachable
   |                   |
   |                   unreachable call
   |
   = note: `#[warn(unreachable_code)]` on by default

error[E0282]: type annotations needed for `Test<T, {_: usize}>`
  --> /home/runner/work/glacier/glacier/ices/92626.rs:12:19
   |
12 |     let mut out = Test(todo!());
   |         -------   ^^^^ cannot infer type for type parameter `T` declared on the struct `Test`
   |         |
   |         consider giving `out` the explicit type `Test<T, N>`, where the type parameter `T` is specified

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: unreachable call
  --> /home/runner/work/glacier/glacier/ices/92626.rs:12:19
   |
12 |     let mut out = Test(todo!());
   |                   ^^^^ ------- any code following this expression is unreachable
   |                   |
   |                   unreachable call
   |
   = note: `#[warn(unreachable_code)]` on by default

error[E0282]: type annotations needed for `Test<T, {_: usize}>`
  --> /home/runner/work/glacier/glacier/ices/92626.rs:12:19
   |
12 |     let mut out = Test(todo!());
   |         -------   ^^^^ cannot infer type for type parameter `T` declared on the struct `Test`
   |         |
   |         consider giving `out` the explicit type `Test<T, N>`, where the type parameter `T` is specified

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0282`.
==============
@Alexendoo Alexendoo merged commit cc7113e into master Jan 19, 2022
@Alexendoo Alexendoo deleted the autofix/ices/92626.rs branch January 19, 2022 16:14
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