Closed
Description
use std::path::Path;
fn f(p: Path) { }
produces
foo.rs:3:6: 3:7 error: the trait `core::marker::Sized` is not implemented for the type `[u8]` [E0277]
foo.rs:3 fn f(p: Path) { }
^
foo.rs:3:6: 3:7 note: `[u8]` does not have a constant size known at compile-time
foo.rs:3 fn f(p: Path) { }
^
We should give an explicit hint that Path
should be passed by reference. Also the error does not mention Path
and the type u8
does not appear in the program.
UPDATE: The message now includes a full stack trace of types, but it would be better to start out with the type the user knows about (Path
, in this case) and only discuss [u8]
last. -- @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint; hard to understand for new users.Call for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Help is requested to fix this issue.Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.