Skip to content

Substitute type params in default type params using them.#11982

Merged
bors merged 1 commit intorust-lang:masterfrom
eddyb:generic-default-type-params
Feb 2, 2014
Merged

Substitute type params in default type params using them.#11982
bors merged 1 commit intorust-lang:masterfrom
eddyb:generic-default-type-params

Conversation

@eddyb
Copy link
Copy Markdown
Contributor

@eddyb eddyb commented Feb 2, 2014

Fixes #11964 and closes #8998.

bors added a commit that referenced this pull request Feb 2, 2014
@bors bors closed this Feb 2, 2014
@bors bors merged commit fdf985c into rust-lang:master Feb 2, 2014
@eddyb eddyb deleted the generic-default-type-params branch February 2, 2014 13:33
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 8, 2024
FP: `needless_return_with_question_mark` with implicit Error Conversion

Return with a question mark was triggered in situations where the `?` desuraging was performing error conversion via `Into`/`From`.

The desugared `?` produces a match over an expression with type `std::ops::ControlFlow<B,C>` with `B:Result<Infallible, E:Error>` and `C:Result<_, E':Error>`, and the arms perform the conversion. The patch adds another check in the lint that checks that `E == E'`. If `E == E'`, then the `?` is indeed unnecessary.

changelog: False Positive: [`needless_return_with_question_mark`] when implicit Error Conversion occurs.

fixes: rust-lang#11982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE with phantom types using default type parameters ICE in typeck subst

3 participants