-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #128186
Rollup of 7 pull requests #128186
Conversation
…up or pollerr for refused connections in linux
…-errors Implement lint against ambiguous negative literals This PR implements a lint against ambiguous negative literals with a literal and method calls right after it. ## `ambiguous_negative_literals` (deny-by-default) The `ambiguous_negative_literals` lint checks for cases that are confusing between a negative literal and a negation that's not part of the literal. ### Example ```rust,compile_fail -1i32.abs(); // equals -1, while `(-1i32).abs()` equals 1 ``` ### Explanation Method calls take precedence over unary precedence. Setting the precedence explicitly makes the code clearer and avoid potential bugs. <details> <summary>Old proposed lint</summary> ## `ambiguous_unary_precedence` (deny-by-default) The `ambiguous_unary_precedence` lint checks for use the negative unary operator with a literal and method calls. ### Example ```rust -1i32.abs(); // equals -1, while `(-1i32).abs()` equals 1 ``` ### Explanation Unary operations take precedence on binary operations and method calls take precedence over unary precedence. Setting the precedence explicitly makes the code clearer and avoid potential bugs. </details> ----- Note: This is a strip down version of rust-lang#117161, without the binary op precedence. Fixes rust-lang#117155 `@rustbot` labels +I-lang-nominated cc `@scottmcm` r? compiler
…oss35 Fix connect timeout for non-linux targets, read readiness of socket connection, Read readiness to detect errors. `Fixes rust-lang#127018` Fixes rust-lang#127018 Connect_timeout would call `poll` and check `pollfd.revents` for POLLHUP error, rather that checking readiness. This behavior was meant for Linux as it returns POLLHUP | POLLOUT | POLLERR in case of errors. But on targets that do not return POLLHUP in `pollfd.revents`, this would indicate a false success and result in this issue. To resolve this we will check readiness of socket using `getsockopt():` and return success from connect_timeout when there are no errors. Changes were tested on Linux and an rtos. ![Screenshot 2024-07-04 105820](https://github.com/rust-lang/rust/assets/88673422/5ef5a87f-f2af-4fb7-98da-7612d5e27e9a) Thank you.
…=lcnr `#[naked]`: use an allowlist for allowed options on `asm!` in naked functions tracking issue: rust-lang#90957 this is mostly just a refactor, but using an allowlist (rather than a denylist) for which asm options are allowed in naked functions is a little safer. These options are disallowed because naked functions are effectively global asm, but defined using inline asm.
…lity-gcc, r=ChrisDenton std: unsafe-wrap personality::gcc Nothing seems obviously wrong with these implementations except for some unanswered questions. Admittedly, I don't want to burn excessive time on exceptional exception handlers. Thus this is mostly a brute-force syntactic wrapping and some comments where they seemed correct, creating another largely whitespace diff. try-job: armhf-gnu
Make sure that args are compatible in `resolve_associated_item` Implements a similar check to the one that we have in projection for GATs (rust-lang#102488, rust-lang#123240), where we check that the args of an impl item are compatible before returning it. This is done in `resolve_assoc_item`, which is backing `Instance::resolve`, so this is conceptually generalizing the check from GATs to methods/assoc consts. This is important to make sure that the inliner will only visit and substitute MIR bodies that are compatible w/ their trait definitions. This shouldn't happen in codegen, but there are a few ways to get the inliner to be invoked (via calls to `optimized_mir`) before codegen, namely polymorphization and CTFE. Fixes rust-lang#121957 Fixes rust-lang#120792 Fixes rust-lang#120793 Fixes rust-lang#121063
…enyukang Don't ICE if HIR and middle types disagree in borrowck error reporting We try to match up the `middle::ty::Ty` and `hir::Ty` types in borrowck error reporting, but due to things like `Self` self type alias, or regular type aliases, these might not match up. Don't ICE. This PR also tries to recover the error by looking up the self type of the impl in case we see `Self`. The diagnostic is frankly quite confusing, but I also didn't really want to look at it because I don't understand the conflict error reporting logic. 🤷 Fixes rust-lang#121816
…, r=oli-obk Remove crashes for misuses of intrinsics All of these do not crash if the feature gate is removed. An ICE due *opting into* the intrinsics feature gate is not a bug that needs to be fixed, but instead a misuse of an internal-only API. See rust-lang/compiler-team#620 The last two issues are already closed anyways, but: Fixes rust-lang#97501 Fixes rust-lang#111699 Fixes rust-lang#101962
@bors r+ rollup=never p=7 |
If there's still time, could #128187 be sneaked into the rollup? |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 54be9ad5eb In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (eb10639): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary 5.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.25s -> 769.861s (0.08%) |
Seems like noise, the regressions went back in the following commit. @rustbot label: +perf-regression-triaged |
Successful merges:
Fixes #127018
#127300 (Fix connect timeout for non-linux targets, read readiness of socket connection, Read readiness to detect errors.Fixes #127018
)#[naked]
: use an allowlist for allowed options onasm!
in naked functions #128138 (#[naked]
: use an allowlist for allowed options onasm!
in naked functions)resolve_associated_item
#128171 (Make sure that args are compatible inresolve_associated_item
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup