about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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 shallow_find_files helper function to run-make-supportOneirical-19/+20
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
2024-07-04Remove a use of `StructuredDiag`, which is incompatible with automatic error ↵Oli Scherer-0/+13
tainting and error translations
2024-07-04reject SmartPointer constructions not serving the purposeDing Xiang Fei-1/+123
2024-07-04Rollup merge of #127289 - aDotInTheVoid:rustdoc-json-lt, r=GuillaumeGomezJacob Pratt-0/+32
rustdoc-json: Better representation of lifetime bounds in where clauses. As suggested [on zulip][1] (CC `@its-the-shrimp),` there's no need to use `GenericBound` here, as the only bound a lifetime can have is that it outlives other lifetimes. While we're making breaking changes here, I also renamed it from using "region" to "lifetime", as this is more user-aligned. See [this comment][2] for details. [1]: https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/.60ItemEnum.3A.3AOpaqueTy.60/near/448871430 [2]: https://github.com/rust-lang/rust/issues/100961#issuecomment-2206565556 r? `@GuillaumeGomez`
2024-07-04Tweak raw-pointer field access and array indexing suggestionsEsteban Küber-22/+32
2024-07-04Tweak slice and as_deref suggestion spanEsteban Küber-38/+72
Use multispan suggestion.
2024-07-04More accurate mutability suggestionEsteban Küber-129/+230
2024-07-04Use shorter span for float literal suggestionEsteban Küber-56/+88
2024-07-04Fix `&mut` removal suggestionEsteban Küber-12/+21
2024-07-04Better suggestion span for missing type parameterEsteban Küber-8/+40
2024-07-04Better span for "make binding mutable" suggestionEsteban Küber-87/+123
2024-07-04Auto merge of #127127 - notriddle:notriddle/pulldown-cmark-0.11, ↵bors-0/+102
r=GuillaumeGomez rustdoc: update to pulldown-cmark 0.11 r? rustdoc This pull request updates rustdoc to the latest version of pulldown-cmark. Along with adding new markdown extensions (which this PR doesn't enable), the new pulldown-cmark version also fixes a large number of bugs. Because all text files successfully parse as markdown, these bugfixes change the output, which can break people's existing docs. A crater run, https://github.com/rust-lang/rust/pull/121659, has already been run for this change. The first commit upgrades and fixes rustdoc. The second commit adds a lint for the footnote and block quote parser changes, which break the largest numbers of docs in the Crater run. The strikethrough change was mitigated in pulldown-cmark itself. Unblocks https://github.com/rust-lang/rust-clippy/pull/12876
2024-07-04Adjust rustdoc automatic link suggestionEsteban Küber-20/+100
Use more accurate spans for multipart suggestion.
2024-07-03Auto merge of #127296 - matthiaskrgr:rollup-1t1isa7, r=matthiaskrgrbors-90/+306
Rollup of 6 pull requests Successful merges: - #127092 (Change return-type-notation to use `(..)`) - #127184 (More refactorings to rustc_interface) - #127190 (Update LLVM submodule) - #127253 (Fix incorrect suggestion for extra argument with a type error) - #127280 (Disable rmake test rustdoc-io-error on riscv64gc-gnu) - #127294 (Less magic number for corountine) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-03Rollup merge of #127280 - ↵Matthias Krüger-2/+7
ferrocene:hoverbear/disable-rmake-rustdoc-io-error, r=jieyouxu Disable rmake test rustdoc-io-error on riscv64gc-gnu In https://github.com/rust-lang/rust/pull/126917 we disabled `inaccessible-temp-dir` on `riscv64gc-gnu` because the container runs the build as `root` (just like the `armhf-gnu` builds). Tests creating an inaccessible test directory are not possible, since `root` can always touch those directories. https://github.com/rust-lang/rust/blob/553a69030e5a086eb3841d020db8c9c463948c72/src/ci/docker/host-x86_64/disabled/riscv64gc-gnu/Dockerfile#L99 This means the tests are run as `root`. As `root`, it's perfectly normal and reasonable to violate permission checks this way: ```bash $ sudo mkdir scratch $ sudo chmod o-w scratch $ sudo mkdir scratch/backs $ ``` Because of this, this PR makes the test ignored on `riscv64gc` (just like on `armhf-gnu`) for now. As an alternative, I believe the best long-term strategy would be to not run the tests as `root` for this job. Some preliminary exploration was done in https://github.com/rust-lang/rust/pull/126917#issuecomment-2189933970, however that appears a larger lift. ## Testing > [!NOTE] > `riscv64gc-unknown-linux-gnu` is a [**Tier 2 with Host Tools** platform](https://doc.rust-lang.org/beta/rustc/platform-support.html), all tests may not necessarily pass! This change should only ignore `inaccessible-temp-dir` and not affect other tests. You can test out the job locally: ```sh DEPLOY=1 ./src/ci/docker/run.sh riscv64gc-gnu ``` r? `@jieyouxu`
2024-07-03Rollup merge of #127253 - chenyukang:yukang-fix-126246-fn-parameters-check, ↵Matthias Krüger-0/+145
r=estebank Fix incorrect suggestion for extra argument with a type error Fixes #126246 I tried to fix it in the `find_errors` of ArgMatrix, but seems it's hard to avoid breaking some other test cases. The root cause is we eliminate the first argument even with a type error at here: https://github.com/rust-lang/rust/blob/6292b2af620dbd771ebb687c3a93c69ba8f97268/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs#L664 So the left argument is always treated as extra one. But if there is already a type error, an error message will be generated firstly, which make this issue a trivial one.
2024-07-03Rollup merge of #127184 - bjorn3:interface_refactor2, r=NadrierilMatthias Krüger-2/+5
More refactorings to rustc_interface Follow up to https://github.com/rust-lang/rust/pull/126834
2024-07-03Rollup merge of #127092 - compiler-errors:rtn-dots-redux, r=estebankMatthias Krüger-86/+149
Change return-type-notation to use `(..)` Aligns the syntax with the current wording of [RFC 3654](https://github.com/rust-lang/rfcs/pull/3654). Also implements rustfmt support (along with making a match exhaustive). Tracking: * https://github.com/rust-lang/rust/issues/109417
2024-07-03Auto merge of #127044 - Oneirical:fantestic-journey, r=Kobzol,jieyouxubors-70/+133
Migrate `dylib-chain`, `rlib-chain`, `issue-47384`, `msvc-opt-minsize` and `test-harness` `run-make` tests to ui/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: aarch64-apple
2024-07-03rustdoc-json: Better representation of lifetime bounds in where clauses.Alona Enraght-Moony-0/+32
As suggested [on zulip][1], there's no need to use `GenericBound` here, as the only bound a lifetime can have is that it outlives other lifetimes. While we're making breaking changes here, I also renamed it from using "region" to "lifetime", as this is more user-aligned. See [this comment][2] for details. [1]: https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/.60ItemEnum.3A.3AOpaqueTy.60/near/448871430 [2]: https://github.com/rust-lang/rust/issues/100961#issuecomment-2206565556
2024-07-03Disable rmake test rustdoc-io-error on riscv64gc-gnuAna Hobden-2/+7
2024-07-03Auto merge of #127278 - matthiaskrgr:rollup-fjexkdr, r=matthiaskrgrbors-2/+135
Rollup of 8 pull requests Successful merges: - #126803 (Change `asm-comments` to `verbose-asm`, always emit user comments) - #127050 (Make mtime of reproducible tarballs dependent on git commit) - #127145 (Add `as_lang_item` to `LanguageItems`, new trait solver) - #127202 (Remove global error count checks from typeck) - #127233 (Some parser cleanups) - #127248 (Add parse fail test using safe trait/impl trait) - #127264 (Small `run-make-support` API improvements) - #127270 (bootstrap: pass correct struct size to winapi) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-03Rollup merge of #127264 - GuillaumeGomez:run-make-support-api-improvements, ↵Matthias Krüger-1/+1
r=Kobzol Small `run-make-support` API improvements r? `@Kobzol`
2024-07-03Rollup merge of #127248 - spastorino:unsafe-extern-tests, r=compiler-errorsMatthias Krüger-0/+47
Add parse fail test using safe trait/impl trait Added 2 more tests to be sure that nothing weird happens using `safe` on items. Needed to do this in separate tests as they give parsing errors.