From a1b065050ba0e19f42d11046e70b1edae33f71e8 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 10 Mar 2022 13:27:38 +0000 Subject: [PATCH] Add const_ptr lang item mappings const_ptr is a lang item used as part of the slice implemenation this adds it to our mappings so we do not error with an unknown lang item. --- gcc/rust/util/rust-lang-item.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index cade09d88541..d2765bf201ea 100644 --- a/gcc/rust/util/rust-lang-item.h +++ b/gcc/rust/util/rust-lang-item.h @@ -68,6 +68,9 @@ class RustLangItem RANGE_INCLUSIVE, RANGE_TO_INCLUSIVE, + // https://github.com/rust-lang/rust/blob/master/library/core/src/ptr/const_ptr.rs + CONST_PTR, + UNKNOWN, }; @@ -201,6 +204,10 @@ class RustLangItem { return ItemType::RANGE_TO_INCLUSIVE; } + else if (item.compare ("const_ptr") == 0) + { + return ItemType::CONST_PTR; + } return ItemType::UNKNOWN; } @@ -273,6 +280,8 @@ class RustLangItem return "RangeInclusive"; case RANGE_TO_INCLUSIVE: return "RangeToInclusive"; + case CONST_PTR: + return "const_ptr"; case UNKNOWN: return "";