Skip to content

chumsky-0.10.0: the parameter type T may not live long enough #194

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

Closed
lcnr opened this issue May 5, 2025 · 2 comments · Fixed by rust-lang/rust#140672
Closed

chumsky-0.10.0: the parameter type T may not live long enough #194

lcnr opened this issue May 5, 2025 · 2 comments · Fixed by rust-lang/rust#140672
Assignees
Labels
from-crater A regression found via a crater run, not part of our test suite

Comments

@lcnr
Copy link
Contributor

lcnr commented May 5, 2025

[INFO] [stdout] error[E0311]: the parameter type `T` may not live long enough
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/chumsky-0.10.0/src/private.rs:271:49
[INFO] [stdout]     |
[INFO] [stdout] 271 |     fn from_mut<T>(_r: &mut Self::Output<T>) -> Self::Output<&mut T> {}
[INFO] [stdout]     |                        --------------------     ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
[INFO] [stdout]     |                        |
[INFO] [stdout]     |                        the parameter type `T` must be valid for the anonymous lifetime defined here...
[INFO] [stdout]     |
[INFO] [stdout] help: consider adding an explicit lifetime bound
[INFO] [stdout]     |
[INFO] [stdout] 271 |     fn from_mut<'a, T: 'a>(_r: &'a mut Self::Output<T>) -> Self::Output<&'a mut T> {}
[INFO] [stdout]     |                 +++  ++++       ++                                       ++
@lcnr lcnr added the from-crater A regression found via a crater run, not part of our test suite label May 5, 2025
@lcnr lcnr changed the title chumsky: the parameter type T may not live long enough chumsky-0.10.0: the parameter type T may not live long enough May 5, 2025
@compiler-errors
Copy link
Member

compiler-errors commented May 5, 2025

Minimized:

trait Mode {
    type Output<T>;
    fn from_mut<T>(_r: &mut Self::Output<T>) -> Self::Output<&mut T>;
}

struct Check;

impl Mode for Check {
    type Output<T> = ();
    fn from_mut<T>(_r: &mut Self::Output<T>) -> Self::Output<&mut T> {}
}

@compiler-errors compiler-errors self-assigned this May 5, 2025
@lcnr lcnr moved this from unknown to in progress in -Znext-solver=globally May 5, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 5, 2025
…r=lcnr

Deeply normalize in the new solver in WF

We need to deeply normalize types we check for well-formedness, since we only collect implied bounds from normalized signature types.

Fixes rust-lang/trait-system-refactor-initiative#194

r? lcnr
rust-timer added a commit to rust-lang-ci/rust that referenced this issue May 6, 2025
Rollup merge of rust-lang#140672 - compiler-errors:deeply-normalize, r=lcnr

Deeply normalize in the new solver in WF

We need to deeply normalize types we check for well-formedness, since we only collect implied bounds from normalized signature types.

Fixes rust-lang/trait-system-refactor-initiative#194

r? lcnr
@lcnr
Copy link
Contributor Author

lcnr commented May 6, 2025

fixed by rust-lang/rust#140672

@lcnr lcnr moved this from in progress to done in -Znext-solver=globally May 6, 2025
@lcnr lcnr closed this as completed by moving to done in -Znext-solver=globally May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-crater A regression found via a crater run, not part of our test suite
Projects
Development

Successfully merging a pull request may close this issue.

2 participants