rust-lang / rust-lang/rfcs

something to keep code from being unrefactored for long periods of time

Open
#2,281 11 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-lang T-libs
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

I'd like a way for rust to tell the stupid programmer (me) about when their stupid code (my code) can be made less stupid.

More specifically, I'd like something along the lines of:

#[error_if(is_stable(try_from))]
// TODO switch to TryFrom/TryInto once those are stable. (rust-lang/rust#33417)
IrcCommand::Numeric(Numeric(unsafe { from_utf8_unchecked(cmd) }.parse().unwrap(), array_ref![cmd,0,3]))

Currently I have this line somewhere in my codebase, and once TryFrom/TryInto lands, I'll still have that line somewhere in my codebase, because there's no way to make the compiler tell me I can change it. (arrayref crate will probably remain useful until we get const generics.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proposed #[error_if(is_stable(try_from))] example and the referenced rust-lang/rust#33417 issue to understand the desired stability notification. Define the scope and acceptance criteria for a compiler-supported mechanism, including what should happen when the referenced API becomes stable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.