Closed
Description
When trying to incorrectly specify a pub fn
in a trait, the error message just complains about the incorrect token:
trait T {
pub fn foo(&self);
}
Ideally the compiler would explain that individual trait methods' visibility can't be modified, only the trait itself, and continue parsing the AST as if it were correct, possibly suggesting the following, if appropriate:
pub trait T {
fn foo(&self);
}