-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
spurious "error: parameter Self
is never used" for trivial
trait T {}`
#22598
Comments
Self
is never used for trivial
trait T {}`Self
is never used" for trivial
trait T {}`
This is actually intended due to a recently merged RFC. You can find some more info about this in the RFC as well. |
This is still a diagnostics error. There is no parameter
The current error message is confusing and misleading. This does not help users. |
Reopening to cover the error message. |
I've had a useful trait stop working with this error: pub trait Graphlike {
type NodeId: Clone;
}
Another example: /// A graph's edge type determines whether is has directed edges or not.
pub trait EdgeType {
fn is_directed() -> bool;
}
impl EdgeType for Directed {
#[inline]
fn is_directed() -> bool { true }
}
impl EdgeType for Undirected {
#[inline]
fn is_directed() -> bool { false }
} |
@bluss, read the RFC linked by alexcrichton: you need to use |
or better (from the docs): use std::marker::MarkerTrait;
trait Graphlike : MarkerTrait { } |
This can be closed, as the original example now compiles without error. |
@apasel422 The playpen linked in the original post does not compile. I still think that the suggestion to "consider removing |
It should compile in the nightly, even if playpen doesn't have that version. PhantomFn was deprecated after beta. |
Huh, did I accidentally close this one? |
The issue no longer exists in the nightly builds. On Thursday, April 9, 2015, Collin J. Sutton notifications@github.com
|
Oh! When did Playpen change the default version to "beta"? But now there's a different error... |
Given the input
rustc will complain:
This may just be a diagnostics issue, but I'll let someone more familiar with Rust make that judgement.
The text was updated successfully, but these errors were encountered: