| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Rollup of 7 pull requests
Successful merges:
- #68984 (Make `u8::is_ascii` a stable `const fn`)
- #69339 (Add test for #69312)
- #69346 (Clean up E0323, E0324, E0325 and E0326 explanations)
- #69348 (Wrong error message for move_ref_pattern)
- #69349 (MIR is not an experiment anymore)
- #69354 (Test `Duration::new` panics on overflow)
- #69370 (move const_eval.rs into the module folder)
Failed merges:
r? @ghost
|
|
|
|
ecstatic-morse:promote-shuffle-no-special-case, r=petrochenkov"
This reverts commit 61d3b6dedb1ec1f3e3cbd3d66b1a3453225bc37c, reversing
changes made to c6ad1e2c2a0c7e48537617d36085f866fa6a65a3.
|
|
Allow trait methods to be called on concrete types in a const context
This partially implements [RFC 2632](https://github.com/rust-lang/rfcs/pull/2632) by const-checking methods inside an `impl const` block and allowing those methods to be called on concrete types. Calling trait methods on type parameters in a const context is not yet allowed. Implementing this will require much more work. Since we are only concerned with methods on concrete types, we are able to take advantage of the machinery in `Instance::resolve`, which is doing most of the work.
This also propagates `#[rustc_const_unstable]` from parent items to child items, making that attribute behave like `#[stable]` and `#[unstable]` do. This allows trait methods to be marked as unstably const.
cc #67792 #57563
cc @rust-lang/wg-const-eval
r? @oli-obk
|
|
|
|
|
|
|
|
|
|
|
|
Change const eval to just return the value
As discussed in https://github.com/rust-lang/rust/pull/68505#discussion_r370956535, the type of consts shouldn't be returned from const eval queries.
r? @eddyb
cc @nikomatsakis
|
|
inside it shouldn't be used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Caller now passes in a `decorate` function, which is only run if the
lint is allowed.
|
|
For now, this is all the crate contains, but more
attribute logic & types will be moved there over time.
|
|
Rollup of 11 pull requests
Successful merges:
- #68200 (Stabilize the debug_map_key_value feature)
- #68383 (Clean up E0205 explanation)
- #68412 (Clean up E0207 explanation)
- #68454 (clean up E0214 explanation)
- #68482 (clean up error codes explanation)
- #68563 (Don't call `tcx.fn_sig` on closures)
- #68570 (Bump LLVM submodule to fix LLVM assertion failure in MSP430 interrupt generation.)
- #68571 (check_match: extract common logic)
- #68573 (Clean up E0262 explanation)
- #68575 (Disable the testcase for Vxworks.)
- #68581 (Add support for icebreakers-cleanup-crew commands)
Failed merges:
r? @ghost
|
|
Fixes #68542
|
|
|
|
immutable allocations
|
|
|
|
Reduce special treatment for zsts
addresses https://github.com/rust-lang/rust/pull/67467#discussion_r360650846
cc @RalfJung
|
|
|
|
The only two uses of the associated methods are in librustc_mir and
librustdoc. Please tell me if there is a better choice.
|
|
|
|
|
|
|
|
|
|
addresses
|
|
|
|
Nix `rustc_hir` reexports in rustc::hir
r? @Zoxc cc @Mark-Simulacrum
|
|
Fixes #67639
`Instance.ty` assumes that we are in a fully monomorphic context (e.g.
codegen), and can therefore use an empty `ParamEnv` when performing
normalization. Howver, the MIR constant evaluator code ends up calling
`Instance.ty` as a result of us attemptign to 'speculatively'
const-evaluate generic functions during const propagation.
As a result,
we may end up with projections involving type parameters
(e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize.
Normalization expects us to have proper predicates in the `ParamEnv` for
such projections, and will ICE if we don't.
This commit adds a new method `Instance.ty_env`, which takes a
`ParamEnv` for use during normalization. The MIR const-evaluator code is
changed to use this method, passing in the proper `ParamEnv` for the
context at hand.
|
|
|
|
libstd uses `core::panic::Location` where possible.
cc @eddyb
|
|
|
|
|
|
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
|
|
new ones
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|