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

ices/88212.rs: fixed with errors #1687

Merged
merged 1 commit into from
Oct 10, 2023
Merged

ices/88212.rs: fixed with errors #1687

merged 1 commit into from
Oct 10, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#88212

#![feature(unsized_locals)]

trait Example {}

struct Foo();

impl Example for Foo {}

fn example() -> Box<dyn Example> {
    Box::new(Foo())
}

fn main() {
    let x: dyn Example = *example();
    (move || {  // ERROR
        let _y = x;
    })();
}
=== stdout ===
=== stderr ===
warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/88212.rs:1:12
  |
1 | #![feature(unsized_locals)]
  |            ^^^^^^^^^^^^^^
  |
  = note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0277]: the size for values of type `dyn Example` cannot be known at compilation time
  --> /home/runner/work/glacier/glacier/ices/88212.rs:16:18
   |
15 |     (move || {  // ERROR
   |           -- this closure captures all values by move
16 |         let _y = x;
   |                  ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `dyn Example`
   = note: all values captured by value by a closure must have a statically known size

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/88212.rs:1:12
  |
1 | #![feature(unsized_locals)]
  |            ^^^^^^^^^^^^^^
  |
  = note: see issue #48055 <rust-lang/rust#48055> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0277]: the size for values of type `dyn Example` cannot be known at compilation time
  --> /home/runner/work/glacier/glacier/ices/88212.rs:16:18
   |
15 |     (move || {  // ERROR
   |           -- this closure captures all values by move
16 |         let _y = x;
   |                  ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `dyn Example`
   = note: all values captured by value by a closure must have a statically known size

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit c3a7e86 into master Oct 10, 2023
@JohnTitor JohnTitor deleted the autofix/ices/88212.rs branch October 10, 2023 14:51
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