about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-31Amortize growing rev_locals.Camille GILLOT-1/+7
2024-07-31Indirect places can only appear as first projection in runtime MIR.Camille GILLOT-1/+1
2024-07-31Do not normalize constants eagerly.Camille GILLOT-59/+32
2024-07-30Auto merge of #128413 - matthiaskrgr:rollup-nrfcvdq, r=matthiaskrgrbors-40/+162
Rollup of 7 pull requests Successful merges: - #128357 (Detect non-lifetime binder params shadowing item params) - #128367 (CI: rfl: build the generated doctests and documentation) - #128376 (Mark `Parser::eat`/`check` methods as `#[must_use]`) - #128379 (the output in stderr expects panic-unwind) - #128380 (make `///` doc comments compatible with naked functions) - #128382 (cargo-miri: better error when we seem to run inside bootstrap but something is wrong) - #128398 (tidy: Fix quote in error message) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-30Rollup merge of #128398 - awilfox:awilfox/fix-tidy-quote, r=jieyouxuMatthias Krüger-1/+1
tidy: Fix quote in error message I noticed that the backticks around the error code wasn't done properly in this string when I was building Rust 1.80.0 and found it is still this way in nightly. Example: ``` warning: Error code `E0595` needs to have at least one UI test in the `tests/error-codes/` directory`! warning: Error code E0602`` has a UI test file, but doesn't contain its own error code! warning: Error code `E0619` needs to have at least one UI test in the `tests/error-codes/` directory`! ``` This commit fixes it to match the other warning strings.
2024-07-30Rollup merge of #128382 - RalfJung:cargo-miri-assert, r=oli-obkMatthias Krüger-1/+4
cargo-miri: better error when we seem to run inside bootstrap but something is wrong Cc https://github.com/rust-lang/miri/issues/3775
2024-07-30Rollup merge of #128380 - folkertdev:naked-compatible-doc-comment, r=bjorn3Matthias Krüger-0/+9
make `///` doc comments compatible with naked functions tracking issue: https://github.com/rust-lang/rust/issues/90957 reported in https://github.com/rust-lang/rust/pull/127853#issuecomment-2257323333 it turns out `/// doc comment` and `#[doc = "doc comment"]` are represented differently, at least at the point where we perform the check for what should be allowed. The `///` style doc comment is now also allowed. r? ``@bjorn3`` cc ``@hsanzg``
2024-07-30Rollup merge of #128379 - Dajamante:aïssata_needs_unwind, r=pietroalbiniMatthias Krüger-2/+3
the output in stderr expects panic-unwind r​? ``@pietroalbini``
2024-07-30Rollup merge of #128376 - compiler-errors:finish-ur-vegetables, r=jieyouxuMatthias Krüger-18/+51
Mark `Parser::eat`/`check` methods as `#[must_use]` These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists). I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay. This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
2024-07-30Rollup merge of #128367 - ojeda:rfl-ci-build-doctests-and-docs, r=KobzolMatthias Krüger-1/+5
CI: rfl: build the generated doctests and documentation Cc ``@tgross35`` r? ``@Kobzol`` try-job: x86_64-rust-for-linux
2024-07-30Rollup merge of #128357 - compiler-errors:shadowed-non-lifetime-binder, ↵Matthias Krüger-17/+89
r=petrochenkov Detect non-lifetime binder params shadowing item params We should check that `for<T>` shadows `T` from an item in the same way that `for<'a>` shadows `'a` from an item. r? ``@petrochenkov`` since you're familiar w the nuances of rib kinds
2024-07-30Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68bors-635/+511
Bump bootstrap compiler to new beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-30Auto merge of #124339 - oli-obk:supports_feature, r=wesleywiserbors-0/+27
allow overwriting the output of `rustc --version` Our wonderful bisection folk [have to work around](https://github.com/rust-lang/rust/issues/123276#issuecomment-2075001510) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for. This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by * choosing when to update rustc * choosing when to update dependencies * choosing which nightly features they are willing to take the breakage for The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency. This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too. This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by https://github.com/rust-lang/cargo-bisect-rustc/pull/335. I mainly want to establish a compiler team policy: > We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to. Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection. I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
2024-07-30Revert "opt-dist: dont overrwite config.toml when verifying"Mark Rousskov-14/+17
This reverts commit c81a40bbc02bb44aa99b3a94322dbf07e7a62ce1.
2024-07-30tidy: Fix quote in error messageA. Wilcox-1/+1
2024-07-30Suppress must_use on eat calls in rustfmtMichael Goulet-5/+7
2024-07-30Make RUSTC_OVERRIDE_VERSION_STRING overwrite the rendered version output, tooOli Scherer-1/+10
2024-07-30Test RUSTC_OVERRIDE_VERSION_STRINGOli Scherer-0/+18
2024-07-30Auto merge of #127955 - ↵bors-10/+55
chenyukang:yukang-fix-mismatched-delimiter-issue-12786, r=nnethercote Add limit for unclosed delimiters in lexer diagnostic Fixes #127868 The first commit shows the original diagnostic, and the second commit shows the changes.
2024-07-30Auto merge of #125929 - Bryanskiy:delegation-generics-3, r=petrochenkovbors-233/+702
Delegation: support generics for delegation from free functions (The PR was split from https://github.com/rust-lang/rust/pull/123958, explainer - https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) This PR implements generics inheritance from free functions to free functions and trait methods. #### free functions to free functions: ```rust fn to_reuse<T: Clone>(_: T) {} reuse to_reuse as bar; // desugaring: fn bar<T: Clone>(x: T) { to_reuse(x) } ``` Generics, predicates and signature are simply copied. Generic arguments in paths are ignored during generics inheritance: ```rust fn to_reuse<T: Clone>(_: T) {} reuse to_reuse::<u8> as bar; // desugaring: fn bar<T: Clone>(x: T) { to_reuse::<u8>(x) // ERROR: mismatched types } ``` Due to implementation limitations callee path is lowered without modifications. Therefore, it is a compilation error at the moment. #### free functions to trait methods: ```rust trait Trait<'a, A> { fn foo<'b, B>(&self, x: A, y: B) {...} } reuse Trait::foo; // desugaring: fn foo<'a, 'b, This: Trait<'a, A>, A, B>(this: &This, x: A, y: B) { Trait::foo(this, x, y) } ``` The inheritance is similar to the previous case but with some corrections: - `Self` parameter converted into `T: Trait` - generic parameters need to be reordered so that lifetimes go first Arguments are similarly ignored. --- In the future, we plan to support generic inheritance for delegating from all contexts to all contexts (from free/trait/impl to free/trait /impl). These cases were considered first as the simplest from the implementation perspective.
2024-07-30make `///` doc comments compatible with naked functionsFolkert-0/+9
2024-07-30cargo-miri: better error when we seem to run inside bootstrap but something ↵Ralf Jung-1/+4
is wrong
2024-07-30Auto merge of #128336 - Bryanskiy:inst-binder-with-fresh, r=lcnrbors-24/+22
Use Vec in instantiate_binder_with_fresh_vars `FxHashMap` was replaced with a pre-computed `Vec` of infer vars. r? `@lcnr`
2024-07-30the output in stderr expects panic-unwindaissata-2/+3
2024-07-30Auto merge of #128378 - matthiaskrgr:rollup-i3qz9uo, r=matthiaskrgrbors-45/+268
Rollup of 4 pull requests Successful merges: - #127574 (elaborate unknowable goals) - #128141 (Set branch protection function attributes) - #128315 (Fix vita build of std and forbid unsafe in unsafe in the os/vita module) - #128339 ([rustdoc] Make the buttons remain when code example is clicked) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-30Auto merge of #128250 - Amanieu:select_unpredictable, r=nikicbors-1/+107
Add `select_unpredictable` to force LLVM to use CMOV Since https://reviews.llvm.org/D118118, LLVM will no longer turn CMOVs into branches if it comes from a `select` marked with an `unpredictable` metadata attribute. This PR introduces `core::intrinsics::select_unpredictable` which emits such a `select` and uses it in the implementation of `binary_search_by`.
2024-07-30Rollup merge of #128339 - GuillaumeGomez:click-code-example, r=notriddleMatthias Krüger-3/+58
[rustdoc] Make the buttons remain when code example is clicked Follow-up of https://github.com/rust-lang/rust/pull/125779. One current issue we have with "run" button and the newly added copy code button is that if you're on mobile devices, you can't use them. I took a look at how `mdbook` is handling it and when you click on a code example, they show the buttons. I think it's a really good idea as if you want to copy the code on your mobile device, you will click on it, showing the buttons. Feature can be tested [here](https://rustdoc.crud.net/imperio/click-code-example/foo/struct.Bar.html). r? `@notriddle`
2024-07-30Rollup merge of #128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubileeMatthias Krüger-37/+5
Fix vita build of std and forbid unsafe in unsafe in the os/vita module See #127747 r? `@workingjubilee` `@pheki` `@nikarh`
2024-07-30Rollup merge of #128141 - nikic:aarch64-bti, r=DianQK,cuviperMatthias Krüger-3/+83
Set branch protection function attributes Since LLVM 19, it is necessary to set not only module flags, but also function attributes for branch protection on aarch64. See https://github.com/llvm/llvm-project/commit/e15d67cfc2e5775cc79281aa860f3ad3be628f39 for the relevant LLVM change. Fixes https://github.com/rust-lang/rust/issues/127829.
2024-07-30Rollup merge of #127574 - lcnr:coherence-check-supertrait, r=compiler-errorsMatthias Krüger-2/+122
elaborate unknowable goals A reimplemented version of #124532 affecting only the new solver. Always trying to prove super traits ends up causing a fatal overflow error in diesel, so we cannot land this in the old solver. The following test currently does not pass coherence: ```rust trait Super {} trait Sub<T>: Super {} trait Overlap<T> {} impl<T, U: Sub<T>> Overlap<T> for U {} impl<T> Overlap<T> for () {} fn main() {} ``` We check whether `(): Sub<?t>` holds. This stalls with ambiguity as downstream crates may add an impl for `(): Sub<Local>`. However, its super trait bound `(): Super` cannot be implemented downstream, so this one is known not to hold. By trying to prove that all the super bounds of a trait before adding a coherence unknowable candidate, this compiles. This is necessary to prevent breakage from enabling `-Znext-solver=coherence` (#121848), see tests/ui/coherence/super-traits/super-trait-knowable-2.rs for more details. The idea is that while there may be an impl of the trait itself we don't know about, if we're able to prove that a super trait is definitely not implemented, then that impl would also never apply/not be well-formed. This approach is different from #124532 as it allows tests/ui/coherence/super-traits/super-trait-knowable-3.rs to compile. The approach in #124532 only elaborating the root obligations while this approach tries it for all unknowable trait goals. r? `@compiler-errors`
2024-07-29Mark Parser::eat/check methods as must_useMichael Goulet-13/+44
2024-07-30Auto merge of #128234 - jcsp:retain-empty-case, r=tgross35bors-0/+6
Optimize empty case in Vec::retain While profiling some code that happens to call Vec::retain() in a tight loop, I noticed more runtime than expected in retain, even in a bench case where the vector was always empty. When I wrapped my call to retain in `if !myvec.is_empty()` I saw faster execution compared with doing retain on an empty vector. On closer inspection, Vec::retain is doing set_len(0) on itself even when the vector is empty, and then resetting the length again in BackshiftOnDrop::drop. Unscientific screengrab of a flamegraph illustrating how we end up spending time in set_len and drop: ![image](https://github.com/user-attachments/assets/ebc72ace-84a0-4432-9b6f-1b3c96d353ba)
2024-07-29Auto merge of #128360 - matthiaskrgr:rollup-wwy5mkj, r=matthiaskrgrbors-378/+478
Rollup of 6 pull requests Successful merges: - #126247 (rustdoc: word wrap CamelCase in the item list table and sidebar) - #128104 (Not lint pub structs without pub constructors intentionally) - #128153 (Stop using `MoveDataParamEnv` for places that don't need a param-env) - #128284 (Stabilize offset_of_nested) - #128342 (simplify the use of `CiEnv`) - #128355 (triagebot: make sure Nora is called Nora) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-29CI: rfl: build the documentationMiguel Ojeda-0/+3
Since the `rfl` CI job has not had almost any issue for some weeks, it is a good time to try to increase a bit the scope of what it tests. The kernel does not use any particular `rustdoc` unstable issue (apart from the doctests ones) so far, so in principle it should not introduce extra issues here, and may be a good extra test case for Rust. In addition, it may help to test new unstable features in the future. In the worst case, we can revert it. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-07-29CI: rfl: build the generated doctestsMiguel Ojeda-1/+2
We were already generating the doctests, which should already catch most issues with our hack around `--test-builder` and `--no-run`. However, we were not building the result of that transformation, thus build it for completeness and to ensure the hack may not have produced something completely broken. In the worst case, we can revert it. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-07-29Rollup merge of #128355 - jieyouxu:rename-nora, r=aDotInTheVoidMatthias Krüger-2/+2
triagebot: make sure Nora is called Nora r? `@Noratrieb`
2024-07-29Rollup merge of #128342 - onur-ozkan:ci-env-usage, r=KobzolMatthias Krüger-8/+6
simplify the use of `CiEnv` self-explanatory
2024-07-29Rollup merge of #128284 - GKFX:stabilize-offset-of-nested, r=dtolnay,jieyouxuMatthias Krüger-236/+126
Stabilize offset_of_nested Tracking issue #120140. Closes #120140. As the FCP is now nearing its end I have opened a stabilization PR. I have done this separately to the offset_of_enum feature, since that FCP has not started. `@rustbot` label F-offset_of_nested T-lang T-libs-api
2024-07-29Rollup merge of #128153 - compiler-errors:mdpe, r=cjgillotMatthias Krüger-64/+53
Stop using `MoveDataParamEnv` for places that don't need a param-env I think not threading through a `ParamEnv` makes it clearer that these functions don't do anything particularly "type systems"-y. r? cjgillot
2024-07-29Rollup merge of #128104 - mu001999-contrib:fix/128053, r=petrochenkovMatthias Krüger-22/+83
Not lint pub structs without pub constructors intentionally Fixes #128053
2024-07-29Rollup merge of #126247 - notriddle:notriddle/word-wrap-item-table, ↵Matthias Krüger-46/+208
r=GuillaumeGomez rustdoc: word wrap CamelCase in the item list table and sidebar This is an alternative to https://github.com/rust-lang/rust/pull/126209. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs. This is, necessarily, a pile of nasty heuristics. We need to balance a few issues: - Sometimes, there's no real word break. For example, `BTreeMap` should be `BTree<wbr>Map`, not `B<wbr>Tree<wbr>Map`. - Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting `TyCtx`, writing `Ty<wbr>Ctx` would have an HTML overhead of 50%. Line breaking inside it makes no sense. # Screenshots | Before | After | | ------ | ----- | | ![image](https://github.com/rust-lang/rust/assets/1593513/d51201fd-46c0-4f48-aee6-a477eadba288) | ![image](https://github.com/rust-lang/rust/assets/1593513/d8e77582-adcf-4966-bbfd-19dfdad7336a)
2024-07-29Auto merge of #128350 - matthiaskrgr:rollup-bcuhts8, r=matthiaskrgrbors-77/+228
Rollup of 6 pull requests Successful merges: - #127882 (Don't elaborate associated types with Sized bounds in `trait_object_ty` in cfi) - #128174 (Don't record trait aliases as marker traits) - #128202 (Tell users not to file a bug when using internal library features) - #128239 (Don't ICE when encountering error regions when confirming object method candidate) - #128337 (skip assoc type during infer source visitor) - #128341 (Make `rustc_attr::parse_version` pub) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-29Add rustdoc GUI test to check click on code examplesGuillaume Gomez-0/+21
2024-07-29Make the buttons remain when code example is clickedGuillaume Gomez-3/+37
2024-07-29Detect non-lifetime binder params shadowing item paramsMichael Goulet-17/+89
2024-07-29rustdoc: move the wbr after the underscore, instead of beforeMichael Howell-9/+9
2024-07-29rustdoc: properly handle path wrappingMichael Howell-5/+21
2024-07-29rustdoc: use `<wbr>` in sidebar headersMichael Howell-4/+24
This also improves sidebar layout, so instead of BTreeM ap you get this BTree Map
2024-07-29Delegation: support generics for delegation from free functionsBryanskiy-233/+702
2024-07-29triagebot: make sure Nora is called Nora许杰友 Jieyou Xu (Joe)-2/+2