| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Fixes #67529
Fixes #67640
Fixes #67641
Fixes #67862
|
|
|
|
|
|
|
|
Promote references to constants instead of statics
r? @oli-obk
|
|
Don't require `allow_internal_unstable` unless `staged_api` is enabled.
#63770 changed `qualify_min_const_fn` to require `allow_internal_unstable` for *all* crates that used an unstable feature, regardless of whether `staged_api` was enabled or the `fn` that used that feature was stably const. In practice, this meant that every crate in the ecosystem that wanted to use nightly features added `#![feature(const_fn)]`, which skips `qualify_min_const_fn` entirely.
After this PR, crates that do not have `#![feature(staged_api)]` will only need to enable the feature they are interested in. For example, `#![feature(const_if_match)]` will be enough to enable `if` and `match` in constants. Crates with `staged_api` (e.g., `libstd`) require `#[allow_internal_unstable]` to be added to a function if it uses nightly features unless that function is also marked `#[rustc_const_unstable]`. This prevents proliferation of `#[allow_internal_unstable]` into functions that are not callable in a `const` context on stable.
r? @oli-obk (author of #63770)
cc @Centril
|
|
Clarify suggestion for E0013
Fixes https://github.com/rust-lang/rust/issues/68038.
|
|
This flag opts out of the min-const-fn checks entirely, which is usually
not what we want. The few cases where the flag is still necessary have
been annotated.
|
|
Unify output of "variant not found" errors
Fix #49566.
|
|
|
|
|
|
This also allows us to use the `const_eval` query again without causing cycles
|
|
|
|
expect `fn` after `const unsafe` / `const extern`
Fixes #68062
r? @estebank @petrochenkov
cc @Aaron1011
|
|
|
|
|
|
|
|
|
|
|
|
Introduce an option for disabling deduplication of diagnostics
With the intent of using it in UI tests (https://github.com/rust-lang/rust/pull/67122).
The option is boolean (`-Z deduplicate-diagnostics=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z deduplicate-diagnostics=no -Z deduplicate-diagnostics=yes` == `-Z deduplicate-diagnostics=yes`), so it can be set in a hierarchical way, e.g. UI testing infra may disable the deduplication by default with specific tests being able to enable it back.
|
|
|
|
Reverts part of #67676
|
|
This extends the invalid cases we catch in const prop to include
overflowing integer casts using the same machinery as the overflowing
binary and unary operation logic.
|
|
Resolve long compile times when evaluating always valid constants
This extends the existing logic which skips validating every integer or
floating point number type to also skip validating empty structs because
they are also trivially valid.
Fixes #67539
r? @oli-obk
cc @RalfJung @spastorino
|
|
Work around a resolve bug in const prop
r? @wesleywiser @anp
This isn't exposed right now, but further changes to rustc may start causing bugs without this.
|
|
This extends the existing logic which skips validating every integer or
floating point number type to also skip validating empty structs because
they are also trivially valid.
Fixes #67539
|
|
|
|
Use the correct type for static qualifs
Closes #67609
|
|
We only want to return specializations when `Reveal::All` is passed, not
when `Reveal::UserFacing` is. Resolving this fixes several issues with
the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization
passes.
Fixes #66901
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test the unleashed Miri
In particular, test what happens when we try to drop something. Cc https://github.com/rust-lang/const-eval/issues/17
r? @oli-obk
|
|
|
|
|
|
`description` has been documented as soft-deprecated since 1.27.0 (17
months ago). There is no longer any reason to call it or implement it.
This commit:
- adds #[rustc_deprecated(since = "1.41.0")] to Error::description;
- moves description (and cause, which is also deprecated) below the
source and backtrace methods in the Error trait;
- reduces documentation of description and cause to take up much less
vertical real estate in rustdocs, while preserving the example that
shows how to render errors without needing to call description;
- removes the description function of all *currently unstable* Error
impls in the standard library;
- marks #[allow(deprecated)] the description function of all *stable*
Error impls in the standard library;
- replaces miscellaneous uses of description in example code and the
compiler.
|
|
Differentiate todo! and unimplemented!
This updates the panic message and docs to make it clear that `todo!` is for unfinished code and `unimplemented!` is for partial trait or enum impls.
r? @Centril
|
|
|
|
|
|
|
|
|
|
Ensure that evaluating or validating a constant never reads from a static
r? @RalfJung
as per https://github.com/rust-lang/rust/pull/66302#issuecomment-554663387
This does not yet address the fact that evaluation of a constant can read from a static (under unleash-miri)
|
|
|
|
Fix ICE in mir interpretation
Indices from the end start at 1 so you can immediately subtract them from the length to get the index instead of having to do an additional `-1`. Kinda documented in https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/enum.ProjectionElem.html#variant.ConstantIndex
|
|
Require const stability attributes on intrinsics to be able to use them in constant contexts
r? @Centril
finally fixes #61495
cc @RalfJung
|
|
|