about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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-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-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.
2024-07-03Rollup merge of #127202 - oli-obk:do_not_count_errors, r=wesleywiserMatthias Krüger-1/+75
Remove global error count checks from typeck Some of these are not reachable anymore, others can now rely on information local to the current typeck run. One check was actually invalid, because it was relying on wfcheck running before typeck, which is not guaranteed in the query system and usually easy to create ICEing examples for via const eval (which runs typeck before wfcheck)
2024-07-03Rollup merge of #126803 - tgross35:verbose-asm, r=AmanieuMatthias Krüger-0/+12
Change `asm-comments` to `verbose-asm`, always emit user comments Implements what is described in https://github.com/rust-lang/compiler-team/issues/762 Tracking issue: https://github.com/rust-lang/rust/issues/126802
2024-07-03Add parse fail test using safe trait/impl traitSantiago Pastorino-0/+47
2024-07-03Auto merge of #126094 - petrochenkov:libsearch, r=michaelwoeristerbors-0/+20
linker: Link dylib crates by path Linkers seem to support linking dynamic libraries by path. Not sure why the previous scheme with splitting the path into a directory (passed with `-L`) and a name (passed with `-l`) was used (upd: likely due to https://github.com/rust-lang/rust/pull/126094#issuecomment-2155063414). When we split a library path `some/dir/libfoo.so` into `-L some/dir` and `-l foo` we add `some/dir` to search directories for *all* libraries looked up by the linker, not just `foo`, and `foo` is also looked up in *all* search directories not just `some/dir`. Technically we may find some unintended libraries this way. Therefore linking dylibs via a full path is both simpler and more reliable. It also makes the set of search directories more easily reproducible when we need to lookup some native library manually (like in https://github.com/rust-lang/rust/pull/123436).
2024-07-03Auto merge of #125507 - compiler-errors:type-length-limit, r=lcnrbors-65/+80
Re-implement a type-size based limit r? lcnr This PR reintroduces the type length limit added in #37789, which was accidentally made practically useless by the caching changes to `Ty::walk` in #72412, which caused the `walk` function to no longer walk over identical elements. Hitting this length limit is not fatal unless we are in codegen -- so it shouldn't affect passes like the mir inliner which creates potentially very large types (which we observed, for example, when the new trait solver compiles `itertools` in `--release` mode). This also increases the type length limit from `1048576 == 2 ** 20` to `2 ** 24`, which covers all of the code that can be reached with craterbot-check. Individual crates can increase the length limit further if desired. Perf regression is mild and I think we should accept it -- reinstating this limit is important for the new trait solver and to make sure we don't accidentally hit more type-size related regressions in the future. Fixes #125460
2024-07-03Small `run-make-support` API improvementsGuillaume Gomez-1/+1
2024-07-03Rollup merge of #127245 - BoxyUwU:gce_hang_test, r=NilstriebJacob Pratt-0/+32
Add a test for `generic_const_exprs` Fixes #103770 r? ``@Nilstrieb``
2024-07-03Rollup merge of #127239 - RalfJung:big-endian, r=NadrierilJacob Pratt-6/+5
remove unnecessary ignore-endian-big from stack-overflow-trait-infer … Follow-up to [this](https://github.com/rust-lang/rust/pull/122895#discussion_r1632206218) discussion
2024-07-03Rollup merge of #127115 - RalfJung:unreferenced-used-static, r=lqd,ChrisDentonJacob Pratt-3/+4
unreferenced-used-static: run test everywhere Follow-up to https://github.com/rust-lang/rust/pull/127099.
2024-07-03Rollup merge of #126917 - ↵Jacob Pratt-2/+6
ferrocene:hoverbear/riscv64-inaccessible-temp-dir-resolution, r=jieyouxu Disable rmake test `inaccessible-temp-dir` on riscv64 In https://github.com/rust-lang/rust/pull/126279 the `inaccessible-temp-dir` test was moved to rmake, I followed up with a 'fix' derived from https://github.com/rust-lang/rust/pull/126355 in https://github.com/rust-lang/rust/pull/126707. That 'fix' was misguided and hiding the true issue of the linker being incorrect for `riscv64gc-unknown-linux-gnu` (addressed in https://github.com/rust-lang/rust/pull/126916). Unfortunately, even with the linker fixed, this test doesn't work. I asked myself why this appeared to work on other platforms and investigated why. Both the containers for `armhf-gnu` and `riscv64gc` run their tests as `root` and have `NO_CHANGE_USER` set: 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` for now. As an alternative, I believe the best long-term strategy would be to not run the tests as `root` for this job. ## 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 mv src/ci/docker/host-x86_64/disabled/riscv64gc-gnu src/ci/docker/host-x86_64/riscv64gc-gnu DEPLOY=1 ./src/ci/docker/run.sh riscv64gc-gnu ```
2024-07-03Rollup merge of #126403 - compiler-errors:better-type-errors, r=lcnrJacob Pratt-9/+39
Actually report normalization-based type errors correctly for alias-relate obligations in new solver We have some special casing to report type mismatch errors that come from projection predicates, but we don't do that for alias-relate obligations. This PR implements that. There's a bit of code duplication, but 🤷 Best reviewed without whitespace. r? lcnr
2024-07-03Rollup merge of #123588 - tgross35:stabilize-assert_unchecked, r=dtolnayJacob Pratt-6/+2
Stabilize `hint::assert_unchecked` Make the following API stable, including const: ```rust // core::hint, std::hint pub const unsafe fn assert_unchecked(p: bool); ``` This PR also reworks some of the documentation and adds an example. Tracking issue: https://github.com/rust-lang/rust/issues/119131 FCP: https://github.com/rust-lang/rust/issues/119131#issuecomment-1906394087. The docs update should resolve the remaining concern.
2024-07-03Auto merge of #123737 - compiler-errors:alias-wf, r=lcnrbors-0/+20
Check alias args for WF even if they have escaping bound vars #### What This PR stops skipping arguments of aliases if they have escaping bound vars, instead recursing into them and only discarding the resulting obligations referencing bounds vars. #### An example: From the test: ``` trait Trait { type Gat<U: ?Sized>; } fn test<T>(f: for<'a> fn(<&'a T as Trait>::Gat<&'a [str]>)) where for<'a> &'a T: Trait {} //~^ ERROR the size for values of type `[()]` cannot be known at compilation time fn main() {} ``` We now prove that `str: Sized` in order for `&'a [str]` to be well-formed. We were previously unconditionally skipping over `&'a [str]` as it referenced a buond variable. We now recurse into it and instead only discard the `[str]: 'a` obligation because of the escaping bound vars. #### Why? This is a change that improves consistency about proving well-formedness earlier in the pipeline, which is necessary for future work on where-bounds in binders and correctly handling higher-ranked implied bounds. I don't expect this to fix any unsoundness. #### What doesn't it fix? Specifically, this doesn't check projection predicates' components are well-formed, because there are too many regressions: https://github.com/rust-lang/rust/pull/123737#issuecomment-2052198478
2024-07-02Always preserve user-written comments in assemblyTrevor Gross-0/+12
2024-07-03Fix incorrect suggestion for extra argument with a type erroryukang-0/+145
2024-07-02Instance::resolve -> Instance::try_resolve, and other nitsMichael Goulet-1/+3
2024-07-02Actually report normalization-based type errors correctly for alias-relate ↵Michael Goulet-9/+39
obligations in new solver
2024-07-02Re-implement a type-size based limitMichael Goulet-65/+78
2024-07-02add testBoxy-0/+32
2024-07-02Rollup merge of #127243 - BoxyUwU:new_invalid_const_param_ty_test, ↵Matthias Krüger-0/+69
r=compiler-errors Add test for adt_const_params Fixes #84238 r? `@compiler-errors`
2024-07-02Rollup merge of #127230 - hattizai:patch01, r=saethlinMatthias Krüger-3/+3
chore: remove duplicate words remove duplicate words in comments to improve readability.
2024-07-02Rollup merge of #127203 - chenyukang:yukang-fix-120074-import, r=NadrierilMatthias Krüger-0/+34
Fix import suggestion error when path segment failed not from starting Fixes #120074
2024-07-02Rollup merge of #127168 - DianQK:cast-size, r=workingjubileeMatthias Krüger-27/+344
Use the aligned size for alloca at args/ret when the pass mode is cast Fixes #75839. Fixes #121028. The `load` and `store` instructions in LLVM access the aligned size. For example, `load { i64, i32 }` accesses 16 bytes on x86_64: https://alive2.llvm.org/ce/z/n8CHAp. BTW, this example is expected to be optimized to immediate UB by Alive2: https://rust.godbolt.org/z/b7xK7hv1c and https://alive2.llvm.org/ce/z/vZDtZH. r? compiler
2024-07-02Rollup merge of #127136 - compiler-errors:coroutine-closure-env-shim, r=oli-obkMatthias Krüger-23/+157
Fix `FnMut::call_mut`/`Fn::call` shim for async closures that capture references I adjusted async closures to be able to implement `Fn` and `FnMut` *even if* they capture references, as long as those references did not need to borrow data from the closure captures themselves. See #125259. However, when I did this, I didn't actually relax an assertion in the `build_construct_coroutine_by_move_shim` shim code, which builds the `Fn`/`FnMut`/`FnOnce` implementations for async closures. Therefore, if we actually tried to *call* `FnMut`/`Fn` on async closures, it would ICE. This PR adjusts this assertion to ensure that we only capture immutable references in closures if they implement `Fn`/`FnMut`. It also adds a bunch of tests and makes more of the async-closure tests into `build-pass` since we often care about these tests actually generating the right closure shims and stuff. I think it might be excessive to *always* use build-pass here, but 🤷 it's not that big of a deal. Fixes #127019 Fixes #127012 r? oli-obk
2024-07-02Rollup merge of #126883 - dtolnay:breakvalue, r=fmeaseMatthias Krüger-0/+33
Parenthesize break values containing leading label The AST pretty printer previously produced invalid syntax in the case of `break` expressions with a value that begins with a loop or block label. ```rust macro_rules! expr { ($e:expr) => { $e }; } fn main() { loop { break expr!('a: loop { break 'a 1; } + 1); }; } ``` `rustc -Zunpretty=expanded main.rs `: ```console #![feature(prelude_import)] #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; macro_rules! expr { ($e:expr) => { $e }; } fn main() { loop { break 'a: loop { break 'a 1; } + 1; }; } ``` The expanded code is not valid Rust syntax. Printing invalid syntax is bad because it blocks `cargo expand` from being able to format the output as Rust syntax using rustfmt. ```console error: parentheses are required around this expression to avoid confusion with a labeled break expression --> <anon>:9:26 | 9 | fn main() { loop { break 'a: loop { break 'a 1; } + 1; }; } | ^^^^^^^^^^^^^^^^^^^^^^^^ | help: wrap the expression in parentheses | 9 | fn main() { loop { break ('a: loop { break 'a 1; }) + 1; }; } | + + ``` This PR updates the AST pretty-printer to insert parentheses around the value of a `break` expression as required to avoid this edge case.
2024-07-02rewrite test-harness to rmakeOneirical-10/+28
2024-07-02rewrite msvc-opt-minsize to ui testOneirical-25/+31
2024-07-02rewrite and rename issue-47384 to rmakeOneirical-12/+29
2024-07-02rewrite rlib-chain to rmakeOneirical-13/+26
2024-07-02rewrite dylib-chain to rmakeOneirical-13/+22
2024-07-02Add testBoxy-0/+69
2024-07-02remove unnecessary ignore-endian-big from stack-overflow-trait-infer testRalf Jung-6/+5
2024-07-02Disable rmake test inaccessible-temp-dir on riscv64Ana Hobden-2/+6
2024-07-02linker: Link dylib crates by pathVadim Petrochenkov-0/+20
2024-07-02chore: remove duplicate wordshattizai-3/+3
2024-07-01Parenthesize break values containing leading labelDavid Tolnay-2/+2
2024-07-02Use the aligned size for alloca at ret when the pass mode is cast.DianQK-11/+11
2024-07-02Use the aligned size for alloca at args when the pass mode is cast.DianQK-28/+11
The `load` and `store` instructions in LLVM access the aligned size.
2024-07-02Add the definition for `extern "C"` at `cast-target-abi.rs`.DianQK-24/+358