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

need Self: Sized (RFC 1214) #29

Closed
durka opened this issue Sep 10, 2015 · 2 comments
Closed

need Self: Sized (RFC 1214) #29

durka opened this issue Sep 10, 2015 · 2 comments

Comments

@durka
Copy link
Contributor

durka commented Sep 10, 2015

There is a warning (which will be eventually be an error) when compiling on nightly:

src/lib.rs:53:3: 53:48 warning: the trait `core::marker::Sized` is not implemented for the type `Self` [E0277]
src/lib.rs:53   fn new(Sender<Event>) -> Result<Self, Error>;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:53:3: 53:48 help: run `rustc --explain E0277` to see a detailed explanation
src/lib.rs:53:3: 53:48 note: `Self` does not have a constant size known at compile-time
src/lib.rs:53   fn new(Sender<Event>) -> Result<Self, Error>;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:53:3: 53:48 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
src/lib.rs:53   fn new(Sender<Event>) -> Result<Self, Error>;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib.rs:53:3: 53:48 note: required by `core::result::Result`
src/lib.rs:53   fn new(Sender<Event>) -> Result<Self, Error>;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@blaenk
Copy link
Contributor

blaenk commented Sep 14, 2015

We can probably just fix this by adding a Self bound to Watcher, i.e. trait Watcher: Self. It's only ever going to be implemented for sized types, AFAIK.

@durka
Copy link
Contributor Author

durka commented Oct 6, 2015

Seems to work. I will send a PR.

@passcod passcod closed this as completed in 4e38574 Oct 6, 2015
passcod added a commit that referenced this issue Oct 6, 2015
Add Sized bound to Watcher (see RFC 1214) to fix #29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants