-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Erroneous compile errors when returning impl trait #140545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
The poor error message in nightly is a variant of #139350. |
This was (accidentally?) fixed in #138785, but without new regression test for this case, AFAICT Originally regressed in nightly-2024-02-06, likely #120556 ? full PR list for 2024-02-06 - 2024-02-04: #120624 (Rollup of 8 pull requests) by matthiaskrgr
- #120484 (Avoid ICE when is_val_statically_known is not of a supported type)
- #120516 (pattern_analysis: cleanup manual impls)
- #120517 (never patterns: It is correct to lower `!` to `_`.)
- #120523 (Improve `io::Read::read_buf_exact` error case)
- #120528 (Store SHOULD_CAPTURE as AtomicU8)
- #120529 (Update data layouts in custom target tests for LLVM 18)
- #120531 (Remove a bunch of `has_errors` checks that have no meaningful or the wrong effect)
- #120533 (Correct paths for hexagon-unknown-none-elf platform doc)
- 2024-02-04: #120649 (Rollup of 8 pull requests) by matthiaskrgr
- #119759 (Add FileCheck annotations to dataflow-const-prop tests)
- #120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types)
- #120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308)
- #120540 (add test for try-block-in-match-arm)
- #120547 (`#![feature(inline_const_pat)]` is no longer incomplete)
- #120552 (Correctly check `never_type` feature gating)
- #120555 (put pnkfelix (me) back on the review queue.)
- #120556 (Improve the diagnostics for unused generic parameters)
- 2024-02-05: #120497 (Move predicate, region, and const stuff into their own modules in middle) by compiler-errors
- 2024-02-05: #120508 (Update cargo) by weihanglo
- 2024-02-05: #120660 (Rollup of 9 pull requests) by matthiaskrgr
- #119481 (Clarify ambiguity in select_nth_unstable docs)
- #119600 (Remove outdated references to librustc_middle)
- #120458 (Document `&CStr` to `CString` conversion)
- #120569 (coverage: Improve handling of function/closure spans)
- #120572 (Update libc to 0.2.153)
- #120587 (miri: normalize struct tail in ABI compat check)
- #120607 (fix #120603 by adding a check in default_read_buf)
- #120636 (Subtree update of `rust-analyzer`)
- #120641 (rustdoc: trait.impl, type.impl: sort impls to make it not depend on serialization order)
- 2024-02-05: #120671 (Rollup of 8 pull requests) by matthiaskrgr
- #113833 (`std::error::Error` -> Trait Implementations: lifetimes consistency improvement)
- #115386 (PartialEq, PartialOrd: update and synchronize handling of transitive chains)
- #116284 (make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern)
- #118960 (Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc.)
- #120384 (Use `<T, U>` for array/slice equality `impl`s)
- #120518 (riscv only supports split_debuginfo=off for now)
- #120657 (Remove unused struct)
- #120661 (target: default to the medium code model on LoongArch targets)
- 2024-02-05: #117372 (Update stdarch submodule) by Amanieu
- 2024-02-05: #120313 (pattern_analysis: Gracefully abort on type incompatibility) by Nadrieril @rustbot label: +E-needs-test -E-needs-bisection -needs-triage |
moxian
added a commit
to moxian/rust
that referenced
this issue
May 1, 2025
moxian
added a commit
to moxian/rust
that referenced
this issue
May 2, 2025
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
May 3, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#139343 (Change signature of File::try_lock and File::try_lock_shared) - rust-lang#140505 (linker: Quote symbol names in .def files) - rust-lang#140534 (PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef…) - rust-lang#140546 (Remove backtrace dep from anyhow in features status dump tool) - rust-lang#140548 (Emit user type annotations for free consts in pattern position) - rust-lang#140564 (Use present indicative tense in std::io::pipe() API docs) - rust-lang#140568 (Add regression test for rust-lang#140545) - rust-lang#140606 (Improve hir pretty printing) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
May 3, 2025
Rollup merge of rust-lang#140568 - moxian:reg-140545, r=compiler-errors Add regression test for rust-lang#140545 Closes rust-lang#140545 I am not very knowledgable about the typesystem internals, so I couldn't come up with a good name for the test. But I'm happy to move it to a more appropriate place if there is one (`tests/ui/impl-trait/non-defining-uses` maybe?) r? types (or reroll as appropriate if this is not actually a T-types issue; i'm clueless)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
more examples on the playground
Meta
Triggers ICE on stable, beta, and nightly 1.87.
On nightly 1.88 no ICE but a strange compile error instead
rustc --version --verbose
:Error output
nightly:
Backtrace
The text was updated successfully, but these errors were encountered: