- 05 12月, 2014 2 次提交
-
-
由 bors 提交于
On *BSD systems, we can `open(2)` a directory and directly `read(2)` from it due to an old tradition. We should avoid doing so by explicitly calling `fstat(2)` to check the type of the opened file. Opening a directory as a module file can't always be avoided. Even when there's no "path" attribute trick involved, there can always be a *directory* named `my_module.rs`. Incidentally, remove unnecessary mutability of `&self` from `io::fs::File::stat()`.
-
由 bors 提交于
This continues the work @thestinger started in #18885 (which hasn't landed yet, so wait for that to land before landing this one). Instead of adding more methods to `BufReader`, this just allows a `&[u8]` to be used directly as a `Reader`. It also adds an impl of `Writer` for `&mut [u8]`.
-
- 04 12月, 2014 25 次提交
-
-
由 Erick Tryzelaar 提交于
-
由 bors 提交于
This closes #19168. Please be careful reviewing this since this gets used all over the place. I've tested all the options and everything appears to be working though.
-
由 bors 提交于
Comparison traits have gained an `Rhs` input parameter that defaults to `Self`. And now the comparison operators can be overloaded to work between different types. In particular, this PR allows the following operations (and their commutative versions): - `&str` == `String` == `CowString` - `&[A]` == `&mut [B]` == `Vec<C>` == `CowVec<D>` == `[E, ..N]` (for `N` up to 32) - `&mut A` == `&B` (for `Sized` `A` and `B`) Where `A`, `B`, `C`, `D`, `E` may be different types that implement `PartialEq`. For example, these comparisons are now valid: `string == "foo"`, and `vec_of_strings == ["Hello", "world"]`. [breaking-change]s Since the `==` may now work on different types, operations that relied on the old "same type restriction" to drive type inference, will need to be type annotated. These are the most common fallout cases: - `some_vec == some_iter.collect()`: `collect` needs to be type annotated: `collect::<Vec<_>>()` - `slice == &[a, b, c]`: RHS doesn't get coerced to an slice, use an array instead `[a, b, c]` - `lhs == []`: Change expression to `lhs.is_empty()` - `lhs == some_generic_function()`: Type annotate the RHS as necessary cc #19148 r? @aturon
-
由 bors 提交于
Implement the `Fn` trait for bare fn pointers in the compiler rather than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
Implement the `Fn` trait for bare fn pointers in the compiler rather than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions. Fixes #19126.
-
由 bors 提交于
This is a work in progress, but this should get *extensive* review, so I'm putting it up early and often. This is the start of a draft of the new 'ownership guide,' which explains ownership, borrowing, etc. I'm feeling better about this framing than last time's, but we'll see.
-
由 NODA, Kai 提交于
On *BSD systems, we can open(2) a directory and directly read(2) from it due to an old tradition. We should avoid doing so by explicitly calling fstat(2) to check the type of the opened file. Opening a directory as a module file can't always be avoided. Even when there's no "path" attribute trick involved, there can always be a *directory* named "my_module.rs". Fix #12460 Signed-off-by: NNODA, Kai <nodakai@gmail.com>
-
由 NODA, Kai 提交于
The same goes for sys::fs::FileDesc::fstat() on Windows. Signed-off-by: NNODA, Kai <nodakai@gmail.com>
-
由 bors 提交于
Part of enforcing capacity-related conventions, for #18424, the collections reform. Implements `fn shrink_to_fit` for HashMap. The `reserve` method now takes as an argument the *extra* space to reserve.
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
This closes #19168. It's possible that if the downloading of `rustup.sh` is interrupted, bad things could happen, such as running a naked "rm -rf /" instead of "rm -rf /path/to/tmpdir". This wraps rustup.sh's functionality in a function that gets called at the last time that should protect us from these truncation errors.
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 bors 提交于
Treat builtin bounds like all other kinds of trait matches. Introduce a simple hashset in the fulfillment context to catch cases where we register the exact same obligation twice. This helps prevent duplicate error reports but also handles the recursive obligations created by builtin bounds. r? @pcwalton cc @FlaPer87
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 Erick Tryzelaar 提交于
-
由 bors 提交于
I don't have enough time to investigate this thoroughly, so for now let's get the queue moving by ignoring this test. cc #19501
-
由 Alex Crichton 提交于
I don't have enough time to investigate this thoroughly, so for now let's get the queue moving by ignoring this test. cc #19501
-
- 03 12月, 2014 12 次提交
-
-
由 Jorge Aparicio 提交于
-
由 Jorge Aparicio 提交于
-
由 Jorge Aparicio 提交于
-
由 Jorge Aparicio 提交于
-
由 Jorge Aparicio 提交于
- String == &str == CowString - Vec == &[T] == &mut [T] == [T, ..N] == CowVec - InternedString == &str
-
由 Steve Klabnik 提交于
This replaces the previous "Lifetimes guide," since we are discussing things from an owernship perspective now.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
now don't print duplicate errors within one context, so I sometimes had to break functions into two functions.
-
由 Niko Matsakis 提交于
Treat builtin bounds like all other kinds of trait matches. Introduce a simple hashset in the fulfillment context to catch cases where we register the exact same obligation twice. This helps prevent duplicate error reports but also handles the recursive obligations created by builtin bounds.
-
由 Jorge Aparicio 提交于
-
由 Jorge Aparicio 提交于
-
由 bors 提交于
-
- 02 12月, 2014 1 次提交
-
-
由 Steve Klabnik 提交于
-