rust-lang.github.io
...Cargo would search for a token by checking all (index, token) pairs for one that matches the index. To unambiguously find a credential by index URL, Cargo would issue an error if two registries were configured with the same index URL. This approach of finding the credentials by index URL...
RFC 3139
RFC
2021-03-31
~7 min read
rust-lang.github.io
...Struct update syntax could be further generalized by lifting this restriction, so that the only remaining restriction would be that the moved field names and types must match. For example, the following could be allowed:
struct Foo {
field1: &'static str,
field2: i32,
}
struct Bar {
field1: f64,
field2: i32,
}
let foo...
RFC 2528
RFC
2018-08-22
~7 min read
github.com
...Vec<String>,
}
impl OneOf {
pub fn matches(self) -> bool {
// Ok! destructure self
self.of.into_iter().any(|s| s == self.text)
}
pub fn filter(&mut self) {
// Ok! mutate and inspect self
self.of.retain(|s| s != &self.text)
}
}
```
Rust will prevent dangerous double usage:
```rust
struct FirstDuplicated(Vec<String>)
impl...
RFC 2229
RFC
2017-11-28
~7 min read
rust-lang.github.io
...Motivation
Rust currently supports a conservative set of implicit coercions that are used when matching the types of arguments against those given for a function's parameters. For example, if T: Trait then &T is implicitly coerced to &Trait when used as a function argument:
trait MyTrait { ... }
struct MyStruct { ... }
impl...
RFC 241
RFC
2014-09-16
~7 min read
github.com
...In other cases we need to link to a library located at some specific path
or not matching the default naming conventions. \
This RFC introduces modifier `verbatim` to pass such libraries to the linker.
This RFC also reformulates the `static-nobundle` linking kind as a modifier `bundle`
thus providing an...
RFC 2951
RFC
2020-06-12
~7 min read
rust-lang.github.io
...In this sense, visibility is a restriction! The compiler stops you from using a private type, after all. #[non_exhaustive] is also a restriction, as it requires you to have a wildcard arm in a match expression. Both of these are used on a daily basis by countless Rust programmers...
RFC 3323
RFC
2022-10-09
~17 min read
rust-lang.github.io
...195, 191]
"\u0100": "\u0100"
b"\x01\x00": [1, 0]
"\u0100".as_bytes(): [196, 128]
%
Note that the behavior of \xXX on byte-string literals matches the expectations established by the C program in Behavior of xXX in C; that is good. The problem is the behavior of \xXX for XX...
RFC 326
RFC
2014-09-26
~6 min read
rust-lang.github.io
...i32) -> i32 {
let result = panic::recover(|| {
let s = unsafe { CStr::from_ptr(ptr) };
println!("{}: {}", s, num);
});
match result {
Ok(..) => 0,
Err(..) => 1,
}
}
Additionally, if FFI functions instead use normal Rust types, AssertPanicSafe still need not be mentioned at all:
#[no_mangle]
pub extern fn called_from_c(ptr: &i32) -> i32...
RFC 1236
RFC
2015-07-24
~17 min read
github.com
...Cargo would search for a token by checking all (index, token) pairs for one that matches the index. To unambiguously find a credential by index URL, Cargo would issue an error if two registries were configured with the same index URL. This approach of finding the credentials by index URL...
RFC 3139
RFC
2021-03-31
~7 min read
rust-lang.github.io
...This field will not apply to cargo install to match the behavior of resolver.incompatible-rust-versions.
The workspace setting breaks down if there are more than one "application" in a workspace, particularly if there are shared dependencies with intentionally disjoint feature sets. What this use case is really modeling...
RFC 3692
RFC
2024-09-11
~7 min read
rust-lang.github.io
...Prior art
• scoped-tls provides 'scoped thread locals' which must be .set() before using them. (They will panic otherwise.)
Unresolved questions
• Should we use the names with_borrow and with_borrow_mut instead of with_ref and with_mut, to match RefCell's method names?
• Do we also want anything...
RFC 3184
RFC
2021-10-17
~8 min read
rust-lang.github.io
...I <= J if:
•
For any way of instantiating I.vars, there is some way of instantiating J.vars such that the Self type and trait type parameters match up.
•
For this instantiation of I.vars, if you assume I.wc holds, you can prove J.wc.
It turns out that...
RFC 1210
RFC
2015-06-17
~57 min read
github.com
...questions
[unresolved-questions]: #unresolved-questions
- Should we use the names `with_borrow` and `with_borrow_mut` instead of `with_ref` and `with_mut`, to match `RefCell`'s method names?
- Do we also want anything for `UnsafeCell`? Maybe `LocalKey<UnsafeCell<T>>::get()` to get the `*mut T`, just like `UnsafeCell<T...
RFC 3184
RFC
2021-10-17
~8 min read
rust-lang.github.io
...The promotion of aarch64-apple-darwin to Tier 1 cited popularity as the major motivation, matching unpopularity as one of the motivations here.
This is a continuation of MCP 822, which contains some additional details in the description and linked Zulip stream.
Unresolved questions
None so far.
Future possibilities
x86...
RFC 3771
RFC
2025-02-11
~7 min read
rust-lang.github.io
...It has the simplest semantics, and I believe it best matches the user intent when they import an associated function; the desire is to make that function available as-if it were a regular function. Furthermore, it is more minimalist than the other two options in the sense that you...
RFC 3591
RFC
2024-03-19
~8 min read
rust-lang.github.io
...For example,
fn attempt_with_status() -> &'static str {
match do_something() {
Ok(_) => "Success!",
Err(e @ MyError) => e.description(),
}
}
This can be useful when using impl Trait in argument or return position.[^rpitit]
trait Iterable {
fn iter(&self) -> impl Iterator;
}
impl<T> Iterable for MyVec<T> {
#[refine]
fn iter(&self) -> impl...
RFC 3245
RFC
2022-03-22
~18 min read
rust-lang.github.io
...Please note that the narrative here doesn't always match the RFC template so some liberties may have been taken in the expression.
Please also note, by way of wilful disclosure, that this RFC's author is an employee of Arm.
Guide-level explanation
1.
In essence, the target tier...
RFC 2959
RFC
2020-07-17
~8 min read
rust-lang.github.io
...set of drop obligations do not
// match on all incoming control-flow paths.
//
// Predecessor 1 has drop obligations
// {pDD.x, pDS.x, some_d}
// and Predecessor 2 has drop obligations
// { pDD.y, pDS.x, some_d}.
//
// Therefore, this merge point implies that
// {pDD.x, pDD.y} are dynamic drop obligations...
RFC 320
RFC
2014-09-24
~18 min read
rust-lang.github.io
...r? | Design mtg. | | :-- | :-- | :-- | :-- | :-- | | Continue resolving cargo-semver-checks blockers for merging into cargo | ✅ | | | | | Crates.io mirroring | | | *3 | *1 *2 | | Extend pubgrub to match cargo's dependency resolution | ✅ | | | | | Finish the libtest json output experiment | ✅ | | | | | Implement Open API Namespace Support | ✅ | | | | | Prototype a new set of Cargo "plumbing" commands | ✅ | | | | | Rust-for-Linux | ✅ | | | | | Stabilize...
RFC 3764
RFC
2025-01-14
~25 min read
rust-lang.github.io
...Note, however, that since we've moved to into_iter as the method name, the existing convention (MoveItems) needs to be updated to match, and it's not clear how to do better than IntoItems in any case.
•
This naming scheme can result in clashes if multiple containers are defined...
RFC 344
RFC
2014-10-15
~8 min read