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
771d77c7cfa Rollup merge of rust-lang#132495 - Houtamelo:remove_unintended_link, r=jieyouxu
d99f3cfc04b Rollup merge of rust-lang#132493 - Houtamelo:doc_type-ref_html-tag, r=jieyouxu
e24475c97e0 Rollup merge of rust-lang#132482 - lukas-code:stab-attrs, r=Noratrieb
21e23b81a3a Rollup merge of rust-lang#132398 - krtab:add_doc_link, r=Noratrieb
64e247223a8 Remove unintended link
166cea20be8 Fix type reference in documents which was being confused with html tags.
cab478ae96f fix some stability annotations
ecd55b1fa47 Rollup merge of rust-lang#132459 - RalfJung:byte_sub_ptr, r=scottmcm
3cd2636d62e Rollup merge of rust-lang#132455 - RalfJung:const_alloc_layout, r=dtolnay
8fdd6d4ceca Rollup merge of rust-lang#132451 - RalfJung:less-rustc_allow_const_fn_unstable, r=tgross35
9f63901f152 Rollup merge of rust-lang#132445 - RalfJung:const-unchecked-shifts, r=tgross35
2b0a6ddf113 Rollup merge of rust-lang#132413 - lolbinarycat:offset_of_nested-docs, r=workingjubilee
c80bb77d125 offset_from / sub_ptr docs: emphasize that pointers must be in the same allocation
861009d737b feat(byte_sub_ptr): add ptr::byte_sub_ptr
f4e1fa3d8b7 make const_alloc_layout feature gate only about functions that are already stable
bf19bdab420 unchecked_shifts, unchecked_neg are safe-to-const-expose-on-stable, so we can get rid of a bunch of attributes
ebf7505acaa remove some unnecessary rustc_allow_const_fn_unstable
36cfa4e5e34 Auto merge of rust-lang#132206 - tgross35:update-builtins, r=wesleywiser
4283f78c3d6 use semantic line break
a4b391601ce update offset_of! docs to reflect the stablization of nesting
f0634f0e84d Add intra-doc link in str::xxx_char_boundary
5d892fb876e Remove do_not_const_check from Iterator methods
93839e7405e Add intra-doc link in str::xxx_prefix
8c0bdb3e115 Auto merge of rust-lang#132238 - Urgau:midpoint-i64-hackers-impl, r=joboet
9b9ea35b918 Auto merge of rust-lang#132326 - matthiaskrgr:rollup-ngyw18g, r=matthiaskrgr
94dd5c6224c Rollup merge of rust-lang#132321 - betrusted-io:xous/fix-rustc_const_stable-attribute, r=joboet
eb2e4208c5c Auto merge of rust-lang#132231 - lukas-code:rc-plug-leaks, r=tgross35
ed1a265dec3 xous: sync: remove `rustc_const_stable` attribute
6495896aefb Rollup merge of rust-lang#132270 - yakiimoninja:fs-truncate-docs, r=Noratrieb
057f9e91003 Rollup merge of rust-lang#132233 - WaffleLapkin:box-module-split, r=workingjubilee
d0a99e723de Rollup merge of rust-lang#131520 - zachs18:const-str-split, r=Noratrieb
e134006be99 Auto merge of rust-lang#132277 - workingjubilee:rollup-5e6q6e4, r=workingjubilee
a1b88a08f16 Auto merge of rust-lang#128985 - GrigorenkoPV:instantly-dangling-pointer, r=Urgau
9318ae3e6ad Rc destructor: tweak inlining
3a686cd946e Split `boxed.rs` into a few modules
7be29e92b87 Rollup merge of rust-lang#131441 - SpriteOvO:proc-macro-to-tokens-trait, r=dtolnay
d56ef5ac6af clarified std::fs truncate doc
b0248e22287 Auto merge of rust-lang#132145 - RalfJung:stdarch, r=Amanieu
191aa709931 clarified doc for `std::fs::OpenOptions.truncate()`
a5aa408646d New lint: `dangling_pointers_from_temporaries`
8cdb783b8a6 Rollup merge of rust-lang#131391 - ChaiTRex:isqrt, r=scottmcm,tgross35
4f4a6c641ca we can now enable the 'const stable fn must be stable' check
79c45bee82c bump stdarch
848fcd56c9e Auto merge of rust-lang#132251 - jieyouxu:rollup-mtv9mpd, r=jieyouxu
e2122609dc1 Auto merge of rust-lang#132200 - Mark-Simulacrum:strengthen-cross-lang, r=RalfJung
ac1ec5f65d3 Support `char::is_digit` in const contexts
b534a028f5a Use Hacker's Delight impl in `i64::midpoint` instead of wide `i128` impl
28223bdba1d Rc/Arc: don't leak the allocation if drop panics
5d8140df6fa add test for panicking drop in Box/Rc/Arc
cde6279ea2f Auto merge of rust-lang#131284 - dingxiangfei2009:rename-smart-ptr-to-coerce-referent, r=compiler-errors
c6676830322 Auto merge of rust-lang#132191 - Urgau:midpoint_signed_towards_zero, r=dtolnay
80f0aa3a99b Add a new trait `proc_macro::ToTokens`
3cfffb8c0ae Update compiler-builtins to 0.1.136
45d8393ddaf Auto merge of rust-lang#131715 - tgross35:add-const_sockaddr_setters, r=Amanieu
ec7694203d1 Make clearer that guarantees in ABI compatibility are for Rust only
139f6325aad Add test for all midpoint expectations
4612afa48e0 Round negative signed integer towards zero in `iN::midpoint`
06b5c8eae1b Rollup merge of rust-lang#132019 - daboross:document-partialeq-oncelock, r=Mark-Simulacrum
658e70932b5 Auto merge of rust-lang#131349 - RalfJung:const-stability-checks, r=compiler-errors
db3b9fca1c0 Rollup merge of rust-lang#132137 - RalfJung:behavior, r=Noratrieb
6daffe4709d get rid of the internal unlikely macro
d2ff6a20074 Re-do recursive const stability checks
295b932be95 library: consistently use American spelling for 'behavior'
2348c065b0e Rollup merge of rust-lang#131457 - kpreid:fnaddr, r=dtolnay
2da7b7f12dc Auto merge of rust-lang#132121 - workingjubilee:rollup-yrtn33e, r=workingjubilee
5cf142bc64b Rollup merge of rust-lang#132113 - LaihoE:pattern_as_utf8_default_impl, r=workingjubilee
1f2f88e41ef Rollup merge of rust-lang#132101 - youknowone:thread_local-gyneiene, r=tgross35
6c8134047be Rollup merge of rust-lang#132048 - mustartt:aix-random-impl, r=workingjubilee
980e5a2d181 Rollup merge of rust-lang#131851 - sunshowers:musl-posix, r=workingjubilee
d25ee97a2b8 Avoid use imports in thread_local_inner! in statik
b4ea08d88cf Auto merge of rust-lang#132116 - matthiaskrgr:rollup-3a0ia4r, r=matthiaskrgr
0ae2951e1b0 Rollup merge of rust-lang#131790 - nmathewson:doc_socketaddr_representation, r=tgross35
8baae66df74 Auto merge of rust-lang#131985 - compiler-errors:const-pred, r=fee1-dead
115a851440e provide default impl for as_utf8_pattern
a92f55cd463 Auto merge of rust-lang#123550 - GnomedDev:remove-initial-arc, r=Noratrieb
c9460bfe499 Document textual format of SocketAddrV{4,6}
78f4ed38d1d Remove associated type based effects logic
21eb2c297f0 [musl] use posix_spawn if a directory change was requested
03798ad0818 Rollup merge of rust-lang#130225 - adetaylor:rename-old-receiver, r=wesleywiser
a45e03057ba Rollup merge of rust-lang#132066 - tifv:ptr-docs-typo, r=Amanieu
927edad8409 Rollup merge of rust-lang#132065 - tifv:dangling-docs, r=Noratrieb
ded2a0afac4 Rollup merge of rust-lang#132060 - joshtriplett:innermost-outermost, r=jieyouxu
e62b2cc663d Rollup merge of rust-lang#132039 - a1phyr:vecdeque_read_exact, r=Noratrieb
76e75ae973e Rollup merge of rust-lang#130991 - LaihoE:vectorized_slice_contains, r=Noratrieb
6799f8562be const fn str::split_at*
887bcf653d8 const fn str::is_char_boundary
01ed719bad8 vectorized SliceContains
1bb8bdeeb98 s/SmartPointer/CoerceReferent/g
843347f94b4 fix a typo in documentation of pointer::sub_ptr()
10f64a79d36 fix documentation of ptr::dangling() function
728a8d71d08 "innermost", "outermost", "leftmost", and "rightmost" don't need hyphens
282790f75ad Specialize `read_exact` and `read_buf_exact` for `VecDeque`
054b256111a Rollup merge of rust-lang#132031 - slanterns:rc_default, r=ibraheemdev
05b4955be28 Rollup merge of rust-lang#131707 - clarfonthey:constify-core-tests, r=thomcc
b0fc9c793f3 Auto merge of rust-lang#131929 - LaihoE:replace_default_capacity, r=joboet
5c416b4572c AIX use /dev/urandom for impl
09e26cb1460 better default capacity for str::replace
3a5e669fcdb Rename Receiver -> LegacyReceiver
224a60d32db refactor `Arc<T>::default`
fe5101d2303 optimize `Rc<T>::default`
507193aaae8 Rollup merge of rust-lang#131697 - ShE3py:rt-arg-lifetimes, r=Amanieu
61fa53e24a6 Document PartialEq impl for OnceLock
2e8dd5b1116 Rollup merge of rust-lang#132003 - RalfJung:abi-compat-docs, r=traviscross
7f91dbe9922 Rollup merge of rust-lang#130350 - RalfJung:strict-provenance, r=dtolnay
8499ec3da71 update ABI compatibility docs for new option-like rules
6d2a4371f48 move strict provenance lints to new feature gate, remove old feature gates
446117163a5 stabilize Strict Provenance and Exposed Provenance
e2b2c3aac1a fix docs
20ed6b56971 replace FindFirstFileW with FindFirstFileExW and apply optimization
a065b8ecafd replace FindFirstFileW with FindFirstFileExW and regenerate bindings
362aec6e09b Auto merge of rust-lang#131948 - matthiaskrgr:rollup-c9rvzu6, r=matthiaskrgr
7628c4ff550 Rollup merge of rust-lang#131921 - klensy:statx_all, r=ChrisDenton
affe042b2cf Rollup merge of rust-lang#131772 - GnomedDev:remove-proc_macro-todo, r=petrochenkov
5615efc263a Auto merge of rust-lang#131907 - saethlin:update-compiler-builtins, r=tgross35
b6b2903e331 Update `compiler-builtins` to 0.1.134
b714f9d7b4f Rollup merge of rust-lang#131919 - RalfJung:zero-sized-accesses, r=jhpratt
fb670790503 Rollup merge of rust-lang#131890 - printfn:precise-capturing-docs, r=traviscross
642ab07d02b Rollup merge of rust-lang#127462 - Ayush1325:uefi-env, r=joboet
bac38912a1e Remove the Arc rt::init allocation for thread info
85f6f48cb96 Auto merge of rust-lang#131816 - Zalathar:profiler-feature, r=Kobzol
f843b262131 replace STATX_ALL with (STATX_BASIC_STATS | STATX_BTIME) as former is deprecated
aabdd7d597b zero-sized accesses are fine on null pointers
ff3f33f0147 Update `use` keyword docs to describe precise capturing
c949985e896 std: uefi: Use common function for UEFI shell
f973e62ee09 std: uefi: Add basic Env variables
63a4a9bf56a Auto merge of rust-lang#131895 - jieyouxu:rollup-jyt3pic, r=jieyouxu
39ccfc9cfbb Rollup merge of rust-lang#126207 - devnexen:stack_overflow_libc_upd, r=joboet
e08bce6edbf Auto merge of rust-lang#131841 - paulmenage:futex-abstraction, r=joboet
eba461cd50a Rollup merge of rust-lang#131866 - jieyouxu:thread_local, r=jhpratt
80bbaa966ed Rollup merge of rust-lang#131858 - AnthonyMikh:AnthonyMikh/repeat_n-is-not-that-special-anymore, r=jhpratt
5ec2cbcf4b0 Rollup merge of rust-lang#131809 - collinoc:fix-retain-mut-docs, r=jhpratt
fe19eb64d14 Rollup merge of rust-lang#131774 - thesummer:rtems-add-getentropy, r=joboet
fca737550f7 Rollup merge of rust-lang#130136 - GKFX:stabilize-const-pin, r=dtolnay
07aaa64759c Add entropy source for RTEMS
1b957f4cc95 Rollup merge of rust-lang#131850 - lexeyOK:master, r=compiler-errors
a6871b84557 Rollup merge of rust-lang#131823 - thesummer:bump-libc-0.2.160, r=workingjubilee
848aed94cd3 Rollup merge of rust-lang#131654 - betrusted-io:xous-various-fixes, r=thomcc
a6e300e1fb6 Avoid shadowing user provided types or type aliases in `thread_local!`
a993e1de676 remove outdated documentation for `repeat_n`
4d2c9694483 Auto merge of rust-lang#131572 - cuviper:ub-index_range, r=thomcc
f905a0cd54e Bump libc to 0.2.161
beee93f748d std::unix::stack_overflow::drop_handler addressing todo through libc update
c8f71dc9d2d Missing parenthesis
01bce29cc5d Abstract the state type for futexes
0ab703c6d44 Rollup merge of rust-lang#131835 - ferrocene:amanjeev/add-missing-attribute-unwind, r=Noratrieb
bac74b68036 Rollup merge of rust-lang#131833 - c-ryan747:patch-1, r=Noratrieb
0d7c8897756 Auto merge of rust-lang#130223 - LaihoE:faster_str_replace, r=thomcc
34c8228660f Do not run test where it cannot run
d73f9242eab Add must_use to CommandExt::exec
aa027e9af5f Make `profiler_builtins` an optional dependency of sysroot, not std
019ad0cab75 Remove TODO in proc_macro now `const_refs_to_static` is stable
3b5d8a26f59 Fix predicate signatures in retain_mut docs
6c85d31157b Auto merge of rust-lang#131797 - matthiaskrgr:rollup-lzpze2k, r=matthiaskrgr
3a5fdfc26a4 Partially stabilize const_pin
7caa6d2fa3f Rollup merge of rust-lang#131730 - zlfn:master, r=tgross35
1e13241be78 Auto merge of rust-lang#131792 - matthiaskrgr:rollup-480nwg4, r=matthiaskrgr
1581f568688 Rollup merge of rust-lang#130822 - bjoernager:non-null-from-ref, r=dtolnay
f7b3231ad4c Auto merge of rust-lang#131767 - cuviper:bump-stage0, r=Mark-Simulacrum
cdbd127ce77 Rollup merge of rust-lang#131746 - slanterns:once_box_order, r=joboet
6f3e65c5db7 Rollup merge of rust-lang#131712 - tgross35:const-lazy_cell_into_inner, r=joboet
151c0c71271 Auto merge of rust-lang#131460 - jwong101:default-placement-new, r=ibraheemdev
43f97fbcc51 update bootstrap configs
eae13d1eb36 replace placeholder version
e35d9fee2f0 relax a memory order in `once_box`
fbde7e89524 Rollup merge of rust-lang#131521 - jdonszelmann:rc, r=joboet
9d9ea42d6d4 Rollup merge of rust-lang#130568 - eduardosm:const-float-methods, r=RalfJung,tgross35
435ce04088a Rollup merge of rust-lang#129794 - Ayush1325:uefi-os-expand, r=joboet
bfd32fa365f Refactor `floating` macro and nofloat panic message
7d1457e2a77 Auto merge of rust-lang#131723 - matthiaskrgr:rollup-krcslig, r=matthiaskrgr
148ed853756 Rename debug! macro to impl_Debug!
db2efb0ff0e Combine impl_int and impl_uint
1897d05bfa1 Make some float methods unstable `const fn`
76342d9978a Auto merge of rust-lang#131724 - matthiaskrgr:rollup-ntgkkk8, r=matthiaskrgr
da7ca2278ec Rollup merge of rust-lang#131706 - GKFX:fix-const-hacks, r=tgross35
54072ab6186 Rollup merge of rust-lang#131496 - bjoernager:const-make-ascii, r=dtolnay
1695b0a8e47 Rollup merge of rust-lang#130608 - YohDeadfall:cstr-from-into-str, r=workingjubilee
f1ee2cd79c7 Rollup merge of rust-lang#131339 - HeroicKatora:set_ptr_value-documentation, r=Mark-Simulacrum
ffc4a6cb394 Rollup merge of rust-lang#122670 - beetrees:non-unicode-option-env-error, r=compiler-errors
cc7730e1264 Auto merge of rust-lang#129458 - EnzymeAD:enzyme-frontend, r=jieyouxu
eeab9d49651 Stabilise 'const_make_ascii'
ec0b0dff72c Add a `const_sockaddr_setters` feature
e7884100078 Mark LazyCell::into_inner unstably const
acaf7e2e9ab Run most core::num tests in const context too
63f38366fb6 Fix two const-hacks
34d920c1aa6 `rt::Argument`: elide lifetimes
ecb3830a8b2 Rollup merge of rust-lang#131384 - saethlin:precondition-tests, r=ibraheemdev
ea7a0c646f4 Rollup merge of rust-lang#129424 - coolreader18:stabilize-pin_as_deref_mut, r=dtolnay
843c9e98097 Auto merge of rust-lang#131672 - matthiaskrgr:rollup-gyzysj4, r=matthiaskrgr
3b92996e629 uefi: Implement getcwd and chdir
8d35aa977cc Rollup merge of rust-lang#131616 - RalfJung:const_ip, r=tgross35
b6cfaeb1239 Rollup merge of rust-lang#131274 - workingjubilee:stabilize-the-one-that-got-away, r=scottmcm
6d8235e8adb Rollup merge of rust-lang#130629 - Dirbaio:net-from-octets, r=tgross35
88634c8310a Rollup merge of rust-lang#128967 - devnexen:get_path_fbsd_upd, r=joboet
d6318f3817a Auto merge of rust-lang#126557 - GrigorenkoPV:vec_track_caller, r=joboet
d11e388017f Auto merge of rust-lang#131662 - matthiaskrgr:rollup-r1wkfxw, r=matthiaskrgr
089c495282b rename rcbox in other places as per review comments
2cfa6d06db7 core/net: use hex for ipv6 doctests for consistency.
9ae0e8bcfaf core/net: add Ipv[46]Addr::from_octets, Ipv6Addr::from_segments
da6c63c5a39 Rollup merge of rust-lang#131646 - RalfJung:unix-miri-fallbacks, r=joboet
87ea4bb9c12 Rollup merge of rust-lang#131644 - RalfJung:win-miri, r=joboet
928b99c635c library: xous: mark alloc as `FIXME(static_mut_refs)`
dde2ff0ebe8 xous: ffi: correct syscall number for adjust_process
c3955e47308 net: fix dead code warning
3919c4f32a0 std: xous: add support for args and env
9c1e16259db Auto merge of rust-lang#125679 - clarfonthey:escape_ascii, r=joboet
262c3fb4d69 unwind: update unwinding dependency to 0.2.3
4c6374963e6 sys/unix: add comments for some Miri fallbacks
e3f701c4b40 remove outdated comment now that Miri is on CI
e2c210e67f8 sys/windows: remove miri hack that is only needed for win7
1799481f55c switch unicode-data back to 'static'
ddfd2ea502a merge const_ipv4 / const_ipv6 feature gate into 'ip' feature gate
b6c03764111 Rollup merge of rust-lang#131418 - coolreader18:wasm-exc-use-stdarch, r=bjorn3
1ee9b69f828 Rollup merge of rust-lang#131120 - tgross35:stabilize-const_option, r=RalfJung
6fc4b1a9f8b Fix bug where `option_env!` would return `None` when env var is present but not valid Unicode
d72915fce78 Fix typo thing->thin referring to pointer
a2d85a1f8b8 Stabilize `const_option`
4a9ad4ac8cc Rollup merge of rust-lang#131617 - RalfJung:const_cow_is_borrowed, r=tgross35
113c6c093fa Rollup merge of rust-lang#131503 - theemathas:stdin_read_line_docs, r=Mark-Simulacrum
7a515952c92 remove const_cow_is_borrowed feature gate
7420c36fae4 Rollup merge of rust-lang#131233 - joboet:stdout-before-main, r=tgross35
08e7188f626 Rollup merge of rust-lang#130954 - workingjubilee:stabilize-const-mut-fn, r=RalfJung
3febfb34f55 std: fix stdout-before-main
3b820ee5e01 library: Stabilize `const_replace`
ee21064fde0 library: Stabilize `const_ptr_write`
36ff2c84d56 library: Stabilize `const_intrinsic_forget`
4f124de46bd Rollup merge of rust-lang#131289 - RalfJung:duration_consts_float, r=tgross35
de76914d8c6 Rollup merge of rust-lang#130962 - nyurik:opts-libs, r=cuviper
76ce3a99e3a Rollup merge of rust-lang#124874 - jedbrown:float-mul-add-fast, r=saethlin
de18ce14fb9 Avoid superfluous UB checks in `IndexRange`
eb8ff202d9e Rollup merge of rust-lang#131463 - bjoernager:const-char-encode-utf8, r=RalfJung
964c91b858a Rollup merge of rust-lang#131287 - RalfJung:const_result, r=tgross35
a8b0950a043 Rollup merge of rust-lang#131109 - tgross35:stabilize-debug_more_non_exhaustive, r=joboet
637b5152fc6 Rollup merge of rust-lang#131065 - Voultapher:port-sort-test-suite, r=thomcc
eeb881dee88 intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics
2b6b22cebab Single commit implementing the enzyme/autodiff frontend
00785c0149e stabilize const_result
12b80281dcd stabilize duration_consts_float
c8d357c99d6 Rollup merge of rust-lang#131512 - j7nw4r:master, r=jhpratt
34f7831c7de rename RcBox in other places too
cd0a8f50855 rename RcBox to RcInner for consistency
dd6dd70c0fd Fixing rustDoc for LayoutError.
7fdd5455da9 Rollup merge of rust-lang#130741 - mrkajetanp:detect-b16b16, r=Amanieu
77f7b2fe97e Rollup merge of rust-lang#130538 - ultrabear:ultrabear_const_from_ref, r=workingjubilee
fca091985c1 More clearly document Stdin::read_line
e4a9064e4d6 Stabilise 'const_char_encode_utf8';
8547f513811 allocate before calling T::default in <Arc<T>>::default()
669e25597c8 allocate before calling T::default in <Box<T>>::default()
5ef6f834a52 rustc_target: Add sme-b16b16 as an explicit aarch64 target feature
74264e37655 stdarch: Bump stdarch submodule
a5529ee2982 Clean up is_aligned_and_not_null
db5a9a7f814 Add more precondition check tests
528dda2686f Allow zero-size reads/writes on null pointers
86c75265bd5 Optimize escape_ascii
36a90d74101 Rollup merge of rust-lang#131462 - cuviper:open_buffered-error, r=RalfJung
49220cd15f1 Rollup merge of rust-lang#131449 - nickrum:wasip2-net-decouple-fd, r=alexcrichton
ff37c087e49 Rollup merge of rust-lang#131383 - AngelicosPhosphoros:better_doc_for_slice_slicing_at_ends, r=cuviper
136ec3ace84 Rollup merge of rust-lang#130827 - fmease:library-mv-obj-save-dyn-compat, r=ibraheemdev
8cdea8c34b0 Add "not guaranteed to be equal"
db9377d33aa Mention allocation errors for `open_buffered`
7e225fa8a49 Apply suggestions from code review
0ce4f76a7d5 Expand `ptr::fn_addr_eq()` documentation.
885e3d14d82 Library: Rename "object safe" to "dyn compatible"
5f495eef33c Decouple WASIp2 sockets from WasiFd
78670fb644f stabilize `{slice,array}::from_mut`
7153288b527 Update library/std/src/sys/pal/unix/process/process_vxworks.rs
cd0d5be2726 fix ref in process_vxworks.rs
01e7f5f97b1 Update library/std/src/sys/pal/unix/process/process_unix.rs
fbb514cbba3 Change a few `&Option<T>` into `Option<&T>`
cc1e8b56f8f Use throw intrinsic from stdarch in wasm libunwind
bc755bb5124 Stabilize Pin::as_deref_mut
fcc990d33eb Stabilize `isqrt` feature
b946b83a26a Add docs about slicing slices at the ends
9ca739e65a6 cfg out checks in add and sub but not offset
8293e745abb Add precondition checks to ptr::offset, ptr::add, ptr::sub
c65244c638a Rollup merge of rust-lang#131308 - mati865:gnullvm-f16-f128, r=tgross35
6a809c73fad Rollup merge of rust-lang#128399 - mammothbane:master, r=Amanieu,tgross35
723693ef035 liballoc: introduce String, Vec const-slicing
fee7e5e4dbb Auto merge of rust-lang#128651 - folkertdev:naked-asm-macro-v2, r=Amanieu
61eff8fd543 Expand set_ptr_value / with_metadata_of docs
7c3b7e72f68 Rollup merge of rust-lang#131335 - dacianpascu06:fix-typo, r=joboet
8e3076e7875 Rollup merge of rust-lang#131307 - YohDeadfall:prctl-set-name-dbg-assert, r=workingjubilee
b8c51a660a1 grammar fix
4ca50c3c94a disallow `asm!` in `#[naked]` functions
cc09cb0dfa4 implement `naked_asm` macro
dbb22815a85 Rollup merge of rust-lang#131316 - programmerjake:patch-4, r=Noratrieb
4b276e63ed9 Auto merge of rust-lang#131314 - tgross35:update-builtins, r=tgross35
5dc3e7cf205 Fix typo in primitive_docs.rs
686d25dc005 Auto merge of rust-lang#130540 - veera-sivarajan:fix-87525, r=estebank
9555c10cffb Update `compiler-builtins` to 0.1.133
0f71b38a203 enable f16 and f128 on windows-gnullvm targets
d14d771cf46 Auto merge of rust-lang#131302 - matthiaskrgr:rollup-56kbpzx, r=matthiaskrgr
b8dd44198e9 Android: Debug assertion after setting thread name
fcd199dec5f Rollup merge of rust-lang#131281 - RalfJung:const-cell, r=Amanieu
71aa514ef59 Auto merge of rust-lang#131221 - XrXr:bump-compiler-builtins, r=tgross35
b7c90c62514 library: Stabilize const `MaybeUninit::assume_init_mut`
0418d546ad5 Add a Lint for Pointer to Integer Transmutes in Consts
460459d3c24 Rollup merge of rust-lang#131256 - RalfJung:f16-f128-const, r=ibraheemdev
a818a4dfa97 Rollup merge of rust-lang#131094 - joboet:lazy_once_box, r=ibraheemdev
2ed62821f6a make Cell unstably const
575391b7daf move f16/f128 const fn under f16/f128 feature gate
b3da4ed72f7 Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk`
bbe8bf7f827 Rollup merge of rust-lang#131267 - okaneco:bufread_skip_until, r=tgross35
65049d1b3a2 Rollup merge of rust-lang#131105 - slanterns:literal_c_str, r=petrochenkov
7001dd5a296 Rollup merge of rust-lang#130403 - eduardosm:stabilize-const_slice_from_raw_parts_mut, r=workingjubilee
0f43ffb1b78 Update compiler-builtins to 0.1.132
7d4319e623c Rollup merge of rust-lang#131177 - workingjubilee:stabilize-const-mut-referees, r=tgross35
67093076d45 Rollup merge of rust-lang#130518 - scottmcm:stabilize-controlflow-extra, r=dtolnay
b732d237348 Stabilize `BufRead::skip_until`
eb2806b2450 Auto merge of rust-lang#130157 - eduardosm:stabilize-const_float_classify, r=RalfJung
c822d330b90 update libc version
26b231be7ab std::fs::get_path freebsd update.
1bd16cdc12d Rollup merge of rust-lang#131197 - EFanZh:avoid-emptyness-check-in-peekmut-pop, r=Amanieu
8cfa0cad753 Avoid emptiness check in `PeekMut::pop`
86fa4749d71 Rollup merge of rust-lang#131163 - JakenHerman:master, r=Nadrieril
6b57e57feb7 Auto merge of rust-lang#128711 - clarfonthey:default-iters-hash, r=dtolnay
254af0b5676 Add `get_line` confusable to `Stdin::read_line()`
f89b8dc4085 impl Default for Hash{Map,Set} iterators that don't already have it
0c22ea874b0 Auto merge of rust-lang#127912 - joboet:tls_dtor_thread_current, r=cuviper
2b4f6ec1c62 Auto merge of rust-lang#131148 - Urgau:hashbrown-0.15, r=Amanieu
26013cd95f9 library: Stabilize `const_slice_first_last`
51ed903979b library: Stabilize `const_unsafecell_get_mut`
cd6c1cc10b9 library: Stabilize `const_ptr_as_ref`
ecb0f03e4e2 library: Stabilize `const_str_as_mut`
78ad293f3b4 library: Stabilize `const_str_from_utf8_unchecked_mut`
db56087d227 std: make `thread::current` available in all `thread_local!` destructors
d5599a7e273 Rollup merge of rust-lang#131141 - RalfJung:mpmc-test, r=Amanieu
487946f8cef Update hashbrown to 0.15 and adjust some methods
0d191198a22 mpmc doctest: make sure main thread waits for child threads
a7d53dad608 Auto merge of rust-lang#130829 - Urgau:option_array_transpose, r=ibraheemdev
7c896fc637d Auto merge of rust-lang#128204 - GuillaumeGomez:integers-opti, r=workingjubilee
f19cac15d11 std: replace `LazyBox` with `OnceBox`
e2ebf0447a4 Stabilize `const_slice_from_raw_parts_mut`
a575a8b0d73 Auto merge of rust-lang#131111 - matthiaskrgr:rollup-n6do187, r=matthiaskrgr
82e1372c75b Rollup merge of rust-lang#130773 - bjoernager:master, r=thomcc
b33d815cbba Rollup merge of rust-lang#130229 - RalfJung:ptr-offset-unsigned, r=scottmcm
bf40ab27b3b Implemented FromStr for CString and TryFrom<CString> for String
ea51d16d7c0 Stabilize `debug_more_non_exhaustive`
f8db8779429 update `Literal`'s intro
bcfd953c29e Auto merge of rust-lang#131098 - GuillaumeGomez:rollup-kk74was, r=GuillaumeGomez
3a8939e2d3c Rollup merge of rust-lang#131085 - RalfJung:miri-slow-test, r=tgross35
90d63b16b5c Auto merge of rust-lang#126839 - obeis:mpmc, r=Amanieu
4451aeededb Remove the need to provide the maximum number of digits to `impl_Display` macro
85c1cec695e Simplify `impl_Display` macro
c4be3da8440 Small optimization for integers Display implementation
82014ee9988 make test_lots_of_insertions test take less long in Miri
f688d7d81d0 Enable `f16` tests on non-GNU Windows
e97c379df19 Rollup merge of rust-lang#130966 - RalfJung:ptr-metadata-const-stable, r=scottmcm
e4d621e29b6 Rollup merge of rust-lang#130961 - tgross35:f16-x86-apple, r=thomcc
3c9808bdfcf Rollup merge of rust-lang#130914 - compiler-errors:insignificant-dtor, r=Amanieu
99e98538bb5 Rollup merge of rust-lang#129638 - nickrum:wasip2-net, r=alexcrichton
e2a020e6863 Add multi-producer, multi-consumer channel (mpmc)
cbc9e287756 Port sort-research-rs test suite Rust stdlib tests
b36201981bc Rollup merge of rust-lang#130972 - RalfJung:const_cell_into_inner, r=dtolnay
109f2701e8b Rollup merge of rust-lang#129003 - Voultapher:improve-ord-docs, r=workingjubilee
07542a5c170 Rollup merge of rust-lang#123932 - adamse:global-alloc-safety-preconds-positive, r=tgross35
2332c3d1a72 Rollup merge of rust-lang#130931 - GuillaumeGomez:standalone-crate, r=notriddle
faa018ecfa8 Rename doctest attribute `standalone-crate` into `standalone_crate` for coherency
e36be64bdf1 Rollup merge of rust-lang#130743 - YohDeadfall:net-nonblocking-doc, r=Mark-Simulacrum
a31f8828ccc Rollup merge of rust-lang#130416 - BatmanAoD:130122-sort-by-docs, r=Mark-Simulacrum
08ac3a03cfd Remove duplicate section
b4307a53105 Auto merge of rust-lang#128321 - BatmanAoD:catch-unwind-doc-update, r=Mark-Simulacrum
9ae087ce909 Fix std tests for wasm32-wasip2 target
b0cc90202cd Hook up std::net to wasi-libc on wasm32-wasip2 target
7311aa8d2c7 Auto merge of rust-lang#123778 - jhorstmann:optimize-upper-lower-auto-vectorization, r=the8472
c3d3d1a1216 Enable `f16` tests on x86 Apple platforms
3aae77071a0 Auto merge of rust-lang#129385 - tgross35:more-platforms-enable-f16, r=Mark-Simulacrum
26407360225 Auto merge of rust-lang#130792 - tgross35:update-builtins, r=Amanieu
383f0def784 Rename `standalone` doctest attribute into `standalone-crate`
1f8a7736596 Update compiler_builtins to 0.1.130
7a5052a8ef7 Rollup merge of rust-lang#128778 - RalfJung:atomic-read-read-races, r=Mark-Simulacrum
098ada160f7 Auto merge of rust-lang#130964 - matthiaskrgr:rollup-suriuub, r=matthiaskrgr
81fcbcd76e6 Further clarificarion for atomic and UnsafeCell docs:
e7c99a7ec72 allow mixed-size atomic reads
addd05ec29a atomics: allow atomic and non-atomic reads to race
b8c2a2a31e9 stabilize const_cell_into_inner
7946445e4ab make ptr metadata functions callable from stable const fn
9f50f5ab7e1 Auto merge of rust-lang#130897 - workingjubilee:dump-hexes-with-class, r=thomcc
e66058d77a1 Rollup merge of rust-lang#130922 - tyilo:udp-unspecified, r=ibraheemdev
1bd2532dc81 Rollup merge of rust-lang#125404 - a1phyr:fix-read_buf-uses, r=workingjubilee
288b9ca02b0 Update Unicode escapes;
05590f7156d Enable `f16` on platforms that were missing conversion symbols
3a00bff8352 Auto merge of rust-lang#130946 - matthiaskrgr:rollup-ia4mf0y, r=matthiaskrgr
c2bd1e39c40 Rollup merge of rust-lang#130926 - ChrisDenton:cc-1-1-22, r=tgross35
7ddd56672f4 Rollup merge of rust-lang#129087 - slanterns:option_get_or_insert_default, r=dtolnay
93916ed57b0 Mark some more smart pointers as insignificant
118d2e4c7dc Mark some more types as having insignificant dtor
9b4776b272b Add 'from_ref' and 'from_mut' constructors to 'core::ptr::NonNull';
56523a9df37 Update Cargo.lock
aabd713b24b Apply review feedback
df28bde6c18 Apply round 1 of review comments
cb0529a1e28 Fix mistake in example
a9eb97b8682 Improve Ord docs
04d91457f81 Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4
edc72ca4a4b Rollup merge of rust-lang#130892 - tgross35:library-cargo-update, r=Noratrieb
fdf84bfd56d Rollup merge of rust-lang#130875 - folkertdev:naked-asm-bootstrap, r=tgross35
1b3f488a588 Rollup merge of rust-lang#130846 - ChrisDenton:revert-break, r=Noratrieb
89c9ef65418 Rollup merge of rust-lang#130313 - c410-f3r:unlock-rfc-2011, r=thomcc
ea82a9668f4 Rollup merge of rust-lang#130880 - RalfJung:const-hack, r=scottmcm
be1d9d67900 Rollup merge of rust-lang#130861 - cuviper:sun-path-offset, r=ibraheemdev
c1c0a1b5a4d Rollup merge of rust-lang#130845 - RalfJung:utf8chunk, r=tgross35
805d196d6a7 Rollup merge of rust-lang#130279 - theemathas:manually-drop-docs, r=thomcc,traviscross
f40ec5aecf4 library: Compute `RUST_EXCEPTION_CLASS` from native-endian bytes
eae051bb5e2 Partially update `library/Cargo.lock`
532cd8551de Add `sun_path` to the fake doc `sockaddr_un`
f0660deaec1 add missing FIXME(const-hack)
0580e66c287 Add `[Option<T>; N]::transpose`
13417248b26 update `compiler_builtins` to `0.1.126`
cd704d4c632 add a bootstrap variant of `naked_asm`
a781a4a638a Stabilize the `map`/`value` methods on `ControlFlow`
ff453134135 Use `&raw` in the standard library
3d036345362 Use `mem::offset_of!` for `sockaddr_un.sun_path`
f50b2ba584d Rollup merge of rust-lang#130842 - Noratrieb:tracking-issue-inprogress, r=jieyouxu
c50befe9ea0 Rollup merge of rust-lang#130832 - RalfJung:sort-cfg-mess, r=workingjubilee
d50c54a1171 Rollup merge of rust-lang#130819 - bjoernager:char-must-use-len-utf, r=Noratrieb
811ce7762b6 Rollup merge of rust-lang#130811 - RalfJung:random, r=joboet
275fb0eb691 Revert Break into the debugger on panic (129019)
f560508bef1 Utf8Chunks: add link to Utf8Chunk
88474293f4b Add tracking issue for io_error_inprogress
fa38b29687b fix some cfg logic around optimize_for_size and 16-bit targets
b9ef35a8f73 Auto merge of rust-lang#130816 - matthiaskrgr:rollup-jy25phv, r=matthiaskrgr
e4f89ece58f Add 'must_use' attribute to 'char::len_utf8' and 'char::len_utf16';
bcb9d2385d9 Rollup merge of rust-lang#130810 - kromych:master, r=workingjubilee
a5a32e2c8f0 Rollup merge of rust-lang#130595 - no1wudi:master, r=ibraheemdev
6a06555427f Rollup merge of rust-lang#130549 - biabbas:riscv32_wrs_vxworks, r=nnethercote
f67efdd34d8 add link from random() helper fn to extensive DefaultRandomSource docs
4a7aeff64ec Auto merge of rust-lang#130803 - cuviper:file-buffered, r=joshtriplett
54834b6bae3 Don't trap into the debugger on panics under Linux
2c408b10a25 Rollup merge of rust-lang#130789 - aviramha:add_inprogress, r=Noratrieb
8849d13a2f0 Rollup merge of rust-lang#130788 - tgross35:memchr-pinning, r=Noratrieb,Mark-Simulacrum
2ab86f01c97 Add a tracking issue for `file_buffered`
963cefb2cd1 Dogfood `feature(file_buffered)`
15d69c9edf4 Pre-allocate buffers in `File::open_buffered` and `create_buffered`
eb07a61acf1 Add `File::open_buffered` and `create_buffered`
92d5cef2a6a Auto merge of rust-lang#129587 - Voultapher:opt-for-size-variants-of-sort-impls, r=cuviper
c86f1ce711b add InProgress ErrorKind gated behind io_error_inprogress feature
6d8f5d81b18 Pin memchr to 2.5.0 in the library rather than rustc_ast
194bbc77c56 Auto merge of rust-lang#130738 - bjoernager:const-make-ascii, r=jhpratt
c47920fa3a5 Initial std library support for NuttX
622d08c26df Mark and implement 'make_ascii_uppercase' and 'make_ascii_lowercase' in '[u8]' and 'str' as const;
668b21ae951 Rollup merge of rust-lang#130762 - RalfJung:const_intrinsic_copy, r=dtolnay
43a4d34efd2 Rollup merge of rust-lang#129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomez
57557c9629f Add a comment to `Read::read_buf`
4a11249c0f7 Add tests
f34267540ce Fix `io::default_read_to_end` uses of `read_buf`
57f279d91b7 Fix `io::BufReader` uses of `read_buf`
8472204d13e Fix `io::Take::read_buf`
db0f33788d6 stabilize const_intrinsic_copy
27136c4a376 Add fast path for ascii to ascii in str::replace
fc983bafafc Fix up standard library intro
6d41b99edf7 Clarifications for set_nonblocking methods
f5406a512b8 Improve autovectorization of to_lowercase / to_uppercase functions
bab810c740a random: add tracking issue, address other comments
849258c77c2 std: switch to faster random sources on macOS and most BSDs
a095a76d3a7 std: implement the `random` feature
ba6158c689b Rollup merge of rust-lang#130723 - D0liphin:master, r=workingjubilee
776d9eff4dc Rollup merge of rust-lang#130713 - bjoernager:const-char-make-ascii, r=Noratrieb
337c634511c Rollup merge of rust-lang#130659 - bjoernager:const-char-encode-utf16, r=dtolnay
8ffc1707657 Rollup merge of rust-lang#129550 - kornelski:boxasstr, r=joshtriplett,dtolnay
a28cdffc73b Reformat using the new identifier sorting from rustfmt
07a62f42f5d reword edge-conditions documentation on all slice 'sort' functions; resolves rust-lang#130122
9bcb2d9551e Add test for `available_parallelism()`
474b9af1e61 Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'u8' as const; Rename 'const_char_make_ascii' feature gate to 'const_make_ascii';
b3d4fde409e Rollup merge of rust-lang#130692 - RalfJung:result-flatten, r=Noratrieb
55becb00610 Rollup merge of rust-lang#130670 - the8472:read-to-end-heuristics, r=ChrisDenton
202df818d33 Rollup merge of rust-lang#130658 - EqualMa:patch-1, r=scottmcm
9c26e05665e Auto merge of rust-lang#130697 - bjoernager:const-char-make-ascii, r=dtolnay
36b115fba8d Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'char' as const;
98aba66e96e make unstable Result::flatten a const fn
d0989933442 Rollup merge of rust-lang#130653 - RalfJung:result-abi-compat, r=traviscross
2953dee0e23 Rollup merge of rust-lang#130408 - okaneco:into_lossy_refactor, r=Noratrieb
94105e87d4f wait for two short reads before uncapping the max read size
dea467af191 Mark and implement 'char::encode_utf16' as const; Rewrite 'encode_utf16_raw';
49128a49622 Fix docs of compare_bytes
db6427b456d ABI compatibility: mention Result guarantee
1632f8f88e8 Reword ManuallyDrop+Box interaction
4969ea81953 Rollup merge of rust-lang#129718 - lolbinarycat:remove_dir-docs, r=Noratrieb
c11b3aa4a78 Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`
93f5e21e0f0 Auto merge of rust-lang#130631 - GuillaumeGomez:rollup-jpgy1iv, r=GuillaumeGomez
a7aac1ef4d2 Remove double spaces
74935ec3185 Rollup merge of rust-lang#130624 - theemathas:vec_as_non_null, r=Noratrieb
2c9a4e3f2b2 Rollup merge of rust-lang#130611 - bjoernager:const-char-encode-utf8, r=dtolnay
25ab8efde9f Rollup merge of rust-lang#130526 - eholk:pin-reborrow, r=compiler-errors
97c4937a933 Rollup merge of rust-lang#128209 - beetrees:no-macos-10.10, r=jieyouxu
3e5c662a8b4 Auto merge of rust-lang#124895 - obeis:static-mut-hidden-ref, r=compiler-errors
31d575bd5a0 Add `Vec::as_non_null`
54e23b5d765 Address diagnostics regression for 'const_char_encode_utf8';
557a0b8ac2e Allow unused unsafe for vxworks in alligned_malloc to resolve build errors
7ae682789c0 [Clippy] Remove final std paths for diagnostic item
7b1c5e87b84 Allow shortening reborrows
86240c7ca53 Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque`
33945576c22 Rollup merge of rust-lang#130554 - ShE3py:unsupported-exitcode, r=Noratrieb
17b0e39d3a9 Rollup merge of rust-lang#130553 - GnomedDev:remove-clippy-paths, r=compiler-errors
64a59842bb1 Rollup merge of rust-lang#128001 - Krappa322:master, r=scottmcm
81c4805e8ad Add str.as_str() for easy dereferencing of Box<str>
4ea6b8269c5 `pal::unsupported::process::ExitCode`: use an `u8` instead of a `bool`
cb771b22bc6 [Clippy] Swap `open_options` to use diagnostic items instead of paths
04bd505e545 [Clippy] Swap `iter_over_hash_type` to use diagnostic items instead of paths
8147cf45a26 [Clippy] Swap `non_octal_unix_permissions` to use diagnostic item instead of path
1b0be2aa317 [Clippy] Swap `unnecessary_owned_empty_strings` to use diagnostic item instead of path
9edfe1dc97f [Clippy] Swap `manual_strip` to use diagnostic items instead of paths
995238ce3f5 [Clippy] Swap `unnecessary_to_owned` to use diagnostic item instead of path
c1a4a69d65a [Clippy] Swap `instant_subtraction` to use diagnostic item instead of path
beaebb53af0 [Clippy] Swap `waker_clone_wake` to use diagnostic item instead of path
925c1c4ffc8 [Clippy] Swap `filter_map_bool_then` to use diagnostic item instead of path
7bc30a7e0d1 [Clippy] Swap `manual_while_let_some` to use diagnostic items instead of paths
08b676d07d8 [Clippy] Swap `repeat_vec_with_capacity` to use diagnostic item instead of path
b95bef03da4 [Clippy] Swap `VecArgs::hir` to use diagnostic items instead of paths
6906fa9d9f5 [Clippy] Swap `single_char_add_str`/`format_push_string` to use diagnostic items instead of paths
b2dc66e63fe [Clippy] Swap `manual_main_separator_str` to use diagnostic item instead of path
a61b7b74edc [Clippy] Swap `redundant_clone` to use diagnostic items instead of paths
3310a0ba289 [Clippy] Swap `float_equality_without_abs` to use diagnostic items instead of paths
6ef72c4aead [Clippy] Swap `option_as_ref_deref` to use diagnostic items instead of paths
b8c0c3b59d6 [Clippy] Swap `lines_filter_map_ok` to use a diagnostic item instead of path
116e527af29 [Clippy] Swap `map_entry` to use diagnostic items instead of paths
03ff0df4056 Auto merge of rust-lang#130547 - workingjubilee:rollup-tw30khz, r=workingjubilee
6210ecb4fdb Auto merge of rust-lang#130511 - bjoernager:const-char-encode-utf8, r=dtolnay
ccb31b838d9 run `x.py fmt`
9510c7695c8 remove feature attributes as const_maybe_uninit_as_mut_ptr is stabilized
c12546bbad7 stabilize `const_maybe_uninit_as_mut_ptr`
e94c0809293 Mark and implement 'char::encode_utf8' as const.
150994417ab Rollup merge of rust-lang#130522 - GnomedDev:clippy-manual-retain-paths, r=compiler-errors
8a9576c7fe5 Rollup merge of rust-lang#130513 - shekhirin:fs-write-doc-comment, r=cuviper
d53d48a35c6 Rollup merge of rust-lang#130487 - cuviper:min-llvm-18, r=nikic
f63c0c181dc Rollup merge of rust-lang#130476 - workingjubilee:more-lazy-methods-take-2, r=Amanieu
09e36adc31d Rollup merge of rust-lang#129934 - ChrisDenton:remove-dir-all3, r=Amanieu
5480d57c571 Rollup merge of rust-lang#97524 - ibraheemdev:thread-raw, r=ibraheemdev
886fc13b4a6 Revert "Add a hack to prevent proc_macro misopt in CI"
56704d424c8 Begin experimental support for pin reborrowing
262a08b3220 library: Call it really_init_mut to avoid name collisions
51023b58e9b library: Destabilize Lazy{Cell,Lock}::{force,deref}_mut
ff51d9fe674 [Clippy] Swap `manual_retain` to use diagnostic items instead of paths
28695bfc395 Auto merge of rust-lang#130497 - saethlin:alloc-zeroed-is-unstable, r=bjorn3
8f6ca5b3867 Clarify docs for std::fs::File::write
b19bf06090d Auto merge of rust-lang#129491 - StackOverflowExcept1on:master, r=m-ou-se
37eb770d8c1 Auto merge of rust-lang#129845 - scottmcm:redo-layout, r=Noratrieb
cc10a764910 Take more advantage of the `isize::MAX` limit in `Layout`
d740b8d22b1 read_volatile __rust_no_alloc_shim_is_unstable in alloc_zeroed
c4fe01a6b27 add `Thread::{into_raw, from_raw}`
e65d8e8dfef Rollup merge of rust-lang#130481 - krtab:clamp_partial_ord, r=cuviper
f3a53b7c4de Auto merge of rust-lang#130483 - matthiaskrgr:rollup-q1r0g0y, r=matthiaskrgr
46a0aa844f2 Remove uneeded PartialOrd bound in cmp::Ord::clamp
c83fbfd2017 Rollup merge of rust-lang#130467 - RalfJung:miri-sync, r=RalfJung
6893990b5ba Rollup merge of rust-lang#129674 - matthewpipie:rc-arc-new-cyclic-in, r=dtolnay
a0f4a4b3281 Implement ACP 429: add `Lazy{Cell,Lock}::get[_mut]` and `force_mut`
7505e2956ba Rollup merge of rust-lang#128535 - mmvanheusden:master, r=workingjubilee
8a5922fb084 Auto merge of rust-lang#130145 - fee1-dead-contrib:repeatn, r=lcnr,workingjubilee
c15d489d04d Merge from rustc
e80d16cdf1e Rollup merge of rust-lang#130448 - alilleybrinker:master, r=workingjubilee
cd8a7af7d0e Update library/alloc/src/sync.rs
2819604711d Auto merge of rust-lang#127633 - SamuelMarks:eq-exit-code, r=dtolnay
49a855dba5e fix: Remove duplicate `LazyLock` example.
9af97fc0a10 Rollup merge of rust-lang#127879 - kornelski:bad-pointer-printf, r=workingjubilee
2c1bd02a09a Merge from rustc
fc9c9009d26 Auto merge of rust-lang#130220 - RalfJung:float-classify, r=workingjubilee
35edcb6461b update docs for `catch_unwind` & related funcs
ee67105e0ae Rollup merge of rust-lang#130339 - CAD97:unwind-choice, r=dtolnay
f3968493684 simplify abort_unwind
b66efddccf2 Rollup merge of rust-lang#129439 - okaneco:vec_string_lossy, r=Noratrieb
af73374905e Rollup merge of rust-lang#130381 - workingjubilee:sometimes-code-really-is-self-descriptive, r=Noratrieb
524402a0fd4 Rollup merge of rust-lang#130118 - RalfJung:unwrap_unchecked, r=Noratrieb
3dccb864068 Rollup merge of rust-lang#129195 - RalfJung:const-mut-refs, r=fee1-dead
524a5e14330 also stabilize const_refs_to_cell
29c8eef74ff const_refs_to_cell: dont let mutable references sneak past the interior mutability check
5671193598c stabilize const_mut_refs
085baa2b96e library: Compute Rust exception class from its string repr
fc53427da98 Rollup merge of rust-lang#130214 - RalfJung:zeroed, r=Mark-Simulacrum
0e7d343962e Rollup merge of rust-lang#130061 - theemathas:box_vec_non_null, r=MarkSimulacrum,workingjubilee
09f1d40a239 Rollup merge of rust-lang#130042 - lolbinarycat:bufreaker_peek_eof, r=Amanieu
0fd6e237ada Add tracking issue number for `box_vec_non_null`
d38c59a2454 Rollup merge of rust-lang#130290 - passcod:stabilise-entry-insert, r=ChrisDenton
96b5b7cd3e6 Rollup merge of rust-lang#130268 - RalfJung:simd-shuffle-idx-vector, r=compiler-errors
79d937d0854 simd_shuffle: require index argument to be a vector
857ad2299b8 Rollup merge of rust-lang#130053 - glowcoil:next_if-docs, r=jhpratt
9c71d4ed0a3 add std::panic::abort_unwind
91ebe065a2b add core::panic::abort_unwind
f30a0ad1f84 Merge from rustc
24fa8b92d38 Rustfmt
4f3d542db01 [`cfg_match`] Generalize inputs
80f8aeb7458 Fix awkward wording.
84d77befb81 Address WaffleLapkin's comments
84da2fc1d77 Update tests for hidden references to mutable static
34e22e80c1a Rollup merge of rust-lang#130245 - RalfJung:miri-alloc-backtrace, r=Amanieu
ba7302270d3 Stabilize entry_insert
283ce13a8f1 Auto merge of rust-lang#130281 - matthiaskrgr:rollup-1b2ibs8, r=matthiaskrgr
ac68273ba0c Rollup merge of rust-lang#130101 - RalfJung:const-cleanup, r=fee1-dead
6695a568f5b Document subtleties of `ManuallyDrop`
1128894f6c8 Stabilize `const_float_classify`
0de05400c79 Auto merge of rust-lang#129992 - alexcrichton:update-compiler-builtins, r=tgross35
553ca3f0eda also update the wrapping_ docs to use similar wording
27049a03ee5 Rollup merge of rust-lang#130160 - Scripter17:fix-slice-first_mut-doc, r=Amanieu
03dedd99fd9 Rollup merge of rust-lang#125060 - ChrisJefferson:pathbuf-doc, r=workingjubilee
abe63f65a04 simplify float::classify logic
34e4b6d8f7e Fixup docs for PathBuf
22ffa3d384f Expand PathBuf documentation
4afc77fbbde Merge from rustc
5997b68ff2a Auto merge of rust-lang#130183 - Marcondiro:unicode-16.0.0, r=Manishearth
60b4cf8f49c Rollup merge of rust-lang#130248 - nyurik:fix-129895, r=workingjubilee
136504a6163 Rollup merge of rust-lang#130168 - juliusl:pr/fix-win-fs-change-time-links, r=ChrisDenton
e9cd33cba20 Rollup merge of rust-lang#130077 - madsmtm:watchos-arm-unwind, r=workingjubilee
0ff84286245 Rollup merge of rust-lang#129835 - RalfJung:float-tests, r=workingjubilee
15a8ea1b299 Rollup merge of rust-lang#129696 - RalfJung:stdarch, r=Amanieu
e977a4483e4 Limit `libc::link` usage to `nto70` target only, not NTO OS
acd25269596 various updates based on review
dbf585c158e make basic allocation functions track_caller in Miri for nicer backtraces
3e2ea2b035a chore: remove struct details
6ff27d2d309 Rollup merge of rust-lang#130207 - GrigorenkoPV:ERROR_CANT_RESOLVE_FILENAME, r=ChrisDenton
0a476447a26 Rollup merge of rust-lang#130206 - GrigorenkoPV:WSAEDQUOT, r=ChrisDenton
61a646bcf16 Rollup merge of rust-lang#129866 - root-goblin:patch-1, r=workingjubilee
bfe2669a142 docs: remove struct info
3c00ffabf46 ptr::add/sub: these are *not* equivalent to offset(count as isize)
e8ddc864cb7 update stdarch
a55bf34b421 MaybeUninit::zeroed: mention that padding is not zeroed
04c4ab4a2a1 clean up internal comments about float semantics
fc9b01ff3b2 these tests seem to work fine on i586 these days
95de48b8208 Auto merge of rust-lang#129403 - scottmcm:only-array-simd, r=compiler-errors
95f9af09fc2 Clarify docs for std::collections
cc0044c5077 Map `ERROR_CANT_RESOLVE_FILENAME` to `ErrorKind::FilesystemLoop`
fde9f6bb823 Map `WSAEDQUOT` to `ErrorKind::FilesystemQuotaExceeded`
22c4e8e02e4 Auto merge of rust-lang#130025 - Urgau:missing_docs-expect, r=petrochenkov
0eb5d756238 Bump unicode printable to version 16.0.0
17e1039b09f Bump unicode_data to version 16.0.0
4d5609fc793 Auto merge of rust-lang#130179 - workingjubilee:rollup-l78cv44, r=workingjubilee
d9d37510b85 Ban non-array SIMD
7e4cfbc077d Rollup merge of rust-lang#130164 - RalfJung:const_ptr_as_ref, r=dtolnay
3fdbce0f3f5 Rollup merge of rust-lang#130146 - folkertdev:bootstrap-naked-asm, r=Amanieu
0bbb25df201 Rollup merge of rust-lang#130132 - sunshowers:illumos-sigsegv, r=Noratrieb
ec7fd8a79b5 Rollup merge of rust-lang#128316 - GrigorenkoPV:io_error_a_bit_more, r=dtolnay
237b11d4e77 Auto merge of rust-lang#129778 - RalfJung:interp-lossy-typed-copy, r=saethlin
b47535f9562 chore: removing supporting links in favor of existing doc-comment style
b6f9e80a922 maint: update docs for change_time ext and doc links
f7b7aa3dce4 Rollup merge of rust-lang#130154 - okaneco:stabilize_char_min, r=cuviper
5a87e4c04c5 Rollup merge of rust-lang#130067 - madsmtm:clean-up-fs-test, r=ChrisDenton
41cd5712d57 move const fn with a null check into const_ptr_is_null gate
f28b1d1f142 move some const fn out of the const_ptr_as_ref feature
4b1440a98ef Fix slice::first_mut docs pointer -> reference
2bc7f6c8ae7 Stabilize `char::MIN`
d2571591f4f fix UB in a test
931d271b035 Add missing `#[allow(missing_docs)]` on hack functions in alloc
4f7783143b7 `RepeatN`: use MaybeUninit
0414a2efc72 bootstrap `naked_asm!` for `compiler-builtins`
2582bbb06c7 Rollup merge of rust-lang#130115 - eduardosm:needless-returns-libs, r=workingjubilee
e8d9b858f36 Rollup merge of rust-lang#130107 - RalfJung:const-ptr-is-null, r=oli-obk
2e128a21428 Rollup merge of rust-lang#130090 - RalfJung:result-copied, r=Noratrieb
2ee8304535b Rollup merge of rust-lang#130087 - RalfJung:option-const-iter, r=workingjubilee
af9a77d0661 [illumos] enable SIGSEGV handler to detect stack overflows
1b763fc2428 remove const_slice_index annotations, it never had a feature gate anyway
9849587e9b4 add FIXME(const-hack)
565b336d144 move Option::unwrap_unchecked into const_option feature gate
f9a9560c597 Remove needless returns detected by clippy in libraries
cc4242b209f const: make ptr.is_null() stop execution on ambiguity
295946c6c1a Option, Result: put the &mut variants of 'copied' under the same feature as the '&' variants
4caabcd5cea Auto merge of rust-lang#130002 - orlp:better-div-floor-ceil, r=thomcc
55f602f895a Auto merge of rust-lang#129019 - kromych:master, r=workingjubilee
84184ab6ba4 Fix linking error when compiling for 32-bit watchOS
e954412fd46 remove pointless rustc_const_unstable on trait impls
0dc4621c3ac add some FIXME(const-hack)
796ae33b0c9 Auto merge of rust-lang#130091 - matthiaskrgr:rollup-kalu1cs, r=matthiaskrgr
64afc032b5d Rollup merge of rust-lang#130047 - ChrisDenton:win-dbghelp, r=wesleywiser
944866225f4 Rollup merge of rust-lang#130046 - RalfJung:const_str_as_mut, r=dtolnay
2feca1e6134 Rollup merge of rust-lang#129555 - RalfJung:const_float_bits_conv, r=dtolnay
72723d7cc0d make Result::copied unstably const
50116718108 remove 'const' from 'Option::iter'
3a535378088 str: make as_mut_ptr and as_bytes_mut unstably const
9469575a168 restate GlobalAlloc method safety preconditions in terms of what the caller has to do for greater clarity
ff7b66117b7 Remove now redundant check in symlink_hard_link test
459f246405d Add `NonNull` convenience methods to `Vec`
a2e7f8b53ee Add `NonNull` convenience methods to `Box`
d1005f501ee fix doc comments for Peekable::next_if(_eq)
a9cf084c94a Remove duplicate impl
7b61eea4f31 remove the Clone requirement
d6e859b240e Win: Add dbghelp to the list of import libraries
335236cb011 properly handle EOF in BufReader::peek
b2d6fdd4d85 [library/std/src/process.rs] Remove `Eq` `derive`
678165efe80 Break into the debugger (if attached) on panics (Windows, macOS, Linux, FreeBSD)
b947f0a81ef better implementation of signed div_floor/ceil
355445b0261 [library/std/src/process.rs] Update docstring with @joshtriplett's replacement text
0d4a80eaee3 Update compiler-builtins to 0.1.125
5446229e7af Use non-overlapping swap for inner heapsort loop
670630da181 Select tiny sorts for 16-bit platforms
cd3d6e88bc9 Shrink heapsort further by combining sift_down loops
bea61dafef2 Drop bubble_sort
83938b9ae3d Remove macOS 10.10 dynamic linker bug workaround
be2b964527c Win: Open dir for sync access in remove_dir_all
a4c4e236c17 stabilize const_float_bits_conv
3a754b1b94e Improve documentation for <integer>::from_str_radix
24eca285951 add new_cyclic_in for Arc
88d85a8c068 improve comments
3e677e3f79a fix new_cyclic_in for rc
7d4ef1728c0 fix fmt
717e3aa5f1f Use simpler branchy swap logic in tiny merge sort
5fa71afdd50 add guarantee about remove_dir and remove_file error kinds
ea236f07aef add new_cyclic_in for rc
ae57bdf05e4 Use last swap optimization in bubblesort
2fa330eeddd Convert cfg blocks to cfg_if
f46fcfed644 Reduce code duplication by moving partition_lomuto_branchless_simple into quicksort module
1805c29ca12 Add binary-size optimized variants for stable and unstable sort as well as select_nth_unstable
4bc6b1fd2a5 Pass `fmt::Arguments` by reference to `PanicInfo` and `PanicMessage`
1339c1bf0a9 Implement feature `string_from_utf8_lossy_owned`
9b21aa05574 Document futility of printing temporary pointers
028104e3bde Refer to other docs
e0fe4a7ca28 Add unordered list with possible values for each const
84ea721e3d5 Format std::env::consts docstrings
7921401d1ae stabilize `option_get_or_insert_default`
8744732f3ed Partially stabilize `io_error_more`
79855bb9ba4 [library/std/src/process.rs] `PartialEq` & `Eq` for `ExitCode`

git-subtree-dir: library
git-subtree-split: 771d77c7cfa8e2f4169cdea50fb879c4f91ff4c9
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