diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-01-21 07:32:45 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-21 07:32:45 +0900 |
| commit | 8d2bac8dff232f3e5ee3208c22865136a370ca72 (patch) | |
| tree | bfe5d992d0675376071b1ae4673e4b540aaa97cf /src/librustc | |
| parent | bff216c56f472dd751d3da636027d5e2d821e979 (diff) | |
| parent | 72dffac6cf170c6c16c043299e35848014aae8d4 (diff) | |
| download | rust-8d2bac8dff232f3e5ee3208c22865136a370ca72.tar.gz rust-8d2bac8dff232f3e5ee3208c22865136a370ca72.zip | |
Rollup merge of #68302 - anp:caller-fn-ptr, r=eddyb,oli-obk
Fix #[track_caller] and function pointers Starting with failing tests, fix the miscompilation and ICE caused by `ReifyShim` bug. Fixes #68178.
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/ty/instance.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc/ty/instance.rs b/src/librustc/ty/instance.rs index 9be50d19a50..1ea695e40b2 100644 --- a/src/librustc/ty/instance.rs +++ b/src/librustc/ty/instance.rs @@ -141,7 +141,12 @@ impl<'tcx> InstanceDef<'tcx> { } pub fn requires_caller_location(&self, tcx: TyCtxt<'_>) -> bool { - tcx.codegen_fn_attrs(self.def_id()).flags.contains(CodegenFnAttrFlags::TRACK_CALLER) + match *self { + InstanceDef::Item(def_id) => { + tcx.codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::TRACK_CALLER) + } + _ => false, + } } } |
