about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-19Rollup merge of #109243 - chenyukang:yukang/fix-ice-109144, r=petrochenkovDylan DPC-0/+13
The name of NativeLib will be presented Fixes #109144 I was working on a quick fix, but found change the name from `Option<Symbol>` to `Symbol` make life a little bit easier.
2023-03-19Rollup merge of #109212 - Ezrashaw:no-similar-sugg-for-unstable, r=estebankDylan DPC-0/+47
fix: don't suggest similar method when unstable Fixes #109177 Don't display typo suggestions for unstable things, unless the feature flag is enabled. AFAIK, there are two places this occurs: - `rustc_resolve`: before type checking, effectively just `FnCtxt::Free`. - `rustc_hir_typck`: during type checking, for `FnCtxt::Assoc(..)`s. The linked issue is about the latter, obviously the issue is applicable to both. r? `@estebank`
2023-03-19Rollup merge of #109003 - GuillaumeGomez:useless-anonymous-reexport-lint, ↵Dylan DPC-4/+80
r=cjgillot Add `useless_anonymous_reexport` lint This is a follow-up of https://github.com/rust-lang/rust/pull/108936. We once again show all anonymous re-exports in rustdoc, however we also wanted to add a lint to let users know that it very likely doesn't have the effect they think it has.
2023-03-19Rollup merge of #105793 - lukas-code:circular-deps, r=Mark-SimulacrumDylan DPC-0/+47
Add note for mismatched types because of circular dependencies If you have crate A with a dependency on crate B, and crate B with a dev-dependency on A, then you might see "mismatched types" errors on types that seem to be equal. This PR adds a note that explains that the types are different, because crate B is compiled twice, one time with `cfg(test)` and one time without. I haven't found a good way to create circular dependencies in UI tests, so I abused the incremental tests instead. As a bonus, incremental tests support "cpass" now. related to https://github.com/rust-lang/rust/issues/22750
2023-03-19Rollup merge of #104100 - ink-feather-org:const_iter_range, r=the8472,fee1-deadDylan DPC-15/+1
Allow using `Range` as an `Iterator` in const contexts. ~~based on #102225 by `@fee1-dead~~`
2023-03-19The name of NativeLib will be presentedyukang-0/+13
2023-03-18Revert "Auto merge of #107224 - nikic:llvm-16, r=cuviper"Nikita Popov-3/+3
This reverts commit 4a04d086cac54a41517d5657b59d5fe2caca2d71, reversing changes made to 2d0a7def330ed90f416a3429dbb44c5ee2a914e5.
2023-03-18Auto merge of #107224 - nikic:llvm-16, r=cuviperbors-3/+3
Upgrade to LLVM 16 This updates Rust to LLVM 16. It also updates our host compiler for dist-x86_64-linux to LLVM 16. The reason for that is that Bolt from LLVM 15 is not capable of compiling LLVM 16 (https://github.com/llvm/llvm-project/issues/61114). LLVM 16.0.0 has been [released](https://discourse.llvm.org/t/llvm-16-0-0-release/69326) on March 18, while Rust 1.70 will become stable on June 1. Tested images: `dist-x86_64-linux`, `dist-riscv64-linux` (alt), `dist-x86_64-illumos`, `dist-various-1`, `dist-various-2`, `dist-powerpc-linux`, `wasm32`, `armhf-gnu` Tested images until the usual IPv6 failures: `test-various`
2023-03-18Rollup merge of #109238 - spastorino:new-rpitit-12, r=compiler-errorsMatthias Krüger-1/+16
Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty This PR stops reporting errors due to different count of generics on the new synthesized associated types for RPITITs. Those were already reported when we compare the function on the triat with the function on the impl. r? ``@compiler-errors``
2023-03-18Rollup merge of #109193 - spastorino:new-rpitit-11, r=compiler-errorsMatthias Krüger-20/+339
Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests Needs to go on top of #109198 r? ``@compiler-errors``
2023-03-18Rollup merge of #107416 - czzrr:issue-80618, r=GuillaumeGomezMatthias Krüger-34/+60
Error code E0794 for late-bound lifetime parameter error. This PR addresses [#80618](https://github.com/rust-lang/rust/issues/80618).
2023-03-18Mark DoubleEndedIterator as #[const_trait] using rustc_do_not_const_check, ↵onestacked-15/+1
implement const Iterator and DoubleEndedIterator for Range.
2023-03-18fix: don't suggest similar method when unstableEzra Shaw-0/+47
2023-03-18Rollup merge of #109251 - MU001999:master, r=NilstriebMatthias Krüger-0/+25
Suggest surrounding the macro with `{}` to interpret as a statement Fixes #109237
2023-03-18Rollup merge of #109248 - compiler-errors:get_fn_decl-aaa, r=WaffleLapkinMatthias Krüger-0/+22
Pass the right HIR back from `get_fn_decl` Fixes #109232 Makes sure that the `fn_id: HirId` that we pass to `suggest_missing_return_type` matches up with the `fn_decl: hir::FnDecl` that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter... This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like `hir::Node` and just deal with `LocalDefId`s everywhere... Anyways, I'd rather fix this ICE, now.
2023-03-18Rollup merge of #109222 - chenyukang:yukang/fix-109143, r=petrochenkovMatthias Krüger-2/+24
Do not ICE for unexpected lifetime with ConstGeneric rib Fixes #109143 r? ````@petrochenkov```` Combining this test with the previous test will affect the previous diagnostics, so I added a separate test case.
2023-03-18Rollup merge of #109200 - compiler-errors:issue-109191, r=WaffleLapkinMatthias Krüger-0/+24
Fix index out of bounds in `suggest_trait_fn_ty_for_impl_fn_infer` Fixes #109191
2023-03-18Rollup merge of #109102 - compiler-errors:ambig-assoc-in-non-lt-binder, ↵Matthias Krüger-0/+29
r=jackh726 Erase escaping late-bound regions when probing for ambiguous associated types Fixes #109090
2023-03-17Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed testsSantiago Pastorino-20/+339
2023-03-17Add generic parameters mismatch test for async in traitsSantiago Pastorino-0/+31
2023-03-17Fix generics mismatch errors for RPITITs on ↵Santiago Pastorino-1/+16
-Zlower-impl-trait-in-trait-to-assoc-ty
2023-03-17Pass the right HIR back from get_fn_declMichael Goulet-0/+22
2023-03-17Erase escaping late-bound regions when probing for ambiguous associated typesMichael Goulet-0/+29
2023-03-17Auto merge of #109253 - matthiaskrgr:rollup-2xmv5zk, r=matthiaskrgrbors-25/+255
Rollup of 8 pull requests Successful merges: - #108958 (Remove box expressions from HIR) - #109044 (Prevent stable `libtest` from supporting `-Zunstable-options`) - #109155 (Fix riscv64 fuchsia LLVM target name) - #109156 (Fix linker detection for clang with prefix) - #109181 (inherit_overflow: adapt pattern to also work with v0 mangling) - #109198 (Install projection from RPITIT to default trait method opaque correctly) - #109215 (Use sort_by_key instead of sort_by) - #109229 (Fix invalid markdown link references) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-17Increase array size in array-map.rsNikita Popov-3/+3
Make sure that the loop is not fully unrolled (which allows eliminating the allocas) in LLVM 16 either.
2023-03-17Auto merge of #109085 - tmiasko:index-based, r=WaffleLapkinbors-63/+17
Use index based drop loop for slices and arrays Instead of building two kinds of drop pair loops, of which only one will be eventually used at runtime in a given monomorphization, always use index based loop.
2023-03-17Rollup merge of #109198 - compiler-errors:new-rpitit-default-body, r=spastorinoMatthias Krüger-24/+254
Install projection from RPITIT to default trait method opaque correctly 1. For new lowering strategy `-Zlower-impl-trait-in-trait-to-assoc-ty`, install the correct default trait method projection predicates (RPITIT -> opaque). This makes default trait body tests pass! 2. Fix two WF-checking bugs -- first, we want to make sure that we're always looking for an opaque type in `check_return_position_impl_trait_in_trait_bounds`. That's because the RPITIT projections are normalized to opaques during wfcheck. Second, fix RPITIT's param-envs by not adding the projection predicates that we install on trait methods to make default RPITITs work -- I left a comment why. 3. Also, just a small drive-by for `rustc_on_unimplemented`. Not sure if it affects any tests, but can't hurt. r? ````@spastorino,```` based off of #109140
2023-03-17Rollup merge of #109181 - durin42:v0-mangle-inherit_overflow, r=NilstriebMatthias Krüger-1/+1
inherit_overflow: adapt pattern to also work with v0 mangling This test was failing under new-symbol-mangling = true. Adapt pattern to work in both cases. Related to #106002 from December.
2023-03-17Suggest surrounding the macro with `{}` to interpret as a statementMu42-0/+25
2023-03-17Do not ICE for unexpected lifetime with ConstGeneric ribyukang-2/+24
2023-03-16Auto merge of #108944 - cjgillot:clear-local-info, r=oli-obkbors-12/+8
Wrap the whole LocalInfo in ClearCrossCrate. MIR contains a lot of information about locals. The primary purpose of this information is the quality of borrowck diagnostics. This PR aims to drop this information after MIR analyses are finished, ie. starting from post-cleanup runtime MIR.
2023-03-16Auto merge of #107270 - cjgillot:remove-zst, r=oli-obkbors-180/+218
Replace ZST operands and debuginfo by constants. This is work that ConstProp will not have to do. Split from https://github.com/rust-lang/rust/pull/107267
2023-03-16Auto merge of #106824 - m-ou-se:format-args-flatten, r=oli-obkbors-18/+51
Flatten/inline format_args!() and (string and int) literal arguments into format_args!() Implements https://github.com/rust-lang/rust/issues/78356 Gated behind `-Zflatten-format-args=yes`. Part of #99012 This change inlines string literals, integer literals and nested format_args!() into format_args!() during ast lowering, making all of the following pairs result in equivalent hir: ```rust println!("Hello, {}!", "World"); println!("Hello, World!"); ``` ```rust println!("[info] {}", format_args!("error")); println!("[info] error"); ``` ```rust println!("[{}] {}", status, format_args!("error: {}", msg)); println!("[{}] error: {}", status, msg); ``` ```rust println!("{} + {} = {}", 1, 2, 1 + 2); println!("1 + 2 = {}", 1 + 2); ``` And so on. This is useful for macros. E.g. a `log::info!()` macro could just pass the tokens from the user directly into a `format_args!()` that gets efficiently flattened/inlined into a `format_args!("info: {}")`. It also means that `dbg!(x)` will have its file, line, and expression name inlined: ```rust eprintln!("[{}:{}] {} = {:#?}", file!(), line!(), stringify!(x), x); // before eprintln!("[example.rs:1] x = {:#?}", x); // after ``` Which can be nice in some cases, but also means a lot more unique static strings than before if dbg!() is used a lot.
2023-03-16Bless -Zhelp output test.Mara Bos-0/+1
2023-03-16Add test for -Zflatten-format-args=yes.Mara Bos-0/+24
2023-03-16Auto merge of #109206 - matthiaskrgr:rollup-oev8ax6, r=matthiaskrgrbors-8/+298
Rollup of 10 pull requests Successful merges: - #108875 (rustdoc: fix type search for `Option` combinators) - #108971 (error-msg: impl better suggestion for `E0532`) - #109139 (rustdoc: DocFS: Replace rayon with threadpool and enable it for all targets) - #109151 (Assert def-kind is correct for alias types) - #109158 (error-msg: expand suggestion for `unused_def` lint) - #109166 (make `define_opaque_types` fully explicit) - #109171 (Some cleanups in our normalization logic) - #109180 (Unequal → Not equal) - #109185 (rustdoc: remove `std::` from primitive intra-doc link tooltips) - #109192 (Mention UEFI target promotion in release notes for 1.67.0) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-16Bless pretty tests.Mara Bos-6/+4
2023-03-16Don't allow new const panic through format flattening.Mara Bos-12/+22
panic!("a {}", "b") is still not allowed in const, even if the hir flattens to panic!("a b").
2023-03-16Rollup merge of #109185 - notriddle:notriddle/primitive-tooltip, r=jshaMatthias Krüger-0/+2
rustdoc: remove `std::` from primitive intra-doc link tooltips Take the intra-doc link to the method `iter` from https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html Before: `method std::slice::iter` After: `method slice::iter`
2023-03-16Rollup merge of #109158 - Ezrashaw:expand-sugg-for-unused-lint, r=NilstriebMatthias Krüger-0/+116
error-msg: expand suggestion for `unused_def` lint Fixes #108885 Expands `let _ = ..` suggestion into more positions.
2023-03-16Rollup merge of #108971 - Ezrashaw:E0532-better-binding-names, r=WaffleLapkinMatthias Krüger-1/+137
error-msg: impl better suggestion for `E0532` Fixes #106862 No test as there is already a test which is nearly identical to the example in the linked issue.
2023-03-16Rollup merge of #108875 - notriddle:notriddle/return-trait, r=GuillaumeGomezMatthias Krüger-7/+43
rustdoc: fix type search for `Option` combinators
2023-03-16Auto merge of #108809 - lqd:fix-ignore, r=pietroalbinibors-2/+3
fix ignore header in MSVC test From `@pietroalbini's` [zulip message](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/better.20compiletest.20ignore.20messages/near/339845864) > there are tests like `tests/ui/panic-runtime/unwind-tables-target-required.rs` which have `only-x86_64-windows-msvc` which I'm pretty sure is invalid This test is currently ignored on x64 MSVC CI because of this incorrect target. We'll see if it still passes. r? `@pietroalbini`
2023-03-16Fix index out of bounds in suggest_trait_fn_ty_for_impl_fn_inferMichael Goulet-0/+24
2023-03-16Auto merge of #109183 - lqd:revert-107376, r=compiler-errorsbors-58/+0
Revert #107376 to fix potential `bincode` breakage and `rustc-perf` benchmark. #107376 caused `rustc-perf`'s `webrender` benchmark to break, by regressing on the `bincode-1.3.3` crate. ~~This PR is a draft revert in case we can't land a fix soon enough, and we'd like to land the revert instead~~ (Though I myself think it'd be safer to do the revert, and run crater when relanding #107376.) cc `@aliemjay`
2023-03-16Don't install default opaque projection predicates in RPITIT associated ↵Michael Goulet-3/+46
type's param-env
2023-03-16Install projection from RPITIT to default trait method opaque correctlyMichael Goulet-2/+28
2023-03-15Auto merge of #108282 - cjgillot:mir-checked-sh, r=tmiaskobors-30/+34
Implement checked Shl/Shr at MIR building. This does not require any special handling by codegen backends, as the overflow behaviour is entirely determined by the rhs (shift amount). This allows MIR ConstProp to remove the overflow check for constant shifts. ~There is an existing different behaviour between cg_llvm and cg_clif (cc `@bjorn3).` I took cg_llvm's one as reference: overflow if `rhs < 0 || rhs > number_of_bits_in_lhs_ty`.~ EDIT: `cg_llvm` and `cg_clif` implement the overflow check differently. This PR uses `cg_llvm`'s implementation based on a `BitAnd` instead of `cg_clif`'s one based on an unsigned comparison.
2023-03-15Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-tySantiago Pastorino-19/+180
2023-03-15rustdoc: remove `std::` from primitive intra-doc link tooltipsMichael Howell-0/+2