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

ices/83704.rs: fixed with errors #1093

Merged
merged 1 commit into from
Jan 19, 2022
Merged

ices/83704.rs: fixed with errors #1093

merged 1 commit into from
Jan 19, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#83704

use std::ops::Deref;

struct VecWrapper<T, const N: usize>(Vec<T>);

impl<T, const N: usize> VecWrapper<T, N> {
    pub fn new() -> Self {
        todo!()
    }
}

impl<T, const N: usize> Deref for VecWrapper<T, N> {
    type Target = [T; N];

    fn deref(&self) -> &Self::Target {
        todo!()
    }
}

fn foo() -> VecWrapper<i32, 10> {
    let tv = VecWrapper::new();
    let _ = tv.len(); // required to trigger ICE?
    tv
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `83704`
  --> /home/runner/work/glacier/glacier/ices/83704.rs:1:1
   |
1  | / use std::ops::Deref;
2  | |
3  | | struct VecWrapper<T, const N: usize>(Vec<T>);
4  | |
...  |
22 | |     tv
23 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/83704.rs`

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `83704`
  --> /home/runner/work/glacier/glacier/ices/83704.rs:1:1
   |
1  | / use std::ops::Deref;
2  | |
3  | | struct VecWrapper<T, const N: usize>(Vec<T>);
4  | |
...  |
22 | |     tv
23 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/83704.rs`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.
==============
@Alexendoo Alexendoo merged commit 51e1beb into master Jan 19, 2022
@Alexendoo Alexendoo deleted the autofix/ices/83704.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