about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-08-31Rollup merge of #129366 - petrochenkov:libsearch, r=jieyouxuMatthias Krüger-1/+1
linker: Synchronize native library search in rustc and linker Also search for static libraries with alternative naming (`libname.a`) on MSVC when producing executables or dynamic libraries, and not just rlibs. This unblocks https://github.com/rust-lang/rust/pull/123436. try-job: x86_64-msvc
2024-08-31Rollup merge of #126183 - Folyd:search-core, r=GuillaumeGomez,notriddleMatthias Krüger-2281/+2319
Separate core search logic with search ui Currenty, the `search.js` mixed with UI/DOM manipulation codes and search logic codes, I propose to extract the search logic to a class for following benefits: - Clean code. Separation of DOM manipulation and search logic can lead better code maintainability and easy code testings. - Easy share the search logic for third party to utilize the search function, such as [Rust Search Extension](https://rust.extension.sh), https://query.rs. This PR added a new class called `DocSearch`, which mainly expose following methods: ```js class DocSearch { // Dependency inject searchIndex, rootPath and searchState constructor(rawSearchIndex, rootPath, searchState) { // build search index... } static parseQuery(userQuery) { } async execQuery(parsedQuery, filterCrates, currentCrate) { } } ```
2024-08-31Auto merge of #18011 - Wilfred:op_queue_doc_comments, r=Veykrilbors-0/+11
internal: Add doc comments to OpQueue I spent a while debugging some OpQueue behaviours and found the API slightly confusing, so I've added doc comments to clarify what each OpQueue method does.
2024-08-31Auto merge of #129797 - workingjubilee:cleanup-apple-ci, r=workingjubileebors-8/+23
Try to reduce space usage in dist CI We have had recurrent CI problems as a result of GitHub adding a new version of Xcode to its runners[^0], which has consumed ~40GB of space which served as padding. Try to reduce the number of Xcodes on our systems, because we only use Xcode 14 in actual practice. Also, try to move files instead of pointlessly copy them when we're at the end of the job. I could not resist addressing a few shellcheck lints while I was at it. [^0]: https://github.com/actions/runner-images/issues/10511
2024-08-30ci: Take tail instead of head to avoid broken pipesJubilee Young-3/+1
2024-08-30ci: Avoid legacy backticks in upload-artifacts.shJubilee Young-1/+1
2024-08-30ci: Use mv instead of cp in upload stepJubilee Young-4/+4
2024-08-30ci: Try to remove unused Xcode dirsJubilee Young-0/+17
2024-08-31Update cargoWeihang Lo-0/+0
2024-08-31Auto merge of #17945 - alibektas:ratoml_categorization, r=alibektasbors-644/+607
Recategorize config classes
2024-08-31Apply changes, fix path information in a comment in config.rsAli Bektas-19/+4
2024-08-31Unify scraped examples with other code examplesGuillaume Gomez-130/+134
2024-08-30Bump to 1.83Boxy-1/+1
2024-08-30Auto merge of #18010 - Veykril:inlay-hints-lt, r=Veykrilbors-358/+597
feat: Support fn-ptr and fn-path types for lifetime elision hints All still syntax based unfortunately but that won't change for quite a while
2024-08-30Support fn-ptr and fn-path types for lifetime elision hintsLukas Wirth-358/+597
2024-08-30Auto merge of #18009 - Veykril:reformat-no-rustup, r=Veykrilbors-22/+26
fix: do not assume rustup is installed in xtask codegen take 2 7d9e4fcc07e5de94e37b73436147cdbbaa35dbdc broke this on rustup toolchains, the `cmd` command is trying to be too smart here
2024-08-30Allow xtask::reformat to work without rustupLukas Wirth-18/+26
2024-08-30Revert "fix: do not assume rustup is installed in xtask codegen"Lukas Wirth-19/+15
This reverts commit 7d9e4fcc07e5de94e37b73436147cdbbaa35dbdc.
2024-08-30enable Miri to pass const pointers through FFIStrophox-5/+257
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-08-30Auto merge of #18008 - Veykril:inlay-hints-resolve, r=Veykrilbors-216/+282
internal: Improve inlay hint resolution reliability The payload now ships the range the inlay hint ought to be triggered for instead of trying to estimate it from its position which is somewhat brittle
2024-08-30Improve inlay hint resolution reliabilityLukas Wirth-216/+282
2024-08-30fix(ide-completion): fix handling of `for` in `impl T for A` in function bodyrami3l-5/+81
2024-08-30Make `./x.py <cmd> compiler/<crate>` aware of the crate's featuresLukas Wirth-12/+30
2024-08-30Auto merge of #18003 - ChayimFriedman2:addr_of-static-mut, r=Veykrilbors-7/+78
Do not report missing unsafe on `addr_of[_mut]!(EXTERN_OR_MUT_STATIC)` The compiler no longer does as well; see https://github.com/rust-lang/rust/pull/125834. Also require unsafe when accessing `extern` `static` (other than by `addr_of!()`). Fixes #17978.
2024-08-30add borrows to NLL MIR dumpsRémy Rakic-0/+1
explicitly disable `-Zmir-include-spans` in mir-opt tests This will override the NLL default of true, and keep the blessed dumps easier to work with.
2024-08-30Auto merge of #17999 - ShoyuVanilla:issue-17998, r=Veykrilbors-21/+45
fix: `std::error::Error` is object unsafe Fixes #17998 I tried to get generic predicates of assoc function itself, not inherited from the parent here; https://github.com/rust-lang/rust-analyzer/blob/0ae42bd42576566540a84c62e118aa823edcf2ec/crates/hir-ty/src/object_safety.rs#L420-L442 But this naive equality check approach doesn't work when the assoc function has one or more generic paramters like; ```rust trait Foo {} trait Bar: Foo { fn bar(&self); } ``` because the generic predicates of the parent, `Bar` is `[^1.0 implements Foo]` and the generic predicates of `fn bar` is `[^1.1 implements Foo]`, which are different. This PR implements a correct logic for filtering out parent generic predicates for this.
2024-08-30bootstrap: Try to track down why `initial_libdir` sometimes failsZalathar-8/+14
Determining this path occasionally fails locally for unknown reasons, resulting in the build failing with an unhelpful `StripPrefixError(())` panic message. In order to track down why that's happening, include some relevant information in the panic message when that failure occurs.
2024-08-30Squashed `aarch64_unknown_nto_qnx700` supportYuri Astrakhan-0/+19
2024-08-30Merge from rustcThe Miri Cronjob Bot-119/+153
2024-08-30Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-08-30Remove `#[macro_use] extern crate tracing` from rustfmt.Nicholas Nethercote-2/+17
2024-08-30Remove `#[macro_use] extern crate tracing` from rustfmt.Nicholas Nethercote-2/+17
2024-08-30Remove `#[macro_use] extern crate tracing` from rustfmt helpers.Nicholas Nethercote-6/+2
2024-08-30Remove `#[macro_use] extern crate tracing` from rustfmt helpers.Nicholas Nethercote-6/+2
2024-08-30Remove `#[macro_use] extern crate tracing` from rustdoc.Nicholas Nethercote-2/+30
2024-08-29Update the `wasm-component-ld` binary dependencyAlex Crichton-1/+1
This keeps it up-to-date by moving from 0.5.6 to 0.5.7. While here I've additionally updated some other wasm-related dependencies in the workspace to keep them up-to-date and try to avoid duplicate versions as well.
2024-08-29fix: consider indentation in the "Generate impl" and "Generate trait impl" ↵Ivar Scholten-13/+76
assists This makes the generated impl's indentation match the ADT it targets, improving formatting when using nested modules inside of the same file or when defining types inside of a function.
2024-08-29Do not report missing unsafe on `addr_of[_mut]!(EXTERN_OR_MUT_STATIC)`Chayim Refael Friedman-6/+51
The compiler no longer does as well; see https://github.com/rust-lang/rust/pull/125834.
2024-08-29Add diagnostic for accessing an `extern` staticChayim Refael Friedman-1/+27
2024-08-30fix: `std::error::Error` is object unsafeShoyu Vanilla-21/+45
2024-08-29interpret/visitor: make memory order iteration slightly more efficientRalf Jung-8/+5
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 #129316 - dingxiangfei2009:riscv64-imac-scs, r=nnethercoteGuillaume Gomez-7/+33
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-0/+7
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 #123940 - kornelski:remove-derived-debug, r=UrgauGuillaume Gomez-1/+17
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-29riscv64imac: allow shadow call stack sanitizerDing Xiang Fei-7/+33
2024-08-29Auto merge of #17814 - ShoyuVanilla:object-safety, r=Veykrilbors-66/+1194
feat: Implement object safety and its hovering hint Resolves #17779 - [x] Fill missing implementations - [x] Hover rendering - [x] Implement object safety's own test suite, like layout - [x] Add test cases (from rustc maybe) - [x] Clean up ugly codes - [x] Add doc string
2024-08-29feat: Implement object safetyShoyu Vanilla-66/+1194
2024-08-29Auto merge of #13246 - xFrednet:12292-remove-cargo-clippy-feature, r=flip1995bors-2/+0
Remove `feature=cargo-clippy` argument Roses are red, Violets are blue, Fixme was written, And now it's due --- changelog: **Important Change** Removed the implicit `cargo-clippy` feature set by Clippy as announced here: <https://blog.rust-lang.org/2024/02/28/Clippy-deprecating-feature-cargo-clippy.html> [#13246](https://github.com/rust-lang/rust-clippy/pull/13246) Follow-up of: rust-lang/rust-clippy#12292 r? `@flip1995` cc: `@GuillaumeGomez`
2024-08-29Auto merge of #17975 - IvarWithoutBones:dont-assume-rustup, r=Veykrilbors-15/+19
fix: do not assume rustup is installed in xtask codegen When formatting generated code the xtask crate attempts to run `rustup run stable rustfmt`, which fails if `rustup` is not installed. This results in test failures when another source manages the compiler toolchain, for example when using Nix (or any other distro-specific packaging solution): * xtask::codegen::grammar::test * xtask::codegen::assists_doc_tests::test With this PR xtask will first attempt to run `rustup run stable rustfmt`, and if that fails just plain `rustfmt`. It still validates a stable version is being used. This allows `cargo test` to pass on systems that do not use `rustup`.