Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message with `panic!()` and `impl trait` #66523

Aaron1011 opened this issue Nov 18, 2019 · 1 comment


Copy link

@Aaron1011 Aaron1011 commented Nov 18, 2019

The following code:

fn bar() -> Vec<impl Copy> {

Currently gives the following error:

error[E0283]: type annotations required: cannot resolve `_: std::marker::Copy`
 --> src/
1 | fn bar() -> Vec<impl Copy> {
  |                 ^^^^^^^^^
  = note: the return type of a function must have a statically known size

This message has a weird span, and doesn't give any clue that the problem lies with the call to panic!


This comment has been minimized.

Copy link

@Centril Centril commented Nov 19, 2019

(Sidenote: "cannot resolve" trips me up every time since it feels like it talking about name resolution, not type checking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.