Fix TyKind lint, make consts no longer fn, etc
This commit is contained in:
parent
a056a953f0
commit
34e05812e0
17 changed files with 868 additions and 538 deletions
|
@ -98,8 +98,10 @@ struct Upvar<'tcx> {
|
|||
by_ref: bool,
|
||||
}
|
||||
|
||||
const fn deref_projection<'tcx>() -> &'tcx [PlaceElem<'tcx>; 1] {
|
||||
&[ProjectionElem::Deref]
|
||||
/// Associate some local constants with the `'tcx` lifetime
|
||||
struct TyCtxtConsts<'tcx>(TyCtxt<'tcx>);
|
||||
impl<'tcx> TyCtxtConsts<'tcx> {
|
||||
const DEREF_PROJECTION: &'tcx [PlaceElem<'tcx>; 1] = &[ProjectionElem::Deref];
|
||||
}
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
|
@ -1445,7 +1447,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
// Thread-locals might be dropped after the function exits
|
||||
// We have to dereference the outer reference because
|
||||
// borrows don't conflict behind shared references.
|
||||
root_place.projection = deref_projection();
|
||||
root_place.projection = TyCtxtConsts::DEREF_PROJECTION;
|
||||
(true, true)
|
||||
} else {
|
||||
(false, self.locals_are_invalidated_at_exit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue