Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Represent trait constness as a distinct predicate #131985

Merged
merged 5 commits into from
Oct 24, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Oct 20, 2024

cc @rust-lang/project-const-traits
r? @ghost for now

Also mirrored everything that is written below on this hackmd here: https://hackmd.io/@compiler-errors/r12zoixg1l

Tl;dr:

  • This PR removes the bulk of the old effect desugaring.
  • This PR reimplements most of the effect desugaring as a new predicate and set of a couple queries. I believe it majorly simplifies the implementation and allows us to move forward more easily on its implementation.

I'm putting this up both as a request for comments and a vibe-check, but also as a legitimate implementation that I'd like to see land (though no rush of course on that last part).

Background

Early days

Once upon a time, we represented trait constness in the param-env and in TraitPredicate. This was very difficult to implement correctly; it had bugs and was also incomplete; I don't think this was anyone's fault though, it was just the limit of experimental knowledge we had at that point.

Dealing with ~const within predicates themselves meant dealing with constness all throughout the trait solver. This was difficult to keep track of, and afaict was not handled well with all the corners of candidate assembly.

Specifically, we had to (in various places) remap constness according to the param-env constness:

pred.remap_constness(&mut param_env);

This was annoying and manual and also error prone.

Beginning of the effects desugaring

Later on, #113210 reimplemented a new desugaring for const traits via a <const HOST: bool> predicate. This essentially "reified" the const checking and separated it from any of the remapping or separate tracking in param-envs. For example, if I was in a const-if-const environment, but I wanted to call a trait that was non-const, this reification would turn the constness mismatch into a simple type mismatch of the effect parameter.

While this was a monumental step towards straightening out const trait checking in the trait system, it had its own issues, since that meant that the constness of a trait (or any item within it, like an associated type) was early-bound. This essentially meant that <T as Trait>::Assoc was distinct from <T as ~const Trait>::Assoc, which was bad.

Associated-type bound based effects desugaring

After this, #120639 implemented a new effects desugaring. This used an associated type to more clearly represent the fact that the constness is not an input parameter of a trait, but a property that could be computed of a impl. The write-up linked in that PR explains it better than I could.

However, I feel like it really reached the limits of what can comfortably be expressed in terms of associated type and trait calculus. Also, <const HOST: bool> remains a synthetic const parameter, which is observable in nested items like RPITs and closures, and comes with tons of its own hacks in the astconv and middle layer.

For example, there are pieces of unintuitive code that are needed to represent semantics like elaboration, and eventually will be needed to make error reporting intuitive, and hopefully in the future assist us in implementing built-in traits (eventually we'll want something like ~const Fn trait bounds!).

elaboration hack:

// HACK(effects): The following code is required to get implied bounds for effects associated
// types to work with super traits.
//
// Suppose `data` is a trait predicate with the form `<T as Tr>::Fx: EffectsCompat<somebool>`
// and we know that `trait Tr: ~const SuperTr`, we need to elaborate this predicate into
// `<T as SuperTr>::Fx: EffectsCompat<somebool>`.
//
// Since the semantics for elaborating bounds about effects is equivalent to elaborating
// bounds about super traits (elaborate `T: Tr` into `T: SuperTr`), we place effects elaboration
// next to super trait elaboration.
if cx.is_lang_item(data.def_id(), TraitSolverLangItem::EffectsCompat)
&& matches!(self.mode, Filter::All)
{
// first, ensure that the predicate we've got looks like a `<T as Tr>::Fx: EffectsCompat<somebool>`.
if let ty::Alias(ty::AliasTyKind::Projection, alias_ty) = data.self_ty().kind()
{
// look for effects-level bounds that look like `<Self as Tr>::Fx: TyCompat<<Self as SuperTr>::Fx>`
// on the trait, which is proof to us that `Tr: ~const SuperTr`. We're looking for bounds on the
// associated trait, so we use `explicit_implied_predicates_of` since it gives us more than just
// `Self: SuperTr` bounds.
let bounds = cx.explicit_implied_predicates_of(cx.parent(alias_ty.def_id));
// instantiate the implied bounds, so we get `<T as Tr>::Fx` and not `<Self as Tr>::Fx`.
let elaborated = bounds.iter_instantiated(cx, alias_ty.args).filter_map(
|(clause, _)| {
let ty::ClauseKind::Trait(tycompat_bound) =
clause.kind().skip_binder()
else {
return None;
};
if !cx.is_lang_item(
tycompat_bound.def_id(),
TraitSolverLangItem::EffectsTyCompat,
) {
return None;
}
// extract `<T as SuperTr>::Fx` from the `TyCompat` bound.
let supertrait_effects_ty =
tycompat_bound.trait_ref.args.type_at(1);
let ty::Alias(ty::AliasTyKind::Projection, supertrait_alias_ty) =
supertrait_effects_ty.kind()
else {
return None;
};
// The self types (`T`) must be equal for `<T as Tr>::Fx` and `<T as SuperTr>::Fx`.
if supertrait_alias_ty.self_ty() != alias_ty.self_ty() {
return None;
};
// replace the self type in the original bound `<T as Tr>::Fx: EffectsCompat<somebool>`
// to the effects type of the super trait. (`<T as SuperTr>::Fx`)
let elaborated_bound = data.with_self_ty(cx, supertrait_effects_ty);
Some(
elaboratable
.child(bound_clause.rebind(elaborated_bound).upcast(cx)),
)
},
);
self.extend_deduped(elaborated);
}
}

trait bound remapping hack for diagnostics:

/// For effects predicates such as `<u32 as Add>::Effects: Compat<host>`, pretend that the
/// predicate that failed was `u32: Add`. Return the constness of such predicate to later
/// print as `u32: ~const Add`.
fn get_effects_trait_pred_override(
&self,
p: ty::PolyTraitPredicate<'tcx>,
leaf: ty::PolyTraitPredicate<'tcx>,
span: Span,
) -> (ty::PolyTraitPredicate<'tcx>, ty::PolyTraitPredicate<'tcx>, ty::BoundConstness) {
let trait_ref = p.to_poly_trait_ref();
if !self.tcx.is_lang_item(trait_ref.def_id(), LangItem::EffectsCompat) {
return (p, leaf, ty::BoundConstness::NotConst);
}
let Some(ty::Alias(ty::AliasTyKind::Projection, projection)) =
trait_ref.self_ty().no_bound_vars().map(Ty::kind)
else {
return (p, leaf, ty::BoundConstness::NotConst);
};
let constness = trait_ref.skip_binder().args.const_at(1);
let constness = if constness == self.tcx.consts.true_ || constness.is_ct_infer() {
ty::BoundConstness::NotConst
} else if constness == self.tcx.consts.false_ {
ty::BoundConstness::Const
} else if matches!(constness.kind(), ty::ConstKind::Param(_)) {
ty::BoundConstness::ConstIfConst
} else {
self.dcx().span_bug(span, format!("Unknown constness argument: {constness:?}"));
};
let new_pred = p.map_bound(|mut trait_pred| {
trait_pred.trait_ref = projection.trait_ref(self.tcx);
trait_pred
});
let new_leaf = leaf.map_bound(|mut trait_pred| {
trait_pred.trait_ref = projection.trait_ref(self.tcx);
trait_pred
});
(new_pred, new_leaf, constness)
}

I want to be clear that I don't think this is a issue of implementation quality or anything like that; I think it's simply a very clear sign that we're using types and traits in a way that they're not fundamentally supposed to be used, especially given that constness deserves to be represented as a first-class concept.

What now?

This PR implements a new desugaring for const traits. Specifically, it introduces a HostEffect predicate to represent the obligation an impl is const, rather than using associated type bounds and the compat trait that exists for effects today.

HostEffect predicate

A HostEffect clause has two parts -- the TraitRef we're trying to prove, and a HostPolarity::{Maybe, Const}.

HostPolarity::Const corresponds to T: const Trait bounds, which must always be proven as const, and which can be written in any context. These are lowered directly into the predicates of an item, since they're not "context-specific".

On the other hand, HostPolarity::Maybe corresponds to T: ~const Trait bounds which must only exist in a conditionally-const context like a method in a #[const_trait], or a const fn free function. We do not lower these immediately into the predicates of an item; instead, we collect them into a new query called the const_conditions. These are the set of trait refs that we need to prove have const implementations for an item to be const.

Notably, they're represented as bare (poly) trait refs because they are meant to be paired back together with a HostPolarity when they're being registered in typeck (see next section).

For example, given:

const fn foo<T: ~const A + const B>() {}

foo's const conditions would contain T: A, but not T: B. On the flip side, foo's predicates (predicates_of) query would contain HostEffect(T: B, HostPolarity::Const) but not HostEffect(T: A, HostPolarity::Maybe) since we don't need to prove that predicate in a non-const environment (and it's not even the right predicate to prove in an unconditionally const environment).

Type checking const bodies

When type checking bodies in HIR, when we encounter a call expression, we additionally register the callee item's const conditions with the HostPolarity from the body we're typechecking (Const for unconditionally const things like const/static items, and Maybe for conditionally const things like const fns; and we don't register HostPolarity predicates for non-const bodies).

When type-checking a conditionally const body, we augment its param-env with HostEffect(..., Maybe) predicates.

Checking that const impls are WF

We extend the logic in compare_method_predicate_entailment to also check the const-conditions of the impl method, to make sure that we error for:

#[const_trait] Bar {}
#[const_trait] trait Foo {
    fn method<T: Bar>();
}

impl Foo for () {
    fn method<T: ~const Bar>() {} // stronger assumption!
}

We also extend the WF check for impls to register the const conditions of the trait that is being implemented. This is to make sure we error for:

#[const_trait] trait Bar {}
#[const_trait] trait Foo<T> where T: ~const Bar {}

impl<T> const Foo<T> for () {}
//~^ `T: ~const Bar` is missing!

Proving a HostEffect predicate

We have several ways of proving a HostEffect predicate:

  1. Matching a HostEffect predicate from the param-env
  2. From an impl - we do impl selection very similar to confirming a trait goal, except we filter for only const impls, and we additionally register the impl's const conditions (i.e. the impl's ~const where clauses).

Later I expect that we will add more built-in implementations for things like Fn.

What next?

After this PR, I'd like to split out the work more so it can proceed in parallel and probably amongst others that are not me.

  • Register HostEffect goal for places in HIR typeck that correspond to call terminators, like autoderef.
  • Make traits in libstd const again.
    • Probably need to impl host effect preds in old solver.
  • Implement built-in HostEffect rules for traits like Fn.
  • Rip out const checking from MIR altogether.

So what?

This ends up being super convenient basically everywhere in the compiler. Due to the design of the new trait solver, we end up having an almost parallel structure to the existing trait and projection predicates for assembling HostEffect predicates; adding new candidates and especially new built-in implementations is now basically trivial, and it's quite straightforward to understand the confirmation logic for these predicates.

Same with diagnostics reporting; since we have predicates which represent the obligation to prove an impl is const, we can simplify and make these diagnostics richer without having to write a ton of logic to intercept and rewrite the existing Compat trait errors.

Finally, it gives us a much more straightforward path for supporting the const effect on the old trait solver. I'm personally quite passionate about getting const trait support into the hands of users without having to wait until the new solver lands1, so I think after this PR lands we can begin to gauge how difficult it would be to implement constness in the old trait solver too. This PR will not do this yet.

Footnotes

  1. Though this is not a prerequisite or by any means the only justification for this PR.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 20, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

This PR changes Stable MIR

cc @oli-obk, @celinval, @ouz-a

Some changes occurred in match checking

cc @Nadrieril

changes to the core type system

