- 10 8月, 2023 13 次提交
-
-
由 Michael Goulet 提交于
-
由 Michael Goulet 提交于
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #110435 (rustdoc-json: Add test for field ordering.) - #111891 (feat: `riscv-interrupt-{m,s}` calling conventions) - #114377 (test_get_dbpath_for_term(): handle non-utf8 paths (fix FIXME)) - #114469 (Detect method not found on arbitrary self type with different mutability) - #114587 (Convert Const to Allocation in smir) - #114670 (Don't use `type_of` to determine if item has intrinsic shim) Failed merges: - #114599 (Add impl trait declarations to SMIR) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
Don't use `type_of` to determine if item has intrinsic shim When we're calling `resolve_instance` on an inline const, we were previously looking at the `type_of` for that const, seeing that it was an `extern "intrinsic"` fn def, and treating it as if we were computing the instance of that intrinsic itself. This is incorrect. Instead, we should be using the def-id of the item we're computing to determine if it's an intrinsic. Fixes #114660
-
由 Matthias Krüger 提交于
Convert Const to Allocation in smir Continuation of previous pr https://github.com/rust-lang/rust/pull/114466 cc https://github.com/rust-lang/project-stable-mir/issues/15 r? `@oli-obk`
-
由 Matthias Krüger 提交于
Detect method not found on arbitrary self type with different mutability ``` error[E0599]: no method named `x` found for struct `Pin<&S>` in the current scope --> $DIR/arbitrary_self_type_mut_difference.rs:11:18 | LL | Pin::new(&S).x(); | ^ help: there is a method with a similar name: `y` | note: method is available for `Pin<&mut S>` --> $DIR/arbitrary_self_type_mut_difference.rs:6:5 | LL | fn x(self: Pin<&mut Self>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Related to #57994, as one of the presented cases can lead to code like this.
-
由 Matthias Krüger 提交于
test_get_dbpath_for_term(): handle non-utf8 paths (fix FIXME) Removes a FIXME for #9639 Part of #44366 which is E-help-wanted The remaining two FIXMEs for #9639 are considerably more complicated, so I will create separate PRs for them.
-
由 Matthias Krüger 提交于
feat: `riscv-interrupt-{m,s}` calling conventions Similar to prior support added for the mips430, avr, and x86 targets this change implements the rough equivalent of clang's [`__attribute__((interrupt))`][clang-attr] for riscv targets, enabling e.g. ```rust static mut CNT: usize = 0; pub extern "riscv-interrupt-m" fn isr_m() { unsafe { CNT += 1; } } ``` to produce highly effective assembly like: ```asm pub extern "riscv-interrupt-m" fn isr_m() { 420003a0: 1141 addi sp,sp,-16 unsafe { CNT += 1; 420003a2: c62a sw a0,12(sp) 420003a4: c42e sw a1,8(sp) 420003a6: 3fc80537 lui a0,0x3fc80 420003aa: 63c52583 lw a1,1596(a0) # 3fc8063c <_ZN12esp_riscv_rt3CNT17hcec3e3a214887d53E.0> 420003ae: 0585 addi a1,a1,1 420003b0: 62b52e23 sw a1,1596(a0) } } 420003b4: 4532 lw a0,12(sp) 420003b6: 45a2 lw a1,8(sp) 420003b8: 0141 addi sp,sp,16 420003ba: 30200073 mret ``` (disassembly via `riscv64-unknown-elf-objdump -C -S --disassemble ./esp32c3-hal/target/riscv32imc-unknown-none-elf/release/examples/gpio_interrupt`) This outcome is superior to hand-coded interrupt routines which, lacking visibility into any non-assembly body of the interrupt handler, have to be very conservative and save the [entire CPU state to the stack frame][full-frame-save]. By instead asking LLVM to only save the registers that it uses, we defer the decision to the tool with the best context: it can more accurately account for the cost of spills if it knows that every additional register used is already at the cost of an implicit spill. At the LLVM level, this is apparently [implemented by] marking every register as "[callee-save]," matching the semantics of an interrupt handler nicely (it has to leave the CPU state just as it found it after its `{m|s}ret`). This approach is not suitable for every interrupt handler, as it makes no attempt to e.g. save the state in a user-accessible stack frame. For a full discussion of those challenges and tradeoffs, please refer to [the interrupt calling conventions RFC][rfc]. Inside rustc, this implementation differs from prior art because LLVM does not expose the "all-saved" function flavor as a calling convention directly, instead preferring to use an attribute that allows for differentiating between "machine-mode" and "superivsor-mode" interrupts. Finally, some effort has been made to guide those who may not yet be aware of the differences between machine-mode and supervisor-mode interrupts as to why no `riscv-interrupt` calling convention is exposed through rustc, and similarly for why `riscv-interrupt-u` makes no appearance (as it would complicate future LLVM upgrades). [clang-attr]: https://clang.llvm.org/docs/AttributeReference.html#interrupt-risc-v [full-frame-save]: https://github.com/esp-rs/esp-riscv-rt/blob/9281af2ecffe13e40992917316f36920c26acaf3/src/lib.rs#L440-L469 [implemented by]: https://github.com/llvm/llvm-project/blob/b7fb2a3fec7c187d58a6d338ab512d9173bca987/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp#L61-L67 [callee-save]: https://github.com/llvm/llvm-project/blob/973f1fe7a8591c7af148e573491ab68cc15b6ecf/llvm/lib/Target/RISCV/RISCVCallingConv.td#L30-L37 [rfc]: https://github.com/rust-lang/rfcs/pull/3246
-
由 Matthias Krüger 提交于
rustdoc-json: Add test for field ordering. Inspired by [this on twitter](https://twitter.com/PredragGruevski/status/1647705616650043392), the ordering of fields really matters, so we should test we preserve it through json. r? rustdoc
-
由 Michael Goulet 提交于
-
由 bjorn3 提交于
-
由 ouz-a 提交于
-
- 09 8月, 2023 27 次提交
-
-
由 bors 提交于
Suggest using `Arc` on `!Send`/`!Sync` types
-
由 Esteban Kuber 提交于
-
由 ouz-a 提交于
-
由 bjorn3 提交于
-
由 bors 提交于
Remove usage of `--use-old-text` for BOLT This flag has [reduced](https://github.com/rust-lang/rust/pull/114141) the size of `libLLVM.so` by ~50 MiB, but sadly it is quite non-deterministic and the size savings frequently fail, thus causing large artifact size [swings](https://github.com/rust-lang/rust/pull/114297#issuecomment-1670292387). To avoid the swings, it would be better to just disable the flag for now. r? `@nikic`
-
由 bjorn3 提交于
-
由 Esteban Küber 提交于
-
由 bjorn3 提交于
-
由 Jakub Beránek 提交于
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #113939 (open pidfd in child process and send to the parent via SOCK_SEQPACKET+CMSG) - #114548 (Migrate a trait selection error to use diagnostic translation) - #114606 (fix: not insert missing lifetime for `ConstParamTy`) - #114634 (Mention riscv64-linux-android support in Android documentation) - #114638 (Remove old RPITIT tests (revisions were removed)) - #114641 (Rename copying `ascii::Char` methods from `as_` to `to_`) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
Rename copying `ascii::Char` methods from `as_` to `to_` Tracking issue: #110998. The [API guidelines][naming] describe `as_` as used for borrowed -> borrowed operations, and `to_` for owned -> owned operations on `Copy` types. [naming]: https://rust-lang.github.io/api-guidelines/naming.html
-
由 Matthias Krüger 提交于
Remove old RPITIT tests (revisions were removed) These tests were not cleaned up after #112988. r? `@spastorino`
-
由 Matthias Krüger 提交于
Mention riscv64-linux-android support in Android documentation This CL brings the android.md file in-line with the list of supported targets from platform-support.md. Followup to https://github.com/rust-lang/rust/pull/112858 r? `@Mark-Simulacrum`
-
由 Matthias Krüger 提交于
fix: not insert missing lifetime for `ConstParamTy` Fixes #113462 We should ignore the missing lifetime, as it's illegal to include a lifetime in a const param. r? ``@compiler-errors``
-
由 Matthias Krüger 提交于
Migrate a trait selection error to use diagnostic translation
-
由 Matthias Krüger 提交于
open pidfd in child process and send to the parent via SOCK_SEQPACKET+CMSG This avoids using `clone3` when a pidfd is requested while still getting it in a 100% race-free manner by passing it up from the child process. This should solve most concerns in #82971
-
由 bors 提交于
Add gamma function to f32 and f64 Adds the [gamma function](https://en.wikipedia.org/wiki/Gamma_function) to `f32` and `f64` (`tgamma` and `tgammaf` from C). Refs: - https://github.com/rust-lang/rfcs/issues/864 - https://github.com/rust-lang/rust/issues/18271
-
由 Seth Pellegrino 提交于
The change in 07f855d7 introduced a trailing numeral of some kind after the `extern crate compiler_builtins`, which appears to have caused at least two false negatives (654b9243 and 657fd24). Instead, this change normalizes the test output to ignore the number (of symbols rustc recognizes?) to avoid needing to re-`--bless` these two tests for unrelated changes.
-
由 Seth Pellegrino 提交于
These new interrupt calling conventions are not themselves stabilized, but there are other unstable calling conventions present in the SMIR mapping (e.g. AVR interrupts) and the mapping appears to be "complete" so far, with no obvious way to represent unstable conventions separately from the stable ones.
-
由 Seth Pellegrino 提交于
Similar to prior support added for the mips430, avr, and x86 targets this change implements the rough equivalent of clang's [`__attribute__((interrupt))`][clang-attr] for riscv targets, enabling e.g. ```rust static mut CNT: usize = 0; pub extern "riscv-interrupt-m" fn isr_m() { unsafe { CNT += 1; } } ``` to produce highly effective assembly like: ```asm pub extern "riscv-interrupt-m" fn isr_m() { 420003a0: 1141 addi sp,sp,-16 unsafe { CNT += 1; 420003a2: c62a sw a0,12(sp) 420003a4: c42e sw a1,8(sp) 420003a6: 3fc80537 lui a0,0x3fc80 420003aa: 63c52583 lw a1,1596(a0) # 3fc8063c <_ZN12esp_riscv_rt3CNT17hcec3e3a214887d53E.0> 420003ae: 0585 addi a1,a1,1 420003b0: 62b52e23 sw a1,1596(a0) } } 420003b4: 4532 lw a0,12(sp) 420003b6: 45a2 lw a1,8(sp) 420003b8: 0141 addi sp,sp,16 420003ba: 30200073 mret ``` (disassembly via `riscv64-unknown-elf-objdump -C -S --disassemble ./esp32c3-hal/target/riscv32imc-unknown-none-elf/release/examples/gpio_interrupt`) This outcome is superior to hand-coded interrupt routines which, lacking visibility into any non-assembly body of the interrupt handler, have to be very conservative and save the [entire CPU state to the stack frame][full-frame-save]. By instead asking LLVM to only save the registers that it uses, we defer the decision to the tool with the best context: it can more accurately account for the cost of spills if it knows that every additional register used is already at the cost of an implicit spill. At the LLVM level, this is apparently [implemented by] marking every register as "[callee-save]," matching the semantics of an interrupt handler nicely (it has to leave the CPU state just as it found it after its `{m|s}ret`). This approach is not suitable for every interrupt handler, as it makes no attempt to e.g. save the state in a user-accessible stack frame. For a full discussion of those challenges and tradeoffs, please refer to [the interrupt calling conventions RFC][rfc]. Inside rustc, this implementation differs from prior art because LLVM does not expose the "all-saved" function flavor as a calling convention directly, instead preferring to use an attribute that allows for differentiating between "machine-mode" and "superivsor-mode" interrupts. Finally, some effort has been made to guide those who may not yet be aware of the differences between machine-mode and supervisor-mode interrupts as to why no `riscv-interrupt` calling convention is exposed through rustc, and similarly for why `riscv-interrupt-u` makes no appearance (as it would complicate future LLVM upgrades). [clang-attr]: https://clang.llvm.org/docs/AttributeReference.html#interrupt-risc-v [full-frame-save]: https://github.com/esp-rs/esp-riscv-rt/blob/9281af2ecffe13e40992917316f36920c26acaf3/src/lib.rs#L440-L469 [implemented by]: https://github.com/llvm/llvm-project/blob/b7fb2a3fec7c187d58a6d338ab512d9173bca987/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp#L61-L67 [callee-save]: https://github.com/llvm/llvm-project/blob/973f1fe7a8591c7af148e573491ab68cc15b6ecf/llvm/lib/Target/RISCV/RISCVCallingConv.td#L30-L37 [rfc]: https://github.com/rust-lang/rfcs/pull/3246
-
由 bors 提交于
Restrict linker version script of proc-macro crates to just its two symbols Restrict linker version script of proc-macro crates to just the two symbols of each proc-macro crate. The main known effect of doing this is to stop including `#[no_mangle]` symbols in the linker version script. Background: The combination of a proc-macro crate with an import of another crate that itself exports a no_mangle function was broken for a period of time, because: * In PR #99944 we stopped exporting no_mangle symbols from proc-macro crates; proc-macro crates have a very limited interface and are meant to be treated as a blackbox to everything except rustc itself. However: he constructed linker version script still referred to them, but resolving that discrepancy was left as a FIXME in the code, tagged with issue #99978. * In PR #108017 we started telling the linker to check (via the`--no-undefined-version` linker invocation flag) that every symbol referenced in the "linker version script" is provided as linker input. So the unresolved discrepancy from #99978 started surfacing as a compile-time error (e.g. #111888). Fix #111888 Fix #99978.
-
由 Alona Enraght-Moony 提交于
-
由 Alyssa Haroldsen 提交于
Tracking issue: #110998. The [API guidelines][naming] describe `as` as used for borrowed -> borrowed operations, and `to_` for owned -> owned operations on `Copy` types. [naming]: https://rust-lang.github.io/api-guidelines/naming.html
-
由 bors 提交于
Rollup of 11 pull requests Successful merges: - #106425 (Make ExitStatus implement Default) - #113480 (add aarch64-unknown-teeos target) - #113586 (Mention style for new syntax in tracking issue template) - #113593 (CFI: Fix error compiling core with LLVM CFI enabled) - #114612 (update llvm-wrapper include to silence deprecation warning) - #114613 (Prevent constant rebuilds of `rustc-main` (and thus everything else)) - #114615 (interpret: remove incomplete protection against invalid where clauses) - #114628 (Allowing re-implementation of mir_drops_elaborated query) - #114629 (tests: Uncomment now valid GAT code behind FIXME) - #114630 (Migrate GUI colors test to original CSS color format) - #114631 (add provisional cache test for new solver) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Michael Goulet 提交于
-
由 The 8472 提交于
This is a 100% race-free way to obtain a child's pidfd while avoiding `clone3`.
-
由 Matthias Krüger 提交于
add provisional cache test for new solver wrote it for chalk in https://github.com/rust-lang/chalk/pull/788 and never added it to the new solver. r? ``@compiler-errors``
-