Skip to content
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

proposal for deprecation of error code E0313 #103742

Closed
bindsdev opened this issue Oct 29, 2022 · 3 comments · Fixed by #106580
Closed

proposal for deprecation of error code E0313 #103742

bindsdev opened this issue Oct 29, 2022 · 3 comments · Fixed by #106580
Assignees

Comments

@bindsdev
Copy link
Contributor

bindsdev commented Oct 29, 2022

This issue is a proposal for the deprecation of error code E0313.

Background

I opened a PR (#103433) as part of an effort to add long error explanations for error codes that didn't have one (#61137). I chose E0313 and for my erroneous code example, I used the example from #42574. I quickly realized, through running the example and other code that would also raise E0313 and through the CI failure message, that E0313 was not being raised. I went back to consult the issue I received the original code example from and noticed comments about E0313 not occurring anymore with NLL. The issue was eventually labeled with NLL-fixed-by-NLL. But, looking at the current contents of the note.rs file, E0313 can still be emitted even while it isn't:

infer::ReborrowUpvar(span, ref upvar_id) => {
    let var_name = self.tcx.hir().name(upvar_id.var_path.hir_id);
    let mut err = struct_span_err!(
        self.tcx.sess,
        span,
        E0313,
        "lifetime of borrowed pointer outlives lifetime of captured variable `​{}`​...",
        var_name
    );

E0313 also doesn't have any UI tests as it is part of the error codes in EXEMPTED_FROM_TEST.

Reasoning

Since E0313, is no longer actually emitted (although it is in code that it could) thanks to NLL, I believe it should be deprecated.

I would be happy to help deprecate the error code, if it is decided that it should happen. I would just need to know the proper steps to take to deprecate an error code. If there are reasons for why it is still an error code, I would love to be enlightened.

@rustbot claim

@bindsdev bindsdev changed the title deprecation of error code E0313 proposal for deprecation of error code E0313 Oct 29, 2022
@Ezrashaw
Copy link
Contributor

Ezrashaw commented Jan 6, 2023

If E0313 is not emitted anymore then it can be removed immediately. A crater run can also be done to ensure that this is the case. I'm also happy to do this if you want.

@bindsdev
Copy link
Contributor Author

bindsdev commented Jan 6, 2023

If E0313 is not emitted anymore then it can be removed immediately. A crater run can also be done to ensure that this is the case. I'm also happy to do this if you want.

Sure, that sounds good.

@Ezrashaw
Copy link
Contributor

Ezrashaw commented Jan 7, 2023

@akabinds Sorry just for clarification, do you want me to do the PR or you?

JohnTitor pushed a commit to JohnTitor/rust that referenced this issue Jan 8, 2023
…errors

remove unreachable error code `E0313`

Fixes rust-lang#103742
Makes rust-lang#103433 redundant

Implements removal of `E0313`. I agree with the linked issue that this error code is unreachable but if someone could confirm that would be great, are crater runs done for this sort of thing?

Also removed a redundant `// ignore-tidy-filelength` that I found while reading code.

cc `@GuillaumeGomez` rust-lang#61137
@bors bors closed this as completed in 6459a51 Jan 8, 2023
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 a pull request may close this issue.

2 participants