cc @compiler-errors, @lcnr

changes to the core type system

cc @compiler-errors, @lcnr

Some changes occurred in match lowering

cc @Nadrieril

HIR ty lowering was modified

cc @fmease

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 21, 2024

☔ The latest upstream changes (presumably #131980) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments after an initial pass, looking pretty nice! Will leave more structured thoughts on the Zulip thread.

compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_typeck/src/callee.rs Show resolved Hide resolved
compiler/rustc_hir_analysis/src/collect/predicates_of.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/collect/predicates_of.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/collect/predicates_of.rs Outdated Show resolved Hide resolved
compiler/rustc_ty_utils/src/ty.rs Outdated Show resolved Hide resolved
compiler/rustc_type_ir/src/elaborate.rs Outdated Show resolved Hide resolved
compiler/rustc_type_ir/src/predicate.rs Outdated Show resolved Hide resolved
compiler/rustc_type_ir/src/predicate_kind.rs Outdated Show resolved Hide resolved
tests/crashes/118320.rs Outdated Show resolved Hide resolved
/// This query also computes the `~const` where clauses for associated types, which are
/// not "const", but which have item bounds which may be `~const`. These must hold for
/// the `~const` item bound to hold.
pub(super) fn const_conditions<'tcx>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does kinda suck tho is that we do need to end up duplicating a fair portion of gather_explicit_predicates_of in the const_conditions impl because they differ just enough that it's kinda not worth unifying atm, tho that could probably be changed later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vibeck: can we change this to ICE instead of eager return Default::default() when called for unexpected definitions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that in the last commit.

predicates: tcx.arena.alloc_from_iter(bounds.clauses(tcx).map(|(clause, span)| {
(
clause.kind().map_bound(|clause| match clause {
ty::ClauseKind::HostEffect(ty::HostEffectPredicate {
Copy link
Member Author

@compiler-errors compiler-errors Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kinda sucks that for the sake of not rewriting all of the code, we end up collecting a list of HostEffect(T: Trait, Maybe) then stripping away everything but the trait ref when actually in the const condition query lol

I don't see how functions like lower_poly_trait_ref could easily be made to be generic over their output, tho.

QueryResult,
};

impl<D, I> assembly::GoalKind<D> for ty::HostEffectPredicate<I>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware that the only thing that is not yet implemented is ~const in item bounds. Not because I couldn't do it, but mostly because I didn't want to complicate the new trait solver implementation yet.

So this code doesn't work yet:

#![feature(const_trait_impl, effects)]

#[const_trait]
trait Bar {}

#[const_trait]
trait Foo {
    type Bar: ~const Bar;
}

const fn needs_const_bar<T: ~const Bar>() {}

const fn test<T: ~const Foo>() {
    needs_const_bar::<T::Bar>();
}

We just need to change the item bound candidate assembly to also have a callback for assembling "custom" item bounds, tho.

@@ -150,6 +150,13 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
});
}

predicates.extend(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we extend the param-env with the ~const bounds of the item, so that we can type check it with those assumptions.

compiler/rustc_hir_analysis/src/collect/predicates_of.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_typeck/src/callee.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/print/pretty.rs Outdated Show resolved Hide resolved
compiler/rustc_next_trait_solver/src/solve/effect_goals.rs Outdated Show resolved Hide resolved
@@ -690,6 +689,9 @@ impl<'tcx> Stable<'tcx> for ty::ClauseKind<'tcx> {
ClauseKind::ConstEvaluatable(const_) => {
stable_mir::ty::ClauseKind::ConstEvaluatable(const_.stable(tables))
}
ClauseKind::HostEffect(..) => {
todo!()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this unimplemented currently, at least until we get consensus that this is something we want :D

compiler/rustc_type_ir/src/predicate.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Oct 21, 2024

☔ The latest upstream changes (presumably #131988) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 21, 2024
@compiler-errors
Copy link
Member Author

Preemptively assigning to @lcnr or @fee1-dead; please re- or un-assign as desired. I believe from an earlier conversation that lcnr said they'd be interested in reviewing if fee1-dead can't get to it, though please speak up if I misunderstood :3

@rust-log-analyzer

This comment has been minimized.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Oct 22, 2024
…ests, r=fee1-dead

Move const trait tests from `ui/rfcs/rfc-2632-const-trait-impl` to `ui/traits/const-traits`

I found the old test directory to be somewhat long to name, and I don't think it's necessary to put an experimental implementation's tests under an rfc which is closed.

r? fee1-dead

Breaking this out of rust-lang#131985 so that PR doesn't touch 300 files.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 22, 2024
Rollup merge of rust-lang#132015 - compiler-errors:move-const-trait-tests, r=fee1-dead

Move const trait tests from `ui/rfcs/rfc-2632-const-trait-impl` to `ui/traits/const-traits`

I found the old test directory to be somewhat long to name, and I don't think it's necessary to put an experimental implementation's tests under an rfc which is closed.

r? fee1-dead

Breaking this out of rust-lang#131985 so that PR doesn't touch 300 files.
@bors
Copy link
Contributor

bors commented Oct 22, 2024

☔ The latest upstream changes (presumably #132020) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Oct 24, 2024

📌 Commit 0f5a47d has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 24, 2024
@bors
Copy link
Contributor

bors commented Oct 24, 2024

⌛ Testing commit 0f5a47d with merge c7ddc3b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 24, 2024
Represent trait constness as a distinct predicate

cc `@rust-lang/project-const-traits`
r? `@ghost` for now

Also mirrored everything that is written below on this hackmd here: https://hackmd.io/`@compiler-errors/r12zoixg1l`

# Tl;dr:

* This PR removes the bulk of the old effect desugaring.
* This PR reimplements most of the effect desugaring as a new predicate and set of a couple queries. I believe it majorly simplifies the implementation and allows us to move forward more easily on its implementation.

I'm putting this up both as a request for comments and a vibe-check, but also as a legitimate implementation that I'd like to see land (though no rush of course on that last part).

## Background

### Early days

Once upon a time, we represented trait constness in the param-env and in `TraitPredicate`. This was very difficult to implement correctly; it had bugs and was also incomplete; I don't think this was anyone's fault though, it was just the limit of experimental knowledge we had at that point.

Dealing with `~const` within predicates themselves meant dealing with constness all throughout the trait solver. This was difficult to keep track of, and afaict was not handled well with all the corners of candidate assembly.

Specifically, we had to (in various places) remap constness according to the param-env constness:

https://github.com/rust-lang/rust/blob/574b64a97f52162f965bc201e47f0af8279ca65d/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1498

This was annoying and manual and also error prone.

### Beginning of the effects desugaring

Later on, rust-lang#113210 reimplemented a new desugaring for const traits via a `<const HOST: bool>` predicate. This essentially "reified" the const checking and separated it from any of the remapping or separate tracking in param-envs. For example, if I was in a const-if-const environment, but I wanted to call a trait that was non-const, this reification would turn the constness mismatch into a simple *type* mismatch of the effect parameter.

While this was a monumental step towards straightening out const trait checking in the trait system, it had its own issues, since that meant that the constness of a trait (or any item within it, like an associated type) was *early-bound*. This essentially meant that `<T as Trait>::Assoc` was *distinct* from `<T as ~const Trait>::Assoc`, which was bad.

### Associated-type bound based effects desugaring

After this, rust-lang#120639 implemented a new effects desugaring. This used an associated type to more clearly represent the fact that the constness is not an input parameter of a trait, but a property that could be computed of a impl. The write-up linked in that PR explains it better than I could.

However, I feel like it really reached the limits of what can comfortably be expressed in terms of associated type and trait calculus. Also, `<const HOST: bool>` remains a synthetic const parameter, which is observable in nested items like RPITs and closures, and comes with tons of its own hacks in the astconv and middle layer.

For example, there are pieces of unintuitive code that are needed to represent semantics like elaboration, and eventually will be needed to make error reporting intuitive, and hopefully in the future assist us in implementing built-in traits (eventually we'll want something like `~const Fn` trait bounds!).

elaboration hack: https://github.com/rust-lang/rust/blob/8069f8d17a6c86a8fd881939fcce359a90c57ff2/compiler/rustc_type_ir/src/elaborate.rs#L133-L195

trait bound remapping hack for diagnostics: https://github.com/rust-lang/rust/blob/8069f8d17a6c86a8fd881939fcce359a90c57ff2/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs#L2370-L2413

I want to be clear that I don't think this is a issue of implementation quality or anything like that; I think it's simply a very clear sign that we're using types and traits in a way that they're not fundamentally supposed to be used, especially given that constness deserves to be represented as a first-class concept.

### What now?

This PR implements a new desugaring for const traits. Specifically, it introduces a `HostEffect` predicate to represent the obligation an impl is const, rather than using associated type bounds and the compat trait that exists for effects today.

### `HostEffect` predicate

A `HostEffect` clause has two parts -- the `TraitRef` we're trying to prove, and a `HostPolarity::{Maybe, Const}`.

`HostPolarity::Const` corresponds to `T: const Trait` bounds, which must *always* be proven as const, and which can be written in any context. These are lowered directly into the predicates of an item, since they're not "context-specific".

On the other hand, `HostPolarity::Maybe` corresponds to `T: ~const Trait` bounds which must only exist in a conditionally-const context like a method in a `#[const_trait]`, or a `const fn` free function. We do not lower these immediately into the predicates of an item; instead, we collect them into a new query called the **`const_conditions`**. These are the set of trait refs that we need to prove have const implementations for an item to be const.

Notably, they're represented as bare (poly) trait refs because they are meant to be paired back together with a `HostPolarity` when they're being registered in typeck (see next section).

For example, given:

```rust
const fn foo<T: ~const A + const B>() {}
```

`foo`'s const conditions would contain `T: A`, but not `T: B`. On the flip side, foo's predicates (`predicates_of`) query would contain `HostEffect(T: B, HostPolarity::Const)` but not `HostEffect(T: A, HostPolarity::Maybe)` since we don't need to prove that predicate in a non-const environment (and it's not even the right predicate to prove in an unconditionally const environment).

### Type checking const bodies

When type checking bodies in HIR, when we encounter a call expression, we additionally register the callee item's const conditions with the `HostPolarity` from the body we're typechecking (`Const` for unconditionally const things like `const`/`static` items, and `Maybe` for conditionally const things like const fns; and we don't register `HostPolarity` predicates for non-const bodies).

When type-checking a conditionally const body, we augment its param-env with `HostEffect(..., Maybe)` predicates.

### Checking that const impls are WF

We extend the logic in `compare_method_predicate_entailment` to also check the const-conditions of the impl method, to make sure that we error for:

```rust
#[const_trait] Bar {}
#[const_trait] trait Foo {
    fn method<T: Bar>();
}

impl Foo for () {
    fn method<T: ~const Bar>() {} // stronger assumption!
}
```

We also extend the WF check for impls to register the const conditions of the trait that is being implemented. This is to make sure we error for:

```rust
#[const_trait] trait Bar {}
#[const_trait] trait Foo<T> where T: ~const Bar {}

impl<T> const Foo<T> for () {}
//~^ `T: ~const Bar` is missing!
```

### Proving a `HostEffect` predicate

We have several ways of proving a `HostEffect` predicate:

1. Matching a `HostEffect` predicate from the param-env
2. From an impl - we do impl selection very similar to confirming a trait goal, except we filter for only const impls, and we additionally register the impl's const conditions (i.e. the impl's `~const` where clauses).

Later I expect that we will add more built-in implementations for things like `Fn`.

## What next?

After this PR, I'd like to split out the work more so it can proceed in parallel and probably amongst others that are not me.

* Register `HostEffect` goal for places in HIR typeck that correspond to call terminators, like autoderef.
* Make traits in libstd const again.
    * Probably need to impl host effect preds in old solver.
* Implement built-in `HostEffect` rules for traits like `Fn`.
* Rip out const checking from MIR altogether.

## So what?

This ends up being super convenient basically everywhere in the compiler. Due to the design of the new trait solver, we end up having an almost parallel structure to the existing trait and projection predicates for assembling `HostEffect` predicates; adding new candidates and especially new built-in implementations is now basically trivial, and it's quite straightforward to understand the confirmation logic for these predicates.

Same with diagnostics reporting; since we have predicates which represent the obligation to prove an impl is const, we can simplify and make these diagnostics richer without having to write a ton of logic to intercept and rewrite the existing `Compat` trait errors.

Finally, it gives us a much more straightforward path for supporting the const effect on the old trait solver. I'm personally quite passionate about getting const trait support into the hands of users without having to wait until the new solver lands[^1], so I think after this PR lands we can begin to gauge how difficult it would be to implement constness in the old trait solver too. This PR will not do this yet.

[^1]: Though this is not a prerequisite or by any means the only justification for this PR.
@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-msvc failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[2024-10-24T17:21:28Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-10-24T17:21:28Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:21:28Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpbefeOC#ctfe-stress-5@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2024-10-24T17:21:34Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:21:34Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpbefeOC#ctfe-stress-5@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpbefeOC\\incremental-state"
[2024-10-24T17:21:40Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:21:40Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpbefeOC#ctfe-stress-5@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpbefeOC\\incremental-state"
[2024-10-24T17:21:40Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-10-24T17:21:40Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:21:40Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpx8tODO#ctfe-stress-5@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2024-10-24T17:21:46Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
[2024-10-24T17:23:14Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-10-24T17:23:14Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:23:14Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmprLFjCH#match-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2024-10-24T17:23:15Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:23:15Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmprLFjCH#match-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmprLFjCH\\incremental-state"
[2024-10-24T17:23:17Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:23:17Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmprLFjCH#match-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmprLFjCH\\incremental-state"
[2024-10-24T17:23:17Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-10-24T17:23:17Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-10-24T17:23:17Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpvOwNAr#match-stress@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2024-10-24T17:23:19Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
   Compiling rustc_driver v0.0.0 (C:\a\rust\rust\compiler\rustc_driver)
[RUSTC-TIMING] rustc_driver test:false 4.598
error: linking with `link.exe` failed: exit code: 1104
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\symbols.o" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_main-b9d4af25c456c3b7.rustc_main.2d24f2be43b4c087-cgu.0.rcgu.o" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_driver-f9c873b4f7cd2164.dll.lib" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-312cc7332d5665e0.rlib" "psapi.lib" "shell32.lib" "ole32.lib" "uuid.lib" "advapi32.lib" "ws2_32.lib" "ntdll.lib" "kernel32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "advapi32.lib" "cfgmgr32.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "opengl32.lib" "user32.lib" "winspool.lib" "bcrypt.lib" "advapi32.lib" "legacy_stdio_definitions.lib" "kernel32.lib" "kernel32.lib" "advapi32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:libcmt" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\advapi32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-errorhandling-l1-1-3.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-file-fromapp-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-handle-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-ioring-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-memory-l1-1-3.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-memory-l1-1-4.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-memory-l1-1-5.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-memory-l1-1-6.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-memory-l1-1-7.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-memory-l1-1-8.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-synch-l1-2-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-sysinfo-l1-2-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-sysinfo-l1-2-3.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-sysinfo-l1-2-4.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-sysinfo-l1-2-6.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-util-l1-1-1.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-winrt-error-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-winrt-l1-1-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-core-wow64-l1-1-1.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\api-ms-win-security-base-l1-2-2.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\avrt.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\bcp47mrm.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\bcryptprimitives.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\clfsw32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\dbghelp.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\elscore.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\gdi32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\icu.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\imagehlp.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\kernel32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\ktmw32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\netapi32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\normaliz.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\ntdll.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\ntdllk.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\ole32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\oleacc.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\oleaut32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\propsys.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\psapi.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\rtworkq.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\txfw32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\user32.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\usp10.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\version.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustckdgaSB\\wofutil.dll_imports_indirect.lib" "/NXCOMPAT" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\stacker-1c496942f5526841\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\psm-b307fe5d9726f8b1\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\blake3-4a372efeb6f355a1\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\blake3-4a372efeb6f355a1\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x64" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\build\\rustc_llvm-e2958cd171cbaa3b\\out" "/LIBPATH:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\llvm\\lib" "/OUT:C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_main-b9d4af25c456c3b7.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/MANIFEST:EMBED" "/MANIFESTINPUT:C:\\a\\rust\\rust\\compiler\\rustc\\Windows Manifest.xml" "/WX"
  = note: LINK : fatal error LNK1104: cannot open file 'C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\rustc_main-b9d4af25c456c3b7.exe'␍

[RUSTC-TIMING] rustc_main test:false 0.632
error: could not compile `rustc-main` (bin "rustc-main") due to 1 previous error
Build completed unsuccessfully in 0:07:36

@compiler-errors
Copy link
Member Author

@bors retry

@bors
Copy link
Contributor

bors commented Oct 24, 2024

⌛ Testing commit 0f5a47d with merge 1d4a767...

@compiler-errors
Copy link
Member Author

2024-10-24T17:31:56.3354246Z �[0m  �[0m�[0m�[1m�[38;5;14m= �[0m�[0m�[1m�[38;5;15mnote�[0m�[0m: LINK : fatal error LNK1104: cannot open file 'C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\rustc_main-b9d4af25c456c3b7.exe'␍�[0m
2024-10-24T17:31:56.3356032Z �[0m          �[0m
2024-10-24T17:31:56.3356636Z 
2024-10-24T17:31:56.3356944Z [RUSTC-TIMING] rustc_main test:false 0.632
2024-10-24T17:31:56.3357863Z �[1m�[31merror�[0m�[1m:�[0m could not compile `rustc-main` (bin "rustc-main") due to 1 previous error
2024-10-24T17:31:56.3626333Z Build completed unsuccessfully in 0:07:36
2024-10-24T17:31:56.3698639Z [2024-10-24T17:31:56.369Z INFO  opt_dist::timer] Section `Stage 1 (Rustc PGO) > Build PGO optimized rustc` ended: FAIL (457.02s)`
2024-10-24T17:31:56.3699927Z [2024-10-24T17:31:56.369Z INFO  opt_dist::timer] Section `Stage 1 (Rustc PGO)` ended: FAIL (2727.01s)`
2024-10-24T17:31:56.3700741Z [2024-10-24T17:31:56.369Z INFO  opt_dist] Timer results
2024-10-24T17:31:56.3701317Z     -----------------------------------------------------------------
2024-10-24T17:31:56.3701870Z     Stage 1 (Rustc PGO):                            2727.01s (100.00%)
2024-10-24T17:31:56.3702498Z       Build PGO instrumented rustc and LLVM:        1710.62s (62.73%)
2024-10-24T17:31:56.3703081Z       Gather profiles:                               558.33s (20.47%)
2024-10-24T17:31:56.3703665Z       Build PGO optimized rustc:                     457.02s (16.76%)
2024-10-24T17:31:56.3704108Z     
2024-10-24T17:31:56.3704452Z     Total duration:                                           45m 27s
2024-10-24T17:31:56.3705010Z     -----------------------------------------------------------------
2024-10-24T17:31:56.3705403Z     
2024-10-24T17:31:57.4277009Z [2024-10-24T17:31:57.427Z INFO  opt_dist::utils] Free disk space: 116.10 GiB out of total 299.51 GiB (61.24% used)
2024-10-24T17:31:57.4278047Z Error: Optimized build pipeline has failed

@jieyouxu jieyouxu added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Oct 24, 2024
@bors
Copy link
Contributor

bors commented Oct 24, 2024

☀️ Test successful - checks-actions
Approved by: fee1-dead
Pushing 1d4a767 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 24, 2024
@bors bors merged commit 1d4a767 into rust-lang:master Oct 24, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 24, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1d4a767): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.5% [0.1%, 1.2%] 16
Regressions ❌
(secondary)
0.9% [0.1%, 1.5%] 22
Improvements ✅
(primary)
-0.3% [-0.5%, -0.1%] 44
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.1%] 13
All ❌✅ (primary) -0.1% [-0.5%, 1.2%] 60

Max RSS (memory usage)

Results (primary -1.1%, secondary -2.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.7% [0.5%, 2.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.9% [-3.4%, -0.4%] 7
Improvements ✅
(secondary)
-2.1% [-2.2%, -1.9%] 6
All ❌✅ (primary) -1.1% [-3.4%, 2.8%] 9

Cycles

Results (secondary -3.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.1%, secondary 0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.2% [0.0%, 0.4%] 105
Regressions ❌
(secondary)
0.6% [0.1%, 1.0%] 15
Improvements ✅
(primary)
-0.3% [-0.4%, -0.2%] 24
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.3%] 18
All ❌✅ (primary) 0.1% [-0.4%, 0.4%] 129

Bootstrap: 780.742s -> 785.158s (0.57%)
Artifact size: 333.58 MiB -> 333.66 MiB (0.02%)

github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Oct 25, 2024
Culprit PR: rust-lang/rust#131985

The automatic PR failed because the culprit PR removed the
`host_param_index` field that we used in the `contract_host_param`
function. We needed the `contract_host_param` function in the first
place because previously, Rust would add a `<const HOST: bool>`
parameter to a function's `GenericArgs` to handle trait constness (c.f.
#3258). The culprit PR [removed that
argument](https://github.com/rust-lang/rust/pull/131985/files#diff-0a61b538a3cec072c76fecae4635af6a12ec3256860029ac70549c2aa53ab394L1527),
so our logic to find and remove this parameter during stubbing is no
longer necessary.

Resolves #3645

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Oct 25, 2024
Culprit PR: rust-lang/rust#131985

The automatic PR failed because the culprit PR removed the
`host_param_index` field that we used in the `contract_host_param`
function. We needed the `contract_host_param` function in the first
place because previously, Rust would add a `<const HOST: bool>`
parameter to a function's `GenericArgs` to handle trait constness (c.f.
#3258). The culprit PR [removed that
argument](https://github.com/rust-lang/rust/pull/131985/files#diff-0a61b538a3cec072c76fecae4635af6a12ec3256860029ac70549c2aa53ab394L1527),
so our logic to find and remove this parameter during stubbing is no
longer necessary.

Resolves #3645

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
@Kobzol
Copy link
Contributor

Kobzol commented Oct 29, 2024

The small doc benchmarks were deemed acceptable during review, I agree.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 29, 2024
qinheping added a commit to qinheping/verify-rust-std that referenced this pull request Nov 7, 2024
771d77c Rollup merge of rust-lang#132495 - Houtamelo:remove_unintended_link, r=jieyouxu
d99f3cf Rollup merge of rust-lang#132493 - Houtamelo:doc_type-ref_html-tag, r=jieyouxu
e24475c Rollup merge of rust-lang#132482 - lukas-code:stab-attrs, r=Noratrieb
21e23b8 Rollup merge of rust-lang#132398 - krtab:add_doc_link, r=Noratrieb
64e2472 Remove unintended link
166cea2 Fix type reference in documents which was being confused with html tags.
cab478a fix some stability annotations
ecd55b1 Rollup merge of rust-lang#132459 - RalfJung:byte_sub_ptr, r=scottmcm
3cd2636 Rollup merge of rust-lang#132455 - RalfJung:const_alloc_layout, r=dtolnay
8fdd6d4 Rollup merge of rust-lang#132451 - RalfJung:less-rustc_allow_const_fn_unstable, r=tgross35
9f63901 Rollup merge of rust-lang#132445 - RalfJung:const-unchecked-shifts, r=tgross35
2b0a6dd Rollup merge of rust-lang#132413 - lolbinarycat:offset_of_nested-docs, r=workingjubilee
c80bb77 offset_from / sub_ptr docs: emphasize that pointers must be in the same allocation
861009d feat(byte_sub_ptr): add ptr::byte_sub_ptr
f4e1fa3 make const_alloc_layout feature gate only about functions that are already stable
bf19bda unchecked_shifts, unchecked_neg are safe-to-const-expose-on-stable, so we can get rid of a bunch of attributes
ebf7505 remove some unnecessary rustc_allow_const_fn_unstable
36cfa4e Auto merge of rust-lang#132206 - tgross35:update-builtins, r=wesleywiser
4283f78 use semantic line break
a4b3916 update offset_of! docs to reflect the stablization of nesting
f0634f0 Add intra-doc link in str::xxx_char_boundary
5d892fb Remove do_not_const_check from Iterator methods
93839e7 Add intra-doc link in str::xxx_prefix
8c0bdb3 Auto merge of rust-lang#132238 - Urgau:midpoint-i64-hackers-impl, r=joboet
9b9ea35 Auto merge of rust-lang#132326 - matthiaskrgr:rollup-ngyw18g, r=matthiaskrgr
94dd5c6 Rollup merge of rust-lang#132321 - betrusted-io:xous/fix-rustc_const_stable-attribute, r=joboet
eb2e420 Auto merge of rust-lang#132231 - lukas-code:rc-plug-leaks, r=tgross35
ed1a265 xous: sync: remove `rustc_const_stable` attribute
6495896 Rollup merge of rust-lang#132270 - yakiimoninja:fs-truncate-docs, r=Noratrieb
057f9e9 Rollup merge of rust-lang#132233 - WaffleLapkin:box-module-split, r=workingjubilee
d0a99e7 Rollup merge of rust-lang#131520 - zachs18:const-str-split, r=Noratrieb
e134006 Auto merge of rust-lang#132277 - workingjubilee:rollup-5e6q6e4, r=workingjubilee
a1b88a0 Auto merge of rust-lang#128985 - GrigorenkoPV:instantly-dangling-pointer, r=Urgau
9318ae3 Rc destructor: tweak inlining
3a686cd Split `boxed.rs` into a few modules
7be29e9 Rollup merge of rust-lang#131441 - SpriteOvO:proc-macro-to-tokens-trait, r=dtolnay
d56ef5a clarified std::fs truncate doc
b0248e2 Auto merge of rust-lang#132145 - RalfJung:stdarch, r=Amanieu
191aa70 clarified doc for `std::fs::OpenOptions.truncate()`
a5aa408 New lint: `dangling_pointers_from_temporaries`
8cdb783 Rollup merge of rust-lang#131391 - ChaiTRex:isqrt, r=scottmcm,tgross35
4f4a6c6 we can now enable the 'const stable fn must be stable' check
79c45be bump stdarch
848fcd5 Auto merge of rust-lang#132251 - jieyouxu:rollup-mtv9mpd, r=jieyouxu
e212260 Auto merge of rust-lang#132200 - Mark-Simulacrum:strengthen-cross-lang, r=RalfJung
ac1ec5f Support `char::is_digit` in const contexts
b534a02 Use Hacker's Delight impl in `i64::midpoint` instead of wide `i128` impl
28223bd Rc/Arc: don't leak the allocation if drop panics
5d8140d add test for panicking drop in Box/Rc/Arc
cde6279 Auto merge of rust-lang#131284 - dingxiangfei2009:rename-smart-ptr-to-coerce-referent, r=compiler-errors
c667683 Auto merge of rust-lang#132191 - Urgau:midpoint_signed_towards_zero, r=dtolnay
80f0aa3 Add a new trait `proc_macro::ToTokens`
3cfffb8 Update compiler-builtins to 0.1.136
45d8393 Auto merge of rust-lang#131715 - tgross35:add-const_sockaddr_setters, r=Amanieu
ec76942 Make clearer that guarantees in ABI compatibility are for Rust only
139f632 Add test for all midpoint expectations
4612afa Round negative signed integer towards zero in `iN::midpoint`
06b5c8e Rollup merge of rust-lang#132019 - daboross:document-partialeq-oncelock, r=Mark-Simulacrum
658e709 Auto merge of rust-lang#131349 - RalfJung:const-stability-checks, r=compiler-errors
db3b9fc Rollup merge of rust-lang#132137 - RalfJung:behavior, r=Noratrieb
6daffe4 get rid of the internal unlikely macro
d2ff6a2 Re-do recursive const stability checks
295b932 library: consistently use American spelling for 'behavior'
2348c06 Rollup merge of rust-lang#131457 - kpreid:fnaddr, r=dtolnay
2da7b7f Auto merge of rust-lang#132121 - workingjubilee:rollup-yrtn33e, r=workingjubilee
5cf142b Rollup merge of rust-lang#132113 - LaihoE:pattern_as_utf8_default_impl, r=workingjubilee
1f2f88e Rollup merge of rust-lang#132101 - youknowone:thread_local-gyneiene, r=tgross35
6c81340 Rollup merge of rust-lang#132048 - mustartt:aix-random-impl, r=workingjubilee
980e5a2 Rollup merge of rust-lang#131851 - sunshowers:musl-posix, r=workingjubilee
d25ee97 Avoid use imports in thread_local_inner! in statik
b4ea08d Auto merge of rust-lang#132116 - matthiaskrgr:rollup-3a0ia4r, r=matthiaskrgr
0ae2951 Rollup merge of rust-lang#131790 - nmathewson:doc_socketaddr_representation, r=tgross35
8baae66 Auto merge of rust-lang#131985 - compiler-errors:const-pred, r=fee1-dead
115a851 provide default impl for as_utf8_pattern
a92f55c Auto merge of rust-lang#123550 - GnomedDev:remove-initial-arc, r=Noratrieb
c9460bf Document textual format of SocketAddrV{4,6}
78f4ed3 Remove associated type based effects logic
21eb2c2 [musl] use posix_spawn if a directory change was requested
03798ad Rollup merge of rust-lang#130225 - adetaylor:rename-old-receiver, r=wesleywiser
a45e030 Rollup merge of rust-lang#132066 - tifv:ptr-docs-typo, r=Amanieu
927edad Rollup merge of rust-lang#132065 - tifv:dangling-docs, r=Noratrieb
ded2a0a Rollup merge of rust-lang#132060 - joshtriplett:innermost-outermost, r=jieyouxu
e62b2cc Rollup merge of rust-lang#132039 - a1phyr:vecdeque_read_exact, r=Noratrieb
76e75ae Rollup merge of rust-lang#130991 - LaihoE:vectorized_slice_contains, r=Noratrieb
6799f85 const fn str::split_at*
887bcf6 const fn str::is_char_boundary
01ed719 vectorized SliceContains
1bb8bde s/SmartPointer/CoerceReferent/g
843347f fix a typo in documentation of pointer::sub_ptr()
10f64a7 fix documentation of ptr::dangling() function
728a8d7 "innermost", "outermost", "leftmost", and "rightmost" don't need hyphens
282790f Specialize `read_exact` and `read_buf_exact` for `VecDeque`
054b256 Rollup merge of rust-lang#132031 - slanterns:rc_default, r=ibraheemdev
05b4955 Rollup merge of rust-lang#131707 - clarfonthey:constify-core-tests, r=thomcc
b0fc9c7 Auto merge of rust-lang#131929 - LaihoE:replace_default_capacity, r=joboet
5c416b4 AIX use /dev/urandom for impl
09e26cb better default capacity for str::replace
3a5e669 Rename Receiver -> LegacyReceiver
224a60d refactor `Arc<T>::default`
fe5101d optimize `Rc<T>::default`
507193a Rollup merge of rust-lang#131697 - ShE3py:rt-arg-lifetimes, r=Amanieu
61fa53e Document PartialEq impl for OnceLock
2e8dd5b Rollup merge of rust-lang#132003 - RalfJung:abi-compat-docs, r=traviscross
7f91dbe Rollup merge of rust-lang#130350 - RalfJung:strict-provenance, r=dtolnay
8499ec3 update ABI compatibility docs for new option-like rules
6d2a437 move strict provenance lints to new feature gate, remove old feature gates
4461171 stabilize Strict Provenance and Exposed Provenance
e2b2c3a fix docs
20ed6b5 replace FindFirstFileW with FindFirstFileExW and apply optimization
a065b8e replace FindFirstFileW with FindFirstFileExW and regenerate bindings
362aec6 Auto merge of rust-lang#131948 - matthiaskrgr:rollup-c9rvzu6, r=matthiaskrgr
7628c4f Rollup merge of rust-lang#131921 - klensy:statx_all, r=ChrisDenton
affe042 Rollup merge of rust-lang#131772 - GnomedDev:remove-proc_macro-todo, r=petrochenkov
5615efc Auto merge of rust-lang#131907 - saethlin:update-compiler-builtins, r=tgross35
b6b2903 Update `compiler-builtins` to 0.1.134
b714f9d Rollup merge of rust-lang#131919 - RalfJung:zero-sized-accesses, r=jhpratt
fb67079 Rollup merge of rust-lang#131890 - printfn:precise-capturing-docs, r=traviscross
642ab07 Rollup merge of rust-lang#127462 - Ayush1325:uefi-env, r=joboet
bac3891 Remove the Arc rt::init allocation for thread info
85f6f48 Auto merge of rust-lang#131816 - Zalathar:profiler-feature, r=Kobzol
f843b26 replace STATX_ALL with (STATX_BASIC_STATS | STATX_BTIME) as former is deprecated
aabdd7d zero-sized accesses are fine on null pointers
ff3f33f Update `use` keyword docs to describe precise capturing
c949985 std: uefi: Use common function for UEFI shell
f973e62 std: uefi: Add basic Env variables
63a4a9b Auto merge of rust-lang#131895 - jieyouxu:rollup-jyt3pic, r=jieyouxu
39ccfc9 Rollup merge of rust-lang#126207 - devnexen:stack_overflow_libc_upd, r=joboet
e08bce6 Auto merge of rust-lang#131841 - paulmenage:futex-abstraction, r=joboet
eba461c Rollup merge of rust-lang#131866 - jieyouxu:thread_local, r=jhpratt
80bbaa9 Rollup merge of rust-lang#131858 - AnthonyMikh:AnthonyMikh/repeat_n-is-not-that-special-anymore, r=jhpratt
5ec2cbc Rollup merge of rust-lang#131809 - collinoc:fix-retain-mut-docs, r=jhpratt
fe19eb6 Rollup merge of rust-lang#131774 - thesummer:rtems-add-getentropy, r=joboet
fca7375 Rollup merge of rust-lang#130136 - GKFX:stabilize-const-pin, r=dtolnay
07aaa64 Add entropy source for RTEMS
1b957f4 Rollup merge of rust-lang#131850 - lexeyOK:master, r=compiler-errors
a6871b8 Rollup merge of rust-lang#131823 - thesummer:bump-libc-0.2.160, r=workingjubilee
848aed9 Rollup merge of rust-lang#131654 - betrusted-io:xous-various-fixes, r=thomcc
a6e300e Avoid shadowing user provided types or type aliases in `thread_local!`
a993e1d remove outdated documentation for `repeat_n`
4d2c969 Auto merge of rust-lang#131572 - cuviper:ub-index_range, r=thomcc
f905a0c Bump libc to 0.2.161
beee93f std::unix::stack_overflow::drop_handler addressing todo through libc update
c8f71dc Missing parenthesis
01bce29 Abstract the state type for futexes
0ab703c Rollup merge of rust-lang#131835 - ferrocene:amanjeev/add-missing-attribute-unwind, r=Noratrieb
bac74b6 Rollup merge of rust-lang#131833 - c-ryan747:patch-1, r=Noratrieb
0d7c889 Auto merge of rust-lang#130223 - LaihoE:faster_str_replace, r=thomcc
34c8228 Do not run test where it cannot run
d73f924 Add must_use to CommandExt::exec
aa027e9 Make `profiler_builtins` an optional dependency of sysroot, not std
019ad0c Remove TODO in proc_macro now `const_refs_to_static` is stable
3b5d8a2 Fix predicate signatures in retain_mut docs
6c85d31 Auto merge of rust-lang#131797 - matthiaskrgr:rollup-lzpze2k, r=matthiaskrgr
3a5fdfc Partially stabilize const_pin
7caa6d2 Rollup merge of rust-lang#131730 - zlfn:master, r=tgross35
1e13241 Auto merge of rust-lang#131792 - matthiaskrgr:rollup-480nwg4, r=matthiaskrgr
1581f56 Rollup merge of rust-lang#130822 - bjoernager:non-null-from-ref, r=dtolnay
f7b3231 Auto merge of rust-lang#131767 - cuviper:bump-stage0, r=Mark-Simulacrum
cdbd127 Rollup merge of rust-lang#131746 - slanterns:once_box_order, r=joboet
6f3e65c Rollup merge of rust-lang#131712 - tgross35:const-lazy_cell_into_inner, r=joboet
151c0c7 Auto merge of rust-lang#131460 - jwong101:default-placement-new, r=ibraheemdev
43f97fb update bootstrap configs
eae13d1 replace placeholder version
e35d9fe relax a memory order in `once_box`
fbde7e8 Rollup merge of rust-lang#131521 - jdonszelmann:rc, r=joboet
9d9ea42 Rollup merge of rust-lang#130568 - eduardosm:const-float-methods, r=RalfJung,tgross35
435ce04 Rollup merge of rust-lang#129794 - Ayush1325:uefi-os-expand, r=joboet
bfd32fa Refactor `floating` macro and nofloat panic message
7d1457e Auto merge of rust-lang#131723 - matthiaskrgr:rollup-krcslig, r=matthiaskrgr
148ed85 Rename debug! macro to impl_Debug!
db2efb0 Combine impl_int and impl_uint
1897d05 Make some float methods unstable `const fn`
76342d9 Auto merge of rust-lang#131724 - matthiaskrgr:rollup-ntgkkk8, r=matthiaskrgr
da7ca22 Rollup merge of rust-lang#131706 - GKFX:fix-const-hacks, r=tgross35
54072ab Rollup merge of rust-lang#131496 - bjoernager:const-make-ascii, r=dtolnay
1695b0a Rollup merge of rust-lang#130608 - YohDeadfall:cstr-from-into-str, r=workingjubilee
f1ee2cd Rollup merge of rust-lang#131339 - HeroicKatora:set_ptr_value-documentation, r=Mark-Simulacrum
ffc4a6c Rollup merge of rust-lang#122670 - beetrees:non-unicode-option-env-error, r=compiler-errors
cc7730e Auto merge of rust-lang#129458 - EnzymeAD:enzyme-frontend, r=jieyouxu
eeab9d4 Stabilise 'const_make_ascii'
ec0b0df Add a `const_sockaddr_setters` feature
e788410 Mark LazyCell::into_inner unstably const
acaf7e2 Run most core::num tests in const context too
63f3836 Fix two const-hacks
34d920c `rt::Argument`: elide lifetimes
ecb3830 Rollup merge of rust-lang#131384 - saethlin:precondition-tests, r=ibraheemdev
ea7a0c6 Rollup merge of rust-lang#129424 - coolreader18:stabilize-pin_as_deref_mut, r=dtolnay
843c9e9 Auto merge of rust-lang#131672 - matthiaskrgr:rollup-gyzysj4, r=matthiaskrgr
3b92996 uefi: Implement getcwd and chdir
8d35aa9 Rollup merge of rust-lang#131616 - RalfJung:const_ip, r=tgross35
b6cfaeb Rollup merge of rust-lang#131274 - workingjubilee:stabilize-the-one-that-got-away, r=scottmcm
6d8235e Rollup merge of rust-lang#130629 - Dirbaio:net-from-octets, r=tgross35
88634c8 Rollup merge of rust-lang#128967 - devnexen:get_path_fbsd_upd, r=joboet
d6318f3 Auto merge of rust-lang#126557 - GrigorenkoPV:vec_track_caller, r=joboet
d11e388 Auto merge of rust-lang#131662 - matthiaskrgr:rollup-r1wkfxw, r=matthiaskrgr
089c495 rename rcbox in other places as per review comments
2cfa6d0 core/net: use hex for ipv6 doctests for consistency.
9ae0e8b core/net: add Ipv[46]Addr::from_octets, Ipv6Addr::from_segments
da6c63c Rollup merge of rust-lang#131646 - RalfJung:unix-miri-fallbacks, r=joboet
87ea4bb Rollup merge of rust-lang#131644 - RalfJung:win-miri, r=joboet
928b99c library: xous: mark alloc as `FIXME(static_mut_refs)`
dde2ff0 xous: ffi: correct syscall number for adjust_process
c3955e4 net: fix dead code warning
3919c4f std: xous: add support for args and env
9c1e162 Auto merge of rust-lang#125679 - clarfonthey:escape_ascii, r=joboet
262c3fb unwind: update unwinding dependency to 0.2.3
4c63749 sys/unix: add comments for some Miri fallbacks
e3f701c remove outdated comment now that Miri is on CI
e2c210e sys/windows: remove miri hack that is only needed for win7
1799481 switch unicode-data back to 'static'
ddfd2ea merge const_ipv4 / const_ipv6 feature gate into 'ip' feature gate
b6c0376 Rollup merge of rust-lang#131418 - coolreader18:wasm-exc-use-stdarch, r=bjorn3
1ee9b69 Rollup merge of rust-lang#131120 - tgross35:stabilize-const_option, r=RalfJung
6fc4b1a Fix bug where `option_env!` would return `None` when env var is present but not valid Unicode
d72915f Fix typo thing->thin referring to pointer
a2d85a1 Stabilize `const_option`
4a9ad4a Rollup merge of rust-lang#131617 - RalfJung:const_cow_is_borrowed, r=tgross35
113c6c0 Rollup merge of rust-lang#131503 - theemathas:stdin_read_line_docs, r=Mark-Simulacrum
7a51595 remove const_cow_is_borrowed feature gate
7420c36 Rollup merge of rust-lang#131233 - joboet:stdout-before-main, r=tgross35
08e7188 Rollup merge of rust-lang#130954 - workingjubilee:stabilize-const-mut-fn, r=RalfJung
3febfb3 std: fix stdout-before-main
3b820ee library: Stabilize `const_replace`
ee21064 library: Stabilize `const_ptr_write`
36ff2c8 library: Stabilize `const_intrinsic_forget`
4f124de Rollup merge of rust-lang#131289 - RalfJung:duration_consts_float, r=tgross35
de76914 Rollup merge of rust-lang#130962 - nyurik:opts-libs, r=cuviper
76ce3a9 Rollup merge of rust-lang#124874 - jedbrown:float-mul-add-fast, r=saethlin
de18ce1 Avoid superfluous UB checks in `IndexRange`
eb8ff20 Rollup merge of rust-lang#131463 - bjoernager:const-char-encode-utf8, r=RalfJung
964c91b Rollup merge of rust-lang#131287 - RalfJung:const_result, r=tgross35
a8b0950 Rollup merge of rust-lang#131109 - tgross35:stabilize-debug_more_non_exhaustive, r=joboet
637b515 Rollup merge of rust-lang#131065 - Voultapher:port-sort-test-suite, r=thomcc
eeb881d intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics
2b6b22c Single commit implementing the enzyme/autodiff frontend
00785c0 stabilize const_result
12b8028 stabilize duration_consts_float
c8d357c Rollup merge of rust-lang#131512 - j7nw4r:master, r=jhpratt
34f7831 rename RcBox in other places too
cd0a8f5 rename RcBox to RcInner for consistency
dd6dd70 Fixing rustDoc for LayoutError.
7fdd545 Rollup merge of rust-lang#130741 - mrkajetanp:detect-b16b16, r=Amanieu
77f7b2f Rollup merge of rust-lang#130538 - ultrabear:ultrabear_const_from_ref, r=workingjubilee
fca0919 More clearly document Stdin::read_line
e4a9064 Stabilise 'const_char_encode_utf8';
8547f51 allocate before calling T::default in <Arc<T>>::default()
669e255 allocate before calling T::default in <Box<T>>::default()
5ef6f83 rustc_target: Add sme-b16b16 as an explicit aarch64 target feature
74264e3 stdarch: Bump stdarch submodule
a5529ee Clean up is_aligned_and_not_null
db5a9a7 Add more precondition check tests
528dda2 Allow zero-size reads/writes on null pointers
86c7526 Optimize escape_ascii
36a90d7 Rollup merge of rust-lang#131462 - cuviper:open_buffered-error, r=RalfJung
49220cd Rollup merge of rust-lang#131449 - nickrum:wasip2-net-decouple-fd, r=alexcrichton
ff37c08 Rollup merge of rust-lang#131383 - AngelicosPhosphoros:better_doc_for_slice_slicing_at_ends, r=cuviper
136ec3a Rollup merge of rust-lang#130827 - fmease:library-mv-obj-save-dyn-compat, r=ibraheemdev
8cdea8c Add "not guaranteed to be equal"
db9377d Mention allocation errors for `open_buffered`
7e225fa Apply suggestions from code review
0ce4f76 Expand `ptr::fn_addr_eq()` documentation.
885e3d1 Library: Rename "object safe" to "dyn compatible"
5f495ee Decouple WASIp2 sockets from WasiFd
78670fb stabilize `{slice,array}::from_mut`
7153288 Update library/std/src/sys/pal/unix/process/process_vxworks.rs
cd0d5be fix ref in process_vxworks.rs
01e7f5f Update library/std/src/sys/pal/unix/process/process_unix.rs
fbb514c Change a few `&Option<T>` into `Option<&T>`
cc1e8b5 Use throw intrinsic from stdarch in wasm libunwind
bc755bb Stabilize Pin::as_deref_mut
fcc990d Stabilize `isqrt` feature
b946b83 Add docs about slicing slices at the ends
9ca739e cfg out checks in add and sub but not offset
8293e74 Add precondition checks to ptr::offset, ptr::add, ptr::sub
c65244c Rollup merge of rust-lang#131308 - mati865:gnullvm-f16-f128, r=tgross35
6a809c7 Rollup merge of rust-lang#128399 - mammothbane:master, r=Amanieu,tgross35
723693e liballoc: introduce String, Vec const-slicing
fee7e5e Auto merge of rust-lang#128651 - folkertdev:naked-asm-macro-v2, r=Amanieu
61eff8f Expand set_ptr_value / with_metadata_of docs
7c3b7e7 Rollup merge of rust-lang#131335 - dacianpascu06:fix-typo, r=joboet
8e3076e Rollup merge of rust-lang#131307 - YohDeadfall:prctl-set-name-dbg-assert, r=workingjubilee
b8c51a6 grammar fix
4ca50c3 disallow `asm!` in `#[naked]` functions
cc09cb0 implement `naked_asm` macro
dbb2281 Rollup merge of rust-lang#131316 - programmerjake:patch-4, r=Noratrieb
4b276e6 Auto merge of rust-lang#131314 - tgross35:update-builtins, r=tgross35
5dc3e7c Fix typo in primitive_docs.rs
686d25d Auto merge of rust-lang#130540 - veera-sivarajan:fix-87525, r=estebank
9555c10 Update `compiler-builtins` to 0.1.133
0f71b38 enable f16 and f128 on windows-gnullvm targets
d14d771 Auto merge of rust-lang#131302 - matthiaskrgr:rollup-56kbpzx, r=matthiaskrgr
b8dd441 Android: Debug assertion after setting thread name
fcd199d Rollup merge of rust-lang#131281 - RalfJung:const-cell, r=Amanieu
71aa514 Auto merge of rust-lang#131221 - XrXr:bump-compiler-builtins, r=tgross35
b7c90c6 library: Stabilize const `MaybeUninit::assume_init_mut`
0418d54 Add a Lint for Pointer to Integer Transmutes in Consts
460459d Rollup merge of rust-lang#131256 - RalfJung:f16-f128-const, r=ibraheemdev
a818a4d Rollup merge of rust-lang#131094 - joboet:lazy_once_box, r=ibraheemdev
2ed6282 make Cell unstably const
575391b move f16/f128 const fn under f16/f128 feature gate
b3da4ed Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk`
bbe8bf7 Rollup merge of rust-lang#131267 - okaneco:bufread_skip_until, r=tgross35
65049d1 Rollup merge of rust-lang#131105 - slanterns:literal_c_str, r=petrochenkov
7001dd5 Rollup merge of rust-lang#130403 - eduardosm:stabilize-const_slice_from_raw_parts_mut, r=workingjubilee
0f43ffb Update compiler-builtins to 0.1.132
7d4319e Rollup merge of rust-lang#131177 - workingjubilee:stabilize-const-mut-referees, r=tgross35
6709307 Rollup merge of rust-lang#130518 - scottmcm:stabilize-controlflow-extra, r=dtolnay
b732d23 Stabilize `BufRead::skip_until`
eb2806b Auto merge of rust-lang#130157 - eduardosm:stabilize-const_float_classify, r=RalfJung
c822d33 update libc version
26b231b std::fs::get_path freebsd update.
1bd16cd Rollup merge of rust-lang#131197 - EFanZh:avoid-emptyness-check-in-peekmut-pop, r=Amanieu
8cfa0ca Avoid emptiness check in `PeekMut::pop`
86fa474 Rollup merge of rust-lang#131163 - JakenHerman:master, r=Nadrieril
6b57e57 Auto merge of rust-lang#128711 - clarfonthey:default-iters-hash, r=dtolnay
254af0b Add `get_line` confusable to `Stdin::read_line()`
f89b8dc impl Default for Hash{Map,Set} iterators that don't already have it
0c22ea8 Auto merge of rust-lang#127912 - joboet:tls_dtor_thread_current, r=cuviper
2b4f6ec Auto merge of rust-lang#131148 - Urgau:hashbrown-0.15, r=Amanieu
26013cd library: Stabilize `const_slice_first_last`
51ed903 library: Stabilize `const_unsafecell_get_mut`
cd6c1cc library: Stabilize `const_ptr_as_ref`
ecb0f03 library: Stabilize `const_str_as_mut`
78ad293 library: Stabilize `const_str_from_utf8_unchecked_mut`
db56087 std: make `thread::current` available in all `thread_local!` destructors
d5599a7 Rollup merge of rust-lang#131141 - RalfJung:mpmc-test, r=Amanieu
487946f Update hashbrown to 0.15 and adjust some methods
0d19119 mpmc doctest: make sure main thread waits for child threads
a7d53da Auto merge of rust-lang#130829 - Urgau:option_array_transpose, r=ibraheemdev
7c896fc Auto merge of rust-lang#128204 - GuillaumeGomez:integers-opti, r=workingjubilee
f19cac1 std: replace `LazyBox` with `OnceBox`
e2ebf04 Stabilize `const_slice_from_raw_parts_mut`
a575a8b Auto merge of rust-lang#131111 - matthiaskrgr:rollup-n6do187, r=matthiaskrgr
82e1372 Rollup merge of rust-lang#130773 - bjoernager:master, r=thomcc
b33d815 Rollup merge of rust-lang#130229 - RalfJung:ptr-offset-unsigned, r=scottmcm
bf40ab2 Implemented FromStr for CString and TryFrom<CString> for String
ea51d16 Stabilize `debug_more_non_exhaustive`
f8db877 update `Literal`'s intro
bcfd953 Auto merge of rust-lang#131098 - GuillaumeGomez:rollup-kk74was, r=GuillaumeGomez
3a8939e Rollup merge of rust-lang#131085 - RalfJung:miri-slow-test, r=tgross35
90d63b1 Auto merge of rust-lang#126839 - obeis:mpmc, r=Amanieu
4451aee Remove the need to provide the maximum number of digits to `impl_Display` macro
85c1cec Simplify `impl_Display` macro
c4be3da Small optimization for integers Display implementation
82014ee make test_lots_of_insertions test take less long in Miri
f688d7d Enable `f16` tests on non-GNU Windows
e97c379 Rollup merge of rust-lang#130966 - RalfJung:ptr-metadata-const-stable, r=scottmcm
e4d621e Rollup merge of rust-lang#130961 - tgross35:f16-x86-apple, r=thomcc
3c9808b Rollup merge of rust-lang#130914 - compiler-errors:insignificant-dtor, r=Amanieu
99e9853 Rollup merge of rust-lang#129638 - nickrum:wasip2-net, r=alexcrichton
e2a020e Add multi-producer, multi-consumer channel (mpmc)
cbc9e28 Port sort-research-rs test suite Rust stdlib tests
b362019 Rollup merge of rust-lang#130972 - RalfJung:const_cell_into_inner, r=dtolnay
109f270 Rollup merge of rust-lang#129003 - Voultapher:improve-ord-docs, r=workingjubilee
07542a5 Rollup merge of rust-lang#123932 - adamse:global-alloc-safety-preconds-positive, r=tgross35
2332c3d Rollup merge of rust-lang#130931 - GuillaumeGomez:standalone-crate, r=notriddle
faa018e Rename doctest attribute `standalone-crate` into `standalone_crate` for coherency
e36be64 Rollup merge of rust-lang#130743 - YohDeadfall:net-nonblocking-doc, r=Mark-Simulacrum
a31f882 Rollup merge of rust-lang#130416 - BatmanAoD:130122-sort-by-docs, r=Mark-Simulacrum
08ac3a0 Remove duplicate section
b4307a5 Auto merge of rust-lang#128321 - BatmanAoD:catch-unwind-doc-update, r=Mark-Simulacrum
9ae087c Fix std tests for wasm32-wasip2 target
b0cc902 Hook up std::net to wasi-libc on wasm32-wasip2 target
7311aa8 Auto merge of rust-lang#123778 - jhorstmann:optimize-upper-lower-auto-vectorization, r=the8472
c3d3d1a Enable `f16` tests on x86 Apple platforms
3aae770 Auto merge of rust-lang#129385 - tgross35:more-platforms-enable-f16, r=Mark-Simulacrum
2640736 Auto merge of rust-lang#130792 - tgross35:update-builtins, r=Amanieu
383f0de Rename `standalone` doctest attribute into `standalone-crate`
1f8a773 Update compiler_builtins to 0.1.130
7a5052a Rollup merge of rust-lang#128778 - RalfJung:atomic-read-read-races, r=Mark-Simulacrum
098ada1 Auto merge of rust-lang#130964 - matthiaskrgr:rollup-suriuub, r=matthiaskrgr
81fcbcd Further clarificarion for atomic and UnsafeCell docs:
e7c99a7 allow mixed-size atomic reads
addd05e atomics: allow atomic and non-atomic reads to race
b8c2a2a stabilize const_cell_into_inner
7946445 make ptr metadata functions callable from stable const fn
9f50f5a Auto merge of rust-lang#130897 - workingjubilee:dump-hexes-with-class, r=thomcc
e66058d Rollup merge of rust-lang#130922 - tyilo:udp-unspecified, r=ibraheemdev
1bd2532 Rollup merge of rust-lang#125404 - a1phyr:fix-read_buf-uses, r=workingjubilee
288b9ca Update Unicode escapes;
05590f7 Enable `f16` on platforms that were missing conversion symbols
3a00bff Auto merge of rust-lang#130946 - matthiaskrgr:rollup-ia4mf0y, r=matthiaskrgr
c2bd1e3 Rollup merge of rust-lang#130926 - ChrisDenton:cc-1-1-22, r=tgross35
7ddd566 Rollup merge of rust-lang#129087 - slanterns:option_get_or_insert_default, r=dtolnay
93916ed Mark some more smart pointers as insignificant
118d2e4 Mark some more types as having insignificant dtor
9b4776b Add 'from_ref' and 'from_mut' constructors to 'core::ptr::NonNull';
56523a9 Update Cargo.lock
aabd713 Apply review feedback
df28bde Apply round 1 of review comments
cb0529a Fix mistake in example
a9eb97b Improve Ord docs
04d9145 Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4
edc72ca Rollup merge of rust-lang#130892 - tgross35:library-cargo-update, r=Noratrieb
fdf84bf Rollup merge of rust-lang#130875 - folkertdev:naked-asm-bootstrap, r=tgross35
1b3f488 Rollup merge of rust-lang#130846 - ChrisDenton:revert-break, r=Noratrieb
89c9ef6 Rollup merge of rust-lang#130313 - c410-f3r:unlock-rfc-2011, r=thomcc
ea82a96 Rollup merge of rust-lang#130880 - RalfJung:const-hack, r=scottmcm
be1d9d6 Rollup merge of rust-lang#130861 - cuviper:sun-path-offset, r=ibraheemdev
c1c0a1b Rollup merge of rust-lang#130845 - RalfJung:utf8chunk, r=tgross35
805d196 Rollup merge of rust-lang#130279 - theemathas:manually-drop-docs, r=thomcc,traviscross
f40ec5a library: Compute `RUST_EXCEPTION_CLASS` from native-endian bytes
eae051b Partially update `library/Cargo.lock`
532cd85 Add `sun_path` to the fake doc `sockaddr_un`
f0660de add missing FIXME(const-hack)
0580e66 Add `[Option<T>; N]::transpose`
1341724 update `compiler_builtins` to `0.1.126`
cd704d4 add a bootstrap variant of `naked_asm`
a781a4a Stabilize the `map`/`value` methods on `ControlFlow`
ff45313 Use `&raw` in the standard library
3d03634 Use `mem::offset_of!` for `sockaddr_un.sun_path`
f50b2ba Rollup merge of rust-lang#130842 - Noratrieb:tracking-issue-inprogress, r=jieyouxu
c50befe Rollup merge of rust-lang#130832 - RalfJung:sort-cfg-mess, r=workingjubilee
d50c54a Rollup merge of rust-lang#130819 - bjoernager:char-must-use-len-utf, r=Noratrieb
811ce77 Rollup merge of rust-lang#130811 - RalfJung:random, r=joboet
275fb0e Revert Break into the debugger on panic (129019)
f560508 Utf8Chunks: add link to Utf8Chunk
8847429 Add tracking issue for io_error_inprogress
fa38b29 fix some cfg logic around optimize_for_size and 16-bit targets
b9ef35a Auto merge of rust-lang#130816 - matthiaskrgr:rollup-jy25phv, r=matthiaskrgr
e4f89ec Add 'must_use' attribute to 'char::len_utf8' and 'char::len_utf16';
bcb9d23 Rollup merge of rust-lang#130810 - kromych:master, r=workingjubilee
a5a32e2 Rollup merge of rust-lang#130595 - no1wudi:master, r=ibraheemdev
6a06555 Rollup merge of rust-lang#130549 - biabbas:riscv32_wrs_vxworks, r=nnethercote
f67efdd add link from random() helper fn to extensive DefaultRandomSource docs
4a7aeff Auto merge of rust-lang#130803 - cuviper:file-buffered, r=joshtriplett
54834b6 Don't trap into the debugger on panics under Linux
2c408b1 Rollup merge of rust-lang#130789 - aviramha:add_inprogress, r=Noratrieb
8849d13 Rollup merge of rust-lang#130788 - tgross35:memchr-pinning, r=Noratrieb,Mark-Simulacrum
2ab86f0 Add a tracking issue for `file_buffered`
963cefb Dogfood `feature(file_buffered)`
15d69c9 Pre-allocate buffers in `File::open_buffered` and `create_buffered`
eb07a61 Add `File::open_buffered` and `create_buffered`
92d5cef Auto merge of rust-lang#129587 - Voultapher:opt-for-size-variants-of-sort-impls, r=cuviper
c86f1ce add InProgress ErrorKind gated behind io_error_inprogress feature
6d8f5d8 Pin memchr to 2.5.0 in the library rather than rustc_ast
194bbc7 Auto merge of rust-lang#130738 - bjoernager:const-make-ascii, r=jhpratt
c47920f Initial std library support for NuttX
622d08c Mark and implement 'make_ascii_uppercase' and 'make_ascii_lowercase' in '[u8]' and 'str' as const;
668b21a Rollup merge of rust-lang#130762 - RalfJung:const_intrinsic_copy, r=dtolnay
43a4d34 Rollup merge of rust-lang#129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomez
57557c9 Add a comment to `Read::read_buf`
4a11249 Add tests
f342675 Fix `io::default_read_to_end` uses of `read_buf`
57f279d Fix `io::BufReader` uses of `read_buf`
8472204 Fix `io::Take::read_buf`
db0f337 stabilize const_intrinsic_copy
27136c4 Add fast path for ascii to ascii in str::replace
fc983ba Fix up standard library intro
6d41b99 Clarifications for set_nonblocking methods
f5406a5 Improve autovectorization of to_lowercase / to_uppercase functions
bab810c random: add tracking issue, address other comments
849258c std: switch to faster random sources on macOS and most BSDs
a095a76 std: implement the `random` feature
ba6158c Rollup merge of rust-lang#130723 - D0liphin:master, r=workingjubilee
776d9ef Rollup merge of rust-lang#130713 - bjoernager:const-char-make-ascii, r=Noratrieb
337c634 Rollup merge of rust-lang#130659 - bjoernager:const-char-encode-utf16, r=dtolnay
8ffc170 Rollup merge of rust-lang#129550 - kornelski:boxasstr, r=joshtriplett,dtolnay
a28cdff Reformat using the new identifier sorting from rustfmt
07a62f4 reword edge-conditions documentation on all slice 'sort' functions; resolves rust-lang#130122
9bcb2d9 Add test for `available_parallelism()`
474b9af Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'u8' as const; Rename 'const_char_make_ascii' feature gate to 'const_make_ascii';
b3d4fde Rollup merge of rust-lang#130692 - RalfJung:result-flatten, r=Noratrieb
55becb0 Rollup merge of rust-lang#130670 - the8472:read-to-end-heuristics, r=ChrisDenton
202df81 Rollup merge of rust-lang#130658 - EqualMa:patch-1, r=scottmcm
9c26e05 Auto merge of rust-lang#130697 - bjoernager:const-char-make-ascii, r=dtolnay
36b115f Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'char' as const;
98aba66 make unstable Result::flatten a const fn
d098993 Rollup merge of rust-lang#130653 - RalfJung:result-abi-compat, r=traviscross
2953dee Rollup merge of rust-lang#130408 - okaneco:into_lossy_refactor, r=Noratrieb
94105e8 wait for two short reads before uncapping the max read size
dea467a Mark and implement 'char::encode_utf16' as const; Rewrite 'encode_utf16_raw';
49128a4 Fix docs of compare_bytes
db6427b ABI compatibility: mention Result guarantee
1632f8f Reword ManuallyDrop+Box interaction
4969ea8 Rollup merge of rust-lang#129718 - lolbinarycat:remove_dir-docs, r=Noratrieb
c11b3aa Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`
93f5e21 Auto merge of rust-lang#130631 - GuillaumeGomez:rollup-jpgy1iv, r=GuillaumeGomez
a7aac1e Remove double spaces
74935ec Rollup merge of rust-lang#130624 - theemathas:vec_as_non_null, r=Noratrieb
2c9a4e3 Rollup merge of rust-lang#130611 - bjoernager:const-char-encode-utf8, r=dtolnay
25ab8ef Rollup merge of rust-lang#130526 - eholk:pin-reborrow, r=compiler-errors
97c4937 Rollup merge of rust-lang#128209 - beetrees:no-macos-10.10, r=jieyouxu
3e5c662 Auto merge of rust-lang#124895 - obeis:static-mut-hidden-ref, r=compiler-errors
31d575b Add `Vec::as_non_null`
54e23b5 Address diagnostics regression for 'const_char_encode_utf8';
557a0b8 Allow unused unsafe for vxworks in alligned_malloc to resolve build errors
7ae6827 [Clippy] Remove final std paths for diagnostic item
7b1c5e8 Allow shortening reborrows
86240c7 Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque`
3394557 Rollup merge of rust-lang#130554 - ShE3py:unsupported-exitcode, r=Noratrieb
17b0e39 Rollup merge of rust-lang#130553 - GnomedDev:remove-clippy-paths, r=compiler-errors
64a5984 Rollup merge of rust-lang#128001 - Krappa322:master, r=scottmcm
81c4805 Add str.as_str() for easy dereferencing of Box<str>
4ea6b82 `pal::unsupported::process::ExitCode`: use an `u8` instead of a `bool`
cb771b2 [Clippy] Swap `open_options` to use diagnostic items instead of paths
04bd505 [Clippy] Swap `iter_over_hash_type` to use diagnostic items instead of paths
8147cf4 [Clippy] Swap `non_octal_unix_permissions` to use diagnostic item instead of path
1b0be2a [Clippy] Swap `unnecessary_owned_empty_strings` to use diagnostic item instead of path
9edfe1d [Clippy] Swap `manual_strip` to use diagnostic items instead of paths
995238c [Clippy] Swap `unnecessary_to_owned` to use diagnostic item instead of path
c1a4a69 [Clippy] Swap `instant_subtraction` to use diagnostic item instead of path
beaebb5 [Clippy] Swap `waker_clone_wake` to use diagnostic item instead of path
925c1c4 [Clippy] Swap `filter_map_bool_then` to use diagnostic item instead of path
7bc30a7 [Clippy] Swap `manual_while_let_some` to use diagnostic items instead of paths
08b676d [Clippy] Swap `repeat_vec_with_capacity` to use diagnostic item instead of path
b95bef0 [Clippy] Swap `VecArgs::hir` to use diagnostic items instead of paths
6906fa9 [Clippy] Swap `single_char_add_str`/`format_push_string` to use diagnostic items instead of paths
b2dc66e [Clippy] Swap `manual_main_separator_str` to use diagnostic item instead of path
a61b7b7 [Clippy] Swap `redundant_clone` to use diagnostic items instead of paths
3310a0b [Clippy] Swap `float_equality_without_abs` to use diagnostic items instead of paths
6ef72c4 [Clippy] Swap `option_as_ref_deref` to use diagnostic items instead of paths
b8c0c3b [Clippy] Swap `lines_filter_map_ok` to use a diagnostic item instead of path
116e527 [Clippy] Swap `map_entry` to use diagnostic items instead of paths
03ff0df Auto merge of rust-lang#130547 - workingjubilee:rollup-tw30khz, r=workingjubilee
6210ecb Auto merge of rust-lang#130511 - bjoernager:const-char-encode-utf8, r=dtolnay
ccb31b8 run `x.py fmt`
9510c76 remove feature attributes as const_maybe_uninit_as_mut_ptr is stabilized
c12546b stabilize `const_maybe_uninit_as_mut_ptr`
e94c080 Mark and implement 'char::encode_utf8' as const.
1509944 Rollup merge of rust-lang#130522 - GnomedDev:clippy-manual-retain-paths, r=compiler-errors
8a9576c Rollup merge of rust-lang#130513 - shekhirin:fs-write-doc-comment, r=cuviper
d53d48a Rollup merge of rust-lang#130487 - cuviper:min-llvm-18, r=nikic
f63c0c1 Rollup merge of rust-lang#130476 - workingjubilee:more-lazy-methods-take-2, r=Amanieu
09e36ad Rollup merge of rust-lang#129934 - ChrisDenton:remove-dir-all3, r=Amanieu
5480d57 Rollup merge of rust-lang#97524 - ibraheemdev:thread-raw, r=ibraheemdev
886fc13 Revert "Add a hack to prevent proc_macro misopt in CI"
56704d4 Begin experimental support for pin reborrowing
262a08b library: Call it really_init_mut to avoid name collisions
51023b5 library: Destabilize Lazy{Cell,Lock}::{force,deref}_mut
ff51d9f [Clippy] Swap `manual_retain` to use diagnostic items instead of paths
28695bf Auto merge of rust-lang#130497 - saethlin:alloc-zeroed-is-unstable, r=bjorn3
8f6ca5b Clarify docs for std::fs::File::write
b19bf06 Auto merge of rust-lang#129491 - StackOverflowExcept1on:master, r=m-ou-se
37eb770 Auto merge of rust-lang#129845 - scottmcm:redo-layout, r=Noratrieb
cc10a76 Take more advantage of the `isize::MAX` limit in `Layout`
d740b8d read_volatile __rust_no_alloc_shim_is_unstable in alloc_zeroed
c4fe01a add `Thread::{into_raw, from_raw}`
e65d8e8 Rollup merge of rust-lang#130481 - krtab:clamp_partial_ord, r=cuviper
f3a53b7 Auto merge of rust-lang#130483 - matthiaskrgr:rollup-q1r0g0y, r=matthiaskrgr
46a0aa8 Remove uneeded PartialOrd bound in cmp::Ord::clamp
c83fbfd Rollup merge of rust-lang#130467 - RalfJung:miri-sync, r=RalfJung
6893990 Rollup merge of rust-lang#129674 - matthewpipie:rc-arc-new-cyclic-in, r=dtolnay
a0f4a4b Implement ACP 429: add `Lazy{Cell,Lock}::get[_mut]` and `force_mut`
7505e29 Rollup merge of rust-lang#128535 - mmvanheusden:master, r=workingjubilee
8a5922f Auto merge of rust-lang#130145 - fee1-dead-contrib:repeatn, r=lcnr,workingjubilee
c15d489 Merge from rustc
e80d16c Rollup merge of rust-lang#130448 - alilleybrinker:master, r=workingjubilee
cd8a7af Update library/alloc/src/sync.rs
2819604 Auto merge of rust-lang#127633 - SamuelMarks:eq-exit-code, r=dtolnay
49a855d fix: Remove duplicate `LazyLock` example.
9af97fc Rollup merge of rust-lang#127879 - kornelski:bad-pointer-printf, r=workingjubilee
2c1bd02 Merge from rustc
fc9c900 Auto merge of rust-lang#130220 - RalfJung:float-classify, r=workingjubilee
35edcb6 update docs for `catch_unwind` & related funcs
ee67105 Rollup merge of rust-lang#130339 - CAD97:unwind-choice, r=dtolnay
f396849 simplify abort_unwind
b66efdd Rollup merge of rust-lang#129439 - okaneco:vec_string_lossy, r=Noratrieb
af73374 Rollup merge of rust-lang#130381 - workingjubilee:sometimes-code-really-is-self-descriptive, r=Noratrieb
524402a Rollup merge of rust-lang#130118 - RalfJung:unwrap_unchecked, r=Noratrieb
3dccb86 Rollup merge of rust-lang#129195 - RalfJung:const-mut-refs, r=fee1-dead
524a5e1 also stabilize const_refs_to_cell
29c8eef const_refs_to_cell: dont let mutable references sneak past the interior mutability check
5671193 stabilize const_mut_refs
085baa2 library: Compute Rust exception class from its string repr
fc53427 Rollup merge of rust-lang#130214 - RalfJung:zeroed, r=Mark-Simulacrum
0e7d343 Rollup merge of rust-lang#130061 - theemathas:box_vec_non_null, r=MarkSimulacrum,workingjubilee
09f1d40 Rollup merge of rust-lang#130042 - lolbinarycat:bufreaker_peek_eof, r=Amanieu
0fd6e23 Add tracking issue number for `box_vec_non_null`
d38c59a Rollup merge of rust-lang#130290 - passcod:stabilise-entry-insert, r=ChrisDenton
96b5b7c Rollup merge of rust-lang#130268 - RalfJung:simd-shuffle-idx-vector, r=compiler-errors
79d937d simd_shuffle: require index argument to be a vector
857ad22 Rollup merge of rust-lang#130053 - glowcoil:next_if-docs, r=jhpratt
9c71d4e add std::panic::abort_unwind
91ebe06 add core::panic::abort_unwind
f30a0ad Merge from rustc
24fa8b9 Rustfmt
4f3d542 [`cfg_match`] Generalize inputs
80f8aeb Fix awkward wording.
84d77be Address WaffleLapkin's comments
84da2fc Update tests for hidden references to mutable static
34e22e8 Rollup merge of rust-lang#130245 - RalfJung:miri-alloc-backtrace, r=Amanieu
ba73022 Stabilize entry_insert
283ce13 Auto merge of rust-lang#130281 - matthiaskrgr:rollup-1b2ibs8, r=matthiaskrgr
ac68273 Rollup merge of rust-lang#130101 - RalfJung:const-cleanup, r=fee1-dead
6695a56 Document subtleties of `ManuallyDrop`
1128894 Stabilize `const_float_classify`
0de0540 Auto merge of rust-lang#129992 - alexcrichton:update-compiler-builtins, r=tgross35
553ca3f also update the wrapping_ docs to use similar wording
27049a0 Rollup merge of rust-lang#130160 - Scripter17:fix-slice-first_mut-doc, r=Amanieu
03dedd9 Rollup merge of rust-lang#125060 - ChrisJefferson:pathbuf-doc, r=workingjubilee
abe63f6 simplify float::classify logic
34e4b6d Fixup docs for PathBuf
22ffa3d Expand PathBuf documentation
4afc77f Merge from rustc
5997b68 Auto merge of rust-lang#130183 - Marcondiro:unicode-16.0.0, r=Manishearth
60b4cf8 Rollup merge of rust-lang#130248 - nyurik:fix-129895, r=workingjubilee
136504a Rollup merge of rust-lang#130168 - juliusl:pr/fix-win-fs-change-time-links, r=ChrisDenton
e9cd33c Rollup merge of rust-lang#130077 - madsmtm:watchos-arm-unwind, r=workingjubilee
0ff8428 Rollup merge of rust-lang#129835 - RalfJung:float-tests, r=workingjubilee
15a8ea1 Rollup merge of rust-lang#129696 - RalfJung:stdarch, r=Amanieu
e977a44 Limit `libc::link` usage to `nto70` target only, not NTO OS
acd2526 various updates based on review
dbf585c make basic allocation functions track_caller in Miri for nicer backtraces
3e2ea2b chore: remove struct details
6ff27d2 Rollup merge of rust-lang#130207 - GrigorenkoPV:ERROR_CANT_RESOLVE_FILENAME, r=ChrisDenton
0a47644 Rollup merge of rust-lang#130206 - GrigorenkoPV:WSAEDQUOT, r=ChrisDenton
61a646b Rollup merge of rust-lang#129866 - root-goblin:patch-1, r=workingjubilee
bfe2669 docs: remove struct info
3c00ffa ptr::add/sub: these are *not* equivalent to offset(count as isize)
e8ddc86 update stdarch
a55bf34 MaybeUninit::zeroed: mention that padding is not zeroed
04c4ab4 clean up internal comments about float semantics
fc9b01f these tests seem to work fine on i586 these days
95de48b Auto merge of rust-lang#129403 - scottmcm:only-array-simd, r=compiler-errors
95f9af0 Clarify docs for std::collections
cc0044c Map `ERROR_CANT_RESOLVE_FILENAME` to `ErrorKind::FilesystemLoop`
fde9f6b Map `WSAEDQUOT` to `ErrorKind::FilesystemQuotaExceeded`
22c4e8e Auto merge of rust-lang#130025 - Urgau:missing_docs-expect, r=petrochenkov
0eb5d75 Bump unicode printable to version 16.0.0
17e1039 Bump unicode_data to version 16.0.0
4d5609f Auto merge of rust-lang#130179 - workingjubilee:rollup-l78cv44, r=workingjubilee
d9d3751 Ban non-array SIMD
7e4cfbc Rollup merge of rust-lang#130164 - RalfJung:const_ptr_as_ref, r=dtolnay
3fdbce0 Rollup merge of rust-lang#130146 - folkertdev:bootstrap-naked-asm, r=Amanieu
0bbb25d Rollup merge of rust-lang#130132 - sunshowers:illumos-sigsegv, r=Noratrieb
ec7fd8a Rollup merge of rust-lang#128316 - GrigorenkoPV:io_error_a_bit_more, r=dtolnay
237b11d Auto merge of rust-lang#129778 - RalfJung:interp-lossy-typed-copy, r=saethlin
b47535f chore: removing supporting links in favor of existing doc-comment style
b6f9e80 maint: update docs for change_time ext and doc links
f7b7aa3 Rollup merge of rust-lang#130154 - okaneco:stabilize_char_min, r=cuviper
5a87e4c Rollup merge of rust-lang#130067 - madsmtm:clean-up-fs-test, r=ChrisDenton
41cd571 move const fn with a null check into const_ptr_is_null gate
f28b1d1 move some const fn out of the const_ptr_as_ref feature
4b1440a Fix slice::first_mut docs pointer -> reference
2bc7f6c Stabilize `char::MIN`
d257159 fix UB in a test
931d271 Add missing `#[allow(missing_docs)]` on hack functions in alloc
4f77831 `RepeatN`: use MaybeUninit
0414a2e bootstrap `naked_asm!` for `compiler-builtins`
2582bbb Rollup merge of rust-lang#130115 - eduardosm:needless-returns-libs, r=workingjubilee
e8d9b85 Rollup merge of rust-lang#130107 - RalfJung:const-ptr-is-null, r=oli-obk
2e128a2 Rollup merge of rust-lang#130090 - RalfJung:result-copied, r=Noratrieb
2ee8304 Rollup merge of rust-lang#130087 - RalfJung:option-const-iter, r=workingjubilee
af9a77d [illumos] enable SIGSEGV handler to detect stack overflows
1b763fc remove const_slice_index annotations, it never had a feature gate anyway
9849587 add FIXME(const-hack)
565b336 move Option::unwrap_unchecked into const_option feature gate
f9a9560 Remove needless returns detected by clippy in libraries
cc4242b const: make ptr.is_null() stop execution on ambiguity
295946c Option, Result: put the &mut variants of 'copied' under the same feature as the '&' variants
4caabcd Auto merge of rust-lang#130002 - orlp:better-div-floor-ceil, r=thomcc
55f602f Auto merge of rust-lang#129019 - kromych:master, r=workingjubilee
84184ab Fix linking error when compiling for 32-bit watchOS
e954412 remove pointless rustc_const_unstable on trait impls
0dc4621 add some FIXME(const-hack)
796ae33 Auto merge of rust-lang#130091 - matthiaskrgr:rollup-kalu1cs, r=matthiaskrgr
64afc03 Rollup merge of rust-lang#130047 - ChrisDenton:win-dbghelp, r=wesleywiser
9448662 Rollup merge of rust-lang#130046 - RalfJung:const_str_as_mut, r=dtolnay
2feca1e Rollup merge of rust-lang#129555 - RalfJung:const_float_bits_conv, r=dtolnay
72723d7 make Result::copied unstably const
5011671 remove 'const' from 'Option::iter'
3a53537 str: make as_mut_ptr and as_bytes_mut unstably const
9469575 restate GlobalAlloc method safety preconditions in terms of what the caller has to do for greater clarity
ff7b661 Remove now redundant check in symlink_hard_link test
459f246 Add `NonNull` convenience methods to `Vec`
a2e7f8b Add `NonNull` convenience methods to `Box`
d1005f5 fix doc comments for Peekable::next_if(_eq)
a9cf084 Remove duplicate impl
7b61eea remove the Clone requirement
d6e859b Win: Add dbghelp to the list of import libraries
335236c properly handle EOF in BufReader::peek
b2d6fdd [library/std/src/process.rs] Remove `Eq` `derive`
678165e Break into the debugger (if attached) on panics (Windows, macOS, Linux, FreeBSD)
b947f0a better implementation of signed div_floor/ceil
355445b [library/std/src/process.rs] Update docstring with @joshtriplett's replacement text
0d4a80e Update compiler-builtins to 0.1.125
5446229 Use non-overlapping swap for inner heapsort loop
670630d Select tiny sorts for 16-bit platforms
cd3d6e8 Shrink heapsort further by combining sift_down loops
bea61da Drop bubble_sort
83938b9 Remove macOS 10.10 dynamic linker bug workaround
be2b964 Win: Open dir for sync access in remove_dir_all
a4c4e23 stabilize const_float_bits_conv
3a754b1 Improve documentation for <integer>::from_str_radix
24eca28 add new_cyclic_in for Arc
88d85a8 improve comments
3e677e3 fix new_cyclic_in for rc
7d4ef17 fix fmt
717e3aa Use simpler branchy swap logic in tiny merge sort
5fa71af add guarantee about remove_dir and remove_file error kinds
ea236f0 add new_cyclic_in for rc
ae57bdf Use last swap optimization in bubblesort
2fa330e Convert cfg blocks to cfg_if
f46fcfe Reduce code duplication by moving partition_lomuto_branchless_simple into quicksort module
1805c29 Add binary-size optimized variants for stable and unstable sort as well as select_nth_unstable
4bc6b1f Pass `fmt::Arguments` by reference to `PanicInfo` and `PanicMessage`
1339c1b Implement feature `string_from_utf8_lossy_owned`
9b21aa0 Document futility of printing temporary pointers
028104e Refer to other docs
e0fe4a7 Add unordered list with possible values for each const
84ea721 Format std::env::consts docstrings
7921401 stabilize `option_get_or_insert_default`
8744732 Partially stabilize `io_error_more`
79855bb [library/std/src/process.rs] `PartialEq` & `Eq` for `ExitCode`

git-subtree-dir: library
git-subtree-split: 771d77c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc CI-spurious-fail-msvc CI spurious failure: target env msvc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants