about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-07-06Auto merge of #126987 - petrochenkov:atvisord2, r=pnkfelixbors-0/+10
out_of_scope_macro_calls: Detect calls inside attributes more precisely Fixes https://github.com/rust-lang/rust/issues/126984.
2024-07-06Rollup merge of #127417 - chenyukang:yukang-method-output-diff, r=oli-obkMichael Goulet-11/+44
Show fnsig's unit output explicitly when there is output diff in diagnostics Fixes #127263
2024-07-06show fnsig's output when there is differenceyukang-7/+7
2024-07-06Uplift push_outlives_componentsMichael Goulet-12/+12
2024-07-06show unit output when there is only output diff in diagnosticsyukang-4/+37
2024-07-06out_of_scope_macro_calls: Detect calls inside attributes more preciselyVadim Petrochenkov-0/+10
2024-07-06Rollup merge of #127391 - estebank:null_mut, r=cjgillotMatthias Krüger-4/+6
Use verbose suggestion for `ptr::null_mut()`
2024-07-06Rollup merge of #127275 - RalfJung:offset-from-isize-min, r=AmanieuMatthias Krüger-5/+19
offset_from, offset: clearly separate safety requirements the user needs to prove from corollaries that automatically follow By landing https://github.com/rust-lang/rust/pull/116675 we decided that objects larger than `isize::MAX` cannot exist in the address space of a Rust program, which lets us simplify these rules. For `offset_from`, we can even state that the *absolute* distance fits into an `isize`, and therefore exclude `isize::MIN`. This PR also changes Miri to treat an `isize::MIN` difference like the other isize-overflowing cases.
2024-07-05Rollup merge of #127392 - estebank:arg-type, r=jieyouxuJubilee-160/+203
Use verbose suggestion for changing arg type
2024-07-05Rollup merge of #127383 - estebank:arg-removal, r=compiler-errorsJubilee-179/+263
Use verbose style for argument removal suggestion
2024-07-05Rollup merge of #127369 - Jules-Bertholet:match-ergonomics-2021, r=NadrierilJubilee-48/+141
Match ergonomics 2024: align with RFC again - `&` matches `&mut` on old editions - Add some more tests r? ``@Nadrieril`` cc https://github.com/rust-lang/rust/issues/123076 ``@rustbot`` label A-edition-2024 A-patterns
2024-07-05Rollup merge of #127098 - Oneirical:big-test-party, r=Kobzol,jieyouxuJubilee-147/+543
Migrate `output-type-permutations` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc try-job: armhf-gnu try-job: aarch64-apple try-job: test-various
2024-07-05Rollup merge of #125751 - pitaj:new_range_api, r=jhprattJubilee-3/+3
Add `new_range_api` for RFC 3550 Initial implementation for #125687 This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC. Having `From` is highly convenient and the debug assert should find almost all misuses. This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum. Currently the iterators are just wrappers around the old range types. Tracking issues: - https://github.com/rust-lang/rust/issues/123741 - https://github.com/rust-lang/rust/issues/125687
2024-07-05Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelixMichael Goulet-23/+152
Improve dead code analysis Fixes #120770 1. check impl items later if self ty is private although the trait method is public, cause we must use the ty firstly if it's private 2. mark the adt live if it appears in pattern, like generic argument, this implies the use of the adt 3. based on the above, we can handle the case that private adts impl Default, so that we don't need adding rustc_trivial_field_reads on Default, and the logic in should_ignore_item r? ``@pnkfelix``
2024-07-05add `new_range_api` for RFC 3550Peter Jaszkowiak-3/+3
This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC. Having `From` is highly convenient and the assertion is unlikely to be a problem in practice. This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum. Currently the iterators are just wrappers around the old range types, and most other trait impls delegate to the old rage types as well. Also includes an `.iter()` shorthand for `.clone().into_iter()`
2024-07-05Use verbose suggestion for changing arg typeEsteban Küber-160/+203
2024-07-05Use verbose suggestion for `ptr::null_mut()`Esteban Küber-4/+6
2024-07-05Use verbose style for argument removal suggestionEsteban Küber-179/+263
2024-07-05Match ergonomics 2024: test type inferenceJules Bertholet-9/+87
2024-07-05Match ergonomics 2024: `&` matches `&mut` on old editionsJules Bertholet-0/+15
2024-07-05Rename edition 2021 fail testJules Bertholet-10/+10
2024-07-05Add shallow_find_files helper function to run-make-supportOneirical-19/+20
2024-07-05Expectations struct for output-type-permutationsOneirical-190/+442
2024-07-05add shallow_find_files helper to run_make_supportOneirical-167/+280
2024-07-05rewrite output-type-permutations to rmakeOneirical-147/+178
2024-07-05rewrite profile to rmakeOneirical-13/+22
2024-07-05rewrite pgo-use to rmakeOneirical-43/+54
2024-07-05rewrite pgo-gen to rmakeOneirical-11/+18
2024-07-05Auto merge of #127360 - GuillaumeGomez:rollup-f0zs1qr, r=GuillaumeGomezbors-82/+146
Rollup of 7 pull requests Successful merges: - #124290 (DependencyList: removed outdated comment) - #126709 (Migrate `include_bytes_deps`, `optimization-remarks-dir-pgo`, `optimization-remarks-dir`, `issue-40535` and `rmeta-preferred` `run-make` tests to rmake) - #127214 (Use the native unwind function in miri where possible) - #127320 (Update windows-bindgen to 0.58.0) - #127349 (Tweak `-1 as usize` suggestion) - #127352 (coverage: Rename `mir::coverage::BranchInfo` to `CoverageInfoHi`) - #127359 (Improve run make llvm ident code) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-05Rollup merge of #127359 - GuillaumeGomez:improve-run-make-llvm-ident-code, ↵Guillaume Gomez-1/+1
r=jieyouxu Improve run make llvm ident code I took the commits that are not blocking https://github.com/rust-lang/rust/pull/127237. r? `@Kobzol`
2024-07-05Rollup merge of #127349 - estebank:negative-unsigned-literal, r=petrochenkovGuillaume Gomez-16/+20
Tweak `-1 as usize` suggestion When writing a negative unsigned integer literal, use a verbose suggestion and account for `as` casting.
2024-07-05Rollup merge of #126709 - Oneirical:exitestial-crisis, r=jieyouxuGuillaume Gomez-65/+125
Migrate `include_bytes_deps`, `optimization-remarks-dir-pgo`, `optimization-remarks-dir`, `issue-40535` and `rmeta-preferred` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Needs BSD tryjob. try-job: aarch64-apple try-job: x86_64-msvc try-job: armhf-gnu try-job: test-various
2024-07-05Improve code of `run-make/llvm-ident` testGuillaume Gomez-1/+1
2024-07-05Auto merge of #127008 - Jules-Bertholet:tc-ergonomics, r=Nadrierilbors-44/+392
Match ergonomics 2024: Implement TC's match ergonomics proposal Under gate `ref_pat_eat_one_layer_2024_structural`. Enabling `ref_pat_eat_one_layer_2024` at the same time allows the union of what the individual gates allow. `@traviscross` r? `@Nadrieril` cc https://github.com/rust-lang/rust/issues/123076 `@rustbot` label A-edition-2024 A-patterns
2024-07-05Auto merge of #127344 - matthiaskrgr:morecrashes, r=jieyouxubors-0/+204
crashes: add latest r? `@jieyouxu` `@bors` rollup=iffy
2024-07-05Auto merge of #126171 - RalfJung:simd_bitmask_multibyte, r=workingjubileebors-12/+123
simd_bitmask intrinsic: add a non-power-of-2 multi-byte example r? `@calebzulawski` `@workingjubilee`
2024-07-05Tweak `-1 as usize` suggestionEsteban Küber-16/+20
When writing a negative unsigned integer literal, use a verbose suggestion and account for `as` casting.
2024-07-04crashes: add latestMatthias Krüger-0/+204
2024-07-04Rollup merge of #127319 - oli-obk:fail2taint, r=compiler-errorsMatthias Krüger-0/+13
Remove a use of `StructuredDiag`, which is incompatible with automatic error tainting and error translations fixes #127219 I want to remove all of `StructuredDiag`, but it's a bit more involved as it is also used from the `ItemCtxt`, which doesn't support tainting yet.
2024-07-04Rollup merge of #127301 - estebank:fix-suggestions, r=UrgauMatthias Krüger-372/+706
Tweak some structured suggestions to be more verbose and accurate Addressing some issues I found while working on #127282. ``` error: this URL is not a hyperlink --> $DIR/auxiliary/include-str-bare-urls.md:1:11 | LL | HEADS UP! https://example.com MUST SHOW UP IN THE STDERR FILE! | ^^^^^^^^^^^^^^^^^^^ | = note: bare URLs are not automatically turned into clickable links note: the lint level is defined here --> $DIR/include-str-bare-urls.rs:14:9 | LL | #![deny(rustdoc::bare_urls)] | ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead | LL | HEADS UP! <https://example.com> MUST SHOW UP IN THE STDERR FILE! | + + ``` ``` error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/assign-imm-local-twice.rs:7:5 | LL | v = 1; | ----- first assignment to `v` LL | println!("v={}", v); LL | v = 2; | ^^^^^ cannot assign twice to immutable variable | help: consider making this binding mutable | LL | let mut v: isize; | +++ ``` ``` error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-22560.rs:9:23 | LL | trait Sub<Rhs=Self> { | ------------------- type parameter `Rhs` must be specified for this ... LL | type Test = dyn Add + Sub; | ^^^ | = note: because of the default `Self` reference, type parameters must be specified on object types help: set the type parameter to the desired type | LL | type Test = dyn Add + Sub<Rhs>; | +++++ ``` ``` error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable --> $DIR/issue-33819.rs:4:34 | LL | Some(ref v) => { let a = &mut v; }, | ^^^^^^ cannot borrow as mutable | help: try removing `&mut` here | LL - Some(ref v) => { let a = &mut v; }, LL + Some(ref v) => { let a = v; }, | ``` ``` help: remove the invocation before committing it to a version control system | LL - dbg!(); | ``` ``` error[E0308]: mismatched types --> $DIR/issue-39974.rs:1:21 | LL | const LENGTH: f64 = 2; | ^ expected `f64`, found integer | help: use a float literal | LL | const LENGTH: f64 = 2.0; | ++ ``` ``` error[E0529]: expected an array or slice, found `Vec<i32>` --> $DIR/match-ergonomics.rs:8:9 | LL | [&v] => {}, | ^^^^ pattern cannot match with input type `Vec<i32>` | help: consider slicing here | LL | match x[..] { | ++++ ``` ``` error[E0609]: no field `0` on type `[u32; 1]` --> $DIR/parenthesized-deref-suggestion.rs:10:21 | LL | (x as [u32; 1]).0; | ^ unknown field | help: instead of using tuple indexing, use array indexing | LL | (x as [u32; 1])[0]; | ~ + ```
2024-07-04Rollup merge of #127283 - dingxiangfei2009:check-repr-transparent, r=davidtwcoMatthias Krüger-1/+123
Reject SmartPointer constructions not serving the purpose Tracking issue: #123430 With this PR we will reject a row of malformed `SmartPointer` implementor candidates. cc `@Darksonn` `@davidtwco` for context.
2024-07-04Rollup merge of #127037 - oli-obk:define_opaque_types18, r=davidtwcoMatthias Krüger-61/+0
Remove some duplicated tests probably some parallel PR development that happened here, copying over the same examples from issues.
2024-07-04Rollup merge of #123043 - GoldsteinE:fix/repr-c-dead-branches, r=oli-obkMatthias Krüger-0/+1546
Disable dead variant removal for `#[repr(C)]` enums. This prevents removing dead branches from a `#[repr(C)]` enum (they now get discriminants allocated as if they were inhabited). Implementation notes: ABI of something like ```rust #[repr(C)] enum Foo { Foo(!), } ``` is still `Uninhabited`, but its layout is now computed as if all the branches were inhabited. This seemed to me like a proper way to do it, especially given that ABI sanity check explicitly asserts that type-level uninhabitedness implies ABI uninhabitedness. This probably needs some sort of FCP (given that it changes `#[repr(C)]` layout, which is a stable guarantee), but I’m not sure how to call for one or which team is the most relevant. See https://github.com/rust-lang/unsafe-code-guidelines/issues/500.
2024-07-04add shallow_find_files helper function to run-make-supportOneirical-10/+35
2024-07-04rewrite rmeta-preferred to rmakeOneirical-20/+20
2024-07-04rewrite and rename issue-40535 to rmakeOneirical-13/+14
2024-07-04rewrite optimization-remarks-dir to rmakeOneirical-15/+39
2024-07-04rewrite optimization-remarks-dir-pgo to rmakeOneirical-17/+19
2024-07-04rewrite and rename include_bytes_deps to rmakeOneirical-7/+15
2024-07-04Improve dead code analysismu001999-23/+152