Skip to content

proposal for deprecation of error code E0313 #103742

Closed
@bindsdev

Description

@bindsdev

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions