]> git.lizzy.rs Git - rust.git/commitdiff
Update comment to properly describe static promotion restrictions
authorAaron Hill <aa1ronham@gmail.com>
Mon, 11 Sep 2017 14:51:28 +0000 (10:51 -0400)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2017 14:51:28 +0000 (10:51 -0400)
src/librustc_passes/consts.rs

index eb955ccf6bf70d4b902ea5e65c9d533be19602fd..547d63fc3d4aa68f58b400bc7aa9b7a14b3a4767 100644 (file)
@@ -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 {