about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-22Delay bug to deduplicate diagnosticsMichael Goulet-11/+1
2022-11-22Check generics parity between impl and trait before collecting RPITITsMichael Goulet-0/+39
2022-11-22Auto merge of #104696 - matthiaskrgr:rollup-gi1pdb0, r=matthiaskrgrbors-20/+124
Rollup of 11 pull requests Successful merges: - #103396 (Pin::new_unchecked: discuss pinning closure captures) - #104416 (Fix using `include_bytes` in pattern position) - #104557 (Add a test case for async dyn* traits) - #104559 (Split `MacArgs` in two.) - #104597 (Probe + better error messsage for `need_migrate_deref_output_trait_object`) - #104656 (Move tests) - #104657 (Do not check transmute if has non region infer) - #104663 (rustdoc: factor out common button CSS) - #104666 (Migrate alias search result to CSS variables) - #104674 (Make negative_impl and negative_impl_exists take the right types) - #104692 (Update test's cfg-if dependency to 1.0) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-22Rollup merge of #104666 - GuillaumeGomez:migrate-alias-search-result, ↵Matthias Krüger-17/+36
r=notriddle Migrate alias search result to CSS variables r? `@notriddle`
2022-11-22Rollup merge of #104663 - notriddle:notriddle/button-cursor, r=GuillaumeGomezMatthias Krüger-0/+24
rustdoc: factor out common button CSS
2022-11-22Rollup merge of #104657 - hi-rustin:rustin-patch-check-transmute, ↵Matthias Krüger-0/+19
r=compiler-errors Do not check transmute if has non region infer close https://github.com/rust-lang/rust/issues/104609 See: https://github.com/rust-lang/rust/issues/104609#issuecomment-1320956351 r? `@compiler-errors`
2022-11-22Rollup merge of #104656 - c410-f3r:moar-errors, r=petrochenkovMatthias Krüger-0/+0
Move tests r? `@petrochenkov`
2022-11-22Rollup merge of #104597 - ↵Matthias Krüger-2/+2
compiler-errors:need_migrate_deref_output_trait_object-msg, r=eholk Probe + better error messsage for `need_migrate_deref_output_trait_object` 1. Use `InferCtxt::probe` in `need_migrate_deref_output_trait_object` -- that normalization *could* technically do type inference as a side-effect, and this is a lint, so it should have no side-effects. 2. Return the trait-ref so we format the error message correctly. See the UI test change -- `(dyn A + 'static)` is not a trait.
2022-11-22Rollup merge of #104557 - eholk:dyn-star-in-traits, r=compiler-errorsMatthias Krüger-0/+36
Add a test case for async dyn* traits This adds a test case that approximates async functions in dyn traits using `dyn*`. The purpose is to have an example of where we are with `dyn*` and the goal of using it for dyn traits. Issue #102425 r? `@compiler-errors`
2022-11-22Rollup merge of #104416 - clubby789:fix-104414, r=eholkMatthias Krüger-1/+7
Fix using `include_bytes` in pattern position Fix #104414
2022-11-21Auto merge of #104533 - oli-obk:method_callee, r=lcnrbors-0/+26
Clean up and harden various methods around trait substs r? `@lcnr`
2022-11-21Simplify testOli Scherer-3/+1
Co-authored-by: lcnr <rust@lcnr.de>
2022-11-21Fix an ICE that I just made worseOli Scherer-0/+28
2022-11-21Add more regression testsOli Scherer-0/+117
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-294/+122
2022-11-21Auto merge of #104120 - mejrs:diag, r=davidtwcobors-132/+167
Match and enforce crate and slug names Some of these were in the wrong place or had a name that didn't match.
2022-11-21Coercions work nowEric Holk-1/+1
2022-11-21Add a test case for async dyn* traitsEric Holk-0/+36
2022-11-21Test generalization during coherenceOli Scherer-0/+13
2022-11-21nit treat different opaque typesOli Scherer-2/+1
2022-11-21rustdoc: add test case for pointer cursorMichael Howell-0/+24
2022-11-21Treat different opaque types of the same def id as equal during coherenceOli Scherer-0/+64
2022-11-21Allow opaque types in trait impl headers and rely on coherence to reject ↵Oli Scherer-160/+216
unsound cases
2022-11-21Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgrbors-23/+28
Rollup of 9 pull requests Successful merges: - #104420 (Fix doc example for `wrapping_abs`) - #104499 (rustdoc JSON: Use `Function` everywhere and remove `Method`) - #104500 (`rustc_ast`: remove `ref` patterns) - #104511 (Mark functions created for `raw-dylib` on x86 with DllImport storage class) - #104595 (Add `PolyExistentialPredicate` type alias) - #104605 (deduplicate constant evaluation in cranelift backend) - #104628 (Revert "Update CI to use Android NDK r25b") - #104662 (Streamline deriving on packed structs.) - #104667 (Revert formatting changes of a test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-21Fix make testmejrs-3/+3
2022-11-21Improve slug name errormejrs-0/+35
2022-11-21Fix testsmejrs-129/+129
2022-11-21Rollup merge of #104667 - WaffleLapkin:unfmttest, r=Dylan-DPCMatthias Krüger-5/+5
Revert formatting changes of a test See https://github.com/rust-lang/rust/pull/99935/files#r1027259119 cc ``@CAD97``
2022-11-21Rollup merge of #104662 - nnethercote:tweak-deriving-for-packed-non-copy, ↵Matthias Krüger-17/+6
r=jackh726 Streamline deriving on packed structs. The current approach to field accesses in derived code: - Normal case: `&self.0` - In a packed struct that derives `Copy`: `&{self.0}` - In a packed struct that doesn't derive `Copy`: `let Self(ref x) = *self` The `let` pattern used in the third case is equivalent to the simpler field access in the first case. This commit changes the third case to use a field access. The commit also combines two boolean arguments (`is_packed` and `always_copy`) into a single field (`copy_fields`) earlier, to save passing both around. r? ``@jackh726``
2022-11-21Rollup merge of #104511 - dpaoliello:privateglobalworkaround, r=michaelwoeristerMatthias Krüger-0/+16
Mark functions created for `raw-dylib` on x86 with DllImport storage class Fix for #104453 ## Issue Details On x86 Windows, LLVM uses 'L' as the prefix for any private global symbols (`PrivateGlobalPrefix`), so when the `raw-dylib` feature creates an undecorated function symbol that begins with an 'L' LLVM misinterprets that as a private global symbol that it created and so fails the compilation at a later stage since such a symbol must have a definition. ## Fix Details Mark the function we are creating for `raw-dylib` with `DllImport` storage class (this was already being done for MSVC at a later point for `callee::get_fn` but not for GNU (due to "backwards compatibility")): this will cause LLVM to prefix the name with `__imp_` and so it won't mistake it for a private global symbol.
2022-11-21Rollup merge of #104499 - Enselic:no-method-in-rustdoc-json, r=GuillaumeGomezMatthias Krüger-1/+1
rustdoc JSON: Use `Function` everywhere and remove `Method` Closes #100259
2022-11-21Auto merge of #103491 - cjgillot:self-rpit, r=oli-obkbors-79/+230
Support using `Self` or projections inside an RPIT/async fn I reuse the same idea as https://github.com/rust-lang/rust/pull/103449 to use variances to encode whether a lifetime parameter is captured by impl-trait. The current implementation of async and RPIT replace all lifetimes from the parent generics by `'static`. This PR changes the scheme ```rust impl<'a> Foo<'a> { fn foo<'b, T>() -> impl Into<Self> + 'b { ... } } opaque Foo::<'_a>::foo::<'_b, T>::opaque<'b>: Into<Foo<'_a>> + 'b; impl<'a> Foo<'a> { // OLD fn foo<'b, T>() -> Foo::<'static>::foo::<'static, T>::opaque::<'b> { ... } ^^^^^^^ the `Self` becomes `Foo<'static>` // NEW fn foo<'b, T>() -> Foo::<'a>::foo::<'b, T>::opaque::<'b> { ... } ^^ the `Self` stays `Foo<'a>` } ``` There is the same issue with projections. In the example, substitute `Self` by `<T as Trait<'b>>::Assoc` in the sugared version, and `Foo<'_a>` by `<T as Trait<'_b>>::Assoc` in the desugared one. This allows to support `Self` in impl-trait, since we do not replace lifetimes by `'static` any more. The same trick allows to use projections like `T::Assoc` where `Self` is allowed. The feature is gated behind a `impl_trait_projections` feature gate. The implementation relies on 2 tweaking rules for opaques in 2 places: - we only relate substs that correspond to captured lifetimes during TypeRelation; - we only list captured lifetimes in choice region computation. For simplicity, I encoded the "capturedness" of lifetimes as a variance, `Bivariant` vs `Invariant` for unused vs captured lifetimes. The `variances_of` query used to ICE for opaques. Impl-trait that do not reference `Self` or projections will have their variances as: - `o` (invariant) for each parent type or const; - `*` (bivariant) for each parent lifetime --> will not participate in borrowck; - `o` (invariant) for each own lifetime. Impl-trait that does reference `Self` and/or projections will have some parent lifetimes marked as `o` (as the example above), and participate in type relation and borrowck. In the example above, `variances_of(opaque) = ['_a: o, '_b: *, T: o, 'b: o]`. r? types cc `@compiler-errors` , as you asked about the issue with `Self` and projections.
2022-11-21Only declare bindings for if-let guards once per armLéo Lanteri Thauvin-0/+7
2022-11-21Revert formatting changes of a testMaybe Waffle-5/+5
2022-11-21Extend GUI test for alias search resultGuillaume Gomez-17/+36
2022-11-21Auto merge of #103454 - camsteffen:remove-conservatively-uninhabited, r=oli-obkbors-3/+3
Factor out `conservative_is_privately_uninhabited` After #102660 there is no more need for `conservative_is_privately_uninhabited`. r? `@oli-obk`
2022-11-21Streamline deriving on packed structs.Nicholas Nethercote-17/+6
The current approach to field accesses in derived code: - Normal case: `&self.0` - In a packed struct that derives `Copy`: `&{self.0}` - In a packed struct that doesn't derive `Copy`: `let Self(ref x) = *self` The `let` pattern used in the third case is equivalent to the simpler field access in the first case. This commit changes the third case to use a field access. The commit also combines two boolean arguments (`is_packed` and `always_copy`) into a single field (`copy_fields`) earlier, to save passing both around.
2022-11-21Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisabors-0/+39
Pass 128-bit C-style enum enumerator values to LLVM Pass the full 128 bits of C-style enum enumerators through to LLVM. This means that debuginfo for C-style repr128 enums is now emitted correctly for DWARF platforms (as compared to not being correctly emitted on any platform). Tracking issue: #56071
2022-11-20Factor out conservative_is_privately_uninhabitedCameron Steffen-2/+2
2022-11-20Change to Ty::is_inhabited_fromCameron Steffen-1/+1
2022-11-21Do not check transmute if has non region inferhi-rustin-0/+19
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-20Move testsCaio-0/+0
2022-11-20Rollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebankMatthias Krüger-19/+65
Add a detailed note for missing comma typo w/ FRU syntax Thanks to `@pierwill` for working on this with me! Fixes #104373, perhaps `@alice-i-cecile` can comment on the new error for the example provided on that issue -- feedback is welcome. ``` error[E0063]: missing field `defaulted` in initializer of `Outer` --> $DIR/multi-line-fru-suggestion.rs:14:5 | LL | Outer { | ^^^^^ missing `defaulted` | note: this expression may have been misinterpreted as a `..` range expression --> $DIR/multi-line-fru-suggestion.rs:16:16 | LL | inner: Inner { | ________________^ LL | | a: 1, LL | | b: 2, LL | | } | |_________^ this expression does not end in a comma... LL | ..Default::default() | ^^^^^^^^^^^^^^^^^^^^ ... so this is interpreted as a `..` range expression, instead of functional record update syntax help: to set the remaining fields from `Default::default()`, separate the last named field with a comma | LL | }, | + error: aborting due to previous error For more information about this error, try `rustc --explain E0063`. ```
2022-11-20Rollup merge of #104640 - GuillaumeGomez:migrate-kdb-css, r=notriddleMatthias Krüger-0/+38
Migrate kdb style to CSS variables r? `@notriddle`
2022-11-20Rollup merge of #104611 - notriddle:notriddle/scrape-examples-button, ↵Matthias Krüger-1/+62
r=GuillaumeGomez rustdoc: use real buttons for scrape examples controls This makes the expand and switch controls keyboard-accessible. Preview: https://notriddle.com/notriddle-rustdoc-demos/scrape-examples-button/test_dingus/fn.test.html
2022-11-20Update VecDeque implementationMarkus Everling-1/+1
2022-11-20Extend GUI tests to check kbd colorsGuillaume Gomez-0/+38
2022-11-20Auto merge of #103390 - compiler-errors:metadata-mod-regions, r=eholkbors-0/+17
Check fat pointer metadata compatibility modulo regions Regions don't really mean anything anyways during hir typeck. If this `erase_regions` makes anyone nervous, it's probably equally valid to just equate the types using a type relation, but regardless we should _not_ be using strict type equality while region variables are present. Fixes #103384
2022-11-20Auto merge of #98914 - fee1-dead-contrib:min-deref-patterns, r=compiler-errorsbors-0/+151
Minimal implementation of implicit deref patterns for Strings cc `@compiler-errors` `@BoxyUwU` https://github.com/rust-lang/lang-team/issues/88 #87121 ~~I forgot to add a feature gate, will do so in a minute~~ Done
2022-11-20Rollup merge of #104467 - ↵Yuki Okushi-0/+45
fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compiler-errors Fix substraction with overflow in `wrong_number_of_generic_args.rs` Fixes #104287 This issue happens in the `suggest_moving_args_from_assoc_fn_to_trait_for_qualified_path` function, which seems to run before the error checking facilities can catch an invalid use of generic arguments. Thus we get a subtraction with overflow because the code implicitly assumes that the source program makes sense (or is this assumption not true even if the program is correct?).