- 08 7月, 2022 4 次提交
-
-
由 Matthias Krüger 提交于
Fix missing word in comment
-
由 Matthias Krüger 提交于
interpret: use AllocRange in UninitByteAccess also use nice new format string syntax in `interpret/error.rs`, and use the `#` flag to add `0x` prefixes where applicable. r? ``@oli-obk``
-
由 Matthias Krüger 提交于
Reword comments and rename HIR visiting methods. Sparked by this discussion in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Confused.20by.20comment.20on.20.60deep_visit_item_likes_in_module.60) r? ``@jyn514`` ``@camsteffen``
-
由 Matthias Krüger 提交于
Implement ExitCodeExt for Windows Fixes #97914 ### Motivation: On Windows it is common for applications to return `HRESULT` (`i32`) or `DWORD` (`u32`) values. These stem from COM based components ([HRESULTS](https://docs.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coinitialize)), Win32 errors ([GetLastError](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror)), GUI applications ([WM_QUIT](https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-quit)) and more. The newly stabilized `ExitCode` provides an excellent fit for propagating these values, because `std::process::exit` does not run deconstructors which can result in errors. However, `ExitCode` currently only implements `From<u8> for ExitCode`, which disallows the full range of `i32`/`u32` values. This pull requests attempts to address that shortcoming by providing windows specific extensions that accept a `u32` value (which covers all possible `HRESULTS` and Win32 errors) analog to [ExitStatusExt::from_raw](https://doc.rust-lang.org/std/os/windows/process/trait.ExitStatusExt.html#tymethod.from_raw). This was also intended by the original Stabilization https://github.com/rust-lang/rust/pull/93840#issue-1129209143= as pointed out by ``@eggyal`` in https://github.com/rust-lang/rust/issues/97914#issuecomment-1151076755: > Issues around platform specific representations: We resolved this issue by changing the return type of report from i32 to the opaque type ExitCode. __That way we can change the underlying representation without affecting the API, letting us offer full support for platform specific exit code APIs in the future.__ [Emphasis added] ### API ```rust /// Windows-specific extensions to [`process::ExitCode`]. /// /// This trait is sealed: it cannot be implemented outside the standard library. /// This is so that future additional methods are not breaking changes. #[stable(feature = "windows_process_exit_code_from", since = "1.63.0")] pub trait ExitCodeExt: Sealed { /// Creates a new `ExitCode` from the raw underlying `u32` return value of /// a process. #[stable(feature = "windows_process_exit_code_from", since = "1.63.0")] fn from_raw(raw: u32) -> Self; } #[stable(feature = "windows_process_exit_code_from", since = "1.63.0")] impl ExitCodeExt for process::ExitCode { fn from_raw(raw: u32) -> Self { process::ExitCode::from_inner(From::from(raw)) } } ``` ### Misc I apologize in advance if I misplaced any attributes regarding stabilzation, as far as I learned traits are insta-stable so I chose to make them stable. If this is an error, please let me know and I'll correct it. I also added some additional machinery to make it work, analog to [ExitStatus](https://doc.rust-lang.org/std/process/struct.ExitStatus.html#). EDIT: Proposal: https://github.com/rust-lang/libs-team/issues/48
-
- 07 7月, 2022 36 次提交
-
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #96856 (Fix ProjectionElem validation) - #97711 (Improve soundness of rustc_arena) - #98507 (Finishing touches for `#[expect]` (RFC 2383)) - #98692 (rustdoc: Cleanup more FIXMEs) - #98901 (incr: cache dwarf objects in work products) - #98930 (Make MIR basic blocks field public) - #98973 (Remove (unused) inherent impl anchors) - #98981 ( Edit `rustc_mir_dataflow::framework` documentation ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Camille GILLOT 提交于
-
由 Dylan DPC 提交于
Edit `rustc_mir_dataflow::framework` documentation Some edits for clarity and consistency.
-
由 Dylan DPC 提交于
Remove (unused) inherent impl anchors This is something `@notriddle` realized a few days ago: we have unused anchors in the DOM. This PR removes them. You can test it [here](https://rustdoc.crud.net/imperio/inherent-impl-anchors/foo/index.html). r? `@notriddle`
-
由 Dylan DPC 提交于
Make MIR basic blocks field public This makes it possible to mutably borrow different fields of the MIR body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`. To preserve validity of control flow graph caches in the presence of modifications, a new struct `BasicBlocks` wraps together basic blocks and control flow graph caches. The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`. On the other hand a mutable access requires explicit `as_mut()` call.
-
由 Dylan DPC 提交于
incr: cache dwarf objects in work products Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios. r? `@michaelwoerister`
-
由 Dylan DPC 提交于
rustdoc: Cleanup more FIXMEs r? `@GuillaumeGomez`
-
由 Dylan DPC 提交于
Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? `@wesleywiser` cc: https://github.com/rust-lang/rust/issues/97660, https://github.com/rust-lang/rust/issues/85549 And I guess that's it. Here have a magical unicorn
🦄 -
由 Dylan DPC 提交于
Improve soundness of rustc_arena Make it runnable in miri by changing the loop iteration count for some tests in miri. Also fix a stacked borrows issue with box.
-
由 Dylan DPC 提交于
Fix ProjectionElem validation `TypeChecker::visit_projection_elem` was not actually being called.
-
由 bors 提交于
rustc_codegen_ssa: use `project_index`, not `project_field`, for array literals. See https://github.com/rust-lang/rust/pull/98615#issuecomment-1170082774 for some context. In short, we were using `project_field` even for array `mir::Rvalue::Aggregate`s, which results in benchmarks like `deep-vector.rs` (and presumably also some real-world usecases?) being impacted by how we handle non-array aggregate fields. (This is a separate PR so that we can measure the perf effects in isolation) r? `@nikic`
-
由 bors 提交于
Use a bitset instead of a hash map in HIR ID validator The hashset insertion was slightly hot in incr patched runs, but it seems unnecessary to use a hashset here, as it just checks that a dense set of N integers was seen. I'm not sure if it's possible to know the amount of items beforehand to preallocate the bitset? I suppose not.
-
由 Tomasz Miąsko 提交于
-
由 Tomasz Miąsko 提交于
-
由 Tomasz Miąsko 提交于
-
由 Tomasz Miąsko 提交于
-
由 Tomasz Miąsko 提交于
This makes it possible to mutably borrow different fields of the MIR body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`. To preserve validity of control flow graph caches in the presence of modifications, a new struct `BasicBlocks` wraps together basic blocks and control flow graph caches. The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`. On the other hand a mutable access requires explicit `as_mut()` call.
-
由 bors 提交于
Suggest using block for `extern "abi" fn` with no body `@rustbot` modify labels: +A-diagnostics
-
由 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
-
由 xFrednet 提交于
-
由 xFrednet 提交于
-
由 xFrednet 提交于
Examples: NON_ASCII_IDENTS, UNCOMMON_CODEPOINTS, CONFUSABLE_IDENTS, MIXED_SCRIPT_CONFUSABLES
-
由 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
-
由 pierwill 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-