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

ices/80062.rs: fixed with errors #598

Merged
merged 1 commit into from
Dec 30, 2020
Merged

ices/80062.rs: fixed with errors #598

merged 1 commit into from
Dec 30, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#80062

fn sof<usize>() -> usize {}
fn test<T>() {
    let _: [u8; sof::<T>()];
}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/80062.rs:3:23
  |
3 |     let _: [u8; sof::<T>()];
  |                       ^ cannot perform const operation using `T`
  |
  = note: type parameters may not be used in const expressions
  = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions

warning: type parameter `usize` should have an upper camel case name
 --> /home/runner/work/glacier/glacier/ices/80062.rs:1:8
  |
1 | fn sof<usize>() -> usize {}
  |        ^^^^^ help: convert the identifier to upper camel case (notice the capitalization): `Usize`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0601]: `main` function not found in crate `80062`
 --> /home/runner/work/glacier/glacier/ices/80062.rs:1:1
  |
1 | / fn sof<usize>() -> usize {}
2 | | fn test<T>() {
3 | |     let _: [u8; sof::<T>()];
4 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/80062.rs`

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/80062.rs:1:20
  |
1 | fn sof<usize>() -> usize {}
  |    --- -----       ^^^^^ expected type parameter `usize`, found `()`
  |    |   |
  |    |   this type parameter
  |    implicitly returns `()` as its body has no tail or `return` expression
  |
  = note: expected type parameter `usize`
                  found unit type `()`

error: aborting due to 3 previous errors; 1 warning emitted

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

=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/80062.rs:3:23
  |
3 |     let _: [u8; sof::<T>()];
  |                       ^ cannot perform const operation using `T`
  |
  = note: type parameters may not be used in const expressions
  = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions

warning: type parameter `usize` should have an upper camel case name
 --> /home/runner/work/glacier/glacier/ices/80062.rs:1:8
  |
1 | fn sof<usize>() -> usize {}
  |        ^^^^^ help: convert the identifier to upper camel case (notice the capitalization): `Usize`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0601]: `main` function not found in crate `80062`
 --> /home/runner/work/glacier/glacier/ices/80062.rs:1:1
  |
1 | / fn sof<usize>() -> usize {}
2 | | fn test<T>() {
3 | |     let _: [u8; sof::<T>()];
4 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/80062.rs`

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/80062.rs:1:20
  |
1 | fn sof<usize>() -> usize {}
  |    --- -----       ^^^^^ expected type parameter `usize`, found `()`
  |    |   |
  |    |   this type parameter
  |    implicitly returns `()` as its body has no tail or `return` expression
  |
  = note: expected type parameter `usize`
                  found unit type `()`

error: aborting due to 3 previous errors; 1 warning emitted

Some errors have detailed explanations: E0308, E0601.
For more information about an error, try `rustc --explain E0308`.
==============
@JohnTitor JohnTitor merged commit b1085b9 into master Dec 30, 2020
@JohnTitor JohnTitor deleted the autofix/ices/80062.rs branch December 30, 2020 09:26
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