Skip to content

Commit

Permalink
Note the invariance over 'env in Scope<'env>.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Jan 5, 2022
1 parent 5bd5781 commit aa9c088
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/std/src/thread/scoped.rs
Expand Up @@ -11,6 +11,8 @@ use crate::sync::Arc;
/// See [`scope`] for details.
pub struct Scope<'env> {
data: ScopeData,
/// Invariance over 'env, to make sure 'env cannot shrink,
/// which is necessary for soundness.
env: PhantomData<&'env mut &'env ()>,
}

Expand Down

0 comments on commit aa9c088

Please sign in to comment.