This commit is contained in:
Aleksey Kladov 2020-07-31 20:23:52 +02:00
parent 81359af733
commit af53d5f4b0
8 changed files with 12 additions and 15 deletions

View file

@ -136,14 +136,14 @@ impl ast::UseTreeList {
}
impl ast::Impl {
pub fn target_type(&self) -> Option<ast::Type> {
pub fn self_ty(&self) -> Option<ast::Type> {
match self.target() {
(Some(t), None) | (_, Some(t)) => Some(t),
_ => None,
}
}
pub fn target_trait(&self) -> Option<ast::Type> {
pub fn trait_(&self) -> Option<ast::Type> {
match self.target() {
(Some(t), Some(_)) => Some(t),
_ => None,

View file

@ -208,7 +208,7 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec<SyntaxError>) {
Some(it) => it,
None => return,
};
if impl_def.target_trait().is_some() {
if impl_def.trait_().is_some() {
errors.push(SyntaxError::new("Unnecessary visibility qualifier", vis.syntax.text_range()));
}
}