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

ices/67981.rs: fixed with errors #1592

Merged
merged 1 commit into from
Jun 4, 2023
Merged

ices/67981.rs: fixed with errors #1592

merged 1 commit into from
Jun 4, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#67981

#![feature(unsized_fn_params)]

fn main() {
    let f: fn([u8]) = |_| {};
    
    let slice: Box<[u8]> = Box::new([1; 8]);
    
    f(*slice);
}
=== stdout ===
=== stderr ===
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/67981.rs:4:24
  |
4 |     let f: fn([u8]) = |_| {};
  |                        ^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[u8]`
help: function arguments must have a statically known size, borrowed types always have a known size
  |
4 |     let f: fn([u8]) = |&_| {};
  |                        +

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/67981.rs:4:24
  |
4 |     let f: fn([u8]) = |_| {};
  |                        ^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[u8]`
help: function arguments must have a statically known size, borrowed types always have a known size
  |
4 |     let f: fn([u8]) = |&_| {};
  |                        +

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit 7ef446e into master Jun 4, 2023
@JohnTitor JohnTitor deleted the autofix/ices/67981.rs branch June 4, 2023 08:47
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