about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-09-24Revise wording to not imply *only* Python 3.10 can be installed许杰友 Jieyou Xu (Joe)-4/+3
2024-09-24Update src/tests/compiletest.mdnora-1/+3
2024-09-24Document `crashes` test suite许杰友 Jieyou Xu (Joe)-0/+37
Describe procedure for adding new crashes tests and removing crashes tests when the crash is intentionally fixed. Also mention setting `COMPILETEST_VERBOSE_CRASHES=1` env var for verbose crashes test output.
2024-09-24Fix getting diagnostics exampleVetle Rasmussen-3/+6
2024-09-24Document `#[rustc_default_body_unstable]`dianne-0/+10
2024-09-24Describe `.git-blame-ignore-rev`许杰友 Jieyou Xu (Joe)-0/+13
2024-09-24Note lldb debuginfo requires `python310.dll` to be present in `PATH`许杰友 Jieyou Xu (Joe)-0/+11
2024-09-24Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure许杰友 Jieyou Xu (Joe)-4/+5
2024-09-24Remove unused import from Clippy versions.py filePhilipp Krones-1/+0
2024-09-24Auto merge of #18164 - ShoyuVanilla:use-as-alias, r=Veykrilbors-13/+97
fix: Temporary fix for `remove_unused_imports` not handling import aliases correctly Fixes #18129
2024-09-24fix: Temporary fix for `remove_unused_imports` not handling import aliases ↵Shoyu Vanilla-13/+97
correctly
2024-09-24Fix toolsMichael Goulet-19/+9
2024-09-24Fix `run-make-support` to respect per-stage cargo许杰友 Jieyou Xu (Joe)-2/+3
2024-09-24Fix tool cargo being off-by-one from rustc staging许杰友 Jieyou Xu (Joe)-0/+8
Previously if you pass compiler stage 1 to `tool::Cargo`, it will build stage2 rustc and give you back a cargo built with stage2 rustc, which is not what we want. This commit adds a hack that chops off a stage from the compiler passed to `tool::Cargo`, meaning that we will get a cargo built with stage 1 compiler, avoiding unnecessary and incorrect build of stage2 rustc and the cargo built by that.
2024-09-24Auto merge of #18166 - ChayimFriedman2:dollar-crate-root, r=Veykrilbors-5/+33
fix: Fix a bug in span map merge, and add explanations of how span maps are stored Because it took me hours to figure out that contrary to common sense, the offset stored is the *end* of the node, and we search by the *start*. Which is why we need a convoluted `partition_point()` instead of a simple `binary_search()`. And this was not documented at all. Which made me make mistakes with my implementation of `SpanMap::merge()`. The other bug fixed about span map merging is correctly keeping track of the current offset in presence of multiple sibling macro invocations. Unrelated, but because of the previous issue it took me hours to debug, so I figured out I'll put them together for posterity. Fixes #18163.
2024-09-24Auto merge of #18161 - ChayimFriedman2:postfix-mut, r=Veykrilbors-1/+52
fix: Better support references in consuming postfix completions Fixes #18155.
2024-09-24Auto merge of #18160 - ChayimFriedman2:fix-18138, r=Veykrilbors-13/+82
fix: Fix name resolution when an import is resolved to some namespace and then later in the algorithm another namespace is added The import is flagged as "indeterminate", and previously it was re-resolved, but only at the end of name resolution, when it's already too late for anything that depends on it. This issue was tried to fix in https://github.com/rust-lang/rust-analyzer/pull/2466, but it was not fixed fully. That PR is also why IDE features did work: the import at the end was resolved correctly, so IDE features that re-resolved the macro path resolved it correctly. I was concerned about the performance of this, but this doesn't seem to regress `analysis-stats .`, so I guess it's fine to land this. I have no idea about the incremental perf however and I don't know how to measure that, although when typing in `zbus` (including creating a new function, which should recompute the def map) completion was fast enough. I didn't check what rustc does, so maybe it does something more performant, like keeping track of only possibly problematic imports. Fixes #18138. Probably fixes #17630.
2024-09-24Auto merge of #18157 - ↵bors-1/+5
davidbarsky:davidbarsky/respect-disabling-proc-macros-in-analysis-stats, r=Veykril analysis-stats: respect `--disable-proc-macros` flag I noticed that this flag wasn't being respected by `analysis-stats` when profiling proc macro expansion, so here's a small fix.
2024-09-24Auto merge of #18123 - jhgg:fix-ambigius-package-cargo-check, r=Veykrilbors-1/+1
fix: fix ambigious package name in flycheck fixes #18121
2024-09-24Hotfix: remove profile from clippy Cargo.tomlPhilipp Krones-7/+0
2024-09-24Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into ↵Philipp Krones-3/+1
clippy-subtree-update
2024-09-24Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into ↵Philipp Krones-2571/+7437
clippy-subtree-update
2024-09-24Auto merge of #18175 - Wilfred:completion_marker, r=Veykrilbors-1/+1
internal: Make COMPLETION_MARKER more explicitly r-a If a user ever sees the completion marker, it's confusing to see text about IntelliJ. Use a string that's more explicitly about completion for rust-analyzer.
2024-09-24Auto merge of #18162 - ChayimFriedman2:gat-object-safe, r=Veykrilbors-1/+14
fix: Consider lifetime GATs object unsafe Fixes #18156.
2024-09-24Scope CI permissions to the job that needs itJakub Beránek-6/+5
2024-09-24Pass bootstrap cargo when `--stage 0` and `COMPILETST_FORCE_STAGE0`许杰友 Jieyou Xu (Joe)-4/+9
And stop passing `BOOTSTRAP_CARGO` as an env var, instead the provided cargo should go through `--cargo-path.`
2024-09-24looks like we need more permissionsRalf Jung-1/+3
2024-09-23Rollup merge of #130759 - rustbot:docs-update, r=ehussMichael Goulet-0/+0
Update books ## rust-lang/book 5 commits in e7d217be2a75ef1753f0988d6ccaba4d7e376259..99cf75a5414fa8adbe3974bd0836661ca901708f 2024-09-23 16:18:39 UTC to 2024-09-11 18:38:03 UTC - translations: remove broken link (rust-lang/book#4036) - Update build instructions: include mdbook plugins (rust-lang/book#4032) - Add `cargo init` usage suggestion to 1.3 (rust-lang/book#4025) - Use immutable borrow of `TcpStream` when creating `BufReader` (rust-lang/book#4024) - Upgrade to Rust 1.81 (rust-lang/book#4031) ## rust-lang/edition-guide 1 commits in b3ca7ade0f87d7e3fb538776defc5b2cc4188172..c7ebae25cb4801a31b6f05353f6d85bfa6feedd1 2024-09-22 08:47:02 UTC to 2024-09-22 08:47:02 UTC - Update static_mut_refs now that it is a lint (rust-lang/edition-guide#322) ## rust-lang/reference 10 commits in 687faf9958c52116d003b41dfd29cc1cf44f5311..24fb2687cdbc54fa18ae4acf5d879cfceca77b2c 2024-09-22 09:07:12 UTC to 2024-09-10 19:24:17 UTC - do not talk about the 'address of a constant' (rust-lang/reference#1624) - Add spec identifier syntax to interior-mutability.md (rust-lang/reference#1585) - Add spec identifier syntax to input-format.md (rust-lang/reference#1584) - Document limitations on block doc comments (rust-lang/reference#1602) - Places based on misaligned pointers: also mention 'static's as a possible base for place projections (rust-lang/reference#1606) - type-layout: mention that call ABI compatibility is a separate concern (rust-lang/reference#1608) - stabilize `const_extern_fn` (rust-lang/reference#1596) - const_eval: update for const_mut_refs and const_refs_to_cell stabilization (rust-lang/reference#1590) - fix: unclosed tag `sup` (rust-lang/reference#1612) - Fix improper documentation on casting non_exhaustive enums (rust-lang/reference#1607) ## rust-lang/rustc-dev-guide 13 commits in 0ed9229f5b6f7824b333beabd7e3d5ba4b9bd971..555f3de2fa0d61c4294b74d245f1cbad6fcbf589 2024-09-23 12:51:33 UTC to 2024-09-10 07:32:10 UTC - chore: add missing `.` (rust-lang/rustc-dev-guide#2074) - Add remark on required free disk space (rust-lang/rustc-dev-guide#2073) - fix broken links (rust-lang/rustc-dev-guide#2063) - Add advice about submitting potentially hard-to-review PRs (rust-lang/rustc-dev-guide#2036) - Edit a sentence for clarity (rust-lang/rustc-dev-guide#2071) - Emphasize how to run a single tool test (rust-lang/rustc-dev-guide#2070) - Remove chalk is owned by WG-traits (rust-lang/rustc-dev-guide#2068) - Fix conditions lowering text for enums with no fields (rust-lang/rustc-dev-guide#2066) - update proof tree chapter (rust-lang/rustc-dev-guide#2054) - Add docs for JS tests (rust-lang/rustc-dev-guide#2048) - Reflect `x.py test`'s `--rustc-args` option being renamed to `--compiletest-rustc-args` (rust-lang/rustc-dev-guide#2062) - we standardized on this more reliable command (rust-lang/rustc-dev-guide#2061) - Fix Typo and Remove Outdated Line About C Variadics (rust-lang/rustc-dev-guide#2060)
2024-09-23Rollup merge of #130750 - heiher:loong-linux-ohos-tier3, r=jieyouxuMichael Goulet-0/+9
Add new Tier-3 target: `loongarch64-unknown-linux-ohos` MCP: https://github.com/rust-lang/compiler-team/issues/784
2024-09-23Rollup merge of #130727 - compiler-errors:objects, r=RalfJungMichael Goulet-8/+41
Check vtable projections for validity in miri Currently, miri does not catch when we transmute `dyn Trait<Assoc = A>` to `dyn Trait<Assoc = B>`. This PR implements such a check, and fixes https://github.com/rust-lang/miri/issues/3905. To do this, we modify `GlobalAlloc::VTable` to contain the *whole* list of `PolyExistentialPredicate`, and then modify `check_vtable_for_type` to validate the `PolyExistentialProjection`s of the vtable, along with the principal trait that was already being validated. cc ``@RalfJung`` r? ``@lcnr`` or types I also tweaked the diagnostics a bit. --- **Open question:** We don't validate the auto traits. You can transmute `dyn Foo` into `dyn Foo + Send`. Should we check that? We currently have a test that *exercises* this as not being UB: https://github.com/rust-lang/rust/blob/6c6d210089e4589afee37271862b9f88ba1d7755/src/tools/miri/tests/pass/dyn-upcast.rs#L14-L20 I'm not actually sure if we ever decided that's actually UB or not 🤔 We could perhaps still check that the underlying type of the object (i.e. the concrete type that was unsized) implements the auto traits, to catch UB like: ```rust fn main() { let x: &dyn Trait = &std::ptr::null_mut::<()>(); let _: &(dyn Trait + Send) = std::mem::transmute(x); //~^ this vtable is not allocated for a type that is `Send`! } ```
2024-09-23Rollup merge of #129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomezMichael Goulet-174/+373
rustdoc: redesign toolbar and disclosure widgets Fixes #77899 Fixes #90310 ## Preview | before | after | ------ | ----- | ![image](https://github.com/user-attachments/assets/ebeec185-3a72-481d-921e-a9a885f348d9) | ![image](https://github.com/user-attachments/assets/08735a65-99d1-4523-ab77-ddb164c0a5db) | ![image](https://github.com/user-attachments/assets/ae8e0f24-49cb-445d-b9bd-cec9c57b94e7) | ![image](https://github.com/user-attachments/assets/ba484f94-b031-41fc-b8a8-6cd81be8fb6b) | ![image](https://github.com/user-attachments/assets/8c2cc041-a138-4950-a12e-3d529c8a5339) | ![image](https://github.com/user-attachments/assets/e7f010bd-19e2-4711-85bf-3fd00c3e5647) | ![image](https://github.com/user-attachments/assets/e2b63785-971c-489e-b069-eb85f6a30620) | ![image](https://github.com/user-attachments/assets/b65eea16-d6a3-4aa3-8a27-6ded74009010) | ![image](https://github.com/user-attachments/assets/1c7b0901-a61a-4325-9d01-9d8b14b476aa) | ![image](https://github.com/user-attachments/assets/d4a485db-d9f1-4a62-94bc-a3d125ea6dc1) | N/A | ![image](https://github.com/user-attachments/assets/7add0a2a-7fd7-483d-87ee-51ee45a2fe5d) | ![image](https://github.com/user-attachments/assets/334f50bc-9f8d-42d9-a7df-95058f7cdfd5) | ![image](https://github.com/user-attachments/assets/451fcc22-b034-453c-ae4b-b948fd6bd779) | ![image](https://github.com/user-attachments/assets/132f720c-802a-466d-bd55-c7a4750acdc3) | ![image](https://github.com/user-attachments/assets/177b7921-06c5-467d-87d3-9cdf88c4e50b) https://notriddle.com/rustdoc-html-demo-12/toolbar-v2/std/index.html ## Description This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. CC <https://github.com/rust-lang/rust/pull/113074#issuecomment-1677469680> and ``@jsha`` regarding the use of triangles for disclosure, which is what everyone wanted, but was pending a good toggle-all button. This PR adds a toggle-all button that should work. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. The breadcrumbs also get redesigned, so that they use less space, by shrinking the parent module path parts. This is done at the same time as the toolbar redesign because it's, effectively, moving space from the toolbar to the breadcrumbs. This is aimed at avoiding any line wrapping at desktop sizes. ## Prior art This style of toolbar, with explicit labels on the buttons, used to be more popular. It's not very common in web browsers nowadays, and for truly universal icons like :arrow_left: I can understand why, but words are great when icons fail. ![image](https://github.com/user-attachments/assets/9a4a0498-232d-4d60-87b9-f601f4515254)
2024-09-23Check vtable projections for validity in miriMichael Goulet-8/+41
2024-09-23Auto merge of #130620 - onur-ozkan:update-make-prepare, r=Kobzolbors-22/+14
remove workaround for make prepare and use dry-run build instead Removes an annoying hard-coded logic. try-job: x86_64-msvc
2024-09-23internal: Make COMPLETION_MARKER more explicitly r-aWilfred Hughes-1/+1
If a user ever sees the completion marker, it's confusing to see text about IntelliJ. Use a string that's more explicitly about completion for rust-analyzer.
2024-09-23Auto merge of #125645 - RalfJung:unclear_local_imports, r=nnethercotebors-45/+47
add unqualified_local_imports lint This lint helps deal with https://github.com/rust-lang/rustfmt/issues/4709 by having the compiler detect imports of local items that are not syntactically distinguishable from imports from other cates. Making them syntactically distinguishable ensures rustfmt can consistently apply the desired import grouping.
2024-09-23Small fixesKirill Bulatov-6/+6
2024-09-23Update booksrustbot-0/+0
2024-09-23invoke cmake check with `run_always`onur-ozkan-1/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-23Tweak breadcrumbs listMichael Howell-11/+16
2024-09-23Add new Tier-3 target: `loongarch64-unknown-linux-ohos`Xiaotian Wu-0/+9
MCP: https://github.com/rust-lang/compiler-team/issues/784 Co-authored-by: WANG Rui <wangrui@loongson.cn>
2024-09-23Rollup merge of #130657 - arttet:fix/fuchsia, r=jieyouxuJubilee-2/+0
Remove x86_64-fuchsia and aarch64-fuchsia target aliases Closes #106649.
2024-09-23Rollup merge of #130536 - cuviper:rustbook-dylib-path, r=Mark-SimulacrumJubilee-9/+11
bootstrap: Set the dylib path when building books with rustdoc The library path is needed when the toolchain has been configured with `[rust] rpath = false`. Otherwise, building the reference book will get an error when it tries to run rustdoc, like: rustdoc: error while loading shared libraries: librustc_driver-2ec457c3b8826b72.so
2024-09-23Rollup merge of #129201 - joboet:random_faster_sources, r=joshtriplettJubilee-0/+17
std: implement the `random` feature (alternative version) Implements the ACP rust-lang/libs-team#393. This PR is an alternative version of #129120 that replaces `getentropy` with `CCRandomGenerateBytes` (on macOS) and `arc4random_buf` (other BSDs), since that function is not suited for generating large amounts of data and should only be used to seed other CPRNGs. `CCRandomGenerateBytes`/`arc4random_buf` on the other hand is (on modern platforms) just as secure and uses its own, very strong CPRNG (ChaCha20 on the BSDs, AES on macOS) periodically seeded with `getentropy`.
2024-09-23chore: add missing `.` (#2074)Marco Ieni-1/+1
2024-09-23Add remark on required free disk space (#2073)许杰友 Jieyou Xu (Joe)-0/+14
2024-09-23Support expect in attribute completion and hoverLaurențiu Nicola-5/+52
2024-09-23fix workflow permissionsRalf Jung-1/+2
2024-09-23Auto merge of #130641 - cuviper:llvm-19.1.0, r=nikicbors-0/+0
Update to LLVM 19.1.0 This is a branch rebase of the submodule, now that LLVM 19.1.0 is final. Our *only* extra patch right now is the one we're carrying for SGX unwind.
2024-09-23fix unqualified_local_imports in MiriRalf Jung-45/+47
2024-09-23add test for new abort_unwind functionRalf Jung-0/+44