Don't stop const-checking after erroneous trait bound
This commit is contained in:
parent
879d3794d3
commit
e02ea835a7
2 changed files with 17 additions and 6 deletions
|
@ -598,9 +598,16 @@ pub mod ty {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TraitBound;
|
||||
pub struct TraitBound(pub mir::LocalKind);
|
||||
impl NonConstOp for TraitBound {
|
||||
const STOPS_CONST_CHECKING: bool = true;
|
||||
fn importance(&self) -> DiagnosticImportance {
|
||||
match self.0 {
|
||||
mir::LocalKind::Var | mir::LocalKind::Temp => DiagnosticImportance::Secondary,
|
||||
mir::LocalKind::ReturnPointer | mir::LocalKind::Arg => {
|
||||
DiagnosticImportance::Primary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
|
||||
mcf_status_in_item(ccx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue