diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-03-29 11:31:58 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-03-29 11:31:58 -0700 |
| commit | c2e0e71a0943b16e6e6f8aad88aaea7b6f60dea5 (patch) | |
| tree | 6bcbda0b1810e9378ffd2dcd5199c811243ce39e /src/librustc_errors | |
| parent | dcb4e817bc8469a0a47e0eaecdf1cf0ea980a496 (diff) | |
Suggest correct order for arguments when encountering early constraints
When encountering constraints before type arguments or lifetimes, suggest the correct order.
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/diagnostic_builder.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index fffae0bfd24..2dbd9f4e52f 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -315,6 +315,20 @@ impl<'a> DiagnosticBuilder<'a> { self } + pub fn span_suggestion_verbose( + &mut self, + sp: Span, + msg: &str, + suggestion: String, + applicability: Applicability, + ) -> &mut Self { + if !self.0.allow_suggestions { + return self; + } + self.0.diagnostic.span_suggestion_verbose(sp, msg, suggestion, applicability); + self + } + pub fn span_suggestion_hidden( &mut self, sp: Span, |
