rust/compiler/rustc_lint/src
bors e7cc3bddbe Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis
Lazy type-alias-impl-trait

Previously opaque types were processed by

1. replacing all mentions of them with inference variables
2. memorizing these inference variables in a side-table
3. at the end of typeck, resolve the inference variables in the side table and use the resolved type as the hidden type of the opaque type

This worked okayish for `impl Trait` in return position, but required lots of roundabout type inference hacks and processing.

This PR instead stops this process of replacing opaque types with inference variables, and just keeps the opaque types around.
Whenever an opaque type `O` is compared with another type `T`, we make the comparison succeed and record `T` as the hidden type. If `O` is compared to `U` while there is a recorded hidden type for it, we grab the recorded type (`T`) and compare that against `U`. This makes implementing

* https://github.com/rust-lang/rfcs/pull/2515

much simpler (previous attempts on the inference based scheme were very prone to ICEs and general misbehaviour that was not explainable except by random implementation defined oddities).

r? `@nikomatsakis`

fixes #93411
fixes #88236
2022-02-07 23:40:26 +00:00
..
nonstandard_style mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
array_into_iter.rs Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
builtin.rs manual formatting 2022-02-02 15:40:12 +00:00
context.rs add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
early.rs rustc_lint: Stop creating a fake ast::Crate for running early lints 2022-01-23 19:31:32 +08:00
enum_intrinsics_non_enums.rs initial revert 2022-01-15 01:16:55 +00:00
hidden_unicode_codepoints.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
internal.rs review + rebase 2022-02-01 10:29:36 +01:00
late.rs Replace NestedVisitorMap with NestedFilter 2022-01-16 16:02:36 -06:00
levels.rs rustc_lint: Stop creating a fake ast::Crate for running early lints 2022-01-23 19:31:32 +08:00
lib.rs add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
methods.rs Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
non_ascii_idents.rs rustc_lint: Remove some redundant fields from EarlyContext 2022-01-23 18:51:51 +08:00
non_fmt_panic.rs Take in account the unreachable! macro in the non_fmt_panic lint 2022-01-31 17:09:31 +01:00
nonstandard_style.rs rustc_lint: Remove some redundant fields from EarlyContext 2022-01-23 18:51:51 +08:00
noop_method_call.rs Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
pass_by_value.rs update pass_by_value 2022-01-27 07:58:33 +01:00
passes.rs Do not pass hir::Crate to lints. 2021-09-30 17:39:54 +02:00
redundant_semicolon.rs Lint on redundant trailing semicolon after item 2020-12-29 16:30:02 -05:00
tests.rs Update to last upstream version 2021-07-08 17:14:28 +02:00
traits.rs drive-by: use is_const and is_const_if_const 2022-01-26 19:24:01 -08:00
types.rs Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
unused.rs Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00