Update comment to properly describe static promotion restrictions
This commit is contained in:
parent
813b323bdc
commit
fb540e3de4
1 changed files with 4 additions and 3 deletions
|
|
@ -336,9 +336,10 @@ fn check_expr<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>, e: &hir::Expr, node
|
|||
Def::VariantCtor(..) | Def::StructCtor(..) |
|
||||
Def::Fn(..) | Def::Method(..) => {}
|
||||
|
||||
// References to a static are inherently promotable,
|
||||
// with the exception of "#[thread_loca]" statics.
|
||||
// The latter may not outlive the current function
|
||||
// References to a static that are themselves within a static
|
||||
// are inherently promotable with the exception
|
||||
// of "#[thread_loca]" statics, which may not
|
||||
// outlive the current function
|
||||
Def::Static(did, _) => {
|
||||
|
||||
if v.in_static {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue