suggest a float literal when dividing a floating-point type by {integer}

fix a message

implement a rustfix-applicable suggestion

implement `suggest_floating_point_literal`

add `ObligationCauseCode::BinOp`

remove duplicate code

fix function names in uitests

use `Diagnostic` instead of `DiagnosticBuilder`
This commit is contained in:
Takayuki Maeda
2022-02-17 19:33:32 +09:00
parent 12b71ed4c5
commit c60bae78ac
12 changed files with 543 additions and 18 deletions

View File

@@ -368,6 +368,11 @@ pub enum ObligationCauseCode<'tcx> {
/// From `match_impl`. The cause for us having to match an impl, and the DefId we are matching against.
MatchImpl(ObligationCause<'tcx>, DefId),
BinOp {
rhs_span: Option<Span>,
is_lit: bool,
},
}
/// The 'location' at which we try to perform HIR-based wf checking.