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

Unhelpful "std::marker::Sized` is not satisfied" error #33869

Closed
alexcrichton opened this issue May 25, 2016 · 4 comments
Closed

Unhelpful "std::marker::Sized` is not satisfied" error #33869

alexcrichton opened this issue May 25, 2016 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-DSTs Area: Dynamically-sized types (DSTs) A-trait-system Area: Trait system

Comments

@alexcrichton
Copy link
Member

Compiling this program:

fn main() {        
    let b = bar;   
    foo(&b);       
}                  

fn foo(_: &[i32]) {
}

yields

foo.rs:2:13: 2:16 error: unresolved name `bar` [E0425]
foo.rs:2     let b = bar;
                     ^~~
foo.rs:2:13: 2:16 help: run `rustc --explain E0425` to see a detailed explanation
foo.rs:2:9: 2:10 error: the trait bound `[i32]: std::marker::Sized` is not satisfied [E0277]
foo.rs:2     let b = bar;
                 ^
foo.rs:2:9: 2:10 help: run `rustc --explain E0277` to see a detailed explanation
foo.rs:2:9: 2:10 note: `[i32]` does not have a constant size known at compile-time
foo.rs:2:9: 2:10 note: all local variables must have a statically known size
error: aborting due to previous error

The first error, the unresolved name, is legitimate, but the next is just extra information that's not too helpful and is likely fixed once the previous error is fixed.

@alexcrichton alexcrichton added the A-diagnostics Area: Messages for errors, warnings, and lints label May 25, 2016
@alexcrichton
Copy link
Member Author

cc @nrc

@nrc
Copy link
Member

nrc commented May 26, 2016

Interesting, we're probably checking that ty::Error: Sized, which is nonsense and shouldn't cause an error.

@nrc nrc added A-trait-system Area: Trait system A-DSTs Area: Dynamically-sized types (DSTs) labels May 26, 2016
@eddyb
Copy link
Member

eddyb commented Jun 4, 2016

@nrc On the contrary, TyError is the solution, and it's not getting used; this is a duplicate of #33575.

@Mark-Simulacrum
Copy link
Member

Closing in favor of #33575.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-DSTs Area: Dynamically-sized types (DSTs) A-trait-system Area: Trait system
Projects
None yet
Development

No branches or pull requests

4 participants