about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-22Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errorsbors-43/+31
a general type system cleanup removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context. changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR. also removes some other small - and imo unnecessary - helpers. r? types
2023-03-21Rollup merge of #109446 - spastorino:new-rpitit-17, r=compiler-errorsMatthias Krüger-4/+35
Do not suggest bounds restrictions for synthesized RPITITs Before this PR we were getting ... ``` warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> tests/ui/async-await/in-trait/missing-send-bound.rs:5:12 | 5 | #![feature(async_fn_in_trait)] | ^^^^^^^^^^^^^^^^^ | = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information = note: `#[warn(incomplete_features)]` on by default error: future cannot be sent between threads safely --> tests/ui/async-await/in-trait/missing-send-bound.rs:17:20 | 17 | assert_is_send(test::<T>()); | ^^^^^^^^^^^ future returned by `test` is not `Send` | = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>` note: future is not `Send` as it awaits another future which is not `Send` --> tests/ui/async-await/in-trait/missing-send-bound.rs:13:5 | 13 | T::bar().await; | ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send` note: required by a bound in `assert_is_send` --> tests/ui/async-await/in-trait/missing-send-bound.rs:21:27 | 21 | fn assert_is_send(_: impl Send) {} | ^^^^ required by this bound in `assert_is_send` help: consider further restricting the associated type | 16 | fn test2<T: Foo>() where impl Future<Output = ()>: Send { | ++++++++++++++++++++++++++++++++++++ error: aborting due to previous error; 1 warning emitted ``` and we want this output ... ``` warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/missing-send-bound.rs:5:12 | LL | #![feature(async_fn_in_trait)] | ^^^^^^^^^^^^^^^^^ | = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information = note: `#[warn(incomplete_features)]` on by default error: future cannot be sent between threads safely --> $DIR/missing-send-bound.rs:17:20 | LL | assert_is_send(test::<T>()); | ^^^^^^^^^^^ future returned by `test` is not `Send` | = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>` note: future is not `Send` as it awaits another future which is not `Send` --> $DIR/missing-send-bound.rs:13:5 | LL | T::bar().await; | ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send` note: required by a bound in `assert_is_send` --> $DIR/missing-send-bound.rs:21:27 | LL | fn assert_is_send(_: impl Send) {} | ^^^^ required by this bound in `assert_is_send` error: aborting due to previous error; 1 warning emitted ``` r? `@compiler-errors`
2023-03-21Rollup merge of #109441 - oli-obk:fn_trait_new_solver, r=compiler-errorsMatthias Krüger-1/+144
Only implement Fn* traits for extern "Rust" safe function pointers and items Since calling the function via an `Fn` trait will assume `extern "Rust"` ABI and not do any safety checks, only safe `extern "Rust"` function can implement the `Fn` traits. This syncs the logic between the old solver and the new solver. r? `@compiler-errors`
2023-03-21Rollup merge of #109403 - chenyukang:yukang/fix-109396, r=estebankMatthias Krüger-0/+46
Avoid ICE of attempt to add with overflow in emitter Fixes #109396 r? ```@estebank```
2023-03-21Rollup merge of #109336 - compiler-errors:constrain-to-ct-err, r=BoxyUwUMatthias Krüger-8/+33
Constrain const vars to error if const types are mismatched When equating two consts of different types, if either are const variables, constrain them to the correct const error kind. This helps us avoid "successfully" matching a const against an impl signature but leaving unconstrained const vars, which will lead to incremental ICEs when we call const-eval queries during const projection. Fixes #109296 The second commit in the stack fixes a regression in the first commit where we end up mentioning `[const error]` in an impl overlap error message. I think the error message changes for the better, but I could implement alternative strategies to avoid this without delaying the overlap error message... r? `@BoxyUwU`
2023-03-21Rollup merge of #108729 - bvanjoi:fix-issue-97534, r=petrochenkovMatthias Krüger-0/+83
fix: modify the condition that `resolve_imports` stops close #97534
2023-03-21Do not suggest bounds restrictions for synthesized RPITITsSantiago Pastorino-4/+35
2023-03-21Rollup merge of #109390 - cbeuw:aggregate-lit, r=oli-obknils-0/+112
Custom MIR: Support aggregate expressions Add support for tuple, array and ADT expressions in custom mir r? `````@oli-obk````` or `````@tmiasko````` or `````@JakobDegen`````
2023-03-21Rollup merge of #109240 - compiler-errors:dont-binder-twice, r=oli-obknils-0/+6
Walk un-shifted nested `impl Trait` in trait when setting up default trait method assumptions Fixes a double subtraction in some binder math in return-position `impl Trait` in trait handling code. Fixes #109239
2023-03-21Rollup merge of #108842 - compiler-errors:non_lifetime_binders-object-safe, ↵nils-0/+80
r=b-naber Enforce non-lifetime-binders in supertrait preds are not object safe We can't construct vtables for these supertraits.
2023-03-21Also check function items' signatures for Fn* trait compatibilityOli Scherer-3/+67
2023-03-21Only implement Fn* traits for extern "Rust" safe function pointers.Oli Scherer-1/+80
2023-03-21evaluate: improve and fix recursion depth handlinglcnr-43/+31
2023-03-21Auto merge of #106967 - saethlin:remove-vec-as-ptr-assume, r=thomccbors-0/+19
Remove the assume(!is_null) from Vec::as_ptr At a guess, this code is leftover from LLVM was worse at keeping track of the niche information here. In any case, we don't need this anymore: Removing this `assume` doesn't get rid of the `nonnull` attribute on the return type.
2023-03-21Auto merge of #108262 - ChrisDenton:libntdll, r=Mark-Simulacrumbors-2/+2
Distribute libntdll.a with windows-gnu toolchains This allows the OS loader to load essential functions (e.g. read/write file) at load time instead of lazily doing so at runtime. r? libs
2023-03-21Add ntdll to run-make-fulldeps extraflagsChris Denton-2/+2
2023-03-20Enforce non-lifetime-binders in supertrait preds are not object safeMichael Goulet-0/+80
2023-03-21Avoid ICE of attempt to add with overflow in emitteryukang-0/+46
2023-03-20Support aggregate expressionsAndy Wang-0/+112
2023-03-20Rollup merge of #109364 - compiler-errors:gat-const-arg, r=BoxyUwUMatthias Krüger-0/+29
Only expect a GAT const param for `type_of` of GAT const arg IDK why we were account for both `is_ty_or_const` instead of just for a const param, since we're computing the `type_of` a const param specifically. Fixes #109300
2023-03-20Rollup merge of #109307 - cjgillot:inline-location, r=compiler-errorsMatthias Krüger-2/+26
Ignore `Inlined` spans when computing caller location. Fixes https://github.com/rust-lang/rust/issues/105538
2023-03-20Rollup merge of #109277 - spastorino:new-rpitit-14, r=compiler-errorsMatthias Krüger-3/+51
Fix generics_of for impl's RPITIT synthesized associated type The only useful commit is the last one. This makes `generics_of` for the impl side RPITIT copy from the trait's associated type and avoid the fn on the impl side which was previously wrongly used. This solution is better but we still need to fix resolution of the generated generics. r? ``@compiler-errors``
2023-03-20Rollup merge of #109266 - petrochenkov:docice4, r=petrochenkovMatthias Krüger-0/+16
rustdoc: Correctly merge import's and its target's docs in one more case Fixes https://github.com/rust-lang/rust/issues/108334. Fixes https://github.com/rust-lang/rust/issues/108378. Fixes https://github.com/rust-lang/rust/issues/108658.
2023-03-20Rollup merge of #109375 - clubby789:unescape-deprecated-doc, r=jshaMatthias Krüger-2/+2
rustdoc: Fix improper escaping of deprecation reasons Fix #109374 r? `@jsha`
2023-03-20Rollup merge of #109370 - DaniPopes:issue-109334, r=NilstriebMatthias Krüger-13/+38
fix ClashingExternDeclarations lint ICE Fixes #109334 First "real" contribution, please let me know if I did something wrong. As I understand it, it's OK if a `#[repr(transparent)]` type has no non-zero sized types (aka is a ZST itself) and the function should just return the type normally instead of panicking r? `@Nilstrieb`
2023-03-20Rollup merge of #109351 - GuillaumeGomez:no-footnote-in-summary, r=notriddleMatthias Krüger-0/+17
rustdoc: Remove footnote references from doc summary Since it's one line, we don't have the footnote definition so it doesn't make sense to have the reference. Part of https://github.com/rust-lang/rust/issues/109024. r? `@notriddle`
2023-03-20Rollup merge of #109331 - notriddle:notriddle/search-bag-semantics, ↵Matthias Krüger-0/+24
r=GuillaumeGomez rustdoc: implement bag semantics for function parameter search This tweak to the function signature search engine makes things so that, if a type is repeated in the search query, it'll only match if the function actually includes it that many times.
2023-03-20Rollup merge of #109319 - aDotInTheVoid:rdj-variadic-test, r=notriddleMatthias Krüger-0/+9
Add test for `c_variadic` in rustdoc-json Helps with #81359
2023-03-20Rollup merge of #109301 - Ezrashaw:fix-ctf-ice, r=NilstriebMatthias Krüger-0/+25
fix: fix ICE in `custom-test-frameworks` feature Fixes #107454 Simple fix to emit error instead of ICEing. At some point, all the code in `tests.rs` should be refactored, there is a bit of duplication (this PR's code is repeated five times over lol). r? `@Nilstrieb` (active on the linked issue?)
2023-03-20Rollup merge of #109259 - GuillaumeGomez:fix-missing-private-inlining, ↵Matthias Krüger-0/+27
r=notriddle rustdoc: Fix missing private inlining Fixes https://github.com/rust-lang/rust/issues/109258. If the item isn't inlined, it shouldn't have been added into `view_item_stack`. The problem here was that it was not removed, preventing sub items to be inlined if they have a re-export in "upper levels". cc `@epage` r? `@notriddle`
2023-03-20Fix improper escaping of deprecation reasonsclubby789-2/+2
2023-03-20Walk un-shifted nested `impl Trait` in trait when setting up default trait ↵Michael Goulet-0/+6
method assumptions
2023-03-20Auto merge of #108148 - parthopdas:master, r=oli-obkbors-4/+109
Implementing "<test_binary> --list --format json" for use by IDE test explorers / runners Fixes #107307 PR 1 of 2 - wiring up just the new information + implement the command line changes i.e. --format json + tests upcoming: PR 2 of 2 - clean up "#[cfg(not(bootstrap))]" from PR 1 As per the discussions on - MCP: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Implementing.20.22.3Ctest_binary.3E.20--list.20--form.E2.80.A6.20compiler-team.23592/near/328747548 - preRFC: https://internals.rust-lang.org/t/pre-rfc-implementing-test-binary-list-format-json-for-use-by-ide-test-explorers-runners/18308 - FYI on Discord: https://discord.com/channels/442252698964721669/459149169546887178/1075581549409484820
2023-03-19rustdoc: implement bag semantics for function parameter searchMichael Howell-0/+24
This tweak to the function signature search engine makes things so that, if a type is repeated in the search query, it'll only match if the function actually includes it that many times.
2023-03-20fix ClashingExternDeclarations lint ICEDaniPopes-13/+38
2023-03-19Only expect a GAT const argMichael Goulet-0/+29
2023-03-19Add test for footnote references in doc summaryGuillaume Gomez-0/+17
2023-03-19fix: modify the condition that `resolve_imports` stopsbohan-0/+83
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-19fix: fix ICE in `custom-test-frameworks` featureEzra Shaw-0/+25
2023-03-19Delay overlap errors if errors are involvedMichael Goulet-7/+10
2023-03-19Constrain const vars to error if const types are mismatchedMichael Goulet-4/+26
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-18Add test for `c_variadic` in rustdoc-jsonAlona Enraght-Moony-0/+9