E0162

pub on a trait method. A trait method takes its visibility from the trait.

Machine-applicable fix: Remove pub.

Example

This program fails with E0162.

trait Show {
    pub fn show(self) -> String
}

Fixed

The same program, fixed.

trait Show {
    fn show(self) -> String
}

Listed in the checker notes. oskac explain E0162 prints this entry offline.

All error codes