diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-07-18 11:29:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-18 11:29:50 -0400 |
| commit | 9c08b2b60ee48e8123a46173e23f7b39436a24fe (patch) | |
| tree | 065e5e955212c6be4e0cf8daa3bde0b1ce0574f2 /src | |
| parent | ee9d4e310e130a51c85338fa6548b6ef9fc7fd5c (diff) | |
| parent | 14a1f7246b27f31906dfe9c70c58fdfe863e314d (diff) | |
| download | rust-9c08b2b60ee48e8123a46173e23f7b39436a24fe.tar.gz rust-9c08b2b60ee48e8123a46173e23f7b39436a24fe.zip | |
Rollup merge of #62749 - chocol4te:fix_60633, r=estebank
Document link_section arbitrary bytes Closes #60633.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 77d45cfa63c..1462c098b19 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1442,11 +1442,14 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: DefId, span: Span) return } - // For the wasm32 target statics with #[link_section] are placed into custom + // For the wasm32 target statics with `#[link_section]` are placed into custom // sections of the final output file, but this isn't link custom sections of // 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, |
