1
Fork 0

Add -Z borrowck=migrate flag, use it to link NLL up to AST-borrowck.

This commit is contained in:
Felix S. Klock II 2018-07-20 17:29:29 +02:00
parent 655894baf9
commit a23e8a726c
6 changed files with 66 additions and 23 deletions

View file

@ -99,6 +99,25 @@ impl Diagnostic {
}
}
pub fn is_error(&self) -> bool {
match self.level {
Level::Bug |
Level::Fatal |
Level::PhaseFatal |
Level::Error |
Level::FailureNote => {
true
}
Level::Warning |
Level::Note |
Level::Help |
Level::Cancelled => {
false
}
}
}
/// Cancel the diagnostic (a structured diagnostic must either be emitted or
/// canceled or it will panic when dropped).
pub fn cancel(&mut self) {

View file

@ -100,25 +100,6 @@ impl<'a> DiagnosticBuilder<'a> {
buffered_diagnostics.push(diagnostic);
}
pub fn is_error(&self) -> bool {
match self.level {
Level::Bug |
Level::Fatal |
Level::PhaseFatal |
Level::Error |
Level::FailureNote => {
true
}
Level::Warning |
Level::Note |
Level::Help |
Level::Cancelled => {
false
}
}
}
/// Convenience function for internal use, clients should use one of the
/// span_* methods instead.
pub fn sub<S: Into<MultiSpan>>(