Skip to content

Remove FromResidual param default#147160

Open
camsteffen wants to merge 1 commit intorust-lang:mainfrom
camsteffen:residual-param-default
Open

Remove FromResidual param default#147160
camsteffen wants to merge 1 commit intorust-lang:mainfrom
camsteffen:residual-param-default

Conversation

@camsteffen
Copy link
Contributor

Tracking issue

This resolves a concern that has been raised several times in the tracking issue. I'll summarize the reasons as:

  • Explicitly naming the type is better for readability, both in impl FromResidual instances and in the trait Try definition.
  • The convenience of omitting the type is small.
  • The default value can be difficult to parse when reading the docs.
  • It can be confusing that FromResidual uses Self as Try when it does not depend on Try.

@rustbot
Copy link
Collaborator

rustbot commented Sep 29, 2025

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 29, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@camsteffen camsteffen force-pushed the residual-param-default branch from cbec40f to 8fe7865 Compare September 29, 2025 20:14
@bors
Copy link
Collaborator

bors commented Nov 27, 2025

☔ The latest upstream changes (presumably #149397) made this pull request unmergeable. Please resolve the merge conflicts.

@wesleywiser
Copy link
Member

Hi @scottmcm, I think this is ready for a review when you get a chance. Thanks!

@wesleywiser wesleywiser removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 22, 2026
@RalfJung
Copy link
Member

A reroll seems appropriate after months of not hearing form the reviewer, but OTOH @scottmcm is one of the main people driving the try stuff AFAIK so... it'd really be best if we could hear from him. @scottmcm could you take a look at this?

@scottmcm
Copy link
Member

I still think that if this change does anything useful it's a bug in the type system or its implementation, and thus that it shouldn't be done and that bug should be fixed instead.

But at the same time, it's unstable and because of the bug it's apparently helpful to change the implementations this way, so 🤷 If you really want to do it, go for it.

@camsteffen
Copy link
Contributor Author

I was not aware of possible type system bug related to this. I thought this is more of an ergonomics change to make the feature generally less confusing and more straightforward. See the points in my original post. Comments in the tracking issue along these lines are here, here and here.

Upon searching the comments again, I see there is a comment suggesting there may be a bug here, but I wasn't able to reproduce it in the playground. So maybe that is a bug that's been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants