about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2017-09-11 10:51:28 -0400
committerGitHub <noreply@github.com>2017-09-11 10:51:28 -0400
commitfb540e3de45571ac85c610475031449993c19277 (patch)
treea57204233c840046b0448d159c3149dfda66fcbe
parent813b323bdcece529a5cc7e5d69aa596253c484e6 (diff)
downloadrust-fb540e3de45571ac85c610475031449993c19277.tar.gz
rust-fb540e3de45571ac85c610475031449993c19277.zip
Update comment to properly describe static promotion restrictions
-rw-r--r--src/librustc_passes/consts.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs
index eb955ccf6bf..547d63fc3d4 100644
--- a/src/librustc_passes/consts.rs
+++ b/src/librustc_passes/consts.rs
@@ -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 {