about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-12-25Rollup merge of #134750 - Zalathar:coverage-attr-errors, r=jieyouxu许杰友 Jieyou Xu (Joe)-214/+378
Update `#[coverage(..)]` attribute error messages to match the current implementation The allowed positions for `#[coverage(..)]` attributes were expanded by #126721, but the corresponding error messages were never updated to reflect the new behaviour. Part of #134749.
2024-12-25Un-redact one occurrence of "coverage attribute not allowed here"Zalathar-1/+1
2024-12-25Overhaul error messages for disallowed coverage attributesZalathar-62/+124
2024-12-25Expand the main test for where the coverage attribute is allowedZalathar-48/+148
Some of these cases are also implicitly checked by other tests, but it's helpful to also explicitly list them in the main test.
2024-12-25Fully redact the [E0788] error message in tests, to make changes easierZalathar-26/+26
2024-12-25Rollup merge of #134741 - compiler-errors:coroutine-verbose, r=lqdDianQK-5/+5
Actually print all the relevant parts of a coroutine in verbose mode I need to actually see these components, idk why we weren't printing them :)
2024-12-25Rollup merge of #134735 - compiler-errors:arm-diverges, r=WaffleLapkinDianQK-3/+29
Consider arm to diverge if guard diverges This is not a fix for #134734, but I discovered it when I was gauging how difficult it would be to fix that. It does fix a really old test though :> r? `@WaffleLapkin` or reassign
2024-12-25Actually print all the relevant parts of a coroutine in verbose modeMichael Goulet-5/+5
2024-12-25Rename `tests/ui/coverage-attr/no-coverage.rs` to `allowed-positions.rs`Zalathar-14/+16
2024-12-25Auto merge of #134729 - oliveredget:typo, r=jieyouxubors-1/+1
chore: fix typos Fix some typos, thank you very much.
2024-12-24Auto merge of #134333 - daxpedda:stdarch-bump, r=daxpeddabors-7/+8
Bump `stdarch` This bumps `stdarch` to https://github.com/rust-lang/stdarch/commit/684de0d6fef708cae08214fef9643dd9ec7296e1 to get in https://github.com/rust-lang/stdarch/pull/1677 (tracked in https://github.com/rust-lang/rust/issues/133908). From the [commit history](https://github.com/rust-lang/stdarch/compare/e5e00aab0a8c8fa35fb7865e88fa82366f615c53...684de0d6fef708cae08214fef9643dd9ec7296e1) I deduced that there shouldn't be any changes to Rust necessary. From past PRs I'm assuming that bumping `stdarch` like this is fine, but please let me know if this is somehow inappropriate or requires something more to be done! try-job: arm-android try-job: armhf-gnu
2024-12-24Consider arm to diverge if guard divergesMichael Goulet-3/+29
2024-12-24Bump `stdarch`daxpedda-7/+8
2024-12-24chore: fix typosoliveredget-1/+1
2024-12-24Auto merge of #134513 - fudancoder:master, r=jieyouxubors-8/+8
Fix some typos
2024-12-24Fix some typosfudancoder-8/+8
Signed-off-by: fudancoder <fudancoder@icloud.com.>
2024-12-24Auto merge of #134716 - Zalathar:rollup-1h4q8cc, r=Zalatharbors-152/+170
Rollup of 5 pull requests Successful merges: - #134638 (Fix effect predicates from item bounds in old solver) - #134662 (Fix safety docs for `dyn Any + Send {+ Sync}`) - #134689 (core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets) - #134699 (Belay new reviews for workingjubilee) - #134701 (Correctly note item kind in `NonConstFunctionCall` error message) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-24Rollup merge of #134701 - compiler-errors:non-const-def-descr, r=Urgau,fmeaseStuart Cook-103/+103
Correctly note item kind in `NonConstFunctionCall` error message Don't just call everything a "`fn`". This is more consistent with the error message we give for conditionally-const items, which do note the item's def kind. r? fmease, this is a prerequisite for making those `~const PartialEq` error messages better. Re-roll if you're busy or don't want to review this.
2024-12-24Rollup merge of #134689 - RalfJung:ptr-swap-test, r=oli-obkStuart Cook-0/+3
core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets Ensure that the pointer gets swapped correctly even if it is not stored at an aligned offset. This rules out implementations that copy things in a `usize` loop -- so our implementation needs to be adjusted to avoid such a loop when running in const context. Part of https://github.com/rust-lang/rust/issues/133668
2024-12-24Rollup merge of #134638 - compiler-errors:fx-item-bounds, r=lcnrStuart Cook-49/+64
Fix effect predicates from item bounds in old solver r? lcnr
2024-12-24Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obkbors-261/+153
Begin to implement type system layer of unsafe binders Mostly TODOs, but there's a lot of match arms that are basically just noops so I wanted to split these out before I put up the MIR lowering/projection part of this logic. r? oli-obk Tracking: - https://github.com/rust-lang/rust/issues/130516
2024-12-23Note def descr in NonConstFunctionCallMichael Goulet-103/+103
2024-12-23Always run tail_expr_drop_order lint on promoted MIRMichael Goulet-37/+90
2024-12-23core: fix const ptr::swap_nonoverlapping when there are pointers at odd ↵Ralf Jung-0/+3
offsets in the type
2024-12-23Rollup merge of #134680 - lqd:run-make-cleanup, r=jieyouxuMatthias Krüger-26/+18
Clean up a few rmake tests Now I'm aware it's a bit late to start participating in the Advent of Tests, but here are a few cleanups in the rmake tests to put under the 🎄 anyways. A handful of unused imports, some warnings, and a couple typos. r? `@jieyouxu` 🎅
2024-12-23Rollup merge of #134528 - jieyouxu:fix-rustc-bootstrap-test, r=KobzolMatthias Krüger-2/+2
opt-dist: propagate channel info to bootstrap Fixes #133503. Previously, `tests/ui/bootstrap/rustc_bootstap.rs` [sic] failed during [beta bump](https://github.com/rust-lang/rust/pull/133447#issuecomment-2501298794) in opt-dist tests. This is because: - `opt-dist` tried to run `./x test` against beta-channel dist `rustc` through `bootstrap`. - The dist build produced during the beta bump produces a `rustc` which correctly thinks that it is a beta compiler based on `src/ci/channel` info. - `opt-dist` tries to run `./x test` on the beta `rustc` from the dist build, but without specifying channel through a synthetic `config.toml`, so `bootstrap` tells `compiletest` that we're on the `nightly` channel (by default). - Now there's a channel mismatch: `compiletest` believes the `rustc` under test is a *nightly* rustc, but the `rustc` under test actually considers itself a *beta* rustc. This means that `//@ only-nightly` will be satisfied yet the test will fail as the *beta* rustc is not a *nightly* rustc. This PR: - Fixes the test failure during beta bump (i.e. #133503) by having `opt-dist` faithfully report the channel of the dist `rustc` being tested (i.e. "beta" in a beta bump PR). This will properly make the test be ignored during beta bump as the `rustc` under test is not a *nightly* rustc. - Fixes the test name `rustc_bootstap.rs` -> `rustc_bootstrap.rs`. No more stapping. - Slightly adjusts the doc comment in the test to make it more clear. I ran a try-job against the beta branch (explicitly running the opt-dist tests by modifying the job definition) with these changes in #134131, and it appears that the try-job was [successful](https://github.com/rust-lang/rust/pull/134131#issuecomment-2555492215). The two commits in this PR are cherry-picked from #134131, with the test commit slightly modified (to also adjust the test comments). r? `@Kobzol` (or compiler or bootstrap or infra I guess?)
2024-12-24Add test for coverage on a body-less trait functionEric Huss-10/+35
2024-12-24Add a test for coverage attr on trait functionEric Huss-0/+60
2024-12-23fix a few typos in rmake tests' commentsRémy Rakic-6/+6
2024-12-23remove unnecessary `mut` from `dump-ice-to-disk` rmake testRémy Rakic-1/+1
2024-12-23clean up `remove-dir-all-race` rmake testRémy Rakic-7/+6
- removes unused variables - fixes a few typos
2024-12-23remove unused imports from rmake testsRémy Rakic-12/+5
2024-12-23Auto merge of #134677 - tgross35:rollup-ozoeyop, r=tgross35bors-358/+470
Rollup of 4 pull requests Successful merges: - #129220 (Add platform docs for FreeBSD.) - #134659 (test-infra: improve compiletest and run-make-support symlink handling) - #134668 (Make sure we don't lose default struct value when formatting struct) - #134672 (Revert stabilization of the `#[coverage(..)]` attribute) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-23Rollup merge of #134672 - Zalathar:revert-coverage-attr, r=wesleywiserTrevor Gross-358/+470
Revert stabilization of the `#[coverage(..)]` attribute Due to a process mixup, the PR to stabilize the `#[coverage(..)]` attribute (#130766) was merged while there are still outstanding concerns. The default action in that situation is to revert, and the feature is not sufficiently urgent or uncontroversial to justify special treatment, so this PR reverts that stabilization. --- - A key point that came up in offline discussions is that unlike most user-facing features, this one never had a proper RFC, so parts of the normal stabilization process that implicitly rely on an RFC break down in this case. - As the implementor and de-facto owner of the feature in its current form, I would like to think that I made good choices in designing and implementing it, but I don't feel comfortable proceeding to stabilization without further scrutiny. - There hasn't been a clear opportunity for T-compiler to weigh in or express concerns prior to stabilization. - The stabilization PR cites a T-lang FCP that occurred in the tracking issue, but due to the messy design and implementation history (and lack of a clear RFC), it's unclear what that FCP approval actually represents in this case. - At the very least, we should not proceed without a clear statement from T-lang or the relevant members about the team's stance on this feature, especially in light of the other concerns listed here. - The existing user-facing documentation doesn't clearly reflect which parts of the feature are stable commitments, and which parts are subject to change. And there doesn't appear to be a clear consensus anywhere about where that line is actually drawn, or whether the chosen boundary is acceptable to the relevant teams and individuals. - For example, the [stabilization report comment](https://github.com/rust-lang/rust/issues/84605#issuecomment-2166514660) mentions that some aspects are subject to change, but that text isn't consistent with my earlier comments, and there doesn't appear to have been any explicit discussion or approval process. - [The current reference text](https://github.com/rust-lang/reference/blob/4dfaa4f/src/attributes/coverage-instrumentation.md) doesn't mention this distinction at all, and instead simply describes the current implementation behaviour. - When the implementation was changed to its current form, the associated user-facing error messages were not updated, so they still refer to the attribute only being allowed on functions and closures. - On its own, this might have been reasonable to fix-forward in the absence of other concerns, but the fact that it never came up earlier highlights the breakdown in process that has occurred here. --- Apologies to everyone who was excited for this stabilization to land, but unfortunately it simply isn't ready yet.
2024-12-23Auto merge of #134608 - DianQK:disable-93775, r=jieyouxubors-3/+3
Add `ignore-rustc-debug-assertions` to `tests/ui/associated-consts/issue-93775.rs` Closes #132111. Closes #133432. I think this test case is flaky because the recursive calls happen to hit the upper limit of the call stack. IMO, this may not be an issue, as it's reasonable for overly complex code to require additional build configurations (such as increasing the call stack size). After set `rust.debug-assertions` is true, the test case requires a larger call stack, so disable it on `rust.debug-assertions=true`. r? jieyouxu try-job: x86_64-msvc try-job: i686-msvc
2024-12-23Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, ↵Zalathar-358/+470
r=wesleywiser" This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
2024-12-23Auto merge of #134666 - matthiaskrgr:rollup-whe0chp, r=matthiaskrgrbors-2/+38
Rollup of 6 pull requests Successful merges: - #130289 (docs: Permissions.readonly() also ignores root user special permissions) - #134583 (docs: `transmute<&mut T, &mut MaybeUninit<T>>` is unsound when exposed to safe code) - #134611 (Align `{i686,x86_64}-win7-windows-msvc` to their parent targets) - #134629 (compiletest: Allow using a specific debugger when running debuginfo tests) - #134642 (Implement `PointerLike` for `isize`, `NonNull`, `Cell`, `UnsafeCell`, and `SyncUnsafeCell`.) - #134660 (Fix spacing of markdown code block fences in compiler rustdoc) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-261/+153
2024-12-22Rollup merge of #134642 - kpreid:pointerlike-cell, r=compiler-errorsMatthias Krüger-2/+38
Implement `PointerLike` for `isize`, `NonNull`, `Cell`, `UnsafeCell`, and `SyncUnsafeCell`. * Implementing `PointerLike` for `UnsafeCell` enables the possibility of interior mutable `dyn*` values. Since this means potentially exercising new codegen behavior, I added a test for it in `tests/ui/dyn-star/cell.rs`. Please let me know if there are further sorts of tests that should be written, or other care that should be taken with this change. It is unfortunately not possible without compiler changes to implement `PointerLike` for `Atomic*` types, since they are not `repr(transparent)` (and, in theory if not in practice, `AtomicUsize`'s alignment may be greater than that of an ordinary pointer or `usize`). * Implementing `PointerLike` for `NonNull` is useful for pointer types which wrap `NonNull`. * Implementing `PointerLike` for `isize` is just for completeness; I have no use cases in mind, but I cannot think of any reason not to do this. * Tracking issue: #102425 `@rustbot` label +F-dyn_star (there is no label or tracking issue for F-pointer_like_trait)
2024-12-22Implement `PointerLike` for `isize`, `NonNull`, `Cell`, `UnsafeCell`, and ↵Kevin Reid-2/+38
`SyncUnsafeCell`. Implementing `PointerLike` for `UnsafeCell` enables the possibility of interior mutable `dyn*` values. Since this means potentially exercising new codegen behavior, I added a test for it in `tests/ui/dyn-star/cell.rs`. Also updated UI tests to account for the `isize` implementation changing error messages.
2024-12-22Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasperbors-81/+36
Delete `Rvalue::Len` 🎉 Everything's moved to `PtrMetadata`, so we can get rid of the `Len` variant now. ~~Depends on #134326, so draft until that lands~~ Ready! r? mir
2024-12-22Auto merge of #131193 - EFanZh:asserts-vec-len, r=the8472bors-1/+53
Asserts the maximum value that can be returned from `Vec::len` Currently, casting `Vec<i32>` to `Vec<u32>` takes O(1) time: ```rust // See <https://godbolt.org/z/hxq3hnYKG> for assembly output. pub fn cast(vec: Vec<i32>) -> Vec<u32> { vec.into_iter().map(|e| e as _).collect() } ``` But the generated assembly is not the same as the identity function, which prevents us from casting `Vec<Vec<i32>>` to `Vec<Vec<u32>>` within O(1) time: ```rust // See <https://godbolt.org/z/7n48bxd9f> for assembly output. pub fn cast(vec: Vec<Vec<i32>>) -> Vec<Vec<u32>> { vec.into_iter() .map(|e| e.into_iter().map(|e| e as _).collect()) .collect() } ``` This change tries to fix the problem. You can see the comparison here: <https://godbolt.org/z/jdManrKvx>.
2024-12-22Delete `Rvalue::Len`Scott McMurray-81/+36
Everything's moved to `PtrMetadata` instead.
2024-12-22Auto merge of #134326 - scottmcm:slice-drop-shim-ptrmetadata, r=saethlinbors-1/+66
Use `PtrMetadata` instead of `Len` in slice drop shims I tried to do a bigger change in #134297 which didn't work, so here's the part I really wanted: Removing another use of `Len`, in favour of `PtrMetadata`. Split into two commits where the first just adds a test, so you can look at the second commit to see how the drop shim for an array changes with this PR. Reusing the same reviewer from the last one: r? BoxyUwU
2024-12-22Rollup merge of #134639 - compiler-errors:negative-ambiguity-causes, r=oli-obkMatthias Krüger-0/+41
Make sure we note ambiguity causes on positive/negative impl conflicts Fixes https://github.com/rust-lang/rust/issues/134632 by explaining why the error must be
2024-12-22Rollup merge of #134635 - compiler-errors:dyn-dyn, r=fmeaseMatthias Krüger-9/+43
Don't ICE on illegal `dyn*` casts Fixes #134544 Fixes #132127
2024-12-22Rollup merge of #134599 - dtolnay:fulldepsparser, r=fmeaseMatthias Krüger-50/+62
Detect invalid exprs in parser used by pretty-printer tests This PR fixes a bug in https://github.com/rust-lang/rust/pull/133730 inherited from https://github.com/rust-lang/rust/pull/43742. Before this fix, the test might silently only operate on a prefix of some of the test cases in this table: https://github.com/rust-lang/rust/blob/13170cd787cb733ed24842ee825bcbd98dc01476/tests/ui-fulldeps/pprust-parenthesis-insertion.rs#L57 For example, adding the test case `1 .. 2 .. 3` (a syntactically invalid expression) into the table would unexpectedly succeed the test instead of crashing at this unwrap: https://github.com/rust-lang/rust/blob/13170cd787cb733ed24842ee825bcbd98dc01476/tests/ui-fulldeps/pprust-parenthesis-insertion.rs#L199-L200 because `parse_expr` would successfully parse just `1 .. 2` and disregard the last `.. 3`. This PR adds a check that `parse_expr` reaches `Eof`, ensuring all the test cases actually test the whole expression they look like they are supposed to.
2024-12-22Add `ignore-rustc-debug-assertions` to ↵DianQK-3/+3
`tests/ui/associated-consts/issue-93775.rs`
2024-12-22Auto merge of #134640 - matthiaskrgr:rollup-xlstm3o, r=matthiaskrgrbors-134/+245
Rollup of 6 pull requests Successful merges: - #134364 (Use E0665 for missing `#[default]` on enum and update doc) - #134601 (Support pretty-printing `dyn*` trait objects) - #134603 (Explain why a type is not eligible for `impl PointerLike`.) - #134618 (coroutine_clone: add comments) - #134630 (Use `&raw` for `ptr` primitive docs) - #134637 (Flatten effects directory now that it doesn't really test anything specific) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-21Show which test case was found to be meaninglessDavid Tolnay-1/+3