Auto merge of #129831 - matthiaskrgr:rollup-befq6zx, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - #128523 (Add release notes for 1.81.0) - #129605 (Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen) - #129650 (Clean up `library/profiler_builtins/build.rs`) - #129651 (skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set) - #129684 (Enable Miri to pass pointers through FFI) - #129762 (Update the `wasm-component-ld` binary dependency) - #129782 (couple more crash tests) - #129816 (tidy: say which feature gate has a stability issue mismatch) - #129818 (make the const-unstable-in-stable error more clear) - #129824 (Fix code examples buttons not appearing on click on mobile) - #129826 (library: Fix typo in `core::mem`) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
a7399ba69d
37 changed files with 559 additions and 101 deletions
|
@ -41,7 +41,7 @@ tempfile = "3.2"
|
|||
thin-vec = "0.2.12"
|
||||
thorin-dwp = "0.7"
|
||||
tracing = "0.1"
|
||||
wasm-encoder = "0.215.0"
|
||||
wasm-encoder = "0.216.0"
|
||||
# tidy-alphabetical-end
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
|
|
|
@ -415,8 +415,8 @@ const_eval_unstable_const_fn = `{$def_path}` is not yet stable as a const fn
|
|||
|
||||
const_eval_unstable_in_stable =
|
||||
const-stable function cannot use `#[feature({$gate})]`
|
||||
.unstable_sugg = if it is not part of the public API, make this function unstably const
|
||||
.bypass_sugg = otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval)
|
||||
.unstable_sugg = if the function is not (yet) meant to be stable, make this function unstably const
|
||||
.bypass_sugg = otherwise, as a last resort `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval)
|
||||
|
||||
const_eval_unterminated_c_string =
|
||||
reading a null-terminated string starting at {$pointer} with no null found before end of allocation
|
||||
|
|
|
@ -362,17 +362,7 @@ pub trait Machine<'tcx>: Sized {
|
|||
ecx: &InterpCx<'tcx, Self>,
|
||||
id: AllocId,
|
||||
alloc: &'b Allocation,
|
||||
) -> InterpResult<'tcx, Cow<'b, Allocation<Self::Provenance, Self::AllocExtra, Self::Bytes>>>
|
||||
{
|
||||
// The default implementation does a copy; CTFE machines have a more efficient implementation
|
||||
// based on their particular choice for `Provenance`, `AllocExtra`, and `Bytes`.
|
||||
let kind = Self::GLOBAL_KIND
|
||||
.expect("if GLOBAL_KIND is None, adjust_global_allocation must be overwritten");
|
||||
let alloc = alloc.adjust_from_tcx(&ecx.tcx, |ptr| ecx.global_root_pointer(ptr))?;
|
||||
let extra =
|
||||
Self::init_alloc_extra(ecx, id, MemoryKind::Machine(kind), alloc.size(), alloc.align)?;
|
||||
Ok(Cow::Owned(alloc.with_extra(extra)))
|
||||
}
|
||||
) -> InterpResult<'tcx, Cow<'b, Allocation<Self::Provenance, Self::AllocExtra, Self::Bytes>>>;
|
||||
|
||||
/// Initialize the extra state of an allocation.
|
||||
///
|
||||
|
|
|
@ -358,10 +358,11 @@ impl Allocation {
|
|||
pub fn adjust_from_tcx<Prov: Provenance, Bytes: AllocBytes, Err>(
|
||||
&self,
|
||||
cx: &impl HasDataLayout,
|
||||
mut alloc_bytes: impl FnMut(&[u8], Align) -> Result<Bytes, Err>,
|
||||
mut adjust_ptr: impl FnMut(Pointer<CtfeProvenance>) -> Result<Pointer<Prov>, Err>,
|
||||
) -> Result<Allocation<Prov, (), Bytes>, Err> {
|
||||
// Copy the data.
|
||||
let mut bytes = Bytes::from_bytes(Cow::Borrowed(&*self.bytes), self.align);
|
||||
let mut bytes = alloc_bytes(&*self.bytes, self.align)?;
|
||||
// Adjust provenance of pointers stored in this allocation.
|
||||
let mut new_provenance = Vec::with_capacity(self.provenance.ptrs().len());
|
||||
let ptr_size = cx.data_layout().pointer_size.bytes_usize();
|
||||
|
|
|
@ -544,9 +544,8 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
|
|||
let is_stable =
|
||||
self.tcx.lookup_stability(def_id).is_some_and(|stability| stability.level.is_stable());
|
||||
let missing_const_stability_attribute = self.tcx.lookup_const_stability(def_id).is_none();
|
||||
let is_reachable = self.effective_visibilities.is_reachable(def_id);
|
||||
|
||||
if is_const && is_stable && missing_const_stability_attribute && is_reachable {
|
||||
if is_const && is_stable && missing_const_stability_attribute {
|
||||
let descr = self.tcx.def_descr(def_id.to_def_id());
|
||||
self.tcx.dcx().emit_err(errors::MissingConstStabAttr { span, descr });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue