about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-08-30Factor out some repetitive code.Nicholas Nethercote-81/+38
2024-08-30Remove some unnecessary constants.Nicholas Nethercote-18/+15
These are just renamings of `CoroutineArgs` constants.
2024-08-30Merge `DerefArgVisitor` and `PinArgVisitor`.Nicholas Nethercote-47/+7
They are almost identical, differing only in the `ProjectionElem` they insert. This commit merges them into a new type `SelfArgVisitor`.
2024-08-30Merge some `if`s.Nicholas Nethercote-24/+15
For more concise code.
2024-08-30Use a local variable.Nicholas Nethercote-1/+1
2024-08-30Simplify a pattern.Nicholas Nethercote-2/+1
2024-08-30Simplify creation of a set.Nicholas Nethercote-3/+1
2024-08-30Simplify a provider definition.Nicholas Nethercote-1/+1
2024-08-30Condense `use rustc_*` declarations.Nicholas Nethercote-3/+2
No reason to have two of them listed separately, after modules.
2024-08-30Remove unused features.Nicholas Nethercote-2/+0
2024-08-29Auto merge of #129750 - GuillaumeGomez:rollup-gphsb7y, r=GuillaumeGomezbors-644/+1587
Rollup of 7 pull requests Successful merges: - #123940 (debug-fmt-detail option) - #128166 (Improved `checked_isqrt` and `isqrt` methods) - #128970 (Add `-Zlint-llvm-ir`) - #129316 (riscv64imac: allow shadow call stack sanitizer) - #129690 (Add `needs-unwind` compiletest directive to `libtest-thread-limit` and replace some `Path` with `path` in `run-make`) - #129732 (Add `unreachable_pub`, round 3) - #129743 (Fix rustdoc clippy lints) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-29Auto merge of #129714 - saethlin:half-a-recursion, r=compiler-errorsbors-1/+9
Use a reduced recursion limit in the MIR inliner's cycle breaker This probably papers over https://github.com/rust-lang/rust/issues/128887, but primarily I'm opening this PR because multiple compiler people have thought about making this change which probably means it's a good idea. r? compiler-errors
2024-08-29Rollup merge of #129743 - GuillaumeGomez:fix-rustdoc-clippy, r=notriddleGuillaume Gomez-105/+94
Fix rustdoc clippy lints Ran clippy on rustdoc and fixed the errors. r? `@notriddle`
2024-08-29Rollup merge of #129732 - nnethercote:unreachable_pub-3, r=UrgauGuillaume Gomez-347/+403
Add `unreachable_pub`, round 3 A follow-up to #129648. r? `@Urgau`
2024-08-29Rollup merge of #129690 - Oneirical:run-make-tidbits, r=jieyouxuGuillaume Gomez-56/+43
Add `needs-unwind` compiletest directive to `libtest-thread-limit` and replace some `Path` with `path` in `run-make` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). This PR does two things: 1. Add this to `libtest-thread-limit` ([Why?](https://github.com/rust-lang/rust/pull/128507#issuecomment-2315158014)) ``` //@ needs-unwind // Reason: this should be ignored in cg_clif (Cranelift) CI and anywhere // else that uses panic=abort. ``` 2. Use `path` instead of `Path` to simplify multiple run-make tests.
2024-08-29Rollup merge of #129316 - dingxiangfei2009:riscv64-imac-scs, r=nnethercoteGuillaume Gomez-9/+52
riscv64imac: allow shadow call stack sanitizer cc `@Darksonn` for shadow call stack sanitizer support on RV64IMAC and RV64GC
2024-08-29Rollup merge of #128970 - DianQK:lint-llvm-ir, r=nikicGuillaume Gomez-4/+26
Add `-Zlint-llvm-ir` This flag is similar to `-Zverify-llvm-ir` and allows us to lint the generated IR. r? compiler
2024-08-29Rollup merge of #128166 - ChaiTRex:isqrt, r=tgross35Guillaume Gomez-67/+684
Improved `checked_isqrt` and `isqrt` methods ### Improved tests of `isqrt` and `checked_isqrt` implementations * Inputs chosen more thoroughly and systematically. * Checks that `isqrt` and `checked_isqrt` have equivalent results for signed types, either equivalent numerically or equivalent as a panic and a `None`. * Checks that `isqrt` has numerically-equivalent results for unsigned types and their `NonZero` counterparts. ### Added benchmarks for `isqrt` implementations ### Greatly sped up `checked_isqrt` and `isqrt` methods * Uses a lookup table for 8-bit integers and then the Karatsuba square root algorithm for larger integers. * Includes optimization hints that give the compiler the exact numeric range of results. ### Feature tracking issue `isqrt` is an unstable feature tracked at #116226. <details><summary>Benchmarked improvements</summary> ### Command used to benchmark ./x bench library/core -- int_sqrt ### Before benchmarks: num::int_sqrt::i128::isqrt 439591.65/iter +/- 6652.70 num::int_sqrt::i16::isqrt 5302.97/iter +/- 160.93 num::int_sqrt::i32::isqrt 62999.11/iter +/- 2022.05 num::int_sqrt::i64::isqrt 125248.81/iter +/- 1674.43 num::int_sqrt::i8::isqrt 123.56/iter +/- 1.87 num::int_sqrt::isize::isqrt 125356.56/iter +/- 1017.03 num::int_sqrt::non_zero_u128::isqrt 437443.75/iter +/- 3535.43 num::int_sqrt::non_zero_u16::isqrt 8604.58/iter +/- 94.76 num::int_sqrt::non_zero_u32::isqrt 62933.33/iter +/- 517.30 num::int_sqrt::non_zero_u64::isqrt 125076.38/iter +/- 11340.61 num::int_sqrt::non_zero_u8::isqrt 221.51/iter +/- 1.58 num::int_sqrt::non_zero_usize::isqrt 136005.21/iter +/- 2020.35 num::int_sqrt::u128::isqrt 439014.55/iter +/- 3920.45 num::int_sqrt::u16::isqrt 8575.08/iter +/- 148.06 num::int_sqrt::u32::isqrt 63008.89/iter +/- 803.67 num::int_sqrt::u64::isqrt 125088.09/iter +/- 879.29 num::int_sqrt::u8::isqrt 230.18/iter +/- 2.04 num::int_sqrt::usize::isqrt 125237.51/iter +/- 4747.83 ### After benchmarks: num::int_sqrt::i128::isqrt 105184.89/iter +/- 1171.38 num::int_sqrt::i16::isqrt 1910.26/iter +/- 78.50 num::int_sqrt::i32::isqrt 34260.34/iter +/- 960.84 num::int_sqrt::i64::isqrt 45939.19/iter +/- 2525.65 num::int_sqrt::i8::isqrt 22.87/iter +/- 0.45 num::int_sqrt::isize::isqrt 45884.17/iter +/- 595.49 num::int_sqrt::non_zero_u128::isqrt 106344.27/iter +/- 780.99 num::int_sqrt::non_zero_u16::isqrt 2790.19/iter +/- 53.43 num::int_sqrt::non_zero_u32::isqrt 33613.99/iter +/- 362.96 num::int_sqrt::non_zero_u64::isqrt 46235.42/iter +/- 429.69 num::int_sqrt::non_zero_u8::isqrt 31.78/iter +/- 0.75 num::int_sqrt::non_zero_usize::isqrt 46208.75/iter +/- 375.27 num::int_sqrt::u128::isqrt 106385.94/iter +/- 1649.95 num::int_sqrt::u16::isqrt 2747.69/iter +/- 28.72 num::int_sqrt::u32::isqrt 33627.09/iter +/- 475.68 num::int_sqrt::u64::isqrt 46182.29/iter +/- 311.16 num::int_sqrt::u8::isqrt 33.10/iter +/- 0.30 num::int_sqrt::usize::isqrt 46165.00/iter +/- 388.41 </details> Tracking Issue for {u8,i8,...}::isqrt #116226 try-job: test-various
2024-08-29Rollup merge of #123940 - kornelski:remove-derived-debug, r=UrgauGuillaume Gomez-56/+285
debug-fmt-detail option I'd like to propose a new option that makes `#[derive(Debug)]` generate no-op implementations that don't print anything, and makes `{:?}` in format strings a no-op. There are a couple of motivations for this: 1. A more thorough stripping of debug symbols. Binaries stripped of debug symbols still retain some of them through `Debug` implementations. It's hard to avoid that without compiler's help, because debug formatting can be used in many places, including dependencies, and their loggers, asserts, panics, etc. * In my testing it gives about 2% binary size reduction on top of all other binary-minimizing best practices (including `panic_immediate_abort`). There are targets like Web WASM or embedded where users pay attention to binary sizes. * Users distributing closed-source binaries may not want to "leak" any symbol names as a matter of principle. 2. Adds ability to test whether code depends on specifics of the `Debug` format implementation in unwise ways (e.g. trying to get data unavailable via public interface, or using it as a serialization format). Because current Rust's debug implementation doesn't change, there's a risk of it becoming a fragile de-facto API that [won't be possible to change in the future](https://www.hyrumslaw.com/). An option that "breaks" it can act as a [grease](https://www.rfc-editor.org/rfc/rfc8701.html). This implementation is a `-Z fmt-debug=opt` flag that takes: * `full` — the default, current state. * `none` — makes derived `Debug` and `{:?}` no-ops. Explicit `impl Debug for T` implementations are left unharmed, but `{:?}` format won't use them, so they may get dead-code eliminated if they aren't invoked directly. * `shallow` — makes derived `Debug` print only the type's name, without recursing into fields. Fieldless enums print their variant names. `{:?}` works. The `shallow` option is a compromise between minimizing the `Debug` code, and compatibility. There are popular proc-macro crates that use `Debug::fmt` as a way to convert enum values into their Rust source code. There's a corresponding `cfg` flag: `#[cfg(fmt_debug = "none")]` that can be used in user code to react to this setting to minimize custom `Debug` implementations or remove unnecessary formatting helper functions.
2024-08-29Use path instead of Path in some run-make testsOneirical-56/+40
2024-08-29Add needs-unwind compiletest directive to libtest-thread-limitOneirical-0/+3
2024-08-29riscv64imac: allow shadow call stack sanitizerDing Xiang Fei-9/+52
2024-08-29Add `warn(unreachable_pub)` to `rustc_resolve`.Nicholas Nethercote-0/+1
2024-08-29Add `warn(unreachable_pub)` to `rustc_query_system`.Nicholas Nethercote-10/+11
2024-08-29Add `warn(unreachable_pub)` to `rustc_query_impl`.Nicholas Nethercote-18/+27
2024-08-29Add `warn(unreachable_pub)` to `rustc_privacy`.Nicholas Nethercote-10/+11
2024-08-29Add `warn(unreachable_pub)` to `rustc_pattern_analysis`.Nicholas Nethercote-0/+1
2024-08-29Add `warn(unreachable_pub)` to `rustc_passes`.Nicholas Nethercote-192/+197
2024-08-29Fix clippy lintsGuillaume Gomez-105/+94
2024-08-29Add `warn(unreachable_pub)` to `rustc_parse_format`.Nicholas Nethercote-0/+1
2024-08-29Add `warn(unreachable_pub)` to `rustc_parser`.Nicholas Nethercote-35/+36
2024-08-29Add `warn(unreachable_pub)` to `rustc_next_trait_solver`.Nicholas Nethercote-26/+37
2024-08-29Add `warn(unreachable_pub)` to `rustc_monomorphize`.Nicholas Nethercote-17/+22
2024-08-29Add `warn(unreachable_pub)` to `rustc_mir_dataflow`.Nicholas Nethercote-7/+8
2024-08-29Add `warn(unreachable_pub)` to `rustc_mir_build`.Nicholas Nethercote-1/+2
2024-08-29Add `warn(unreachable_pub)` to `rustc_middle`.Nicholas Nethercote-8/+10
I am surprised the diff is so small for this enormous crate.
2024-08-29Add `warn(unreachable_pub)` to `rustc_metadata`.Nicholas Nethercote-14/+29
2024-08-29Add `warn(unreachable_pub)` to `rustc_macros`.Nicholas Nethercote-16/+17
2024-08-29Add `-Zlint-llvm-ir`DianQK-4/+26
2024-08-28Speed up `checked_isqrt` and `isqrt` methodsChai T. Rex-35/+371
* Use a lookup table for 8-bit integers and the Karatsuba square root algorithm for larger integers. * Include optimization hints that give the compiler the exact numeric range of results.
2024-08-28Improve `isqrt` tests and add benchmarksChai T. Rex-32/+313
* Choose test inputs more thoroughly and systematically. * Check that `isqrt` and `checked_isqrt` have equivalent results for signed types, either equivalent numerically or equivalent as a panic and a `None`. * Check that `isqrt` has numerically-equivalent results for unsigned types and their `NonZero` counterparts. * Reuse `ilog10` benchmarks, plus benchmarks that use a uniform distribution.
2024-08-29Auto merge of #129721 - workingjubilee:rollup-y2o1mnp, r=workingjubileebors-467/+798
Rollup of 14 pull requests Successful merges: - #128192 (rustc_target: Add various aarch64 features) - #129170 (Add an ability to convert between `Span` and `visit::Location`) - #129343 (Emit specific message for time<=0.3.35) - #129378 (Clean up cfg-gating of ProcessPrng extern) - #129401 (Partially stabilize `feature(new_uninit)`) - #129467 (derive(SmartPointer): assume pointee from the single generic and better error messages) - #129494 (format code in tests/ui/threads-sendsync) - #129617 (Update books) - #129673 (Add fmt::Debug to sync::Weak<T, A>) - #129683 (copysign with sign being a NaN can have non-portable results) - #129689 (Move `'tcx` lifetime off of impl and onto methods for `CrateMetadataRef`) - #129695 (Fix path to run clippy on rustdoc) - #129712 (Correct trusty targets to be tier 3) - #129715 (Update `compiler_builtins` to `0.1.123`) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-28Rollup merge of #129715 - Amjad50:update-compiler-builtins, r=tgross35Jubilee-4/+4
Update `compiler_builtins` to `0.1.123` Includes https://github.com/rust-lang/compiler-builtins/pull/680 and fixes https://github.com/rust-lang/rust/issues/128386. Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored r? tgross35
2024-08-28Rollup merge of #129712 - randomPoison:trusty-tier-3-fix, r=saethlinJubilee-2/+2
Correct trusty targets to be tier 3 The Trusty targets were added in https://github.com/rust-lang/rust/pull/129490, but in that PR I accidentally marked them as tier 2. This PR corrects the target metadata to mark them as tier 3.
2024-08-28Rollup merge of #129695 - GuillaumeGomez:fix-clippy-rustdoc-path, r=onur-ozkanJubilee-1/+1
Fix path to run clippy on rustdoc Took me a while to find out that the path clippy expected was `src/tools/rustdoc` and not `src/librustdoc`. I think it makes more sense this way as most commands rely on source paths. r? ```@Kobzol```
2024-08-28Rollup merge of #129689 - compiler-errors:impl-lifetime, r=michaelwoeristerJubilee-14/+18
Move `'tcx` lifetime off of impl and onto methods for `CrateMetadataRef` Unconstrained type and const variables are not allowed, but unconstrained lifetimes are. This is not very good style, though, and it leads to unnecessary captures of a lifetime in edition 2024 (not that it matters, but it does trigger the edition migration lint).
2024-08-28Rollup merge of #129683 - RalfJung:copysign, r=thomccJubilee-12/+32
copysign with sign being a NaN can have non-portable results Follow-up to https://github.com/rust-lang/rust/pull/129559. Cc ```@tgross35``` ```@beetrees``` There's no portable variant we can recommend instead here, is there? Something with a semantics like "if `sign` is a NaN, then return `self` unaltered, otherwise return `self` with the sign changed to that of `sign`"?
2024-08-28Rollup merge of #129673 - matthewpipie:arc-weak-debug-trait, r=dtolnayJubilee-1/+1
Add fmt::Debug to sync::Weak<T, A> Currently, `sync::Weak<T>` implements `Debug`, but `sync::Weak<T, A>` does not. This appears to be an oversight, as `rc::Weak<T, A>` implements `Debug`. (Note: `sync::Weak` is the weak for `Arc`, and `rc::Weak` is the weak for `Rc`.) This PR adds the Debug trait for `sync::Weak<T, A>`. The issue was initially brought up here: https://github.com/rust-lang/wg-allocators/issues/131
2024-08-28Rollup merge of #129617 - rustbot:docs-update, r=ehussJubilee-0/+1
Update books ## rust-lang/book 4 commits in 04bc1396bb857f35b5dda1d773c9571e1f253304..e7d217be2a75ef1753f0988d6ccaba4d7e376259 2024-08-14 01:19:47 UTC to 2024-08-13 16:51:00 UTC - Backport/forward port ch12 (rust-lang/book#4008) - Found some more things to fix in ch7; I forgot to update the snapshot (rust-lang/book#4007) - Remove redundant sentence. Send to nostarch (rust-lang/book#4006) - Fix: typo (rust-lang/book#4003) ## rust-lang/edition-guide 5 commits in aeeb287d41a0332c210da122bea8e0e91844ab3e..eeba2cb9c37ab74118a4fb5e5233f7397e4a91f8 2024-08-19 23:28:06 UTC to 2024-08-15 15:12:33 UTC - 2024: Add rustdoc combined doctests (rust-lang/edition-guide#320) - Update for unsafe attributes stabilization (rust-lang/edition-guide#319) - 2024: Add macro-fragment-specifiers. (rust-lang/edition-guide#312) - Fix deprecated_safe_2024 link (rust-lang/edition-guide#317) - Add 2024 unsafe functions (rust-lang/edition-guide#304) ## rust-embedded/book 1 commits in 019f3928d8b939ec71b63722dcc2e46330156441..ff5d61d56f11e1986bfa9652c6aff7731576c37d 2024-08-20 07:26:19 UTC to 2024-08-20 07:26:19 UTC - Use aligned address to demonstrate HardFault (rust-embedded/book#374) ## rust-lang/nomicon 1 commits in 6ecf95c5f2bfa0e6314dfe282bf775fd1405f7e9..14649f15d232d509478206ee9ed5105641aa60d0 2024-08-14 14:49:09 UTC to 2024-08-14 14:49:09 UTC - CI: Switch to merge queue (rust-lang/nomicon#459) ## rust-lang/reference 14 commits in 62cd0df95061ba0ac886333f5cd7f3012f149da1..0668397076da350c404dadcf07b6cbc433ad3743 2024-08-11 21:06:12 +0000 to 2024-08-27 21:47:20 +0000 - Update enum.md (rust-lang/reference#1354) - Be consistent about how "Edition differences" is capitalized (rust-lang/reference#1586) - Sync denied lints with upstream (rust-lang/reference#1589) - const_eval: update for const-fn float stabilization (rust-lang/reference#1566) - Add spec identifier syntax to destructors.md (rust-lang/reference#1571) - Say that `pub(in path)` can't depend on `use` statements (rust-lang/reference#1559) - bytes inside implicitly const-promoted expressions are immutable (rust-lang/reference#1554) - Tweak `repr(transparent)` to mention requiring *at most* one non-1-ZST (rust-lang/reference#1568) - operator expressions: add &raw (rust-lang/reference#1567) - Rewrite the automatic std link translation, and switch to automatic links (rust-lang/reference#1578) - Add some basic docs for unsafe attrs (rust-lang/reference#1539) - don't capitalize Undefined Behavior (rust-lang/reference#1575) - add the `const` operand to docs for inline assembly (rust-lang/reference#1556) - Typo: 'a' to 'an' in type-coercions.md (rust-lang/reference#1572) ## rust-lang/rust-by-example 1 commits in 8f94061936e492159f4f6c09c0f917a7521893ff..859786c5bc99301bbc22fc631a5c2b341860da08 2024-08-26 10:30:48 UTC to 2024-08-26 10:30:48 UTC - Update primitives.md with examples (rust-lang/rust-by-example#1878) ## rust-lang/rustc-dev-guide 7 commits in 43d83780db545a1ed6d45773312fc578987e3968..fa928a6d19e1666d8d811dfe3fd35cdad3b4e459 2024-08-26 14:46:50 UTC to 2024-08-12 21:07:49 UTC - Fix x.py reference (rust-lang/rustc-dev-guide#2049) - Update `stabilization_guide.md` (rust-lang/rustc-dev-guide#2034) - Explain the internal `#[rustc_*]` TEST attributes used for debugging and inside tests (rust-lang/rustc-dev-guide#2046) - missing char (rust-lang/rustc-dev-guide#2047) - Replace direct http links to rustc-dev-guide.rust-lang.org (rust-lang/rustc-dev-guide#2044) - Update index.html, 39. The MIR: fix typo (rust-lang/rustc-dev-guide#2043) - Update LLVM docs (rust-lang/rustc-dev-guide#2039)
2024-08-28Rollup merge of #129494 - tshepang:fmt-threads-sendsync, r=NadrierilJubilee-247/+315
format code in tests/ui/threads-sendsync was thinking of fixing formatting for 1 test in the directory, but found a bunch of them to also be in need