rust/src/test/ui/range
Ayaz Hafiz 7930f9a368
Change heuristic for determining range literal
Currently, rustc uses a heuristic to determine if a range expression is
not a literal based on whether the expression looks like a function call
or struct initialization. This fails for range literals whose
lower/upper bounds are the results of function calls. A possibly-better
heuristic is to check if the expression contains `..`, required in range
literals.

Of course, this is also not perfect; for example, if the range
expression is a struct which includes some text with `..` this will
fail, but in general I believe it is a better heuristic.

A better alternative altogether is to add the `QPath::LangItem` enum
variant suggested in #60607. I would be happy to do this as a precursor
to this patch if someone is able to provide general suggestions on how
usages of `QPath` need to be changed later in the compiler with the
`LangItem` variant.

Closes #73553
2020-06-22 20:52:44 -07:00
..
issue-54505-no-literals.fixed Address review comments 2018-10-02 22:10:04 +01:00
issue-54505-no-literals.rs Address review comments 2018-10-02 22:10:04 +01:00
issue-54505-no-literals.stderr Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
issue-54505-no-std.rs Remove eh_unwind_resume lang item 2020-03-05 17:36:50 +00:00
issue-54505-no-std.stderr Remove eh_unwind_resume lang item 2020-03-05 17:36:50 +00:00
issue-54505.fixed Address review comments 2018-10-02 22:10:04 +01:00
issue-54505.rs Address review comments 2018-10-02 22:10:04 +01:00
issue-54505.stderr Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
issue-73553-misinterp-range-literal.rs Change heuristic for determining range literal 2020-06-22 20:52:44 -07:00
issue-73553-misinterp-range-literal.stderr Change heuristic for determining range literal 2020-06-22 20:52:44 -07:00
range-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
range-1.stderr Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
range-inclusive-pattern-precedence.rs Remove licenses 2018-12-25 21:08:33 -07:00
range-inclusive-pattern-precedence.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
range_traits-1.rs Update tests 2020-01-09 21:23:12 +03:00
range_traits-1.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
range_traits-2.rs Remove double trailing newlines 2019-04-22 16:57:01 +01:00
range_traits-2.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
range_traits-3.rs Remove double trailing newlines 2019-04-22 16:57:01 +01:00
range_traits-3.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
range_traits-4.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
range_traits-5.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
range_traits-6.rs Remove double trailing newlines 2019-04-22 16:57:01 +01:00
range_traits-6.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
range_traits-7.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00