rust/compiler
Manish Goregaokar 8c5114b4e8
Rollup merge of #89327 - oli-obk:nll_diag_infer_vars, r=wesleywiser
Pick one possible lifetime in case there are multiple choices

In case a lifetime variable is created, but doesn't have an obvious lifetime in the list of named lifetimes that it should be inferred to, just pick the first one for the diagnostic.

This happens e.g. in

```rust
fn foo<'a, 'b>(a: Struct<'a>, b: Struct<'b>) -> impl Trait<'a, 'b> {
    if bar() { a } else { b }
}
```

where we get a lifetime variable that combines the lifetimes of `a` and `b` creating a lifetime that is the intersection of both. Right now the type system cannot express this and thus we get an error, but that error also can't express this.

I can also create an entirely new diagnostic that mentions all involved lifetimes, so it would actually mention `'a` and `'b` instead of just `'b`.
2021-09-30 23:41:08 -07:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty
rustc_attr
rustc_borrowck Rollup merge of #89327 - oli-obk:nll_diag_infer_vars, r=wesleywiser 2021-09-30 23:41:08 -07:00
rustc_builtin_macros
rustc_codegen_cranelift Update compiler/rustc_codegen_cranelift/scripts/filter_profile.rs 2021-09-30 19:41:32 +02:00
rustc_codegen_gcc Rebase fallout. 2021-09-30 20:22:42 +02:00
rustc_codegen_llvm Move EncodedMetadata to rustc_metadata. 2021-09-30 19:41:32 +02:00
rustc_codegen_ssa Move EncodedMetadata to rustc_metadata. 2021-09-30 19:41:32 +02:00
rustc_const_eval CTFE: extra assertions for Aggregate rvalues; remove unnecessarily eager special case 2021-09-29 13:47:41 -04:00
rustc_data_structures More tracing instrumentation 2021-09-28 12:28:22 +00:00
rustc_driver
rustc_error_codes
rustc_errors
rustc_expand Improve help for recursion limit errors 2021-09-28 22:17:13 +02:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #88782 - asquared31415:issue-79559, r=cjgillot 2021-09-30 18:05:20 -07:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer More tracing instrumentation 2021-09-28 12:28:22 +00:00
rustc_interface Move EncodedMetadata to rustc_metadata. 2021-09-30 19:41:32 +02:00
rustc_lexer
rustc_lint rustc_session: Remove lint store from Session 2021-09-28 11:56:15 +03:00
rustc_lint_defs
rustc_llvm PassWrapper: handle function rename from upstream D36850 2021-09-27 18:11:21 -04:00
rustc_macros
rustc_metadata Move EncodedMetadata to rustc_metadata. 2021-09-30 19:41:32 +02:00
rustc_middle Move EncodedMetadata to rustc_metadata. 2021-09-30 19:41:32 +02:00
rustc_mir_build Rollup merge of #89314 - notriddle:notriddle/lint-fix-enum-variant-match, r=davidtwco 2021-09-30 18:05:25 -07:00
rustc_mir_dataflow More tracing instrumentation 2021-09-28 12:28:22 +00:00
rustc_mir_transform Rebase resume argument projections during state transform 2021-09-28 14:39:18 +02:00
rustc_monomorphize
rustc_parse Check for macros in built-in attributes that don't support them. 2021-09-25 09:03:15 -07:00
rustc_parse_format
rustc_passes
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve Rollup merge of #88838 - FabianWolff:issue-88472, r=estebank 2021-09-30 23:41:05 -07:00
rustc_save_analysis
rustc_serialize
rustc_session rustc_session: Remove lint store from Session 2021-09-28 11:56:15 +03:00
rustc_span
rustc_symbol_mangling
rustc_target Add SOLID targets 2021-09-28 11:31:47 +09:00
rustc_trait_selection Improve help for recursion limit errors 2021-09-28 22:17:13 +02:00
rustc_traits Improve cause information for NLL higher-ranked errors 2021-09-27 10:23:45 -05:00
rustc_ty_utils Auto merge of #89144 - sexxi-goose:insig_stdlib, r=nikomatsakis 2021-09-26 19:36:00 +00:00
rustc_type_ir
rustc_typeck Rollup merge of #89251 - estebank:negative-index-literals, r=davidtwco 2021-09-30 23:41:06 -07:00