about summary refs log tree commit diff
path: root/src/test/ui/rfc-2632-const-trait-impl
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-3040/+0
2022-12-28Allow trait method paths to satisfy const Fn boundsDeadbeef-0/+61
2022-12-15fix tidy and add rpitit testDeadbeef-2/+23
2022-12-15Allow `impl ~const Trait` opaque typesDeadbeef-51/+36
2022-12-11Point at method call when it is the source of the bound errorEsteban Küber-24/+12
2022-12-04Add regression test for #79450Yuki Okushi-0/+32
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-11-14Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwcoMatthias Krüger-1/+1
Don't print full paths in overlap errors We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message. r? diagnostics
2022-11-12Rollup merge of #102049 - fee1-dead-contrib:derive_const, r=oli-obkDylan DPC-0/+61
Add the `#[derive_const]` attribute Closes #102371. This is a minimal patchset for the attribute to work. There are no restrictions on what traits this attribute applies to. r? `````@oli-obk`````
2022-11-10Oops, bless this test.Ben Reeves-1/+1
2022-11-10Apply PR feedback.Ben Reeves-1/+1
2022-11-10Require `~const` qualifier on trait bounds in specializing impls if present ↵Ben Reeves-8/+94
in base impl.
2022-11-10Add #[const_trait] where needed in tests.Ben Reeves-1/+10
2022-11-10Disallow specializing on const impls with non-const impls.Ben Reeves-76/+20
2022-11-10Allow specialized const trait impls.Ben Reeves-0/+242
Fixes #95186. Fixes #95187.
2022-11-10Don't print full paths in overlap errorsMichael Goulet-1/+1
2022-10-28Retain ParamEnv constness when running deferred cast checksDeadbeef-0/+5
Fixes #103677.
2022-10-27Rollup merge of #103525 - oli-obk:const_impl_on_non_const_trait, r=lcnrMatthias Krüger-12/+12
Move a wf-check into the site where the value is instantiated r? ``@lcnr``
2022-10-26Auto merge of #103284 - compiler-errors:const-sad, r=oli-obkbors-3/+19
Revert "Unify tcx.constness and param env constness checks" Too much of a perf regression https://github.com/rust-lang/rust/pull/102975#issuecomment-1282702513, and an attempt in #103263 didn't fix it except for just a tiny bit. This change isn't really needed (see https://github.com/rust-lang/rust/pull/102830#issuecomment-1272514096), so this should be an easy revert.
2022-10-25Move a wf-check into the site where the value is instantiatedOli Scherer-12/+12
2022-10-23Rollup merge of #103328 - compiler-errors:trivial-false-const-sugg, r=jackh726Matthias Krüger-33/+0
Do not suggest trivially false const predicates Pass through constness to `predicate_can_apply` and don't suggest other impls if it's satisfied but not const. Fixes #103267
2022-10-21Require Drop impls to have the same constness on its bounds as the bounds on ↵Oli Scherer-46/+115
the struct have
2022-10-20Do not suggest trivially false const predicatesMichael Goulet-33/+0
2022-10-20Improve "`~const` is not allowed here" messageDeadbeef-5/+42
2022-10-20Bless testMichael Goulet-3/+19
2022-10-13Delay intrinsic call until after we've determined the callee is a functionMichael Goulet-0/+37
2022-10-04Merge the `~const` and `impl const` checks and add some explanatory notesOli Scherer-17/+10
2022-10-04Only allow ~const bounds for traits with #[const_trait]Oli Scherer-75/+178
2022-09-27Fix ICE in const_trait check codeDeadbeef-0/+34
This fixes #102156.
2022-09-27rustc_typeck to rustc_hir_analysislcnr-1/+1
2022-09-26Rollup merge of #102273 - woppopo:relax_const_bound, r=fee1-deadMatthias Krüger-28/+40
Allow `~const` bounds on non-const functions Makes the behavior of bound of trait-associated functions and non-associated functions consistent.
2022-09-26Allow `~const` bounds on non-const functionswoppopo-28/+40
2022-09-24added testsDeadbeef-0/+84
2022-09-22Auto merge of #100982 - fee1-dead-contrib:const-impl-requires-const-trait, ↵bors-91/+188
r=oli-obk Require `#[const_trait]` on `Trait` for `impl const Trait` r? `@oli-obk`
2022-09-21Make error messages great again (and fix clippy and add test)Deadbeef-0/+12
2022-09-20Add the `#[derive_const]` attributeDeadbeef-0/+61
2022-09-18make projection bounds with const bounds satisfy constDeadbeef-0/+14
2022-09-16do const trait method bounds check later in rustc_const_evalDeadbeef-63/+89
2022-09-16bless testsDeadbeef-28/+64
2022-09-16Add testDeadbeef-0/+23
2022-08-22Rollup merge of #100336 - fee1-dead-contrib:fix-wf-const-trait, r=oli-obkDylan DPC-0/+29
Fix two const_trait_impl issues r? ``@oli-obk`` Fixes #100222. Fixes #100543.
2022-08-22fix tidyDeadbeef-1/+3
2022-08-22Overhaul 100222 test; wf always remap to nonconstDeadbeef-4/+17
2022-08-22Fix wf check on `#[const_trait]` return typesDeadbeef-0/+14
2022-08-22Rollup merge of #99915 - WaffleLapkin:recover_keyword_bounds, r=compiler-errorsDylan DPC-3/+5
Recover keywords in trait bounds (_this pr was inspired by [this tweet](https://twitter.com/Azumanga/status/1552982326409367561)_) Recover keywords in trait bound, motivational example: ```rust fn f(_: impl fn()) {} // mistyped, meant `Fn` ``` <details><summary>Current nightly (3 needless and confusing errors!)</summary> <p> ```text error: expected identifier, found keyword `fn` --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | ^^ expected identifier, found keyword | help: escape `fn` to use it as an identifier | 1 | fn _f(_: impl r#fn()) {} | ++ error: expected one of `:` or `|`, found `)` --> ./t.rs:1:19 | 1 | fn _f(_: impl fn()) {} | ^ expected one of `:` or `|` error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found keyword `fn` --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | -^^ expected one of 9 possible tokens | | | help: missing `,` error: at least one trait must be specified --> ./t.rs:1:10 | 1 | fn _f(_: impl fn()) {} | ^^^^ ``` </p> </details> This PR: ```text error: expected identifier, found keyword `fn` --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | ^^ expected identifier, found keyword | help: escape `fn` to use it as an identifier | 1 | fn _f(_: impl r#fn()) {} | ++ error[E0405]: cannot find trait `r#fn` in this scope --> ./t.rs:1:15 | 1 | fn _f(_: impl fn()) {} | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn` | ::: /home/waffle/projects/repos/rust/library/core/src/ops/function.rs:74:1 | 74 | pub trait Fn<Args>: FnMut<Args> { | ------------------------------- similarly named trait `Fn` defined here ``` It would be nice to have suggestion in the first error like "have you meant `Fn` trait", instead of a separate error, but the recovery is deep inside ident parsing, which makes it a lot harder to do. r? `@compiler-errors`
2022-08-21recover `const Tr` bounds (no `~`)Maybe Waffle-11/+6
2022-08-21Adjust messages, address some nitsMichael Goulet-4/+4
2022-08-21Account for relative pathsMichael Goulet-6/+6
2022-08-21Rework point-at-argMichael Goulet-16/+24
2022-08-18Reword "Required because of the requirements on the impl of ..."Andy Wang-4/+4
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-1/+1