| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
messages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Clean up some diagnostics by making them more consistent
In general:
- Diagnostic should start with a lowercase letter.
- Diagnostics should not end with a full stop.
- Ellipses contain three dots.
- Backticks should encode Rust code.
I also reworded a couple of messages to make them read more clearly.
It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics.
r? @Centril
|
|
unevaluated consts
which requires a lot of unnecessary work to evaluate them further down the line.
|
|
|
|
|
|
|
|
This also allows us to use the `const_eval` query again without causing cycles
|
|
|
|
|
|
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
|
|
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
|
|
|
|
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
|
|
|
|
Require const stability attributes on intrinsics to be able to use them in constant contexts
r? @Centril
finally fixes #61495
cc @RalfJung
|
|
Rollup of 6 pull requests
Successful merges:
- #67148 ( Refactor type & bounds parsing thoroughly)
- #67410 (Reenable static linking of libstdc++ on windows-gnu)
- #67439 (Cleanup `lower_pattern_unadjusted` & Improve slice pat typeck)
- #67480 (Require issue = "none" over issue = "0" in unstable attributes)
- #67500 (Tweak non_shorthand_field_patterns' suggestion)
- #67504 (Warn against relying on ?Sized being last)
Failed merges:
r? @ghost
|
|
|
|
|
|
|
|
constant contexts
|
|
|
|
Enable `loop` and `while` in constants behind a feature flag
This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways.
`while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user.
r? @oli-obk
cc @rust-lang/wg-const-eval
|
|
r=centril
Revert stabilization of never type
Fixes https://github.com/rust-lang/rust/issues/66757
I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean.
( cc @Centril, author of #65355, you may want to check this over briefly )
|
|
|
|
|
|
functions with a `const` modifier
|
|
|
|
Ensure that panicking in constants eventually errors
based on #67134
closes #66975
r? @oli-obk
|
|
|
|
Implement #[track_caller] attribute. (RFC 2091 4/N)
Implements the `#[track_caller]` attribute in both const and codegen contexts.
The const implementation walks up the stack to find the nearest untracked callsite.
The codegen implementation adds an implicit argument to tracked function calls, and populates it with either a call to the previously-landed intrinsic or if the caller has `#[track_caller]` with a copy of the location passed to the current function.
Also includes a little cleanup and a few comments in the other caller location areas.
[Depends on: 65664](https://github.com/rust-lang/rust/pull/65664)
[RFC 2091 text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)
[Tracking issue](https://github.com/rust-lang/rust/issues/47809)
[Tracking doc](https://paper.dropbox.com/doc/track_rfc_2091_impl-notes--Anf1NwnIb0xcRv31YLIadyj0Ag-rwCdRc2fi2yvRZ7syGZ9q#:uid=863513134494965680023183&h2=TODO-actually-pass-location-to)
|
|
Miri core engine: use throw_ub instead of throw_panic
See https://github.com/rust-lang/rust/issues/66902 for context: panicking is not really an "interpreter error", but just part of a normal Rust execution. This is a first step towards removing the `InterpError::Panic` variant: the core Miri engine does not use it any more.
ConstProp and ConstEval still use it, though. This will be addressed in future PRs.
From what I can tell, all the error messages this removes are actually duplicates.
r? @oli-obk @wesleywiser
|
|
Add feature gate for mut refs in const fn
r? @oli-obk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This creates a new test directory, `ui/consts/control-flow` to hold
tests related to control flow in a const context. It also blesses all
existing tests with the new error messages, and adds new tests for the
`const_if_match` feature.
|
|
|