gnu/gcc/7cd98512853df3cc8ffd0357fac0d69d820df631 gccrs: lang: Add range_inclusive_new
This patch introduces the 'range_inclusive_new' lang item to the compiler.
When the compiler encounters an inclusive range expression, it now
correctly desugars the operation into a function call targeting this
lang item instead of lowering it directly into a static struct.
gcc/rust/ChangeLog:
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Add
desugaring for range_inclusive_new lang item.
* util/rust-lang-item.cc (Rust::LangItem::lang_items): Add
range_inclusive_new to the BiMap.
* util/rust-lang-item.h (class LangItem): Add RANGE_INCLUSIVE_NEW
to the Kind enum.
gcc/testsuite/ChangeLog:
* rust/compile/torture/range-lang-item1.rs: Update test to use
the new lang item.
Signed-off-by: Enes Cevik <enes@nsvke.com>
4 files changed