Rollup of 8 pull requests#159336
Conversation
This better matches how the argument is actually used.
See `rustc_hir::intravisit::{walk_expr,walk_pat_expr}`.
Fixes rust-lang#158295 The `overflowing_literal` lint is, I believe, supposed to consider the literal and not the surrounding context when deciding whether to lint. This is in contrast to the `arithmetic_overflow` lint, which only considers code that executes at run time, which excludes the negation inside a literal. According to [the reference](https://doc.rust-lang.org/1.96.0/reference/expressions/operator-expr.html#r-expr.operator.int-overflow.unary-neg), a negation in front of an integer does not result in an overflow. I think of this as: a negation, and only one negation, in front of an integer, is "part of" the integer. Therefore, the `overflowing_literal` lint should consider that when linting. It should not consider the second or third negation. Therefore, this commit changes `overflowing_literals` so that it only lints on `128_i8` when there is no preceding negation at all. This is in contrast to the previous behavior, which lints on `128_i8` preceded by an even number of negations.
The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error. Stop suppressing it, dropping the `is_local` flag and check. Fix the test for this case to now expect the error. Drop a separate test that depended on the lack of error (and that specifically notes it should be dropped once the lint becomes a hard error).
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
The macro is used in expressions, but the arm for eliminating a trailing comma introduces a semicolon.
Co-authored-by: Cameron Steffen <cam.steffen94@gmail.com>
this used an async closure with the default 2015 edition, so it never did anything useful. fix it to the original test case posted in the issue.
Document the built-in `cold` and `track_caller` attributes in the standard library using the `#[doc(attribute = "...")]` mechanism, following the existing `must_use` and `inline` attribute documentation.
There needs to be spaces around the dash, otherwise it doesn't work as a range (which matters now that LLVM trunk is 24).
Rename ModDefId to ModId and use more Addresses some FIXMEs. The `ModDefId` was used pretty sparingly, and honestly I wondered if it should exist at all. After making these changes, I think the type is worth it. Most notably it is now used in `Visibility::Restricted`. I first renamed `ModDefId` to `ModId` since I think the former is over-specific, and also this is more in line with `BodyId` or `OwnerId`. I'll wait for initial feedback before fixing rustdoc/clippy.
semicolon_in_expressions_from_macros: Lint on non-local macros too The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error. Stop suppressing it, dropping the `is_local` flag and check. Fix the test for this case to now expect the error. Drop a separate test that depended on the lack of error (and that specifically notes it should be dropped once the lint becomes a hard error).
…kang Implement `bool::toggle` This implements `bool::toggle` as originally proposed and accepted in rust-lang/libs-team#820. Tracking issue: rust-lang#159298
Fix `overflowing_literals` lint with repeated negation Fixes rust-lang#158295 This PR consists of: two commits with non-functional cleanups, a commit that adds a test, and a commit that actually changes the behavior. The following description concerns the changed behavior. See the test changed in the fourth commit for code demonstrating the change in behavior. --- The `overflowing_literal` lint is, I believe, supposed to consider the literal and not the surrounding context when deciding whether to lint. This is in contrast to the `arithmetic_overflow` lint, which only considers code that executes at run time, which excludes the negation inside a literal. According to [the reference](https://doc.rust-lang.org/1.96.0/reference/expressions/operator-expr.html#r-expr.operator.int-overflow.unary-neg), a negation in front of an integer does not result in an overflow. I think of this as: a negation, and only one negation, in front of an integer, is "part of" the integer. Therefore, the `overflowing_literal` lint should consider that when linting. It should not consider the second or third negation. Therefore, this PR changes `overflowing_literals` so that it only lints on `128_i8` when there is no preceding negation at all. This is in contrast to the previous behavior, which lints on `128_i8` preceded by an even number of negations.
…-attributes, r=GuillaumeGomez Add documentation for the `cold` and `track_caller` attributes Adds `cold` and `track_caller`, the two code generation attributes left from my claim on the tracking issue. Both stay guide-level, with one runnable example each. For `track_caller` I used a small assert-style helper, since the attribute mainly affects which line a panic points at. `inline` is already up in rust-lang#158348. Part of rust-lang#157604 r? @GuillaumeGomez Tested with `./x test library/std --doc --test-args attribute_docs`.
…h-unreachable, r=mejrs Add codegen test for remainder match Closes rust-lang#93514
…thercote fix some edition annotations in UI tests - 155202 used an async closure with the default 2015 edition, so it never tested anything useful - tait-normalize is already known to crash with edition 2021 (rust-lang#119786) - use-self-at-end legitimately has different behavior in 2021 edition
…mati865 Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs There needs to be spaces around the dash, otherwise it doesn't work as a range (which matters now that LLVM trunk is 24).
This comment has been minimized.
This comment has been minimized.
Rollup of 8 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
This comment has been minimized.
This comment has been minimized.
…uwer Rollup of 8 pull requests Successful merges: - #159197 (Rename ModDefId to ModId and use more) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #159296 (Implement `bool::toggle`) - #158302 (Fix `overflowing_literals` lint with repeated negation) - #158484 (Add documentation for the `cold` and `track_caller` attributes) - #159239 (Add codegen test for remainder match) - #159330 (fix some edition annotations in UI tests) - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs) Failed merges: - #158962 (Add `proc_macro` attribute documentation)
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #159336. |
This comment has been minimized.
This comment has been minimized.
…uwer Rollup of 8 pull requests Successful merges: - #159197 (Rename ModDefId to ModId and use more) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #159296 (Implement `bool::toggle`) - #158302 (Fix `overflowing_literals` lint with repeated negation) - #158484 (Add documentation for the `cold` and `track_caller` attributes) - #159239 (Add codegen test for remainder match) - #159330 (fix some edition annotations in UI tests) - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs) Failed merges: - #158962 (Add `proc_macro` attribute documentation)
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #159314. |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: df1ae0f7dd In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing df1ae0f (parent) -> 2118366 (this PR) Test differencesShow 102 test diffsStage 1
Stage 2
Additionally, 89 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 2118366bbfe2e57ec0e8417ea270833e9f013640 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (2118366): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.2%, secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 487.651s -> 490.55s (0.59%) |
Successful merges:
bool::toggle#159296 (Implementbool::toggle)overflowing_literalslint with repeated negation #158302 (Fixoverflowing_literalslint with repeated negation)coldandtrack_callerattributes #158484 (Add documentation for thecoldandtrack_callerattributes)Failed merges:
proc_macroattribute documentation #158962 (Addproc_macroattribute documentation)r? @ghost
Create a similar rollup