about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-07-05Add more testsOli Scherer-0/+59
2023-07-05Lint now-unnecessary associated type boundsOli Scherer-0/+41
2023-07-05Don't require associated types with `Self: Sized` bounds in `dyn Trait` objectsOli Scherer-13/+3
2023-07-04Rollup merge of #113324 - lcnr:const-evaluatable-goal, r=BoxyUwUMatthias Krüger-3/+33
implement `ConstEvaluatable` goals in new solver this only supports stable const generics. `feature(generic_const_exprs)` needs to extend that function is non-trivial ways. Leaving this for someone else or some later date. r? `@BoxyUwU`
2023-07-04implement `ConstEvaluatable` goals in new solverlcnr-3/+33
we don't yet handle `generic_const_exprs`, someone else can do that :3
2023-07-04Auto merge of #113309 - chenyukang:yukang-fix-89640-space, r=Nilstriebbors-0/+16
Detect extra space in keyword for better hint Fixes #89640 r? `@Nilstrieb` I met the same issue, then found out this old issue :)
2023-07-04Detect extra space in keyword for better hintyukang-0/+16
2023-07-04Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnrbors-799/+3
Remove chalk support from the compiler Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly: * Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk` * Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation * Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms) * Remove the chalk migration mode from compiletest * Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??) Fulfills rust-lang/types-team#93. r? `@jackh726`
2023-07-04Auto merge of #113304 - cuviper:indexmap-2, r=Mark-Simulacrumbors-10/+2
Upgrade to indexmap 2.0.0 The new version was already added to the tree as an indirect dependency in #113046, but now our direct dependents are using it too.
2023-07-04Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorinobors-15/+52
Make RPITITs assume/require their parent method's predicates Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions. r? `@spastorino`
2023-07-04Auto merge of #112917 - chenyukang:yukang-fix-112590, r=estebankbors-9/+110
Suggest importing for partial mod path matching in name resolving Fixes #112590
2023-07-03Remove compare modeMichael Goulet-3/+0
2023-07-03Remove chalk from the compilerMichael Goulet-796/+3
2023-07-03Bless ui-fulldeps/missing-rustc-driver-errorJosh Stone-10/+2
The specific crates have changed, but the expected "help" remains.
2023-07-03Auto merge of #108611 - ↵bors-1/+178
davidtwco:issue-94223-external-abi-fn-ptr-in-internal-abi-fn, r=jackh726 lint/ctypes: ext. abi fn-ptr in internal abi fn Fixes #94223. - In the improper ctypes lint, instead of skipping functions with internal ABIs, check that the signature doesn't contain any fn-ptr types with external ABIs that aren't FFI-safe. - When computing the ABI for fn-ptr types, remove an `unwrap` that assumed FFI-safe types in foreign fn-ptr types. - I'm not certain that this is the correct approach.
2023-07-03Rollup merge of #113286 - fmease:iat-dont-select-if-not-enabled, ↵Guillaume Gomez-41/+90
r=compiler-errors Don't perform selection if inherent associated types are not enabled Fixes #113265. As discussed r? `@compiler-errors`
2023-07-03Rollup merge of #113285 - GuillaumeGomez:display-long-inline-cfg, r=notriddleGuillaume Gomez-1/+20
[rustdoc] Fix display of long inline cfg labels Fixes #87957. Fixes #112880. Before: ![Screenshot from 2023-07-03 13-25-47](https://github.com/rust-lang/rust/assets/3050060/401e2c6b-2cfd-4ae3-9d15-b5e1dfec4201) After: ![Screenshot from 2023-07-03 13-24-49](https://github.com/rust-lang/rust/assets/3050060/e42a34a8-bf60-409d-8a0c-1669d09e7e1e) r? `@notriddle`
2023-07-03lint/ctypes: check other types for ext. fn-ptr tyDavid Wood-1/+127
Extend previous checks for external ABI fn-ptrs to use in internal statics, constants, type aliases and algebraic data types. Signed-off-by: David Wood <david.wood@huawei.com>
2023-07-03lint/ctypes: multiple external fn-ptrs in tyDavid Wood-1/+23
Extend previous commit's support for checking for external fn-ptrs in internal fn types to report errors for multiple found fn-ptrs. Signed-off-by: David Wood <david.wood@huawei.com>
2023-07-03abi: avoid ice for non-ffi-safe fn ptrsDavid Wood-0/+8
Remove an `unwrap` that assumed FFI-safe types in foreign fn-ptr types. Signed-off-by: David Wood <david.wood@huawei.com>
2023-07-03lint/ctypes: ext. abi fn-ptr in internal abi fnDavid Wood-1/+22
Instead of skipping functions with internal ABIs, check that the signature doesn't contain any fn-ptr types with external ABIs that aren't FFI-safe. Signed-off-by: David Wood <david.wood@huawei.com>
2023-07-03Don't perform selection if IATs are not enabledLeón Orell Valerian Liehr-41/+90
2023-07-03Add GUI test for long inline cfg labels displayGuillaume Gomez-1/+20
2023-07-03Auto merge of #113086 - lcnr:rust8, r=compiler-errorsbors-191/+366
implement deep normalization via the new solver together with #112869 this should remove all uses of the old solver with `-Ztrait-solver=next`. see https://hackmd.io/V0qsUB_fTxexfQO_pcOcrg for a description of this PR. Will move that doc to the `rustc-dev-guide` after merging this. r? `@compiler-errors`
2023-07-03update testslcnr-191/+366
2023-07-02Rollup merge of #113258 - GuillaumeGomez:migrate-gui-test-color-19, r=notriddleMatthias Krüger-15/+15
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? `@notriddle`
2023-07-02Auto merge of #108537 - ↵bors-115/+252
GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle rustdoc: Allow whitespace as path separator like double colon Fixes https://github.com/rust-lang/rust/issues/108447. I think it makes sense since it allows more common cases, however it also makes the syntax heavier. Not sure what the rest of the team thinks about it. In any case we'll need to go through FCP. Full explanation for the changes is available [here](https://github.com/rust-lang/rust/pull/108537#issuecomment-1589480564). r? `@notriddle`
2023-07-02Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiaskobors-0/+18
Add `-Zremark-dir` unstable flag to write LLVM optimization remarks to YAML This PR adds an option for `rustc` to emit LLVM optimization remarks to a set of YAML files, which can then be digested by existing tools, like https://github.com/OfekShilon/optview2. When `-Cremark-dir` is passed, and remarks are enabled (`-Cremark=all`), the remarks will be now written to the specified directory, **instead** of being printed to standard error output. The files are named based on the CGU from which they are being generated. Currently, the remarks are written using the LLVM streaming machinery, directly in the diagnostics handler. It seemed easier than going back to Rust and then form there back to C++ to use the streamer from the diagnostics handler. But there are many ways to implement this, of course, so I'm open to suggestions :) I included some comments with questions into the code. Also, I'm not sure how to test this. r? `@tmiasko`
2023-07-02Add `rustc` option to output LLVM optimization remarks to YAML filesJakub Beránek-0/+18
2023-07-02Migrate GUI colors test to original CSS color formatGuillaume Gomez-15/+15
2023-07-02Rollup merge of #113231 - Urgau:fix_false_positive_drop_copy, r=NilstriebMatthias Krüger-0/+38
Fix `dropping_copy_types` lint from linting in match-arm with side-effects This PR fixes an issue with the `dropping_copy_types` and `dropping_references` lints when not all patterns that can have side-effects were detected and ignored. Nearly _fixes_ https://github.com/rust-lang/rust/issues/112653 (will need beta-backport to completely fix the issue) r? ``@Nilstrieb``
2023-07-02Rollup merge of #113228 - GuillaumeGomez:migrate-gui-test-color-18, r=notriddleMatthias Krüger-9/+9
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ``@notriddle``
2023-07-02add testcase for 112590yukang-55/+88
2023-07-02Auto merge of #112910 - lqd:mcp510, r=petrochenkovbors-5/+21
Implement most of MCP510 This implements most of what remains to be done for MCP510: - turns `-C link-self-contained` into a `+`/`-` list of components, like `-C link-self-contained=+linker,+crto,+libc,+unwind,+sanitizers,+mingw`. The scaffolding is present for all these expected components to be implemented and stabilized in the future on their own time. This PR only handles the `-Zgcc-ld=lld` subset of these link-self-contained components as `-Clink-self-contained=+linker` - handles `-C link-self-contained=y|n` as-is today, for compatibility with `rustc_codegen_ssa::back::link::self_contained`'s [explicit opt-in and opt-out](https://github.com/lqd/rust/blob/9eee230cd0a56bfba3ce65121798d9f9f4341cdd/compiler/rustc_codegen_ssa/src/back/link.rs#L1671-L1676). - therefore supports our plan to opt out of `rust-lld` (when it's enabled by default) even for current `-Clink-self-contained` users, with e.g. `-Clink-self-contained -Clink-self-contained=-linker` - turns `add_gcc_ld_path` into its expected final form, by using the `-C link-self-contained=+linker` CLI flag, and whether the `LinkerFlavor` has the expected `Cc::Yes` and `Lld::Yes` shape (this is not yet the case in practice for any CLI linker flavor) - makes the [new clean linker flavors](https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595) selectable in the CLI in addition to the legacy ones, in order to opt-in to using `cc` and `lld` to emulate `-Zgcc-ld=lld` - ensure the new `-C link-self-contained` components, and `-C linker-flavor`s are unstable, and require `-Z unstable-options` to be used The up-to-date set of flags for the future stable CLI version of `-Zgcc-ld=lld` is currently: `-Clink-self-contained=+linker -Clinker-flavor=gnu-lld-cc -Zunstable-options`. It's possible we'll also need to do something for distros that don't ship `rust-lld`, but maybe there are already no tool search paths to be added to `cc` in this situation anyways. r? `@petrochenkov`
2023-07-01Fix dropping_copy_types lint from linting in match-arm with side-effectsUrgau-0/+38
2023-07-01Rollup merge of #113182 - compiler-errors:rpit-stricter-captures, r=oli-obkMatthias Krüger-24/+167
Error when RPITITs' hidden types capture more lifetimes than their trait definitions This implements a stricter set of captures rules for RPITITs. They now may only capture: 1. Lifetimes from the impl header (both the self type and any trait substs -- we may want to restrict just to the self type's lifetimes, but the PR makes that easy to do, too) 2. Lifetimes mentioned by the `impl Trait` in the trait method's definition. Namely, they may not mention lifetimes from the method (early or late) that are not mentioned in the `impl Trait`. cc #105258 which I think was trying to do this too, though I'm not super familiar with what exactly differs from that or why that one was broken. cc #112194 (doesn't fix this issue per se, because it's still an open question, but I think this is objectively better than the status quo, and gets us closer to resolving that issue.) Technically is a fix for the ICE in #108580, but it turns that issue into an error now. We can decide separately whether or not nested RPITITs should capture lifetimes from their parents. r? ``@oli-obk``
2023-07-01Rollup merge of #113174 - chenyukang:yukang-fix-102972-loop-next, ↵Matthias Krüger-0/+49
r=compiler-errors Better messages for next on a iterator inside for loops Fixes #102972
2023-07-01Rollup merge of #113168 - bvanjoi:fix-85992, r=petrochenkovMatthias Krüger-0/+27
fix(resolve): skip assertion judgment when NonModule is dummy Fixes #85992 ## Why #85992 panic During `resolve_imports`, the `path_res` of the import `issue_85992_extern_2::Outcome` is pointing to `external::issue_85992_extern_2` instead of `crate::issue_85992_extern_2`. As a result `import.imported_module.set` had been executed. Attached 1: the state of `early_resolve_ident_in_lexical_scope` during the `resolve_imports` for `use issue_85992_extern_2::Outcome` is as follows: |iter in `visit_scopes` | `scope` | `result.binding` | | - | - | - | | init | - | - | | 0 | `CrateRoot` | Err(Determined) | | 1 | `ExternPrelude` | pointing to the `issue_85992_extern_2`(external) | However, during finalization for `issue_85992_extern_2::Outcome`, the `innermost_result` was pointed to `crate::issue_85992_extern_2` and no ambiguity was generated, leading to a panic. Attached 2: the state of `early_resolve_ident_in_lexical_scope` during the `finalize_import` for `use issue_85992_extern_2::Outcome` is as follows: |iter in `visit_scopes` | `scope` | `result.binding` | `innermost_result` | | - | - | - | - | | init | - | - | `None` | | 0 | `CrateRoot` | pointing to `use crate::issue_85992_extern_2` **(introdcued by dummy)** | same as `result` but with a `Some` wapper| | 1 | `ExternPrelude` | pointing to the `issue_85992_extern_2`(external) | smae as above | ## Try to solve Skip assertion judgment when `NonModule` is dummy r? `@petrochenkov`
2023-07-01Migrate GUI colors test to original CSS color formatGuillaume Gomez-9/+9
2023-07-01Auto merge of #111992 - ferrocene:pa-panic-abort-tests-bench, r=m-ou-sebors-4/+14
Test benchmarks with `-Z panic-abort-tests` During test execution, when a `#[bench]` benchmark is encountered it's executed once to check whether it works. Unfortunately that was not compatible with `-Z panic-abort-tests`: the feature works by spawning a subprocess for each test, which prevents the use of dynamic tests as we cannot pass closures to child processes, and before this PR the conversion from benchmark to test was done by turning benchmarks into dynamic tests whose closures execute the benchmark once. The approach this PR took was to add two new kinds of `TestFn`s: `StaticBenchAsTestFn` and `DynBenchAsTestFn` (:warning: **this is a breaking change** :warning:). With that change, a `StaticBenchFn` can be converted into a `StaticBenchAsTestFn` without creating dynamic tests, and making it possible to test `#[bench]` functions with `-Z panic-abort-tests`. The subprocess test runner also had to be updated to perform the conversion from benchmark to test when appropriate. Along with the bug fix, in the first commit I refactored how tests are executed: rather than executing the test function in multiple places across `libtest`, there is now a private `TestFn::into_runnable()` method, which returns either a `RunnableTest` or `RunnableBench`, on which you can call the `run()` method. This simplified the rest of the changes in the PR. This PR is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/73509
2023-07-01fix(resolve): skip assertion judgment when `NonModule` is dummybohan-0/+27
2023-06-30comment, and bless, unstable linker flavor testRémy Rakic-4/+8
2023-06-30add end-to-end testRémy Rakic-0/+12
2023-06-30bless test with new linker flavorsRémy Rakic-1/+1
2023-06-30Additional wf testMichael Goulet-10/+51
2023-06-30RPITITs inherit method predicatesMichael Goulet-5/+1
2023-06-30Improve search-result-display.goml testGuillaume Gomez-4/+5
2023-06-30Better messages for next in a iterator inside for loopsyukang-0/+49
2023-06-30Rollup merge of #113177 - estebank:hrlt-sugg, r=compiler-errorsMatthias Krüger-61/+150
Use structured suggestion when telling user about `for<'a>` ``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 | LL | T: Into<&u32>, | ^ explicit lifetime name needed here | help: consider introducing a higher-ranked lifetime here | LL | T: for<'a> Into<&'a u32>, | +++++++ ++ ```
2023-06-30Rollup merge of #113171 - spastorino:new-rpitit-25, r=compiler-errorsMatthias Krüger-0/+19
Properly implement variances_of for RPITIT GAT This fixes some of the issues found by crater run in https://github.com/rust-lang/rust/pull/112988#issuecomment-1610019572 r? ``@compiler-errors``