hir: simplify is_range_literal

This commit simplifies `is_range_literal` by checking for
`QPath::LangItem` containing range-related lang items, rather than using
a heuristic.

Co-authored-by: Matthew Jasper <mjjasper1@gmail.com>
Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
David Wood 2020-08-04 14:18:11 +01:00
parent 1e2f350d92
commit 664ecf1085
No known key found for this signature in database
GPG key ID: 2592E76C87381FD9
4 changed files with 23 additions and 49 deletions

View file

@ -17,9 +17,13 @@ error[E0277]: the size for values of type `[{integer}]` cannot be known at compi
|
LL | let range = *arr..;
| ^^^^^^ doesn't have a size known at compile-time
|
::: $SRC_DIR/core/src/ops/range.rs:LL:COL
|
LL | pub struct RangeFrom<Idx> {
| --- required by this bound in `std::ops::RangeFrom`
|
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
= note: required by `std::ops::RangeFrom`
error: aborting due to 3 previous errors