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

ices/82455.rs: fixed with errors #674

Merged
merged 1 commit into from
Feb 28, 2021
Merged

ices/82455.rs: fixed with errors #674

merged 1 commit into from
Feb 28, 2021

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#82455

fn map<T>(_: fn() -> Option<&'static T>) -> Option<T> {
    None
}

fn value() -> Option<&'static _> {
    Option::<&'static u8>::None
}

const _: Option<_> = {
    let _: Option<_> = map(value);
};
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `82455`
  --> /home/runner/work/glacier/glacier/ices/82455.rs:1:1
   |
1  | / fn map<T>(_: fn() -> Option<&'static T>) -> Option<T> {
2  | |     None
3  | | }
4  | |
...  |
10 | |     let _: Option<_> = map(value);
11 | | };
   | |__^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/82455.rs`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> /home/runner/work/glacier/glacier/ices/82455.rs:5:31
  |
5 | fn value() -> Option<&'static _> {
  |               ----------------^-
  |               |               |
  |               |               not allowed in type signatures
  |               help: replace with the correct return type: `Option<&'static u8>`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> /home/runner/work/glacier/glacier/ices/82455.rs:9:10
  |
9 | const _: Option<_> = {
  |          ^^^^^^^^^ not allowed in type signatures

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `82455`
  --> /home/runner/work/glacier/glacier/ices/82455.rs:1:1
   |
1  | / fn map<T>(_: fn() -> Option<&'static T>) -> Option<T> {
2  | |     None
3  | | }
4  | |
...  |
10 | |     let _: Option<_> = map(value);
11 | | };
   | |__^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/82455.rs`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> /home/runner/work/glacier/glacier/ices/82455.rs:5:31
  |
5 | fn value() -> Option<&'static _> {
  |               ----------------^-
  |               |               |
  |               |               not allowed in type signatures
  |               help: replace with the correct return type: `Option<&'static u8>`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> /home/runner/work/glacier/glacier/ices/82455.rs:9:10
  |
9 | const _: Option<_> = {
  |          ^^^^^^^^^ not allowed in type signatures

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0121, E0601.
For more information about an error, try `rustc --explain E0121`.
==============
@JohnTitor JohnTitor merged commit 0fee26d into master Feb 28, 2021
@JohnTitor JohnTitor deleted the autofix/ices/82455.rs branch February 28, 2021 12:27
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