1
Fork 0

Rollup merge of #99748 - compiler-errors:better-impl-trait-printing, r=fee1-dead

Use full type name instead of just saying `impl Trait` in "captures lifetime" error

I think this is very useful, especially when there's >1 `impl Trait`, and it just means passing around a bit more info that we already have access to.
This commit is contained in:
Dylan DPC 2022-07-26 14:27:00 +05:30 committed by GitHub
commit ad32667bc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 52 additions and 50 deletions

View file

@ -2,9 +2,8 @@ pub mod canonical;
pub mod unify_key;
use crate::ty::Region;
use crate::ty::Ty;
use crate::ty::{OpaqueTypeKey, Ty};
use rustc_data_structures::sync::Lrc;
use rustc_hir::def_id::LocalDefId;
use rustc_span::Span;
/// Requires that `region` must be equal to one of the regions in `choice_regions`.
@ -15,8 +14,9 @@ use rustc_span::Span;
/// ```
#[derive(Debug, Clone, HashStable, TypeFoldable, TypeVisitable, Lift)]
pub struct MemberConstraint<'tcx> {
/// The `DefId` of the opaque type causing this constraint: used for error reporting.
pub opaque_type_def_id: LocalDefId,
/// The `DefId` and substs of the opaque type causing this constraint.
/// Used for error reporting.
pub key: OpaqueTypeKey<'tcx>,
/// The span where the hidden type was instantiated.
pub definition_span: Span,