Get rid of HIR const checker
This commit is contained in:
parent
75703c1a78
commit
01ff36a6b9
38 changed files with 151 additions and 604 deletions
|
@ -110,7 +110,7 @@ const_eval_extern_type_field = `extern type` field does not have a known offset
|
|||
const_eval_fn_ptr_call =
|
||||
function pointers need an RFC before allowed to be called in {const_eval_const_context}s
|
||||
const_eval_for_loop_into_iter_non_const =
|
||||
cannot convert `{$ty}` into an iterator in {const_eval_const_context}s
|
||||
cannot use `for` loop on `{$ty}` in {const_eval_const_context}s
|
||||
|
||||
const_eval_frame_note = {$times ->
|
||||
[0] {const_eval_frame_note_inner}
|
||||
|
@ -324,11 +324,11 @@ const_eval_ptr_as_bytes_1 =
|
|||
this code performed an operation that depends on the underlying bytes representing a pointer
|
||||
const_eval_ptr_as_bytes_2 =
|
||||
the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||
const_eval_question_branch_non_const =
|
||||
`?` cannot determine the branch of `{$ty}` in {const_eval_const_context}s
|
||||
|
||||
const_eval_question_branch_non_const =
|
||||
`?` is not allowed on `{$ty}` in {const_eval_const_context}s
|
||||
const_eval_question_from_residual_non_const =
|
||||
`?` cannot convert from residual of `{$ty}` in {const_eval_const_context}s
|
||||
`?` is not allowed on `{$ty}` in {const_eval_const_context}s
|
||||
|
||||
const_eval_range = in the range {$lo}..={$hi}
|
||||
const_eval_range_lower = greater or equal to {$lo}
|
||||
|
|
|
@ -180,8 +180,10 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
|
|||
};
|
||||
}
|
||||
|
||||
let mut err = match kind {
|
||||
CallDesugaringKind::ForLoopIntoIter => {
|
||||
// Don't point at the trait if this is a desugaring...
|
||||
// FIXME(const_trait_impl): we could perhaps do this for `Iterator`.
|
||||
match kind {
|
||||
CallDesugaringKind::ForLoopIntoIter | CallDesugaringKind::ForLoopNext => {
|
||||
error!(NonConstForLoopIntoIter)
|
||||
}
|
||||
CallDesugaringKind::QuestionBranch => {
|
||||
|
@ -196,10 +198,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
|
|||
CallDesugaringKind::Await => {
|
||||
error!(NonConstAwait)
|
||||
}
|
||||
};
|
||||
|
||||
diag_trait(&mut err, self_ty, kind.trait_def_id(tcx));
|
||||
err
|
||||
}
|
||||
}
|
||||
CallKind::FnCall { fn_trait_id, self_ty } => {
|
||||
let note = match self_ty.kind() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue