Skip to content

Commit 9c08b2b

Browse files
Rollup merge of #62749 - chocol4te:fix_60633, r=estebank
Document link_section arbitrary bytes Closes #60633.
2 parents ee9d4e3 + 14a1f72 commit 9c08b2b

File tree

1 file changed

+4
-1
lines changed
  • src/librustc_typeck/check

1 file changed

+4
-1
lines changed

src/librustc_typeck/check/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1442,11 +1442,14 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: DefId, span: Span)
14421442
return
14431443
}
14441444

1445-
// For the wasm32 target statics with #[link_section] are placed into custom
1445+
// For the wasm32 target statics with `#[link_section]` are placed into custom
14461446
// sections of the final output file, but this isn't link custom sections of
14471447
// other executable formats. Namely we can only embed a list of bytes,
14481448
// nothing with pointers to anything else or relocations. If any relocation
14491449
// show up, reject them here.
1450+
// `#[link_section]` may contain arbitrary, or even undefined bytes, but it is
1451+
// the consumer's responsibility to ensure all bytes that have been read
1452+
// have defined values.
14501453
let instance = ty::Instance::mono(tcx, id);
14511454
let cid = GlobalId {
14521455
instance,

0 commit comments

Comments
 (0)