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

ices/77218.rs: fixed with errors #520

Merged
merged 1 commit into from
Oct 27, 2020
Merged

ices/77218.rs: fixed with errors #520

merged 1 commit into from
Oct 27, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#77218

pub struct Cache {
    data: Vec<i32>,
}

pub fn list_data(cache: &Cache, key: usize) {
    for reference in vec![1, 2, 3] {
        if /*let*/ Some(reference) = cache.data.get(key) {
            unimplemented!()
        }
    }
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `77218`
  --> /home/runner/work/glacier/glacier/ices/77218.rs:1:1
   |
1  | / pub struct Cache {
2  | |     data: Vec<i32>,
3  | | }
4  | |
...  |
10 | |     }
11 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/77218.rs`

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/77218.rs:7:20
  |
7 |         if /*let*/ Some(reference) = cache.data.get(key) {
  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
  |
help: you might have meant to use pattern matching
  |
7 |         if /*let*/ let Some(reference) = cache.data.get(key) {
  |                    ^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0308, E0601.
For more information about an error, try `rustc --explain E0308`.
==============

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `77218`
  --> /home/runner/work/glacier/glacier/ices/77218.rs:1:1
   |
1  | / pub struct Cache {
2  | |     data: Vec<i32>,
3  | | }
4  | |
...  |
10 | |     }
11 | | }
   | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/77218.rs`

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/77218.rs:7:20
  |
7 |         if /*let*/ Some(reference) = cache.data.get(key) {
  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
  |
help: you might have meant to use pattern matching
  |
7 |         if /*let*/ let Some(reference) = cache.data.get(key) {
  |                    ^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0308, E0601.
For more information about an error, try `rustc --explain E0308`.
==============
@JohnTitor JohnTitor merged commit e69c596 into master Oct 27, 2020
@JohnTitor JohnTitor deleted the autofix/ices/77218.rs branch October 27, 2020 12:24
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