about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFerdia McKeogh <ferdia@mckeogh.tech>2019-07-17 15:00:14 +0200
committerFerdia McKeogh <ferdia@mckeogh.tech>2019-07-17 15:35:32 +0200
commit8c589bca53fd9ce350092290fd0bf9c39994f8fb (patch)
treecaf3cebb92c89b1a4ec11cd1f61d34f58b127737 /src
parentd56128d2919132aceaf74cc3c68a4554f5445fce (diff)
downloadrust-8c589bca53fd9ce350092290fd0bf9c39994f8fb.tar.gz
rust-8c589bca53fd9ce350092290fd0bf9c39994f8fb.zip
Document link_section arbitrary bytes
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 77d45cfa63c..3990946291d 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -1447,6 +1447,9 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: DefId, span: Span)
     // other executable formats. Namely we can only embed a list of bytes,
     // nothing with pointers to anything else or relocations. If any relocation
     // show up, reject them here.
+    // #[link_section] may contain arbitrary, or even undefined bytes, but it is
+    // the consumer's responsibility to ensure all bytes that have been read
+    // have defined values.
     let instance = ty::Instance::mono(tcx, id);
     let cid = GlobalId {
         instance,