about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-22Rollup merge of #109358 - petrochenkov:nosess, r=cjgillotMatthias Krüger-87/+5
rustc: Remove unused `Session` argument from some attribute functions (One auxiliary test file containing one of these functions was unused, so I removed it instead of updating.)
2023-03-22Rollup merge of #109213 - oli-obk:cstore, r=cjgillotMatthias Krüger-1/+1
Eagerly intern and check CrateNum/StableCrateId collisions r? ``@cjgillot`` It seems better to check things ahead of time than checking them afterwards. The [previous version](https://github.com/rust-lang/rust/pull/108390) was a bit nonsensical, so this addresses the feedback
2023-03-22Rollup merge of #109203 - Ezrashaw:refactor-ident-parsing, r=NilstriebMatthias Krüger-30/+109
refactor/feat: refactor identifier parsing a bit \+ error recovery for `expected_ident_found` Prior art: #108854
2023-03-22Rollup merge of #108954 - notriddle:notriddle/notable-trait-generic, r=camelidMatthias Krüger-0/+41
rustdoc: handle generics better when matching notable traits This commit makes the `clean::Type::is_same` non-commutative (renaming it `is_doc_subtype_of`), so that a generic `impl` matches a concrete return, but a generic return does not match a concrete `impl`. It makes slice and vector Write for `u8` not match on every generic return value. Fixes #100322 Fixes #55082 Preview: * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/vec/struct.Vec.html#method.new * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/vec/struct.Vec.html#method.from-12 * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/iter/trait.Iterator.html#method.intersperse_with * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/string/struct.String.html#method.as_bytes
2023-03-23Rollup merge of #109435 - oli-obk:🇨🇭🥚_copy_op, r=RalfJungDylan DPC-28/+26
Detect uninhabited types early in const eval r? `@RalfJung` implements https://github.com/rust-lang/rust/pull/108442#discussion_r1143003840 this is a breaking change, as some UB during const eval is now detected instead of silently being ignored. Users can see this and other UB that may cause future breakage with `-Zextra-const-ub-checks` or just by running miri on their code, which sets that flag by default.
2023-03-23Rollup merge of #109414 - spastorino:new-rpitit-16, r=compiler-errorsDylan DPC-3/+27
Do not consider synthesized RPITITs on missing items checks Without this patch for `tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs` we get ... ``` warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:4:12 | 4 | #![feature(return_position_impl_trait_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[E0046]: not all trait items implemented, missing: `foo`, `` --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:12:1 | 8 | fn foo(&self) -> impl Sized; | ---------------------------- | | | | | `` from trait | `foo` from trait ... 12 | impl MyTrait for i32 { | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `` in implementation error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0046`. ``` instead of ... ``` warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12 | LL | #![feature(return_position_impl_trait_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[E0046]: not all trait items implemented, missing: `foo` --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1 | LL | fn foo(&self) -> impl Sized; | ---------------------------- `foo` from trait ... LL | impl MyTrait for i32 { | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0046`. ``` r? `@compiler-errors`
2023-03-23Rollup merge of #109405 - compiler-errors:rpitit-as-opaques, r=spastorinoDylan DPC-0/+2
RPITITs are `DefKind::Opaque` with new lowering strategy r? `@spastorino` Kinda cherry-picked #109400
2023-03-23Rollup merge of #109312 - petrochenkov:docice5, r=GuillaumeGomezDylan DPC-0/+11
rustdoc: Cleanup parent module tracking for doc links Keep ids of the documented items themselves, not their parent modules. Parent modules can be retreived from those ids when necessary. Fixes https://github.com/rust-lang/rust/issues/108501. That issue could be fixed in a more local way, but this refactoring is something that I wanted to do since https://github.com/rust-lang/rust/pull/93805 anyway.
2023-03-23Rollup merge of #109179 - llogiq:intrinsically-option-as-slice, r=eholkDylan DPC-0/+63
move Option::as_slice to intrinsic ````@scottmcm```` suggested on #109095 I use a direct approach of unpacking the operation in MIR lowering, so here's the implementation. cc ````@nikic```` as this should hopefully unblock #107224 (though perhaps other changes to the prior implementation, which I left for bootstrapping, are needed).
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-87/+5
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-21Always encode RPITITsSantiago Pastorino-0/+2
2023-03-21Do not consider synthesized RPITITs on missing items checksSantiago Pastorino-3/+27
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-21rustdoc: Cleanup parent module tracking for doc linksVadim Petrochenkov-0/+11
Keep ids of the documented items themselves, not their parent modules. Parent modules can be retreived from those ids when necessary.
2023-03-21Eagerly intern and check CrateNum/StableCrateId collisionsOli Scherer-1/+1
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-21Detect uninhabited types early in const eval.Oli Scherer-28/+26
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-20feat: implement error recovery in `expected_ident_found`Ezra Shaw-33/+96
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.