| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2024-11-22 | Auto merge of #130867 - michirakara:steps_between, r=dtolnay | bors | -1/+1 | |
| distinguish overflow and unimplemented in Step::steps_between | ||||
| 2024-11-21 | distinguish overflow and unimplemented in Step::steps_between | michirakara | -1/+1 | |
| 2024-11-18 | Check use<..> in RPITIT for refinement | Michael Goulet | -0/+88 | |
| 2024-11-15 | Rollup merge of #133080 - ehuss:edition-desugar-span, r=compiler-errors | Guillaume Gomez | -0/+75 | |
| Fix span edition for 2024 RPIT coming from an external macro This fixes a problem where code generated by an external macro with an RPIT would end up using the call-site edition instead of the macro's edition for the RPIT. When used from a 2024 crate, this caused the code to change behavior to the 2024 capturing rules, which we don't want. This was caused by the impl-trait lowering code would replace the span with one marked with `DesugaringKind::OpaqueTy` desugaring. However, it was also overriding the edition of the span with the edition of the local crate. Instead it should be using the edition of the span itself. Fixes https://github.com/rust-lang/rust/issues/132917 | ||||
| 2024-11-15 | Fix span edition for 2024 RPIT coming from an external macro | Eric Huss | -93/+1 | |
| This fixes a problem where code generated by an external macro with an RPIT would end up using the call-site edition instead of the macro's edition for the RPIT. When used from a 2024 crate, this caused the code to change behavior to the 2024 capturing rules, which we don't want. This was caused by the impl-trait lowering code would replace the span with one marked with `DesugaringKind::OpaqueTy` desugaring. However, it was also overriding the edition of the span with the edition of the local crate. Instead it should be using the edition of the span itself. Fixes https://github.com/rust-lang/rust/issues/132917 | ||||
| 2024-11-15 | Rollup merge of #132817 - compiler-errors:impl-trait-overcaptures-apit, ↵ | Matthias Krüger | -16/+45 | |
| r=BoxyUwU Recurse into APITs in `impl_trait_overcaptures` We were previously not detecting cases where an RPIT was located in the return type of an async function, leading to underfiring of the `impl_trait_overcaptures`. This PR does this recursion properly now. cc https://github.com/rust-lang/rust/issues/132809 | ||||
| 2024-11-15 | Add test for precise-capturing from an external macro | Eric Huss | -0/+167 | |
| 2024-11-12 | Make precise capturing suggestion machine-applicable only if it has not APITs | Michael Goulet | -0/+52 | |
| 2024-11-11 | Recurse into APITs in impl_trait_overcaptures | Michael Goulet | -16/+45 | |
| 2024-11-09 | Dont suggest use<APIT> | Michael Goulet | -12/+61 | |
| 2024-11-09 | Suggest turning APITs into generics in opaque overcaptures | Michael Goulet | -1/+65 | |
| 2024-11-06 | Add --diagnostic-width to some tests failing after 1a0c5021838 | Hans Wennborg | -4/+5 | |
| Otherwise the tests would fail depending on the execution environment. | ||||
| 2024-11-02 | Auto merge of #132147 - estebank:long-types-2, r=davidtwco | bors | -21/+51 | |
| Tweak E0277 output when a candidate is available *Follow up to #132086.* Go from ``` error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ the trait `chumsky::private::ParserSealed<'_, &str, (), chumsky::extra::Full<EmptyErr, (), ()>>` is not implemented for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>`, which is required by `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` | = help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>` = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt' = note: consider using `--verbose` to print the full type name to the console ``` to ``` error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied --> src/main.rs:7:50 | 7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> { | ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound ... 11 | ws.then(parser.map(|_| ())) | --------------------------- return type was inferred to be `Then<Ignored<..., ...>, ..., ..., ..., ...>` here | = help: the trait `ParserSealed<'_, &_, (), Full<_, _, _>>` is not implemented for `Then<Ignored<..., ...>, ..., ..., ..., ...>` but trait `ParserSealed<'_, &'a _, ((), ()), Full<_, _, _>>` is implemented for it = help: for that trait implementation, expected `((), ())`, found `()` = note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>` note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>` --> src/main.rs:5:16 | 5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {} | ^^^^^^^^^^^^^^^^ ^ ---------------------- unsatisfied trait bound introduced here = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-df9d52be87eada65.long-type-1337037744507305372.txt' = note: consider using `--verbose` to print the full type name to the console ``` * Remove redundant wording * Introduce trait diff highlighting logic and use it * Fix incorrect "long type written to path" logic (can be split off) * Point at tail expression in more cases in E0277 * Avoid long primary span labels in E0277 by moving them to a `help` Fix #132013. There are individual commits that can be their own PR. If the review load is too big, happy to split them off. | ||||
| 2024-11-02 | Point at tail expression on rpit E0277 | Esteban Küber | -15/+38 | |
| ``` error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}: Coroutine` is not satisfied --> $DIR/gen_block_is_coro.rs:6:13 | LL | fn foo() -> impl Coroutine<Yield = u32, Return = ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` LL | gen { yield 42 } | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` here ``` The secondary span label is new. | ||||
| 2024-11-02 | Add trait diff highlighting logic and use it in E0277 | Esteban Küber | -18/+25 | |
| When a trait is not implemented for a type, but there *is* an `impl` for another type or different trait params, we format the output to use highlighting in the same way that E0308 does for types. The logic accounts for 3 cases: - When both the type and trait in the expected predicate and the candidate are different - When only the types are different - When only the trait generic params are different For each case, we use slightly different formatting and wording. | ||||
| 2024-11-01 | Use more minimized test. | Camille GILLOT | -38/+6 | |
| 2024-11-01 | Account for late-bound depth when capturing all opaque lifetimes. | Camille GILLOT | -0/+45 | |
| 2024-10-31 | Rollup merge of #132209 - compiler-errors:modifiers, r=fmease | Jubilee | -25/+9 | |
| Fix validation when lowering `?` trait bounds Pass the unlowered (`rustc_hir`) polarity to `lower_poly_trait_ref`. This allows us to actually *validate* that generic args are actually valid on `?Trait` paths. This actually regressed in #113671 because that PR changed the behavior where we were inadvertently re-lowering paths as `BoundPolarity::Positive`, which was also coincidentally the only place we were enforcing the generics on `?Trait` paths were correct. | ||||
| 2024-10-31 | Auto merge of #131186 - compiler-errors:precise-capturing-borrowck, r=estebank | bors | -0/+521 | |
| Try to point out when edition 2024 lifetime capture rules cause borrowck issues Lifetime capture rules in 2024 are modified to capture more lifetimes, which sometimes lead to some non-local borrowck errors. This PR attempts to link these back together with a useful note pointing out the capture rule changes. This is not a blocking concern, but I'd appreciate feedback (though, again, I'd like to stress that I don't want to block this PR on this): I'm worried about this note drowning in the sea of other diagnostics that borrowck emits. I was tempted to change the level of the note to `.span_warn` just so it would show up in a different color. Thoughts? Fixes #130545 Opening as a draft first since it's stacked on #131183. r? `@ghost` | ||||
| 2024-10-31 | Try to point out when edition 2024 lifetime capture rules cause borrowck issues | Michael Goulet | -0/+521 | |
| 2024-10-31 | Auto merge of #132377 - matthiaskrgr:rollup-3p1c6hs, r=matthiaskrgr | bors | -0/+13 | |
| Rollup of 3 pull requests Successful merges: - #132368 (Remove `do_not_const_check` from `Iterator` methods) - #132373 (Make sure `type_param_predicates` resolves correctly for RPITIT) - #132374 (Remove dead code stemming from the old effects desugaring) r? `@ghost` `@rustbot` modify labels: rollup | ||||
| 2024-10-30 | Actually do validation for poly trait refs with ? modifier | Michael Goulet | -25/+9 | |
| 2024-10-30 | Make sure type_param_predicates resolves correctly for RPITIT | Michael Goulet | -0/+13 | |
| 2024-10-30 | Actually capture all in-scope lifetimes. | Camille GILLOT | -5/+14 | |
| 2024-10-30 | Promote crashes tests to ui. | Camille GILLOT | -0/+48 | |
| 2024-10-30 | Remap impl-trait lifetimes on HIR instead of AST lowering. | Camille GILLOT | -20/+11 | |
| 2024-10-29 | Remove detail from label/note that is already available in other note | Esteban Küber | -15/+15 | |
| Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` | ||||
| 2024-10-28 | Rollup merge of #132227 - compiler-errors:better-const-span, r=Nadrieril | 许杰友 Jieyou Xu (Joe) | -8/+8 | |
| Pass constness with span into lower_poly_trait_ref Gives us a span to point at for ~const/const on non-const traits. Split from #132209. r? Nadrieril | ||||
| 2024-10-28 | Rollup merge of #132086 - estebank:long-types, r=jieyouxu | 许杰友 Jieyou Xu (Joe) | -0/+82 | |
| Tweak E0277 highlighting and "long type" path printing Partially address #132013.  | ||||
| 2024-10-27 | Rollup merge of #132214 - fmease:mv-impl-trait-val-paths, r=compiler-errors | Matthias Krüger | -64/+58 | |
| Cleanup: Move an impl-Trait check from AST validation to AST lowering Namely the one that rejects `impl Trait` in qself types and non-final path segments. There's no good reason to perform this during AST validation. We have better infrastructure in place in the AST lowerer (`ImplTraitContext`). This shaves off a lot of code. We now lower `impl Trait` in bad positions to `{type error}` which allows us to remove a special case from HIR ty lowering. Coincidentally fixes #126725. Well, it only *masks* it by passing `{type error}` to HIR analysis instead of a "bad" opaque. I was able to find a new reproducer for it. See the issue. | ||||
| 2024-10-27 | Move an impl-Trait check from AST validation to AST lowering | León Orell Valerian Liehr | -64/+58 | |
| 2024-10-26 | Pass constness with span into lower_poly_trait_ref | Michael Goulet | -8/+8 | |
| 2024-10-26 | Deny calls to non-`#[const_trait]` methods in MIR constck | Deadbeef | -4/+0 | |
| 2024-10-25 | Tweak highlighting when trait is available for different type | Esteban Küber | -2/+2 | |
| When printing ``` = help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>` = help: for that trait implementation, expected `((), ())`, found `()` ``` Highlight only the `expected` and `found` types, instead of the full type in the first `help`. | ||||
| 2024-10-25 | Add test for #132013 | Esteban Küber | -0/+82 | |
| 2024-10-24 | Implement const effect predicate in new solver | Michael Goulet | -1/+17 | |
| 2024-10-19 | Rollup merge of #131795 - compiler-errors:expectation, r=Nadrieril | Matthias Krüger | -10/+10 | |
| Stop inverting expectation in normalization errors We have some funky special case logic to invert the expectation and actual type for normalization errors depending on their cause code. IMO most of the error messages get better, except for `try {}` blocks' type expectations. I think that these need to be special cased in some other way, rather than via this hack. Fixes #131763 | ||||
| 2024-10-19 | Make sure that outer opaques capture inner opaques's lifetimes even with ↵ | Michael Goulet | -0/+37 | |
| precise capturing syntax | ||||
| 2024-10-17 | Allow dropping dyn principal | Michael Goulet | -30/+4 | |
| 2024-10-16 | Auto merge of #131797 - matthiaskrgr:rollup-lzpze2k, r=matthiaskrgr | bors | -0/+12 | |
| Rollup of 9 pull requests Successful merges: - #130989 (Don't check unsize goal in MIR validation when opaques remain) - #131657 (Rustfmt `for<'a> async` correctly) - #131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated) - #131730 (Refactor some `core::fmt` macros) - #131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe) - #131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`) - #131776 (Emscripten: Xfail backtrace ui tests) - #131777 (Fix trivially_copy_pass_by_ref in stable_mir) - #131778 (Fix needless_lifetimes in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup | ||||
| 2024-10-16 | Stop inverting expectation in normalization errors | Michael Goulet | -10/+10 | |
| 2024-10-15 | Don't check unsize goal in MIR validation when opaques remain | Michael Goulet | -0/+12 | |
| 2024-10-15 | Register a dummy candidate for failed structural normalization during ↵ | Michael Goulet | -50/+7 | |
| candiate assembly | ||||
| 2024-10-15 | Be better at reporting alias errors | Michael Goulet | -141/+75 | |
| 2024-10-15 | Make sure the alias is actually rigid | Michael Goulet | -58/+166 | |
| 2024-10-15 | stabilize `-Znext-solver=coherence` | lcnr | -14/+20 | |
| 2024-10-11 | Don't assume traits used as type are trait objs | VulnBandit | -13/+5 | |
| 2024-10-10 | Rollup merge of #131475 - fmease:compiler-mv-obj-safe-dyn-compat-2, r=jieyouxu | Matthias Krüger | -71/+72 | |
| Compiler & its UI tests: Rename remaining occurrences of "object safe" to "dyn compatible" Follow-up to #130826. Part of #130852. 1. 1st commit: Fix stupid oversights. Should've been part of #130826. 2. 2nd commit: Rename the unstable feature `object_safe_for_dispatch` to `dyn_compatible_for_dispatch`. Might not be worth the churn, you decide. 3. 3rd commit: Apply the renaming to all UI tests (contents and paths). | ||||
| 2024-10-10 | Clarify implicit captures for RPITIT | Michael Goulet | -2/+2 | |
| 2024-10-10 | Add variances to RPITITs | Michael Goulet | -162/+177 | |
