about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-10-30Avoid interior mutability in `TyLoweringContext`Chayim Refael Friedman-224/+201
This requires some serious code juggling.
2024-10-30Merge pull request #4000 from noahmbright/futexRalf Jung-4/+18
Change futex_wait errno from Scalar to IoError
2024-10-30Change futex_wait errno from Scalar to IoErrorNoah Bright-4/+18
To shift more Scalars to IoErrors, implement this change, allowing for a few other changes in the Linux and Windows shims. This also requires introducing a WindowsError variant in the IoError enum and implementing the VisitProvenance trait for IoErrors.
2024-10-30rustdoc-search: show types signatures in resultsMichael Howell-96/+670
2024-10-30rustdoc-search: use correct type annotationsMichael Howell-2/+2
2024-10-30rustdoc-search: pass original names through ASTMichael Howell-21/+26
2024-10-30rustdoc-search: simplify the checkTypes fast pathMichael Howell-26/+11
This reduces code size while still matching the common case for plain, concrete types.
2024-10-30rustdoc-search: add type param names to indexMichael Howell-7/+39
2024-10-30Only parse `safe` as contextual kw in extern blocksChayim Refael Friedman-8/+47
I don't like the party of `bool`s that is becoming, but two isn't worth a refactoring yet IMO.
2024-10-30Remap impl-trait lifetimes on HIR instead of AST lowering.Camille GILLOT-57/+41
2024-10-30Update LLVM to 19.1.3DianQK-0/+0
2024-10-30Rollup merge of #132315 - jieyouxu:extract-llvm-version, r=onur-ozkan许杰友 Jieyou Xu (Joe)-70/+139
compiletest: improve robustness of LLVM version handling Previously, `extract_llvm_versions` did some gymnastics for llvm versions by combining `(major, minor, patch)` into a combined version integer, but that is not very robust and made it difficult to add `max-llvm-major-version`. This PR tries to: - Improve llvm version handling robustness by parsing and representing the version as a semver. We intentionally deviate from strict semver standards by allowing omission of minor and patch versions. They default to `0` when absent. This is for convenience to allow the user to write e.g. `//@ min-llvm-version: 18` instead of having to spell out the full `major.minor.patch` semver string `//@ min-llvm-verison: 18.0.0`. - Adjust some panic messages to include a bit more context about *why* the version string was rejected. Prerequisite for #132310. r? bootstrap (or compiler)
2024-10-30Rollup merge of #131096 - GuillaumeGomez:rm-no_unused, r=notriddle许杰友 Jieyou Xu (Joe)-4/+0
rustdoc: Remove usage of `allow(unused)` attribute on `no_run` merged doctests Fixes [#130681](https://github.com/rust-lang/rust/issues/130681). It fixes the behaviour difference with the current doctests. r? ``@notriddle``
2024-10-30Reject generic self types.Adrian Taylor-1/+0
The RFC for arbitrary self types v2 declares that we should reject "generic" self types. This commit does so. The definition of "generic" was unclear in the RFC, but has been explored in https://github.com/rust-lang/rust/issues/129147 and the conclusion is that "generic" means any `self` type which is a type parameter defined on the method itself, or references to such a type. This approach was chosen because other definitions of "generic" don't work. Specifically, * we can't filter out generic type _arguments_, because that would filter out Rc<Self> and all the other types of smart pointer we want to support; * we can't filter out all type params, because Self itself is a type param, and because existing Rust code depends on other type params declared on the type (as opposed to the method). This PR decides to make a new error code for this case, instead of reusing the existing E0307 error. This makes the code a bit more complex, but it seems we have an opportunity to provide specific diagnostics for this case so we should do so. This PR filters out generic self types whether or not the 'arbitrary self types' feature is enabled. However, it's believed that it can't have any effect on code which uses stable Rust, since there are no stable traits which can be used to indicate a valid generic receiver type, and thus it would have been impossible to write code which could trigger this new error case. It is however possible that this could break existing code which uses either of the unstable `arbitrary_self_types` or `receiver_trait` features. This breakage is intentional; as we move arbitrary self types towards stabilization we don't want to continue to support generic such types. This PR adds lots of extra tests to arbitrary-self-from-method-substs. Most of these are ways to trigger a "type mismatch" error which https://github.com/rust-lang/rust/blob/9b82580c7347f800c2550e6719e4218a60a80b28/compiler/rustc_hir_typeck/src/method/confirm.rs#L519 hopes can be minimized by filtering out generics in this way. We remove a FIXME from confirm.rs suggesting that we make this change. It's still possible to cause type mismatch errors, and a subsequent PR may be able to improve diagnostics in this area, but it's harder to cause these errors without contrived uses of the turbofish. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? @wesleywiser
2024-10-30Merge pull request #18304 from davidkurilla/docs-create-setup-documentLukas Wirth-0/+57
docs: create setup documentation
2024-10-30Merge pull request #18382 from dqkqd/issue-17042Lukas Wirth-3/+72
fix: auto-complete import for aliased function and module
2024-10-30Merge pull request #18385 from Giga-Bowser/masterLukas Wirth-1/+503
feat: Add assist to generate a type alias for a function
2024-10-30Merge pull request #18436 from Veykril/lw-yvkqwpnwsouoLukas Wirth-191/+478
Do not render meta info when hovering usages
2024-10-30Rollup merge of #132338 - nnethercote:rm-Engine, r=nnethercoteMatthias Krüger-3/+1
Remove `Engine` It's just unnecessary plumbing. Removing it results in less code, and simpler code. r? ``@cjgillot``
2024-10-30Rollup merge of #132327 - djkoloski:redirect_fuchsia_maintainers, ↵Matthias Krüger-10/+2
r=compiler-errors Point to Fuchsia team in platform support docs This consolidates our docs into a single source of truth for the current Fuchsia maintainers. r? ```@tmandry```
2024-10-30Rollup merge of #132322 - daltenty:daltenty/update-aix-maintainters, ↵Matthias Krüger-2/+2
r=workingjubilee powerpc64-ibm-aix: update maintainters Chaofan (`@ecnelises)` and Kai (`@bzEq)` will be passing over maintainership for the target over to David Tenty (`@daltenty)` and Chris Cambly (`@gilamn5tr)`
2024-10-30Merge from rustcThe Miri Cronjob Bot-6916/+15458
2024-10-30Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-10-30compiletest: improve robustness of LLVM version handling许杰友 Jieyou Xu (Joe)-70/+139
2024-10-30Remove `Analysis::into_engine`.Nicholas Nethercote-3/+1
This is a standard pattern: ``` MyAnalysis.into_engine(tcx, body).iterate_to_fixpoint() ``` `into_engine` and `iterate_to_fixpoint` are always called in pairs, but sometimes with a builder-style `pass_name` call between them. But a builder-style interface is overkill here. This has been bugging me a for a while. This commit: - Merges `Engine::new` and `Engine::iterate_to_fixpoint`. This removes the need for `Engine` to have fields, leaving it as a trivial type that the next commit will remove. - Renames `Analysis::into_engine` as `Analysis::iterate_to_fixpoint`, gives it an extra argument for the optional pass name, and makes it call `Engine::iterate_to_fixpoint` instead of `Engine::new`. This turns the pattern from above into this: ``` MyAnalysis.iterate_to_fixpoint(tcx, body, None) ``` which is shorter at every call site, and there's less plumbing required to support it.
2024-10-29rust-analyzer: `rustc_abi::Abi` => `BackendRepr`Jubilee Young-11/+11
2024-10-29miri: `rustc_abi::Abi` => `BackendRepr`Jubilee Young-9/+20
2024-10-29rust_analyzer_helix.toml: add library/ manifestTshepang Mbambo-3/+4
Also, sort list
2024-10-29Point to Fuchsia team in platform support docsDavid Koloski-10/+2
2024-10-29update toolslcnr-24/+24
2024-10-29Style hover messages a bit differentlyLukas Wirth-116/+362
2024-10-29Publish test-fixture => ra_ap_test_fixtureSam McCall-1/+1
2024-10-29Do not render meta info when hovering usagesLukas Wirth-83/+124
2024-10-29powerpc64-ibm-aix: update maintaintersDavid Tenty-2/+2
Chaofan and Kai will be passing over maintainership for the target over to David Tenty and Chris Cambly.
2024-10-29Auto merge of #132317 - workingjubilee:rollup-x21ncea, r=workingjubileebors-6/+7
Rollup of 12 pull requests Successful merges: - #131375 (compiler: apply clippy::clone_on_ref_ptr for CI) - #131520 (Mark `str::is_char_boundary` and `str::split_at*` unstably `const`.) - #132119 (Hack out effects support for old solver) - #132194 (Collect item bounds for RPITITs from trait where clauses just like associated types) - #132216 (correct LLVMRustCreateThinLTOData arg types) - #132233 (Split `boxed.rs` into a few modules) - #132266 (riscv-soft-abi-with-float-features.rs: adapt for LLVM 20) - #132270 (clarified doc for `std::fs::OpenOptions.truncate()`) - #132284 (Remove my ping for rustdoc/clean/types.rs) - #132293 (Remove myself from mentions inside `tests/ui/check-cfg` directory) - #132312 (Delete `tests/crashes/23707.rs` because it's flaky) - #132313 (compiletest: Rename `command-list.rs` to `directive-list.rs`) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-29Merge pull request #18432 from Veykril/lw-yptzmuxyvxxtLukas Wirth-4/+7
fix: Fix the server not honoring diagnostic refresh support
2024-10-29Describe why and how to use a separate build directory for rust-analyzer (#2106)Stuart Cook-4/+25
2024-10-29Rollup merge of #132313 - Zalathar:directive-list, r=jieyouxuJubilee-4/+4
compiletest: Rename `command-list.rs` to `directive-list.rs` Because I forget the name of this file literally every single time I need to find and edit it. r? jieyouxu
2024-10-29Rollup merge of #132233 - WaffleLapkin:box-module-split, r=workingjubileeJubilee-1/+1
Split `boxed.rs` into a few modules I wanted to add an impl for `Box<_>`, but was quickly discouraged by the 3K file. This splits off a couple bits, making it at least a bit more manageable. r? ````@workingjubilee```` (I think you are not bothered by refactorings like this?)
2024-10-29Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillotJubilee-1/+2
compiler: apply clippy::clone_on_ref_ptr for CI Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443. Some Arc's can be misplaced with Lrc's, sorry. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
2024-10-29fix: Fix the server not honoring diagnostic refresh supportLukas Wirth-4/+7
2024-10-29Auto merge of #132314 - lnicola:sync-from-ra, r=lnicolabors-3366/+7243
Subtree update of `rust-analyzer` r? `@ghost`
2024-10-29Merge pull request #18427 from ChayimFriedman2/cleanup-tyLukas Wirth-170/+151
Cleanup TypeRef lowering
2024-10-29Auto merge of #132277 - workingjubilee:rollup-5e6q6e4, r=workingjubileebors-14/+7
Rollup of 9 pull requests Successful merges: - #130259 (Lower AST node id only once) - #131441 (Add a new trait `proc_macro::ToTokens`) - #132247 (stable_mir: Directly use types from rustc_abi) - #132249 (compiler: Add rustc_abi dependence to the compiler) - #132255 (Add `LayoutData::is_uninhabited` and use it) - #132258 ([rustdoc] Unify variant struct fields margins with struct fields) - #132260 (cg_llvm: Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char`) - #132261 (refactor: cleaner check to return None) - #132271 (Updating Fuchsia platform-support documentation) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-29Bump rustc cratesLaurențiu Nicola-17/+17
2024-10-29Rename `command-list.rs` to `directive-list.rs`Zalathar-4/+4
2024-10-29Merge from rust-lang/rustLaurențiu Nicola-933/+1729
2024-10-29Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-10-29Remove region from adjustmentsMichael Goulet-8/+8
2024-10-29Auto merge of #128985 - GrigorenkoPV:instantly-dangling-pointer, r=Urgaubors-9/+15
Lint against getting pointers from immediately dropped temporaries Fixes #123613 ## Changes: 1. New lint: `dangling_pointers_from_temporaries`. Is a generalization of `temporary_cstring_as_ptr` for more types and more ways to get a temporary. 2. `temporary_cstring_as_ptr` is removed and marked as renamed to `dangling_pointers_from_temporaries`. 3. `clippy::temporary_cstring_as_ptr` is marked as renamed to `dangling_pointers_from_temporaries`. 4. Fixed a false positive[^fp] for when the pointer is not actually dangling because of lifetime extension for function/method call arguments. 5. `core::cell::Cell` is now `rustc_diagnostic_item = "Cell"` ## Questions: - [ ] Instead of manually checking for a list of known methods and diagnostic items, maybe add some sort of annotation to those methods in library and check for the presence of that annotation? https://github.com/rust-lang/rust/pull/128985#issuecomment-2318714312 ## Known limitations: ### False negatives[^fn]: See the comments in `compiler/rustc_lint/src/dangling.rs` 1. Method calls that are not checked for: - `temporary_unsafe_cell.get()` - `temporary_sync_unsafe_cell.get()` 2. Ways to get a temporary that are not recognized: - `owning_temporary.field` - `owning_temporary[index]` 3. No checks for ref-to-ptr conversions: - `&raw [mut] temporary` - `&temporary as *(const|mut) _` - `ptr::from_ref(&temporary)` and friends [^fn]: lint **should** be emitted, but **is not** [^fp]: lint **should not** be emitted, but **is**