Open
Description
The documentation of #[rustc_allocator]
seems to disagree with its implementation.
The documentation says it applies a returns-nonnull hint. The implementation instead only applies a returns-noalias hint.
// compiler/rustc_middle/src/middle/codegen_fn_attrs.rs:49
/// `#[rustc_allocator]`: a hint to LLVM that the pointer returned from this
/// function is never null.
const ALLOCATOR = 1 << 1;
// compiler/rustc_codegen_llvm/src/attributes.rs:304
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
Attribute::NoAlias.apply_llfn(llvm::AttributePlace::ReturnValue, llfn);
}