- 07 7月, 2022 18 次提交
-
-
由 bors 提交于
Do not fetch HIR to compute variances. Everything can be done using higher-level queries. This simplifies the code, and should allow better incremental caching.
-
由 bors 提交于
interpret: remove support for unsized_locals I added support for unsized_locals in https://github.com/rust-lang/rust/pull/59780 but the current implementation is a crude hack and IMO definitely not the right way to have unsized locals in MIR. It also [causes problems](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Missing.20Layout.20Check.20in.20.60interpret.2Foperand.2Ers.60.3F). and what codegen does is unsound and has been for years since clearly nobody cares (so I hope nobody actually relies on that implementation and I'll be happy if Miri ensures they do not). I think if we want to have unsized locals in Miri/MIR we should add them properly, either by having a `StorageLive` that takes metadata or by having an `alloca` that returns a pointer (making the ptr indirection explicit) or something like that. So, this PR removes the `LocalValue::Unallocated` hack. It adds `Immediate::Uninit`, for several reasons: - This lets us still do fairly little work in `push_stack_frame`, in particular we do not actually have to create any allocations. - If/when I remove `ScalarMaybeUninit`, we will need something like this to have an "optimized" representation of uninitialized locals. Without this we'd have to put uninitialized integers into the heap! - const-prop needs some way to indicate "I don't know the value of this local'; it used to use `LocalValue::Unallocated` for that, now it can use `Immediate::Uninit`. There is still a fundamental difference between `LocalValue::Unallocated` and `Immediate::Uninit`: the latter is considered a regular local that you can read from and write to, it just has a more optimized representation when compared with an actual `Allocation` that is fully uninit. In contrast, `LocalValue::Unallocated` had this really odd behavior where you would write to it but not read from it. (This is in fact what caused the problems mentioned above.) While at it I also did two drive-by cleanups/improvements: - In `pop_stack_frame`, do the return value copying and local deallocation while the frame is still on the stack. This leads to better error locations being reported. The old errors were [sometimes rather confusing](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Cron.20Job.20Failure.202022-06-24/near/287445522). - Deduplicate `copy_op` and `copy_op_transmute`. r? `@oli-obk`
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #96935 (Allow arithmetic and certain bitwise ops on AtomicPtr) - #98519 (Replace some `guess_head_span` with `def_span`) - #98911 (rustdoc: filter '_ lifetimes from ty::Generics) - #98939 (rustdoc: Add more semantic information to impl IDs) - #98971 (Fix typo in file descriptor docs) - #98983 (docs: Add overview of `rustc_middle::mir::TerminatorKind`) - #98984 (Remove erroneous doc comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Guillaume Gomez 提交于
Remove erroneous doc comment Fixes the formatting issue shown here: <img width="803" alt="Screen Shot 2022-07-06 at 12 50 56 PM" src="https://user-images.githubusercontent.com/19642016/177612734-2d881c6a-2850-4c1b-8f1a-08339ad5bfbc.png">
-
由 Guillaume Gomez 提交于
docs: Add overview of `rustc_middle::mir::TerminatorKind`
-
由 Guillaume Gomez 提交于
Fix typo in file descriptor docs
-
由 Guillaume Gomez 提交于
rustdoc: Add more semantic information to impl IDs Take over of #92745. I fixed the last remaining issue for the links in the sidebar (mentioned by `@jsha)` and fixed the few links broken in the std/core docs. cc `@camelid` r? `@notriddle`
-
由 Guillaume Gomez 提交于
rustdoc: filter '_ lifetimes from ty::Generics Fixes a weirdly-rendered section of the std::string::String docs. Before: ![image](https://user-images.githubusercontent.com/1593513/177256873-20b9cf6e-2429-4865-853b-b269d74672f4.png) After: ![image](https://user-images.githubusercontent.com/1593513/177256900-ef3efd17-f624-40c5-af90-fe709ec034f2.png)
-
由 Guillaume Gomez 提交于
Replace some `guess_head_span` with `def_span` This patch fixes a part of #97417. r? `@cjgillot`
-
由 Guillaume Gomez 提交于
Allow arithmetic and certain bitwise ops on AtomicPtr This is mainly to support migrating from `AtomicUsize`, for the strict provenance experiment. This is a pretty dubious set of APIs, but it should be sufficient to allow code that's using `AtomicUsize` to manipulate a tagged pointer atomically. It's under a new feature gate, `#![feature(strict_provenance_atomic_ptr)]`, but I'm not sure if it needs its own tracking issue. I'm happy to make one, but it's not clear that it's needed. I'm unsure if it needs changes in the various non-LLVM backends. Because we just cast things to integers anyway (and were already doing so), I doubt it. API change proposal: https://github.com/rust-lang/libs-team/issues/60 Fixes #95492
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
Operand::Uninit is an *allocated* operand that is fully uninitialized. This lets us lazily allocate the actual backing store of *all* locals (no matter their ABI). I also reordered things in pop_stack_frame at the same time. I should probably have made that a separate commit...
-
由 pierwill 提交于
-
由 pierwill 提交于
-
由 bors 提交于
Return a FxIndexSet in is_late_bound query. This return value is iterated upon by borrowck, hence the need to preserve a deterministic iteration order. Fixes https://github.com/rust-lang/rust/issues/98890 Affects https://github.com/rust-lang/rust/issues/96655 I don't know if this supersedes https://github.com/rust-lang/rust/pull/98924 or fixes an unrelated bug. r? `@michaelwoerister` This may deserve a backport.
-
- 06 7月, 2022 22 次提交
-
-
由 bors 提交于
Rollup of 5 pull requests Successful merges: - #98881 (Only compute DefKind through the query.) - #98884 (macros: `LintDiagnostic` derive) - #98964 (fix typo in function name) - #98967 (fix typo in note about multiple inaccessible type aliases) - #98968 (assert Scalar sanity) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 bors 提交于
Update llvm-project Closes https://github.com/rust-lang/rust/issues/98167
🙂 -
由 Takayuki Maeda 提交于
-
由 Takayuki Maeda 提交于
-
由 Takayuki Maeda 提交于
-
由 Takayuki Maeda 提交于
-
由 Florian Spieß 提交于
-
由 Michael Woerister 提交于
-
由 Dylan DPC 提交于
assert Scalar sanity With https://github.com/rust-lang/rust/pull/96814 having landed, finally our `Scalar` layouts have the invariants they deserve. :)
-
由 Dylan DPC 提交于
fix typo in note about multiple inaccessible type aliases Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope but there are multiple inaccessible type aliases that match the missing type. In general this change would use the correct plural form in this scenario for base words that end with 's'.
-
由 Dylan DPC 提交于
fix typo in function name I don't know what I was doing when I named that function... follow-up to #98888 r? `@oli-obk`
-
由 Dylan DPC 提交于
macros: `LintDiagnostic` derive - Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it. - Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning). - Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`). - Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery. ~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~ r? `@oli-obk`
-
由 Dylan DPC 提交于
Only compute DefKind through the query.
-
由 fee1-dead 提交于
-
由 Camille GILLOT 提交于
-
由 Alan Egerton 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 ClementTsang 提交于
Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope, and there are multiple inaccessible type aliases that match the missing type. In general this change would use the correct plural form in this scenario for words that end with 's'.
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #95503 (bootstrap: Allow building individual crates) - #96814 (Fix repr(align) enum handling) - #98256 (Fix whitespace handling after where clause) - #98880 (Proper macOS libLLVM symlink when cross compiling) - #98944 (Edit `rustc_mir_dataflow::framework::lattice::FlatSet` docs) - #98951 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Ralf Jung 提交于
-