Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Nov 16, 2023
1 parent 6515ac9 commit 08036a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_smir/src/rustc_smir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ impl<'tcx> Tables<'tcx> {

fn has_body(&self, instance: Instance<'tcx>) -> bool {
let def_id = instance.def_id();
!self.tcx.is_foreign_item(def_id)
&& self.tcx.is_mir_available(def_id)
self.tcx.is_mir_available(def_id)
&& !matches!(
instance.def,
ty::InstanceDef::Virtual(..) | ty::InstanceDef::Intrinsic(..)
Expand Down
4 changes: 2 additions & 2 deletions compiler/stable_mir/src/mir/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Instance {
with(|cx| cx.resolve_drop_in_place(ty))
}

/// Resolve the drop in place for a given type.
/// Resolve an instance for a given function pointer.
pub fn resolve_for_fn_ptr(def: FnDef, args: &GenericArgs) -> Result<Instance, crate::Error> {
with(|context| {
context.resolve_for_fn_ptr(def, args).ok_or_else(|| {
Expand All @@ -70,7 +70,7 @@ impl Instance {
})
}

/// Resolve a closure (do we need kind? -- most cases use FnOnce)
/// Resolve a closure with the expected kind.
pub fn resolve_closure(
def: ClosureDef,
args: &GenericArgs,
Expand Down

0 comments on commit 08036a8

Please sign in to comment.