about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-09-23Omit completion fields to be resolved laterKirill Bulatov-62/+99
2024-09-23Prepare for omittiong parts of completion data that need to be resolvedKirill Bulatov-16/+99
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-249/+197
2024-09-23Fix a bug in span map merge, and add explanations of how span maps are storedChayim Refael Friedman-5/+33
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.
2024-09-22Auto merge of #3852 - tiif:rwrefactor, r=RalfJungbors-153/+249
Refactor fd read/write This PR passed the responsibility of reading to user supplied buffer and dest place to each implementation of ``FileDescription::read/write/pread/pwrite``. This is part of #3665.
2024-09-22simplify eventfd handling a bitRalf Jung-49/+30
2024-09-22remove some unnecessary to_ownedRalf Jung-9/+9
2024-09-22read, write: move cast-to-usize logic up and deduplicate itRalf Jung-4/+6
2024-09-22further tweak FileDescription commentsRalf Jung-17/+12
2024-09-22Pass pointer and len to FileDescription::write and change the type of len in ↵tiif-47/+60
read to usize
2024-09-22Use &[u8] instead of Vec<u8> and improve docstiif-13/+25
2024-09-22Consider lifetime GATs object unsafeChayim Refael Friedman-1/+14
2024-09-22try to give the CI job permission to create PRsRalf Jung-0/+3
2024-09-22rustfmt: switch over to setting style_editionRalf Jung-1/+1
2024-09-22Merge from rustcRalf Jung-6/+8
2024-09-22Preparing for merge from rustcRalf Jung-1/+1
2024-09-22Include dereferences in consuming postfix completions (e.g. `call`)Chayim Refael Friedman-0/+31
2024-09-22Properly account for mutable references when postfix-completing consuming ↵Chayim Refael Friedman-1/+21
completions (e.g. `call`)
2024-09-22Fix name resolution when an import is resolved to some namespace and then ↵Chayim Refael Friedman-13/+82
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.
2024-09-21Rollup merge of #127766 - folkertdev:c-cmse-nonsecure-entry, r=jackh726Michael Goulet-1/+5
add `extern "C-cmse-nonsecure-entry" fn` tracking issue #75835 in https://github.com/rust-lang/rust/issues/75835#issuecomment-1183517255 it was decided that using an abi, rather than an attribute, was the right way to go for this feature. This PR adds that ABI and removes the `#[cmse_nonsecure_entry]` attribute. All relevant tests have been updated, some are now obsolete and have been removed. Error 0775 is no longer generated. It contains the list of targets that support the CMSE feature, and maybe we want to still use this? right now a generic "this abi is not supported on this platform" error is returned when this abi is used on an unsupported platform. On the other hand, users of this abi are likely to be experienced rust users, so maybe the generic error is good enough.
2024-09-21Auto merge of #127546 - workingjubilee:5-level-paging-exists, r=saethlinbors-4/+2
Correct outdated object size limit The comment here about 48 bit addresses being enough was written in 2016 but was made incorrect in 2019 by 5-level paging, and then persisted for another 5 years before being noticed and corrected. The bolding of the "exclusive" part is merely to call attention to something I missed when reading it and doublechecking the math. try-job: i686-msvc try-job: test-various
2024-09-21Auto merge of #129283 - saethlin:unreachable-allocas, r=scottmcmbors-1/+1
Don't alloca for unused locals We already have a concept of mono-unreachable basic blocks; this is primarily useful for ensuring that we do not compile code under an `if false`. But since we never gave locals the same analysis, a large local only used under an `if false` will still have stack space allocated for it. There are 3 places we traverse MIR during monomorphization: Inside the collector, `non_ssa_locals`, and the walk to generate code. Unfortunately, https://github.com/rust-lang/rust/pull/129283#issuecomment-2297925578 indicates that we cannot afford the expense of tracking reachable locals during the collector's traversal, so we do need at least two mono-reachable traversals. And of course caching is of no help here because the benchmarks that regress are incr-unchanged; they don't do any codegen. This fixes the second problem in https://github.com/rust-lang/rust/issues/129282, and brings us anther step toward `const if` at home.
2024-09-21remove `#[cmse_nonsecure_entry]`Folkert-1/+0
2024-09-21add `C-cmse-nonsecure-entry` ABIFolkert de Vries-0/+5
2024-09-21Add an option of using nix-shell instead of nix flakeMaybe Lapkin-0/+34
2024-09-21fmt (with a huge diff for some reason)Ralf Jung-205/+180
2024-09-21Merge from rustcRalf Jung-3964/+7383
2024-09-21Preparing for merge from rustcRalf Jung-1/+1
2024-09-21Rollup merge of #130642 - cuviper:run-make-cargo, r=jieyouxuMatthias Krüger-0/+14
Pass the current cargo to `run-make` tests A couple tests were using `BOOTSTRAP_CARGO` with `-Zbuild-std`, but that stage0 cargo might not always be in sync with in-tree changes. In particular, those tests started failing on the beta branch because the older cargo couldn't find the library `Cargo.lock`, and then couldn't build the latest version of `compiler_builtins` that had nightly changes. Fixes #130634 r? `@saethlin`
2024-09-21Fix clippyBen Kimock-1/+1
2024-09-20Pass the current cargo to `run-make` testsJosh Stone-0/+14
A couple tests were using `BOOTSTRAP_CARGO` with `-Zbuild-std`, but that stage0 cargo might not always be in sync with in-tree changes. In particular, those tests started failing on the beta branch because the older cargo couldn't find the library `Cargo.lock`, and then couldn't build the latest version of `compiler_builtins` that had nightly changes.
2024-09-20Auto merge of #130632 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 16 commits in a9a418d1a22f29e7dfd034e3b93f15657e608a29..eaee77dc1584be45949b75e4c4c9a841605e3a4b 2024-09-15 19:13:12 +0000 to 2024-09-19 21:10:23 +0000 - fix(complete): Harden `--target` completions (rust-lang/cargo#14564) - Cleanup duplicated check-cfg lint logic (rust-lang/cargo#14567) - Revert "remove reference to incomplete crates.io feature from docs" (rust-lang/cargo#14562) - feat: Add custom completer for `cargo help &lt;TAB&gt;` (rust-lang/cargo#14557) - docs(unstable): Expand on completion documentation (rust-lang/cargo#14563) - feat: Add custom completer for `cargo build --example=&lt;TAB&gt;` (rust-lang/cargo#14531) - remove reference to incomplete crates.io feature from docs (rust-lang/cargo#14561) - fix(complete): Fix problems on my machine (rust-lang/cargo#14558) - feat: Add custom completer for completing benchmark names (rust-lang/cargo#14532) - refactor(info): Use the `shell.note` to print the note (rust-lang/cargo#14554) - feat: Add custom completer for completing test names (rust-lang/cargo#14548) - Suggest `cargo info` command in the `cargo search` result (rust-lang/cargo#14537) - feat: Add custom completer for completing target triple (rust-lang/cargo#14535) - feat: Add custom completer for `cargo -Z &lt;TAB&gt;` (rust-lang/cargo#14536) - feat: Add custom completer for completing installed binaries (rust-lang/cargo#14534) - feat: Add custom completer for completing bin names (rust-lang/cargo#14533) r? ghost
2024-09-20Auto merge of #130631 - GuillaumeGomez:rollup-jpgy1iv, r=GuillaumeGomezbors-2/+3
Rollup of 7 pull requests Successful merges: - #128209 (Remove macOS 10.10 dynamic linker bug workaround) - #130526 (Begin experimental support for pin reborrowing) - #130611 (Address diagnostics regression for `const_char_encode_utf8`.) - #130614 (Add arm64e-apple-tvos target) - #130617 (bail if there are too many non-region infer vars in the query response) - #130619 (Fix scraped examples height) - #130624 (Add `Vec::as_non_null`) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-20Update cargoWeihang Lo-0/+0
2024-09-20Rollup merge of #130614 - arttet:arm64e-apple-tvos, r=bjorn3Guillaume Gomez-2/+3
Add arm64e-apple-tvos target This introduces * `arm64e-apple-tvos` ## Tier 3 Target Policy > * A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) I will be a target maintainer. > * Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. The `arm64e-apple-tvos` target names like `arm64e-apple-ios`, `arm64e-apple-darwin`. So, **I have chosen this name because there are similar triplets in LLVM**. I think there are no more suitable names for these targets. > * Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. The target must not introduce license incompatibilities. Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. No dependencies were added to Rust. > * Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > * This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Understood. I am not a member of a Rust team. > * Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. Understood. `std` is supported. > * The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. Building is described in the derived target doc. > * Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > * Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. Understood. > * Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > * In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. Understood. https://github.com/rust-lang/rust/issues/121663 https://github.com/rust-lang/rust/issues/73628
2024-09-20analysis-stats: respect --disable-proc-macros flagDavid Barsky-1/+5
2024-09-20Auto merge of #124895 - obeis:static-mut-hidden-ref, r=compiler-errorsbors-93/+157
Disallow hidden references to mutable static Closes #123060 Tracking: - https://github.com/rust-lang/rust/issues/123758
2024-09-20miri: An error message got changedJubilee Young-2/+2
2024-09-20Normalize being an annoying little compile testJubilee Young-1/+0
The issue-112505-overflow test just extended a case of transmute-fail.rs so simply put them in the same file. Then we normalize away other cases of this.
2024-09-20Add arm64e-apple-tvos targetArtyom Tetyukhin-2/+3
2024-09-20Rollup merge of #130607 - GnomedDev:remove-seekfrom-paths, r=compiler-errorsGuillaume Gomez-25/+18
[Clippy] Remove final std paths for diagnostic item Removes the paths to SeekFrom::Start/Current that were left in #130553. This was split off as it involves introducing a utility to check for enum ctors, as both: - enum variants cannot be diagnostic items - even if they could, that wouldn't help because we need to get the enum variant ctor While adding the `is_enum_variant_ctor`, I removed both `is_diagnostic_ctor` and `is_res_diagnostic_ctor` as they are unused and never worked due to the above bullet points.
2024-09-20Rollup merge of #130585 - GuillaumeGomez:add-rustdoc-template-tidy-check, ↵Guillaume Gomez-0/+60
r=notriddle Add tidy check for rustdoc templates to ensure the whitespace characters are all stripped Fixes https://github.com/rust-lang/rust/issues/130559. I'm planning to send a follow-up in case a tag at the end of a line isn't needed (if the next line starts with a jinja tag for example). r? `@notriddle`
2024-09-20Rollup merge of #130566 - jieyouxu:breakup-runtest, r=compiler-errorsGuillaume Gomez-2041/+2156
Break up compiletest `runtest.rs` into smaller helper modules Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This PR breaks the `runtest.rs` file up into smaller helper modules, one for each test suite/mode. > [!NOTE] > This PR should not contain functional changes, it is intended to be mostly code motion to breakup `runtest.rs` into smaller helper modules to make it easier to digest. > > This PR intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR. Some methods on `TestCx` do not need to be on `TestCx`. It also does not address a weirdness in valgrind, that is intended for a follow-up PR as well. Part of a series of compiletest cleanups #130565. Fixes #89475. r? `@ghost` (I need to do a self-review pass first)
2024-09-20Add flake.nix and .envrcMaybe Lapkin-0/+105
2024-09-20[Clippy] Remove final std paths for diagnostic itemGnomedDev-25/+18
2024-09-20Auto merge of #130508 - adwinwhite:niche-not-depend-on-order, r=the8472bors-4/+5
Get rid of niche selection's dependence on fields's order Fixes #125630. Use the optimal niche selection decided in `univariant()` rather than picking niche field manually. r? `@the8472`
2024-09-20Auto merge of #18132 - ChayimFriedman2:fix-closure-semi, r=Veykrilbors-32/+100
fix: Don't complete `;` when in closure return expression Completing it will break syntax. Fixes #18130.
2024-09-20Auto merge of #18151 - ChayimFriedman2:metavar-concat, r=Veykrilbors-5/+304
feat: Support the `${concat(...)}` metavariable expression I didn't follow rustc precisely, because I think it does some things wrongly (or they are FIXME), but I only allowed more code, not less. So we're all fine. Closes #18145.
2024-09-20Auto merge of #18108 - ChayimFriedman2:lint-level-cfg, r=Veykrilbors-16/+120
fix: Handle lint attributes that are under `#[cfg_attr]` I forgot `cfg_attr` while working on #18099. Although the original code also didn't handle that (although case lints specifically were correct, by virtue of using hir attrs).
2024-09-20Auto merge of #130597 - matthiaskrgr:rollup-9ls4066, r=matthiaskrgrbors-6/+6
Rollup of 3 pull requests Successful merges: - #130485 (Do not expect infer/bound/placeholder/error in v0 symbol mangling) - #130567 (Register tool docs for compiletest) - #130582 (rustdoc: use the correct span for doctests) r? `@ghost` `@rustbot` modify labels: rollup