diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-10-13 11:32:49 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-10-13 11:32:49 +0200 |
| commit | 78aaa3e5468f7e23267659b99b20f9ef33cdad44 (patch) | |
| tree | e4d6a050aa415464cc47a30c33076c6b3071cf6c /src/librustc_codegen_llvm/debuginfo/metadata.rs | |
| parent | 849a0e9c40ef79efec0802334fe10406ea3e7256 (diff) | |
| download | rust-78aaa3e5468f7e23267659b99b20f9ef33cdad44.tar.gz rust-78aaa3e5468f7e23267659b99b20f9ef33cdad44.zip | |
Check the invariant for `principal` inside the method
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo/metadata.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/metadata.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 706568b5446..6eff086a2ba 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -435,12 +435,7 @@ fn trait_pointer_metadata( // But it does not describe the trait's methods. let containing_scope = match trait_type.sty { - ty::Dynamic(ref data, ..) => if let Some(principal) = data.principal() { - let def_id = principal.def_id(); - Some(get_namespace_for_item(cx, def_id)) - } else { - NO_SCOPE_METADATA - }, + ty::Dynamic(ref data, ..) => Some(get_namespace_for_item(cx, data.principal().def_id())), _ => { bug!("debuginfo: Unexpected trait-object type in \ trait_pointer_metadata(): {:?}", |
