about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-12-09Add regression test for #134060许杰友 Jieyou Xu (Joe)-0/+27
Mostly just to check that the lint impl doesn't ICE from an easy case.
2024-12-09Revert #131669 due to ICEs许杰友 Jieyou Xu (Joe)-490/+181
Revert <https://github.com/rust-lang/rust/pull/131669> due to ICE reports: - <https://github.com/rust-lang/rust/issues/134059> (real-world) - <https://github.com/rust-lang/rust/issues/134060> (fuzzing) The changes can be re-landed with those cases addressed. This reverts commit 703bb982303ecab02fec593899639b4c3faecddd, reversing changes made to f415c07494b98e4559e4b13a9c5f867b0e6b2444.
2024-12-09Auto merge of #134052 - matthiaskrgr:rollup-puxwqrk, r=matthiaskrgrbors-1542/+2107
Rollup of 7 pull requests Successful merges: - #133567 (A bunch of cleanups) - #133789 (Add doc alias 'then_with' for `then` method on `bool`) - #133880 (Expand home_dir docs) - #134036 (crash tests: use individual mir opts instead of mir-opt-level where easily possible) - #134045 (Fix some triagebot mentions paths) - #134046 (Remove ignored tests for hangs w/ new solver) - #134050 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-09Rollup merge of #134050 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-1164/+1755
Miri subtree update r? `@ghost`
2024-12-09Rollup merge of #134046 - lqd:new-solver-hangs, r=compiler-errorsMatthias Krüger-24/+24
Remove ignored tests for hangs w/ new solver As asked on zulip [here](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/needs_help.3A.20look.20through.20compare-mode.20hangs). As far as I can tell there are no more UI tests that hang anymore, so this removes the ignore directives for the compare mode. (As I was using `--compare-mode new-solver` and that failed in an obscure way without any info about what to do, I've also fixed its error handling in `compiletest`: it didn't show the invalid `--compare-mode`, nor the valid values one can pass). r? lcnr
2024-12-09Rollup merge of #134045 - ehuss:triagebot-path-fixes, r=compiler-errorsMatthias Krüger-10/+2
Fix some triagebot mentions paths This fixes some mentions paths in `triagebot.toml` that are no longer valid. * rustdoc themes were merged into rustdoc.css (which already has a mention, and unfortunately can't independently mention the ayu theme). https://github.com/rust-lang/rust/pull/115829 cc `@GuillaumeGomez` `@Cldfire` * The entry for `inspect_obligations.rs` was never correct, from https://github.com/rust-lang/rust/pull/122385. cc `@lcnr` `@compiler-errors` * The entry for `need_type_info.rs` was moved in https://github.com/rust-lang/rust/pull/127501
2024-12-09Rollup merge of #134036 - matthiaskrgr:opppt, r=saethlinMatthias Krüger-7/+7
crash tests: use individual mir opts instead of mir-opt-level where easily possible r? `@saethlin`
2024-12-09Rollup merge of #133880 - ChrisDenton:homedir, r=Mark-SimulacrumMatthias Krüger-0/+7
Expand home_dir docs Since `home_dir` is set to be undeprecated, let's make the docs a bit more thorough.
2024-12-09Rollup merge of #133789 - rossmacarthur:then-with-doc-alias, r=Mark-SimulacrumMatthias Krüger-0/+1
Add doc alias 'then_with' for `then` method on `bool` I think its logical to search for this name since `Ordering::then_with` exists as well.
2024-12-09Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillotMatthias Krüger-337/+311
A bunch of cleanups These are all extracted from a branch I have to get rid of driver queries. Most of the commits are not directly necessary for this, but were found in the process of implementing the removal of driver queries. Previous PR: https://github.com/rust-lang/rust/pull/132410
2024-12-08Auto merge of #134039 - matthiaskrgr:rollup-ix8kdg1, r=matthiaskrgrbors-301/+739
Rollup of 7 pull requests Successful merges: - #133424 (Parse guard patterns) - #133733 ( compiletest: show the difference between the normalized output and the actual output for lines which didn't match) - #133993 (Fix: typo in E0751 error explanation) - #134013 (Adds new intrinsic declaration) - #134020 (Remove unnecessary `int_type_width_signed` function) - #134024 (Advent of `tests/ui` (misc cleanups and improvements) [2/N]) - #134038 (deps: Update psm) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-08update lockfileRalf Jung-1/+0
2024-12-08Fix some triagebot mentions pathsEric Huss-10/+2
2024-12-08bless test expectationsRémy Rakic-11/+11
(in a separate commit for easier review, one of them is huge)
2024-12-08mark previously hanging tests as good to goRémy Rakic-8/+1
2024-12-08improve `--compare-mode` error handlingRémy Rakic-5/+12
- show the erroneous value - show the valid values
2024-12-08Auto merge of #133134 - Walnut356:synth_prov, r=Mark-Simulacrumbors-1/+22
Don't use a SyntheticProvider for literally every type Replaces a glob regex with individualized imports for each standard library type. This improves debugger performance by quite a bit when populating lots of values with lots of fields With the glob, afaik every single value of every single type that the debugger renders is run through a python function that does quite a few string comparisons (i plan to fix those next) to determine the SyntheticProvider to use. It looks like DefaultSyntheticProvider's functions internally call the liblldb c++ functions, which ends up with identical behavior to not using a SyntheticProvider at all, except you have extra python round trips slowing things down. These sample vidoes were run on x86-64-pc-windows-gnu. `vect` is a 1000 element `Vec<Big>`, `Big` contains a dozen or so `Small`, and `Small` contains a dozen or so `[i32; 5]` Before: https://github.com/user-attachments/assets/07c31fe7-e126-4c2e-8ae9-cfe36e351d3f After: https://github.com/user-attachments/assets/6c0d1a45-1ffe-46de-95a0-5dbe59a173b5 --- try-job: aarch64-apple
2024-12-08Use ensure for analysis callsbjorn3-2/+2
2024-12-08Rollup merge of #134038 - ognevny:update-psm, r=ChrisDentonMatthias Krüger-2/+2
deps: Update psm part of #133456, which is blocked due to checks failure see https://github.com/rust-lang/rust/pull/133456#issuecomment-2507102176 r? `@ChrisDenton`
2024-12-08Rollup merge of #134024 - jieyouxu:ui-cleanup-2, r=NadrierilMatthias Krüger-63/+176
Advent of `tests/ui` (misc cleanups and improvements) [2/N] Part of #133895. Misc improvements to some ui tests immediately under `tests/ui/`. Best reviewed commit-by-commit. Please see individual commit messages for some further rationale and change summaries. r? compiler
2024-12-08Rollup merge of #134020 - scottmcm:fix-a-fixme, r=jieyouxuMatthias Krüger-91/+75
Remove unnecessary `int_type_width_signed` function This can just use `Ty::int_size_and_signed` instead of making its own version. You might want to look at this [ignoring whitespace](https://github.com/rust-lang/rust/pull/134020/files?w=1) since a huge bunch of code got un-indented.
2024-12-08Rollup merge of #134013 - BLANKatGITHUB:intrinsic, r=saethlinMatthias Krüger-28/+38
Adds new intrinsic declaration This pr is for #132735 removes removes `extern "intrinsic"` I think its the last block of this file and was kind of asking for advice how to handle other files as mentioned in the issue .
2024-12-08Rollup merge of #133993 - LuanOldCode:fix-e0571-typo, r=compiler-errorsMatthias Krüger-1/+1
Fix: typo in E0751 error explanation Corrected a grammatical error in the explanation for E0751. Changed "exists" to "exist" to improve clarity and ensure proper grammar in the error message.
2024-12-08Rollup merge of #133733 - jyn514:compiletest-diffs, r=jieyouxuMatthias Krüger-35/+119
compiletest: show the difference between the normalized output and the actual output for lines which didn't match example output: ``` failures: ---- [ui] tests/ui/layout/enum.rs stdout ---- diff of stderr: - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIGN } + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIN } 2 --> $DIR/enum.rs:9:1 3 | 4 LL | enum UninhabitedVariantAlign { Note: some mismatched output was normalized before being compared - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: Align(8 bytes) } - --> /home/jyn/src/rust2/tests/ui/layout/enum.rs:9:1 + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIN } ```
2024-12-08Rollup merge of #133424 - Nadrieril:guard-patterns-parsing, r=fee1-deadMatthias Krüger-81/+328
Parse guard patterns This implements the parsing of [RFC3637 Guard Patterns](https://rust-lang.github.io/rfcs/3637-guard-patterns.html) (see also [tracking issue](https://github.com/rust-lang/rust/issues/129967)). This PR is extracted from https://github.com/rust-lang/rust/pull/129996 with minor modifications. cc `@max-niederman`
2024-12-08deps: Update psmMaksim Bondarenkov-2/+2
2024-12-08crash tests: use individual mir opts instead of mir-opt-level where easily ↵Matthias Krüger-7/+7
possible
2024-12-08Adds new intrinsic declarationaaishwarymishra@gmail.com-28/+38
changes old intrinsic to new declaration
2024-12-08Auto merge of #134033 - matthiaskrgr:rollup-69fswyh, r=matthiaskrgrbors-280/+912
Rollup of 7 pull requests Successful merges: - #131669 (lint: change help for pointers to dyn types in FFI) - #133104 (crashes: add test for #131451) - #133767 (Add more info on type/trait mismatches for different crate versions) - #133861 (Add allocate_bytes and refactor allocate_str in InterpCx for raw byte…) - #133976 (Removed Unnecessary Spaces From RELEASES.md) - #133987 (Define acronym for thread local storage) - #133992 (Actually walk into lifetimes and attrs in `EarlyContextAndPass`) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-08Rollup merge of #133992 - compiler-errors:walk-fully, r=jieyouxuMatthias Krüger-5/+95
Actually walk into lifetimes and attrs in `EarlyContextAndPass` Visitors that don't also call `walk_*` are kinda a footgun... I believe all the other early lint functions walk into their types correctly at this point.
2024-12-08Rollup merge of #133987 - Will-Low:DefineTlsAcronym, r=workingjubileeMatthias Krüger-1/+1
Define acronym for thread local storage There are multiple references in this module's documentation to the acronym "TLS" (meaning "thread local storage"), without defining it. This is confusing for the reader. I propose that this acronym be defined during the first use of the term.
2024-12-08Rollup merge of #133976 - rohit141914:master, r=workingjubileeMatthias Krüger-4/+4
Removed Unnecessary Spaces From RELEASES.md
2024-12-08Rollup merge of #133861 - shamb0:refactor_InterpCx_allocate_str, r=RalfJungMatthias Krüger-13/+32
Add allocate_bytes and refactor allocate_str in InterpCx for raw byte… Fixes https://github.com/rust-lang/miri/issues/4025 This PR introduces a new `allocate_bytes` function in InterpCx and refactors `allocate_str` to use it internally. This change improves memory allocation handling in the interpreter by: 1. Adding `allocate_bytes`: - Direct byte slice allocation support - Handles both mutable and immutable allocations - Maintains proper memory alignment and deduplication 2. Refactoring `allocate_str`: - Now uses `allocate_bytes` internally - Adds string-specific metadata handling - Preserves existing string allocation behavior This is part 1 of the planned changes to improve timezone string handling in Miri. A follow-up PR will update Miri's timezone logic to use this new allocation mechanism. Related: https://github.com/rust-lang/miri/pull/4069
2024-12-08Rollup merge of #133767 - estebank:multiple-dep-version-tests, r=NadrierilMatthias Krüger-76/+281
Add more info on type/trait mismatches for different crate versions When encountering a type or trait mismatch for two types coming from two different crates with the same name, detect if it is either mixing two types/traits from the same crate on different versions: ``` error[E0308]: mismatched types --> replaced | LL | do_something_type(Type); | ----------------- ^^^^ expected `dependency::Type`, found `dep_2_reexport::Type` | | | arguments to this function are incorrect | note: two different versions of crate `dependency` are being used; two types coming from two different versions of the same crate are different types even if they look the same --> replaced | LL | pub struct Type(pub i32); | ^^^^^^^^^^^^^^^ this is the expected type `dependency::Type` | ::: replaced | LL | pub struct Type; | ^^^^^^^^^^^^^^^ this is the found type `dep_2_reexport::Type` | ::: replaced | LL | extern crate dep_2_reexport; | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` LL | extern crate dependency; | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate = help: you can use `cargo tree` to explore your dependency tree note: function defined here --> replaced | LL | pub fn do_something_type(_: Type) {} | ^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> replaced | LL | do_something_trait(Box::new(Type) as Box<dyn Trait2>); | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `dependency::Trait2`, found trait `dep_2_reexport::Trait2` | | | arguments to this function are incorrect | note: two different versions of crate `dependency` are being used; two types coming from two different versions of the same crate are different types even if they look the same --> replaced | LL | pub trait Trait2 {} | ^^^^^^^^^^^^^^^^ this is the expected trait `dependency::Trait2` | ::: replaced | LL | pub trait Trait2 {} | ^^^^^^^^^^^^^^^^ this is the found trait `dep_2_reexport::Trait2` | ::: replaced | LL | extern crate dep_2_reexport; | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` LL | extern crate dependency; | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate = help: you can use `cargo tree` to explore your dependency tree note: function defined here --> replaced | LL | pub fn do_something_trait(_: Box<dyn Trait2>) {} | ^^^^^^^^^^^^^^^^^^ ``` or if it is different crates that were renamed to the same name: ``` error[E0308]: mismatched types --> $DIR/type-mismatch-same-crate-name.rs:21:20 | LL | a::try_foo(foo2); | ---------- ^^^^ expected `main::a::Foo`, found a different `main::a::Foo` | | | arguments to this function are incorrect | note: two types coming from two different crates are different types even if they look the same --> $DIR/auxiliary/crate_a2.rs:1:1 | LL | pub struct Foo; | ^^^^^^^^^^^^^^ this is the found type `crate_a2::Foo` | ::: $DIR/auxiliary/crate_a1.rs:1:1 | LL | pub struct Foo; | ^^^^^^^^^^^^^^ this is the expected type `crate_a1::Foo` | ::: $DIR/type-mismatch-same-crate-name.rs:13:17 | LL | let foo2 = {extern crate crate_a2 as a; a::Foo}; | --------------------------- one type comes from crate `crate_a2` is used here, which is renamed locally to `a` ... LL | extern crate crate_a1 as a; | --------------------------- one type comes from crate `crate_a1` is used here, which is renamed locally to `a` note: function defined here --> $DIR/auxiliary/crate_a1.rs:10:8 | LL | pub fn try_foo(x: Foo){} | ^^^^^^^ error[E0308]: mismatched types --> $DIR/type-mismatch-same-crate-name.rs:27:20 | LL | a::try_bar(bar2); | ---------- ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` | | | arguments to this function are incorrect | note: two types coming from two different crates are different types even if they look the same --> $DIR/auxiliary/crate_a2.rs:3:1 | LL | pub trait Bar {} | ^^^^^^^^^^^^^ this is the found trait `crate_a2::Bar` | ::: $DIR/auxiliary/crate_a1.rs:3:1 | LL | pub trait Bar {} | ^^^^^^^^^^^^^ this is the expected trait `crate_a1::Bar` | ::: $DIR/type-mismatch-same-crate-name.rs:13:17 | LL | let foo2 = {extern crate crate_a2 as a; a::Foo}; | --------------------------- one trait comes from crate `crate_a2` is used here, which is renamed locally to `a` ... LL | extern crate crate_a1 as a; | --------------------------- one trait comes from crate `crate_a1` is used here, which is renamed locally to `a` note: function defined here --> $DIR/auxiliary/crate_a1.rs:11:8 | LL | pub fn try_bar(x: Box<Bar>){} | ^^^^^^^ ``` This new output unifies the E0308 errors detail with the pre-existing E0277 errors, and better differentiates the "`extern crate` renamed" and "same crate, different versions" cases.
2024-12-08Rollup merge of #133104 - matthiaskrgr:crashtest_debugass_131451.rs, r=saethlinMatthias Krüger-0/+9
crashes: add test for #131451 r? `@saethlin` How do I find out which mir opts are involved here? :sweat_smile:
2024-12-08Rollup merge of #131669 - niacdoial:linting-ptrdyn-ffi, r=workingjubileeMatthias Krüger-181/+490
lint: change help for pointers to dyn types in FFI ### Context while playing around, I encountered the warning for dyn types in `extern "C"` functions, but even after that I assumed that a (rust) raw pointer could be interpreted in C ('s ABI) as a `void *`... to be fair part of why I ignored the warning is because I wanted to poke at the generated assembly, not make useful code. ### Example ```rust extern "C" fn caller(callee: *const dyn Fn(i32)->i32){ // -- snip -- } ``` old warning: ``` warning: `extern` fn uses type `dyn Fn(i32) -> i32`, which is not FFI-safe --> file/name.rs:42:19 | 42 | fn caller(callee: *const dyn Fn(i32)->i32) { | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe | = note: trait objects have no C equivalent = note: `#[warn(improper_ctypes_definitions)]` on by default ``` new warning: ``` warning: `extern` fn uses type `dyn Fn(i32) -> i32`, which is not FFI-safe --> file/name.rs:42:19 | 42 | fn caller(callee: *const dyn Fn(i32)->i32) -> (){ | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe | = note: this pointer to an unsized type contains metadata, which makes it incompatible with a C pointer = note: `#[warn(improper_ctypes_definitions)]` on by default ```
2024-12-08crashes: add test for #131451Matthias Krüger-0/+9
2024-12-08Auto merge of #133522 - estebank:dont-suggest-unstable-trait, r=compiler-errorsbors-374/+486
Don't suggest restricting bound with unstable traits on stable and mention it's unstable on nightly On nightly, we mention the trait is unstable ``` error[E0277]: the trait bound `T: Unstable` is not satisfied --> $DIR/unstable-trait-suggestion.rs:13:9 | LL | foo(t) | --- ^ the trait `Unstable` is not implemented for `T` | | | required by a bound introduced by this call | note: required by a bound in `foo` --> $DIR/unstable-trait-suggestion.rs:9:11 | LL | fn foo<T: Unstable>(_: T) {} | ^^^^^^^^ required by this bound in `foo` help: consider restricting type parameter `T` but it is an `unstable` trait | LL | pub fn demo<T: Unstable>(t: T) { | ++++++++++ ``` On stable, we don't suggest the trait at all ``` error[E0277]: the trait bound `T: Unstable` is not satisfied --> $DIR/unstable-trait-suggestion.rs:13:9 | LL | foo(t) | --- ^ the trait `Unstable` is not implemented for `T` | | | required by a bound introduced by this call | note: required by a bound in `foo` --> $DIR/unstable-trait-suggestion.rs:9:11 | LL | fn foo<T: Unstable>(_: T) {} | ^^^^^^^^ required by this bound in `foo` ``` Fix #133511.
2024-12-08Merge pull request #4081 from rust-lang/rustup-2024-12-08Ben Kimock-258/+198
Automatic Rustup
2024-12-08Adjust `atomic-from-mut-not-available.rs`许杰友 Jieyou Xu (Joe)-3/+53
- Introduce two revisions: one for 32-bit x86 vs one for 64-bit x86_64 and compare & contrast the errors. - Document the test intention and note its limitations.
2024-12-08Move `atomic-from-mut-not-available.rs` to `tests/ui/stdlib-unit-tests/`许杰友 Jieyou Xu (Joe)-17/+0
This test exercises the combined effect of the `cfg(target_has_atomic_equal_alignment = "...")` implementation in the compiler as well as the usage of said `cfg(target_has_atomic_equal_alignment)` in `core`.
2024-12-08Adjust `assoc-oddities-3.rs`许杰友 Jieyou Xu (Joe)-0/+28
- Include the original MCVE as reported in <https://github.com/rust-lang/rust/issues/28777>. - Document the intention of the test.
2024-12-08Move `assoc-oddities-3.rs` under `tests/ui/parser/assoc/`许杰友 Jieyou Xu (Joe)-0/+0
This is where `assoc-oddities-{1,2}.rs` are located, reunite them!
2024-12-08Move `assoc-lang-items.rs` to `tests/ui/lang-items/`许杰友 Jieyou Xu (Joe)-0/+0
2024-12-08Document `assoc-lang-items.rs`许杰友 Jieyou Xu (Joe)-4/+18
2024-12-08Move `assign-imm-local-twice.rs` to `tests/ui/borrowck/`许杰友 Jieyou Xu (Joe)-0/+0
2024-12-08Adjust `assign-imm-local-twice.rs`许杰友 Jieyou Xu (Joe)-9/+38
- Document the test intention, including both the language semantics it is checking, as well as the borrowck diagnostics that this is exercising. - Tag this test with `//@ run-rustfix` as this ui test exercises a suggestion diagnostics to make an immutable local var mutable. - Minor error annotation reformatting.
2024-12-08Move `assign-assign.rs` to `tests/ui/codegen/assign-expr-unit-type.rs`许杰友 Jieyou Xu (Joe)-0/+0
2024-12-08Document `assign-assign.rs`许杰友 Jieyou Xu (Joe)-2/+11
2024-12-08fix buildRalf Jung-2/+2