Only track (trivially) freeze types
This commit is contained in:
parent
b5063ab0e5
commit
1765587846
@ -849,7 +849,7 @@ pub fn is_freeze(self, tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>) -> bool
|
||||
///
|
||||
/// Returning true means the type is known to be `Freeze`. Returning
|
||||
/// `false` means nothing -- could be `Freeze`, might not be.
|
||||
fn is_trivially_freeze(self) -> bool {
|
||||
pub fn is_trivially_freeze(self) -> bool {
|
||||
match self.kind() {
|
||||
ty::Int(_)
|
||||
| ty::Uint(_)
|
||||
|
@ -674,7 +674,11 @@ fn register_with_ty<'tcx>(
|
||||
return Err(());
|
||||
}
|
||||
|
||||
// FIXME: Check that the place is `Freeze`.
|
||||
if !ty.is_trivially_freeze() {
|
||||
// Due to the way we deal with shared references, only `Freeze` types may be tracked.
|
||||
// We are a little bit to restrictive here by only allowing trivially `Freeze` types.
|
||||
return Err(());
|
||||
}
|
||||
|
||||
let place = self.make_place(local, projection)?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user