rust-lang.github.io
...operator will follow Deref impls to try to find a matching function. This can lead to really confusing compiler errors, or code "spuriously compiling" but doing something unexpected because there was an unexpected match somewhere in the Deref chain. This is why many of Rc's operations are static functions...
RFC 1966
RFC
2015-08-01
~8 min read
rust-lang.github.io
...across all binaries
• Noisy test output (see also #5089)
• Confusing command-line interactions (see also #8903, #10392)
• Poor messaging when a filter doesn't match
• Smarter test execution order (see also #8685, #10673)
• JUnit output is incorrect when running multiple test binaries
• Lack of failure when test binaries exit unexpectedly...
RFC 3558
RFC
2024-01-18
~4 min read
rust-lang.github.io
...Similarly, the published Cargo.toml will not explicitly declare any dependencies that match the implicit state. builtin dependencies that do match the implicit state could be made explicit in a future edition.
See the following sections for rationale/alternatives:
• Why add standard library crates to Cargo's index?
• Why add...
RFC 3875
RFC
2025-06-05
~31 min read
rust-lang.github.io
...Users who need such a feature will need to write (or generate) big match statements and hope they optimize well (this has been servo's approach).
2. Directly stabilize the discriminant_value intrinsic, or a wrapper that doesn't use an opaque newtype. This more drastically precludes future enum representation...
RFC 1696
RFC
2016-08-01
~4 min read
rust-lang.github.io
...However, this increasingly seems like a strange decision, as it does not comport with the support for 32-bit Windows that Microsoft offers, nor does it match actual ongoing usage of i686-pc-windows-msvc as a target.
In October of 2025, Microsoft's general support for Windows 10 concluded...
RFC 3999
RFC
2026-07-02
~9 min read
rust-lang.github.io
...A nice side-effect is that we inherit the diagnostics for normal pattern-matching, so users benefit from existing diagnostics for destructuring declarations.
Nested structures may be destructured, for instance:
let (a, b, c);
((a, b), c) = ((1, 2), 3);
// desugars to:
let (a, b, c);
{
let ((_a, _b), _c...
RFC 2909
RFC
2020-04-17
~10 min read
rust-lang.github.io
...Today, an attribute can look like:
• name,
• name(`TokenStream`)
• name = `TokenTree`
where TokenStream is a sequence of tokens that only has the restriction that delimiters match and TokenTree is a single identifier, literal, punctuation mark, or a delimited TokenStream.
With this RFC accepted, the following cannot ever be parsed as...
RFC 2539
RFC
2018-09-10
~4 min read
rust-lang.github.io
...fn print_lines() -> impl Future<Item = (), Error = io::Error> {
CoroutineToFuture(|| {
let addr = "127.0.0.1:8080".parse().unwrap();
let tcp = {
let mut future = TcpStream::connect(&addr);
loop {
match future.poll() {
Ok(Async::Ready(e)) => break Ok(e),
Ok(Async::NotReady) => yield,
Err(e) => break Err(e),
}
}
}?;
let io = BufReader...
RFC 2033
RFC
2017-06-15
~16 min read
rust-lang.github.io
...fn read_exact(&mut self, mut buf: &mut [u8]) -> Result<()> {
while !buf.is_empty() {
match self.read(buf) {
Ok(0) => break,
Ok(n) => { let tmp = buf; buf = &mut tmp[n..]; }
Err(ref e) if e.kind() == ErrorKind::Interrupted => {}
Err(e) => return Err(e),
}
}
if !buf.is_empty() {
Err(Error::new...
RFC 980
RFC
2015-03-15
~10 min read
rust-lang.github.io
...This RFC proposes we include both Future and IntoFuture to match.
Guide-level explanation
In Rust 2024, you can name and make use of the Future and IntoFuture traits without explicitly importing them, since they appear in the Rust 2024 prelude. For instance, you can write a function that accepts...
RFC 3509
RFC
2023-10-05
~4 min read
rust-lang.github.io
...There is ambiguity: $($x:ident)?+ today matches a?b?c and not a+. Fortunately this is easy to resolve: you just look one more token ahead and always treat ?* and ?+ to mean separate by the question mark token.
Drawbacks
While there are grammar ambiguities, they can be easily fixed.
Also...
RFC 2298
RFC
2018-01-17
~4 min read
rust-lang.github.io
...grep -r "//[!/]" --binary-files=without-match --include=*.rs . | wc -l
• Find the number of lines in the README file, if specified in Cargo.toml
• Find the number of lines in Rust files: find . -name '*.rs' | xargs wc -l
We would then add the lines in the README to the lines...
RFC 1824
RFC
2016-12-19
~23 min read
rust-lang.github.io
...Unresolved questions
• It is likely best to simply match the semantics of C/C++ in the regard of custom alignment, but is it ensured that this RFC is the same as the behavior of standard C compilers?
RFC 1358
RFC
2015-11-09
~4 min read
rust-lang.github.io
...FnOnce(&T) -> bool
{
match self {
Some(x) => {
if predicate(&x) {
Some(x)
} else {
None
}
}
None => None,
}
}
}
Drawbacks
It increases the size of the standard library by a tiny bit.
Rationale and Alternatives
• Don't do anything.
Unresolved questions
Maybe filter() wouldn't be used a lot.
The feature proposed in...
RFC 2124
RFC
2017-08-21
~4 min read
rust-lang.github.io
...A silver lining here is that nothing is added to the current module namespace, so the shadowing bugs demonstrated in the next bullet point do not apply here. (To locate this bug in the code, find the match immediately following the FIXME (#3785) comment in resolve.rs.) This leads to...
RFC 155
RFC
2014-07-04
~4 min read
rust-lang.github.io
...Option<String>) {
let y = match x.as_ref() {
Some(s) => todo!(),
None => todo!(),
};
println!("{y}"); // <- this code would no longer be marked unreachable
}
/* in `other_crate`:
macro_rules! macro_containing_todo! {
{ $x:expr } => {
println!("{x:?}");
todo!();
}
}
*/
fn test_external(x: Result<String, std::io::Error>) {
let y = other_crate::macro...
RFC 3928
RFC
2026-01-31
~4 min read
rust-lang.github.io
...For the most part, these paths match up with user's intuitions. So a struct Foo declared in a module bar would just have a path like bar::Foo. However, the paths are also able to express things for which there is no syntax, such as an item declared within...
RFC 1298
RFC
2015-08-04
~23 min read
rust-lang.github.io
...However, this introduces an unnecessary level of indirection that does not match the developer's intuition and mental model as well as it could. In particular, given the ability to write bounds on a type variable as T: Bounds, it makes sense to permit writing bounds on an associated type...
RFC 2289
RFC
2018-01-13
~4 min read
rust-lang.github.io
...usize) -> Option<(Self, usize)> {
let padded_size = match self.size.checked_add(self.padding_needed_for(self.align)) {
None => return None,
Some(padded_size) => padded_size,
};
let alloc_size = match padded_size.checked_mul(n) {
None => return None,
Some(alloc_size) => alloc_size,
};
Some((Layout::from_size_align(alloc_size...
RFC 1398
RFC
2015-12-01
~62 min read
rust-lang.github.io
...The update will fail if a matching version can't be found, since the required features aren't available.
Package authors that want to support versions of Cargo older than 1.51 may want to avoid using the new feature syntax.
Internal resolver changes
Internally, Cargo will switch to always...
RFC 3143
RFC
2021-06-10
~11 min read