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

ices/53448.rs: fixed with errors #488

Merged
merged 1 commit into from
Oct 7, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 7, 2020

Issue: rust-lang/rust#53448

#![feature(unboxed_closures)]

trait Lt<'a> {
    type T;
}
impl<'a> Lt<'a> for () {
    type T = ();
}

fn main() {
    let v:<() as Lt<'_>>::T = ();
    let f:&mut FnMut<(_,),Output=()> = &mut |_:<() as Lt<'_>>::T|{};
    f(v);
}
=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
  --> /home/runner/work/glacier/glacier/ices/53448.rs:12:16
   |
12 |     let f:&mut FnMut<(_,),Output=()> = &mut |_:<() as Lt<'_>>::T|{};
   |                ^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut<(_,),Output=()>`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

error[E0277]: the size for values of type `<() as Lt<'_>>::T` cannot be known at compilation time
  --> /home/runner/work/glacier/glacier/ices/53448.rs:12:46
   |
12 |     let f:&mut FnMut<(_,),Output=()> = &mut |_:<() as Lt<'_>>::T|{};
   |                                              ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `<() as Lt<'_>>::T`
   = help: unsized locals are gated as an unstable feature
help: consider further restricting the associated type
   |
10 | fn main() where <() as Lt<'_>>::T: Sized {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: function arguments must have a statically known size, borrowed types always have a known size
   |
12 |     let f:&mut FnMut<(_,),Output=()> = &mut |_:&<() as Lt<'_>>::T|{};
   |                                                ^

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
  --> /home/runner/work/glacier/glacier/ices/53448.rs:12:16
   |
12 |     let f:&mut FnMut<(_,),Output=()> = &mut |_:<() as Lt<'_>>::T|{};
   |                ^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut<(_,),Output=()>`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

error[E0277]: the size for values of type `<() as Lt<'_>>::T` cannot be known at compilation time
  --> /home/runner/work/glacier/glacier/ices/53448.rs:12:46
   |
12 |     let f:&mut FnMut<(_,),Output=()> = &mut |_:<() as Lt<'_>>::T|{};
   |                                              ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `<() as Lt<'_>>::T`
   = help: unsized locals are gated as an unstable feature
help: consider further restricting the associated type
   |
10 | fn main() where <() as Lt<'_>>::T: Sized {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: function arguments must have a statically known size, borrowed types always have a known size
   |
12 |     let f:&mut FnMut<(_,),Output=()> = &mut |_:&<() as Lt<'_>>::T|{};
   |                                                ^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit 85521d9 into master Oct 7, 2020
@JohnTitor JohnTitor deleted the autofix/ices/53448.rs branch October 7, 2020 12: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