Apply suggestions from code review
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
This commit is contained in:
parent
97738e1b86
commit
c77b56901f
2 changed files with 3 additions and 3 deletions
|
@ -466,7 +466,7 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
|
||||||
hir::InlineAsmOperand::SymFn { anon_const } => {
|
hir::InlineAsmOperand::SymFn { anon_const } => {
|
||||||
debug_assert!(matches!(
|
debug_assert!(matches!(
|
||||||
self.tcx.type_of(anon_const.def_id).instantiate_identity().kind(),
|
self.tcx.type_of(anon_const.def_id).instantiate_identity().kind(),
|
||||||
ty::Error(_) | ty::Never | ty::FnDef(..)
|
ty::Error(_) | ty::FnDef(..)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
// AST lowering guarantees that SymStatic points to a static.
|
// AST lowering guarantees that SymStatic points to a static.
|
||||||
|
|
|
@ -65,7 +65,7 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
|
||||||
let ty = tcx.typeck(def_id).node_type(hir_id);
|
let ty = tcx.typeck(def_id).node_type(hir_id);
|
||||||
|
|
||||||
match ty.kind() {
|
match ty.kind() {
|
||||||
ty::Never | ty::Error(_) => ty,
|
ty::Error(_) => ty,
|
||||||
ty::FnDef(..) => ty,
|
ty::FnDef(..) => ty,
|
||||||
_ => {
|
_ => {
|
||||||
tcx.dcx()
|
tcx.dcx()
|
||||||
|
@ -80,7 +80,7 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
|
||||||
Ty::new_error_with_message(
|
Ty::new_error_with_message(
|
||||||
tcx,
|
tcx,
|
||||||
span,
|
span,
|
||||||
format!("invalid type for `const` operand"),
|
format!("invalid type for `sym` operand"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue