| Age | Commit message (Collapse) | Author | Lines |
|
|
|
change offset from u32 to u64
References #71696
r? @oli-obk
(closed the earlier pr because the rebase got messed up)
|
|
|
|
|
|
|
|
This commit adjusts the naming of various lang items so that they are
consistent and don't include prefixes containing the target or
"LangItem". In addition, lang item variants are no longer exported from
the `lang_items` module.
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
Already covered by MIR constant comments
|
|
|
|
|
|
|
|
Renamed remaining references to "undef" to "uninit" when referring to Miri.
Impacted directories are:
- src/librustc_codegen_llvm/consts.rs
- src/librustc_middle/mir/interpret/
- src/librustc_middle/ty/print/pretty.rs
- src/librustc_mir/
- src/tools/clippy/clippy_lints/src/consts.rs
Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project.
Related issue #71193
|
|
Replace all uses of `log::log_enabled` with `Debug` printers
cc @RalfJung this touches a bunch of logging in the miri engine. There are some visual changes, mainly that in several cases we stop prepending lines with the module path and just have a newline.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Track span of function in method calls, and use this in #[track_caller]
Fixes #69977
When we parse a chain of method calls like `foo.a().b().c()`, each
`MethodCallExpr` gets assigned a span that starts at the beginning of
the call chain (`foo`). While this is useful for diagnostics, it means
that `Location::caller` will return the same location for every call
in a call chain.
This PR makes us separately record the span of the function name and
arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This
`Span` is passed through HIR lowering and MIR building to
`TerminatorKind::Call`, where it is used in preference to
`Terminator.source_info.span` when determining `Location::caller`.
This new span is also useful for diagnostics where we want to emphasize
a particular method call - for an example, see
https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
|
|
Fixes #69977
When we parse a chain of method calls like `foo.a().b().c()`, each
`MethodCallExpr` gets assigned a span that starts at the beginning of
the call chain (`foo`). While this is useful for diagnostics, it means
that `Location::caller` will return the same location for every call
in a call chain.
This PR makes us separately record the span of the function name and
arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This
`Span` is passed through HIR lowering and MIR building to
`TerminatorKind::Call`, where it is used in preference to
`Terminator.source_info.span` when determining `Location::caller`.
This new span is also useful for diagnostics where we want to emphasize
a particular method call - for an example, see
https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
|
|
This is only really useful in debug messages, so I've switched to
calling `span_to_string` in any place that causes a `Span` to end up in
user-visible output.
|
|
Revert pr 71840
Revert7 PR #71840 to fix issue #72470
This will need a backport to beta if we do not want #72470 to hit stable.
|
|
This reverts commit 611988551fba1bcbb33ae2e1e0171cb8d2e70d5a.
|
|
This reverts commit 54aa418a6082b364b90feee70b07381ea266c4d5.
|
|
|
|
|
|
|
|
|
|
Rework MIR drop tree lowering
This PR changes how drops are generated in MIR construction. This is the first half of the fix for #47949.
Rather than generating the drops for a given unwind/break/continue/return/generator drop path as soon as they are needed, the required drops are recorded and get generated later.
The motivation for this is
* It simplifies the caching scheme, because it's now possible to walk up the currently scheduled drop tree to recover state.
* The basic block order for MIR more closely resembles execution order.
This PR also:
* Highlights cleanup blocks in the graphviz MIR output.
* Removes some unnecessary drop flag assignments.
|
|
Simplify the `tcx.alloc_map` API
This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private.
r? @RalfJung
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #70834 (Add core::future::{pending,ready})
- #71839 (Make BTreeMap::new and BTreeSet::new const)
- #71890 (Simplify the error Registry methods a little)
- #71942 (Shrink `LocalDecl`)
- #71947 (Dead-code pass highlights too much of impl functions)
- #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation)
- #72018 (Fix canonicalization links)
- #72031 (Better documentation for io::Read::read() return value)
Failed merges:
r? @ghost
|
|
Shrink `LocalDecl`
`LocalDecl` contributes 4-8% of peak heap memory usage on a range of benchmarks. This PR reduces its size from 128 bytes to 56 bytes on 64-bit, and does some clean-ups as well.
r? @matthewjasper
|
|
Renamed "undef" -> "uninit"
1. InvalidUndefBytes -> InvalidUninitBytes
2. ScalarMaybeUndef -> ScalarMaybeUninit
3. UndefMask -> InitMask
Related issue #71193
|
|
|
|
The liveness dataflow analysis now lives in
`librustc_mir/dataflow/impls/liveness.rs`. The borrow-checker has an
abstraction around of "defs" and "uses" that I've made module private. I
would have moved it to `util/def_use.rs`, but there's a slightly
different abstraction used for copy propagation with that name.
|
|
1. InvalidUndefBytes -> InvalidUninitBytes
2. ScalarMaybeUndef -> ScalarMaybeUninit
3. UndefMask -> InitMask
Related issue #71193
|
|
By boxing `user_ty`.
|
|
This commit adds some new `LocalDecl` methods:
- `with_source_info`, a most general constructor.
- `new`, a variant of `with_source_info` which represents the most
common use case.
- `internal` a modifying method (like the already present `immutable`).
It removes some old `LocalDecl` methods:
- `new_internal` and `new_local`, because they're subsumed by the new
methods.
- `new_return_place`, because it was identical to `new_temp`.
Finally, it cleans up all the use sites.
|
|
|
|
...emulating `MutatingUseContext::Call`
|
|
MIR dump: print pointers consistently with Miri output
This makes MIR allocation dump pointer printing consistent with Miri output: both use hexadecimal offsets with a `0x` prefix. To save some space, MIR dump replaces the `alloc` prefix by `a` when necessary.
I also made AllocId/Pointer printing more consistent in their Debug/Display handling, and adjusted Display printing for Scalar a bit to avoid using decimal printing when we do not know the sign with which to interpret the value (IMO using decimal then is misleading).
|
|
remove obsolete comment
Not sure if it's better to have an outdated comment or no comment at all (made obsolete by 2b9fea1300b515e0f8929bb3a09d4fb6fef3f0ea).
|
|
Convert more queries to use `LocalDefId`
This PR is based on commits in https://github.com/rust-lang/rust/pull/71215 and should partially solve #70853
|
|
|