| Age | Commit message (Collapse) | Author | Lines |
|
|
|
r=BoxyUwU
Introduce `structurally_normalize_const`, use it in `rustc_hir_typeck`
Introduces `structurally_normalize_const` to typecking to separate the "eval a const" step from the "try to turn a valtree into a target usize" in HIR typeck, where we may still have infer vars and stuff around.
I also changed `check_expr_repeat` to move a double evaluation of a const into a single one. I'll leave inline comments.
r? ```@BoxyUwU```
I hesitated to really test this on the new solver where it probably matters for unevaluated consts. If you're worried about the side-effects, I'd be happy to craft some more tests 😄
|
|
|
|
|
|
|
|
- Replace non-standard names like 's, 'p, 'rg, 'ck, 'parent, 'this, and
'me with vanilla 'a. These are cases where the original name isn't
really any more informative than 'a.
- Replace names like 'cx, 'mir, and 'body with vanilla 'a when the lifetime
applies to multiple fields and so the original lifetime name isn't
really accurate.
- Put 'tcx last in lifetime lists, and 'a before 'b.
|
|
Rollup of 8 pull requests
Successful merges:
- #125060 (Expand documentation of PathBuf, discussing lack of sanitization)
- #129367 (Fix default/minimum deployment target for Aarch64 simulator targets)
- #130156 (Add test for S_OBJNAME & update test for LF_BUILDINFO cl and cmd)
- #130160 (Fix `slice::first_mut` docs)
- #130235 (Simplify some nested `if` statements)
- #130250 (Fix `clippy::useless_conversion`)
- #130252 (Properly report error on `const gen fn`)
- #130256 (Re-run coverage tests if `coverage-dump` was modified)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix `clippy::useless_conversion`
Self-explanatory. Probably the last clippy change I'll actually put up since this is the only other one I've actually seen in the wild.
|
|
|
|
|
|
|
|
|
|
Use `DeepRejectCtxt` to quickly reject `ParamEnv` candidates
The description is on the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/.5Basking.20for.20help.5D.20.60DeepRejectCtxt.60.20for.20param.20env.20candidates)
r? `@lcnr`
|
|
|
|
|
|
Add `unreachable_pub`, round 4
A follow-up to #129732.
r? `@Urgau`
|
|
|
|
chore: Fix typos in 'compiler' (batch 3)
Batch 3/3: Fixes typos in `compiler`
(See [issue](https://github.com/rust-lang/rust/issues/129874) tracking all PRs with typos fixes)
|
|
|
|
|
|
This reverts commit acb4e8b6251f1d8da36f08e7a70fa23fc581839e, reversing
changes made to 100fde5246bf56f22fb5cc85374dd841296fce0e.
|
|
Remove `#[macro_use] extern crate tracing`, round 4
Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from #124511, #124914, and #125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately.
r? ```@jieyouxu```
|
|
Stop using `ty::GenericPredicates` for non-predicates_of queries
`GenericPredicates` is a struct of several parts: A list of of an item's own predicates, and a parent def id (and some effects related stuff, but ignore that since it's kinda irrelevant). When instantiating these generic predicates, it calls `predicates_of` on the parent and instantiates its predicates, and appends the item's own instantiated predicates too:
https://github.com/rust-lang/rust/blob/acb4e8b6251f1d8da36f08e7a70fa23fc581839e/compiler/rustc_middle/src/ty/generics.rs#L407-L413
Notice how this should result in a recursive set of calls to `predicates_of`... However, `GenericPredicates` is *also* misused by a bunch of *other* queries as a convenient way of passing around a list of predicates. For these queries, we don't ever set the parent def id of the `GenericPredicates`, but if we did, then this would be very easy to mistakenly call `predicates_of` instead of some other intended parent query.
Given that footgun, and the fact that we don't ever even *use* the parent def id in the `GenericPredicates` returned from queries like `explicit_super_predicates_of`, It really has no benefit over just returning `&'tcx [(Clause<'tcx>, Span)]`.
This PR additionally opts to wrap the results of `EarlyBinder`, as we've tended to use that in the return type of these kinds of queries to properly convey that the user has params to deal with, and it also gives a convenient way of iterating over a slice of things after instantiating.
|
|
|
|
|
|
|
|
|
|
safe transmute: check lifetimes
Modifies `BikeshedIntrinsicFrom` to forbid lifetime extensions on references. This static check can be opted out of with the `Assume::lifetimes` flag.
Fixes #129097
Tracking Issue: https://github.com/rust-lang/rust/issues/99571
r? `@compiler-errors`
|
|
Modifies `BikeshedIntrinsicFrom` to forbid lifetime extensions on
references. This static check can be opted out of with the
`Assume::lifetimes` flag.
Fixes #129097
|
|
Fixes #126831.
Without this patch, type normalization is not always idempotent, which
leads to all sorts of bugs in places that assume that normalizing a
normalized type does nothing.
|
|
r=compiler-errors
`ParamEnvAnd::fully_perform`: we have an `ocx`, use it
cc #123669
r? ``@compiler-errors``
|
|
Remove redundant type ops: `Eq`/`Subtype`
r? lcnr or anyone really
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #128410 (Migrate `remap-path-prefix-dwarf` `run-make` test to rmake)
- #128759 (alloc: add ToString specialization for `&&str`)
- #128873 (Add windows-targets crate to std's sysroot)
- #129001 (chore(lib): Enhance documentation for core::fmt::Formatter's write_fm…)
- #129061 (Use `is_lang_item` more)
- #129062 (Remove a no-longer-true assert)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use `is_lang_item` more
Few places that I missed since introducing `TyCtxt::is_lang_item`.
|
|
Shrink `TyKind::FnPtr`.
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
r? `@compiler-errors`
|
|
|
|
Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver
Realized that the new solver didn't handle ptr-to-ptr casting correctly.
r? lcnr
Built on #128694
|
|
Use `assert_matches` around the compiler more
It's a useful assertion, especially since it actually prints out the LHS.
|
|
|
|
|
|
|
|
Cache supertrait outlives of impl header for soundness check
This caches the results of computing the transitive supertraits of an impl and filtering it to its outlives obligations. This is purely an optimization to improve https://github.com/rust-lang/rust/pull/124336.
|
|
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and
`FnHeader`, which can be packed more efficiently. This reduces the size
of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms.
This reduces peak memory usage by a few percent on some benchmarks. It
also reduces cache misses and page faults similarly, though this doesn't
translate to clear cycles or wall-time improvements on CI.
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #128385 (rustdoc-json: discard non-local inherent impls for primitives)
- #128559 (Don't re-elaborated already elaborated caller bounds in method probe)
- #128631 (handle crates when they are not specified for std docs)
- #128664 (Add `Debug` impls to API types in `rustc_codegen_ssa`)
- #128686 (fix the invalid argument type)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|