about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-05-08Auto merge of #3580 - tiif:feat/malloc0-non-null-pointer, r=RalfJungbors-19/+74
Implement non-null pointer for malloc(0) Use non-null pointer for malloc(0) as mentioned in #3576 to detect leaks and double free of ``malloc(0)`` addresses.
2024-05-09Implement non-null pointer for malloc(0)tiif-19/+74
2024-05-08Use generic `NonZero`.Markus Reiter-65/+65
2024-05-08Simplify `clippy` lint.Markus Reiter-136/+113
2024-05-08Ignore empty RUSTC_WRAPPER in bootstrapJack Rickard-6/+7
This change ignores the RUSTC_WRAPPER_REAL environment variable if it's set to the empty string. This matches cargo behaviour and allows users to easily shadow a globally set RUSTC_WRAPPER (which they might have set for non-rustc projects).
2024-05-08bootstrap: add comments for the automatic dry runRalf Jung-0/+5
2024-05-08Make term search fuel configurableTavo Annus-9/+56
2024-05-08Auto merge of #3589 - RalfJung:io-error, r=RalfJungbors-34/+31
io::Error handling: keep around the full io::Error for longer so we can give better errors This should help with the error message in https://github.com/rust-lang/miri/issues/3587.
2024-05-08io::Error handling: keep around the full io::Error for longer so we can give ↵Ralf Jung-34/+31
better errors
2024-05-08miri: rename intrinsic_fallback_checks_ub to intrinsic_fallback_is_specRalf Jung-18/+18
2024-05-08Rollup merge of #124864 - ↵Matthias Krüger-32/+19
notriddle:notriddle/feature-flags-are-not-stability-markers, r=fmease rustdoc: use stability, instead of features, to decide what to show Fixes #124635 To decide if internal items should be inlined in a doc page, check if the crate is itself internal, rather than if it has the rustc_private feature flag. The standard library uses internal items, but is not itself internal and should not show internal items on its docs pages.
2024-05-08Migrate `run-make/rustdoc-map-file` to rmakeGuillaume Gomez-1/+0
2024-05-08use key-value format in stage0 fileonur-ozkan-43/+552
Currently, we are working on the python removal task on bootstrap. Which means we have to extract some data from the stage0 file using shell scripts. However, parsing values from the stage0.json file is painful because shell scripts don't have a built-in way to parse json files. This change simplifies the stage0 file format to key-value pairs, which makes it easily readable from any environment. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-08Auto merge of #124695 - erickt:bump-fuchsia, r=tmandrybors-93/+111
Fuchsia test runner: fixup script This commit fixes several issues in the fuchsia-test-runner.py script: 1. Migrate from `pm` to `ffx` for package management, as `pm` is now deprecated. Furthermore, the `pm` calls used in this script no longer work at Fuchsia's HEAD. This is the largest change in this commit, and impacts all steps around repository management (creation and registration of the repo, as well as package publishing). 2. Allow for `libtest` to be either statically or dynamically linked. The script assumed it was dynamically linked, but the current Rust behavior at HEAD is to statically link it. 3. Minor cleanup to use `ffx --machine json` rather than string parsing. 4. Minor cleanup to the docs around the script.
2024-05-08Simplify `use crate::rustc_foo::bar` occurrences.Nicholas Nethercote-13/+10
They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.)
2024-05-07rustdoc: use stability, instead of features, to decide what to showMichael Howell-32/+19
To decide if internal items should be inlined in a doc page, check if the crate is itself internal, rather than if it has the rustc_private feature flag. The standard library uses internal items, but is not itself internal and should not show internal items on its docs pages.
2024-05-07Update cargoWeihang Lo-0/+0
2024-05-07remove problems that I do not think we have seen in a whileRalf Jung-13/+0
2024-05-07README: update introductionRalf Jung-39/+31
2024-05-07Use unit of work as fuel instead of timeTavo Annus-42/+48
2024-05-07Fuchsia test runner: fixup scriptMarc Khouri-93/+111
This commit fixes several issues in the fuchsia-test-runner.py script: 1. Migrate from `pm` to `ffx` for package management, as `pm` is now deprecated. Furthermore, the `pm` calls used in this script no longer work at Fuchsia's HEAD. This is the largest change in this commit, and impacts all steps around repository management (creation and registration of the repo, as well as package publishing). 2. Allow for `libtest` to be either statically or dynamically linked. The script assumed it was dynamically linked, but the current Rust behavior at HEAD is to statically link it. 3. Minor cleanup to use `ffx --machine json` rather than string parsing. 4. Minor cleanup to the docs around the script.
2024-05-07Remove unnecessary -fembed-bitcode usage now that it's deprecatedKeith Smiley-12/+2
This is a partial revert of 6d819a4b8f45b170e7c2c415df20cfa2e0cbbf7f because https://github.com/rust-lang/cc-rs/pull/812 removed this flag entirely, meaning we shouldn't have to pass this manually anymore
2024-05-07Rollup merge of #124738 - notriddle:notriddle/search-form-js, r=GuillaumeGomezMatthias Krüger-24/+48
rustdoc: dedup search form HTML This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test. There should be no visible changes. Just use less disk space.
2024-05-07Auto merge of #124781 - VladimirMakaev:lldb-enum-formatter, r=dtolnaybors-2/+60
Implement lldb formatter for "clang encoded" enums (LLDB 18.1+) (V3) This is a redo of PR (#124458) which was approved previously but force-pushed out. Then a V2 (#124745) failed `debuginfo\msvc-pretty-enums.rs` test during merge. I've fixed the test and checked it to pass on Windows with `.\x.ps1 test .\tests\debuginfo\msvc-pretty-enums.rs` Below is the original summary: ## Summary: fixes #79530 I landed a fix last year to enable `DW_TAG_variant_part` encoding in LLDBs (https://reviews.llvm.org/D149213). This PR is a corresponding fix in synthetic formatters to decode that information. This is in no way perfect implementation but at least it improves the status quo. But most types of enums will be visible and debuggable in some way. I've also updated most of the existing tests that touch enums and re-enabled test cases based on LLDB for enums. ## Test Plan: ran tests `./x test tests/debuginfo/`. Also tested manually in LLDB CLI and LLDB VSCode ## Other Thoughs: A better approach would probably be adopting [formatters from codelldb](https://github.com/vadimcn/codelldb/blob/master/formatters/rust.py). There is some neat hack that hooks up summary provider via synthetic provider which can ultimately fix more display issues for Rust types and enums too. But getting it to work well might take more time that I have right now.
2024-05-07Auto merge of #17192 - roife:fix-issue-17179, r=lnicolabors-1/+46
Fix source_range for INT_NUMBER in completion fix #17179. Previously r-a use `TextRange::empty(self.position.offset)` as `source_range` for `INT_NUMBER`, so the `text_edit` would always be an insertion, which results in #17179. This PR changed it by using `text_range` of `original_token` (same as `IDENT`).
2024-05-07Auto merge of #122504 - jfgoog:update-cc-crate-version-2, r=onur-ozkanbors-72/+116
Update cc crate for bootstrap to v1.0.97 Reason: In order to build the Windows version of the Rust toolchain for the Android platform, the following patch to the cc is crate is required to avoid incorrectly determining that we are building with the Android NDK: https://github.com/rust-lang/cc-rs/commit/57853c4bf8a89a0f4c9137eb367ac580305c6919 This patch is present in version 1.0.80 and newer versions of the cc crate. The rustc source distribution currently has 3 different versions of cc in the vendor directory, only one of which has the necessary fix. We (the Android Rust toolchain) are currently maintaining local patches to upgrade the cc crate dependency versions, which we would like to upstream. Furthermore, beyond the specific reason, the cc crate in bootstrap is currently pinned at an old version due to problems in the past when trying to update it. It is worthwhile to figure out and resolve these problems so we can keep the dependency up-to-date. Other fixes: As of cc v1.0.78, object files are prefixed with a 16-character hash. Update src/bootstrap/src/core/build_steps/llvm.rs to account for this to avoid failures when building libunwind and libcrt. Note that while the hash prefix was introduced in v1.0.78, in order to determine the names of the object files without scanning the directory, we rely on the compile_intermediates method, which was introduced in cc v1.0.86 As of cc v1.0.86, compilation on MacOS uses the -mmacosx-version-min flag. A long-standing bug in the CMake rules for compiler-rt causes compilation to fail when this flag is specified. So we add a workaround to suppress this flag. Updating to cc v1.0.91 and newer requires fixes to bootstrap unit tests. The unit tests use targets named "A", "B", etc., which fail a validation check introduced in 1.0.91 of the cc crate. As of cc v1.0.74, the SDKROOT environment variable is used on Darwin if present, regardless of whether it is for the correct platform or not. This is fixed in cc v1.0.97.
2024-05-06rustdoc: allow custom element rustdoc-searchMichael Howell-0/+2
2024-05-06Enable profiler for armv7-unknown-linux-gnueabihf.Brian Smith-1/+1
2024-05-06Auto merge of #124822 - matthiaskrgr:rollup-h7fc52t, r=matthiaskrgrbors-0/+0
Rollup of 3 pull requests Successful merges: - #124759 (Record impl args in the proof tree in new solver) - #124809 (borrowck: prepopulate opaque storage more eagerly) - #124815 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-06Update version of cc crate to v1.0.97James Farrell-72/+116
Reason: In order to build the Windows version of the Rust toolchain for the Android platform, the following patch to the cc is crate is required to avoid incorrectly determining that we are building with the Android NDK: https://github.com/rust-lang/cc-rs/commit/57853c4bf8a89a0f4c9137eb367ac580305c6919 This patch is present in version 1.0.80 and newer versions of the cc crate. The rustc source distribution currently has 3 different versions of cc in the vendor directory, only one of which has the necessary fix. We (the Android Rust toolchain) are currently maintaining local patches to upgrade the cc crate dependency versions, which we would like to upstream. Furthermore, beyond the specific reason, the cc crate in bootstrap is currently pinned at an old version due to problems in the past when trying to update it. It is worthwhile to figure out and resolve these problems so we can keep the dependency up-to-date. Other fixes: As of cc v1.0.78, object files are prefixed with a 16-character hash. Update src/bootstrap/src/core/build_steps/llvm.rs to account for this to avoid failures when building libunwind and libcrt. Note that while the hash prefix was introduced in v1.0.78, in order to determine the names of the object files without scanning the directory, we rely on the compile_intermediates method, which was introduced in cc v1.0.86 As of cc v1.0.86, compilation on MacOS uses the -mmacosx-version-min flag. A long-standing bug in the CMake rules for compiler-rt causes compilation to fail when this flag is specified. So we add a workaround to suppress this flag. Updating to cc v1.0.91 and newer requires fixes to bootstrap unit tests. The unit tests use targets named "A", "B", etc., which fail a validation check introduced in 1.0.91 of the cc crate.
2024-05-06Auto merge of #124209 - Urgau:check-cfg-more-friendly-docs, r=ehussbors-62/+97
Make check-cfg docs more user-friendly This PR improves the `--check-cfg` to make them more user-friendly by: - explaining the purpose of the feature - removing the "form" jargon - making it (bit) less formal and more "friendly" - making the doc less cluttered - and by fixing (the width and flags) of the examples `@rustbot` label +F-check-cfg
2024-05-06Add time based fuel to term searchTavo Annus-8/+36
2024-05-06Update booksrustbot-0/+0
2024-05-06Collapse term search exprs before Cartesian product to avoid OOMTavo Annus-20/+43
2024-05-06Make check-cfg docs more user-friendlyUrgau-62/+97
2024-05-06Refactor float `Primitive`s to a separate `Float` typebeetrees-6/+6
2024-05-06Auto merge of #124753 - GuillaumeGomez:migrate-rustdoc-determinism, r=jieyouxubors-12/+31
Migrate `run-make/rustdoc-error-lines` to new `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. There was a weird naming inconsistency with `input`/`output`. A few tests write `.arg("-o").arg(path)` and the `output` method was actually the command output. So instead, I renamed the original `output` into `command_output` so that I could create the `output` method with the expected effect (and updated the tests to use it too). EDIT: The first two commits come from https://github.com/rust-lang/rust/pull/124711. Some weird things happened recently pparently. ^^' r? `@jieyouxu`
2024-05-06Implement unsafe attribute parsingLukas Wirth-11/+534
2024-05-06Auto merge of #124497 - rytheo:move-std-tests-to-library, r=workingjubileebors-1/+0
Move some stdlib tests from `tests/ui` to `library/std/tests` Related to #99417
2024-05-06Auto merge of #3579 - RalfJung:libc, r=RalfJungbors-208/+211
organize libc tests into a proper folder, and run some of them on Windows
2024-05-06organize libc tests into a proper folder, and run some of them on WindowsRalf Jung-208/+211
2024-05-06Implement wcslenAsger Hautop Drewsen-9/+64
2024-05-06Auto merge of #3578 - RalfJung:realloc, r=RalfJungbors-7/+1
avoid code duplication between realloc and malloc
2024-05-06avoid code duplication between realloc and mallocRalf Jung-7/+1
2024-05-06Migrate `run-make/rustdoc-error-lines` to `rmake.rs`Guillaume Gomez-1/+0
2024-05-06Add new `output` method to `Rustc` and `Rustdoc` typesGuillaume Gomez-0/+14
2024-05-06Rollup merge of #124765 - GuillaumeGomez:fix-wrong-cog-colotr, r=notriddleMatthias Krüger-0/+5
[rustdoc] Fix bad color for setting cog in ayu theme Before: ![Screenshot from 2024-05-05 19-29-36](https://github.com/rust-lang/rust/assets/3050060/e1f078e5-7fb3-472d-91e7-b4bde551d411) After: ![image](https://github.com/rust-lang/rust/assets/3050060/0aa115ac-dd69-48e1-b93e-067a39cf25d2) r? ````@notriddle````
2024-05-06Rollup merge of #124742 - Urgau:check-cfg-rustfmt, r=fmeaseMatthias Krüger-1/+2
Add `rustfmt` cfg to well known cfgs list This PR adds the `rustfmt` cfg to the well known cfgs list. Related to https://github.com/rust-lang/rust/issues/124735
2024-05-06Fix source_range for INT_NUMBER in completionroife-1/+46
2024-05-06Auto merge of #124747 - MasterAwesome:master, r=davidtwcobors-0/+14
Support Result<T, E> across FFI when niche optimization can be used (v2) This PR is identical to #122253, which was approved and merged but then removed from master by a force-push due to a [CI bug](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/ci.20broken.3F). r? ghost Original PR description: --- Allow allow enums like `Result<T, E>` to be used across FFI if the T/E can be niche optimized and the non-niche-optimized type is FFI safe. Implementation of https://github.com/rust-lang/rfcs/pull/3391 Tracking issue: https://github.com/rust-lang/rust/issues/110503 Additional ABI and codegen tests were added in https://github.com/rust-lang/rust/pull/115372