Expose the fallibilty of the unstable lint emission in the method name
This commit is contained in:
parent
e65688386b
commit
d06aac1783
@ -102,7 +102,11 @@ pub fn method_exists(
|
|||||||
ProbeScope::TraitsInScope,
|
ProbeScope::TraitsInScope,
|
||||||
) {
|
) {
|
||||||
Ok(pick) => {
|
Ok(pick) => {
|
||||||
pick.emit_unstable_name_collision_hint(self.tcx, method_name.span, call_expr_id);
|
pick.maybe_emit_unstable_name_collision_hint(
|
||||||
|
self.tcx,
|
||||||
|
method_name.span,
|
||||||
|
call_expr_id,
|
||||||
|
);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
Err(NoMatch(..)) => false,
|
Err(NoMatch(..)) => false,
|
||||||
@ -256,7 +260,7 @@ pub fn lookup_probe(
|
|||||||
call_expr.hir_id,
|
call_expr.hir_id,
|
||||||
scope,
|
scope,
|
||||||
)?;
|
)?;
|
||||||
pick.emit_unstable_name_collision_hint(self.tcx, method_name.span, call_expr.hir_id);
|
pick.maybe_emit_unstable_name_collision_hint(self.tcx, method_name.span, call_expr.hir_id);
|
||||||
Ok(pick)
|
Ok(pick)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,7 +593,7 @@ pub fn resolve_fully_qualified_call(
|
|||||||
ProbeScope::TraitsInScope,
|
ProbeScope::TraitsInScope,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
pick.emit_unstable_name_collision_hint(self.tcx, span, expr_id);
|
pick.maybe_emit_unstable_name_collision_hint(self.tcx, span, expr_id);
|
||||||
|
|
||||||
self.lint_fully_qualified_call_from_2018(
|
self.lint_fully_qualified_call_from_2018(
|
||||||
span,
|
span,
|
||||||
|
@ -1331,7 +1331,8 @@ fn consider_candidates<'b, ProbesIter>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Pick<'tcx> {
|
impl<'tcx> Pick<'tcx> {
|
||||||
pub fn emit_unstable_name_collision_hint(
|
/// In case there were unstable name collisions, emit them as a lint.
|
||||||
|
pub fn maybe_emit_unstable_name_collision_hint(
|
||||||
&self,
|
&self,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
span: Span,
|
span: Span,
|
||||||
|
Loading…
Reference in New Issue
Block a user