- 24 7月, 2014 29 次提交
-
-
由 Adolfo Ochagavía 提交于
Use `string:raw::from_utf8` instead [breaking-change]
-
由 Adolfo Ochagavía 提交于
Replaced by `string::raw::from_utf8` [breaking-change]
-
由 Adolfo Ochagavía 提交于
Use `string::raw::from_buf` instead [breaking-change]
-
由 Adolfo Ochagavía 提交于
This trait was only implemented by `String`. It provided the methods `into_bytes` and `append`, both of which **are already implemented as normal methods** of `String` (not as trait methods). This change improves the consistency of strings. This shouldn't break any code, except if somebody has implemented `OwnedStr` for a user-defined type.
-
由 bors 提交于
Add examples to methods.
-
由 bors 提交于
The allocas used in match expression currently don't get good lifetime markers, in fact they only get lifetime start markers, because their lifetimes don't match to cleanup scopes. While the bindings themselves are bog standard and just need a matching pair of start and end markers, they might need them twice, once for a guard clause and once for the match body. The __llmatch alloca OTOH needs a single lifetime start marker, but when there's a guard clause, it needs two end markers, because its lifetime ends either when the guard doesn't match or after the match body. With these intrinsics in place, LLVM can now, for example, optimize code like this: ````rust enum E { A1(int), A2(int), A3(int), A4(int), } pub fn variants(x: E) { match x { A1(m) => bar(&m), A2(m) => bar(&m), A3(m) => bar(&m), A4(m) => bar(&m), } } ```` To a single call to bar, using only a single stack slot. It still fails to eliminate some of checks. ````gas .Ltmp5: .cfi_def_cfa_offset 16 movb (%rdi), %al testb %al, %al je .LBB3_5 movzbl %al, %eax cmpl $1, %eax je .LBB3_5 cmpl $2, %eax .LBB3_5: movq 8(%rdi), %rax movq %rax, (%rsp) leaq (%rsp), %rdi callq _ZN3bar20hcb7a0d8be8e17e37daaE@PLT popq %rax retq ```` Refs #15665
-
由 Jonas Hietala 提交于
-
由 Jonas Hietala 提交于
-
由 bors 提交于
Tested this on the playground, the range specifies range(0u, 3), so it should be okay to remove this cast.
-
由 bors 提交于
Fixed #15774.
-
由 bors 提交于
Semaphores are not currently designed to handle this case correctly, leading to very strange behavior. Semaphores as written are intended to count *resources* and it's not possible to have a negative number of resources. This alters the behavior and documentation to note that the task will be failed if the initial count is 0. Closes #15758
-
由 bors 提交于
At the moment, writing generic functions for integer types that involve shifting is rather verbose. For example, a function at shifts an integer left by 1 currently requires use std::num::One; fn f<T: Int>(x : T) -> T { x << One::one() } If the shift amount is not 1, it's even worse: use std::num::FromPrimitive; fn f<T: Int + FromPrimitive>(x: T) -> T { x << FromPrimitive::from_int(2).unwrap() } This patch allows the much simpler implementation fn f<T: Int>(x: T) -> T { x << 2 } It accomplishes this by changing the built-in integer types (and the `Int` trait) to implement `Shl<uint, T>` instead of `Shl<T, T>` as it currently is defined. Note that the internal implementations of `shl` already cast the right-hand side to `uint`. `BigInt` also implements `Shl<uint, BigInt>`, so this increases consistency. All of the above applies similarly to right shifts, i.e., `Shr<uint, T>`.
-
由 bors 提交于
This fixes naming conventions for `push`/`pop` from either end of a structure by partially implementing @erickt's suggestion from https://github.com/rust-lang/rust/issues/10852#issuecomment-30823343, namely: * push/pop from the 'back' are called `push` and `pop`. * push/pop from the 'front' are called `push_front` and `pop_front`. * `push`/`pop` are declared on the `MutableSeq` trait. * Implement `MutableSeq` for `Vec`, `DList`, and `RingBuf`. * Add `MutableSeq` to the prelude. I did not make any further refactorings because there is some more extensive thought that needs to be put into the collections traits. This is an easy first step that should close https://github.com/rust-lang/rust/issues/10852. I left the `push_back` and `pop_back` methods on `DList` and `RingBuf` deprecated. Because `MutableSeq` is in the prelude it shouldn't break many, but it is a breaking change.
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
Use insert/remove instead.
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
Implement for Vec, DList, RingBuf. Add MutableSeq to the prelude. Since the collections traits are in the prelude most consumers of these methods will continue to work without change. [breaking-change]
-
由 Jakub Wieczorek 提交于
Fixed #15774.
-
由 bors 提交于
The first commit reverts a similar fix that only solves the `make install` case. This adds the `--enable-dist-host-only` flag to configure to preserve the old behavior, which the nightly bots rely on. The bots will need to be updated soon after this lands (or they will ~double in size). Closes https://github.com/rust-lang/rust/issues/15711
-
由 Brian Anderson 提交于
Closes #15711
-
由 Brian Anderson 提交于
This preserves the current behavior of `make dist` where we only distribute bins for the host architecture. The bots need this.
-
由 bors 提交于
cc #15294
-
- 23 7月, 2014 11 次提交
-
-
由 Björn Steinbrink 提交于
The allocas used in match expression currently don't get good lifetime markers, in fact they only get lifetime start markers, because their lifetimes don't match to cleanup scopes. While the bindings themselves are bog standard and just need a matching pair of start and end markers, they might need them twice, once for a guard clause and once for the match body. The __llmatch alloca OTOH needs a single lifetime start marker, but when there's a guard clause, it needs two end markers, because its lifetime ends either when the guard doesn't match or after the match body. With these intrinsics in place, LLVM can now, for example, optimize code like this: ````rust enum E { A1(int), A2(int), A3(int), A4(int), } pub fn variants(x: E) { match x { A1(m) => bar(&m), A2(m) => bar(&m), A3(m) => bar(&m), A4(m) => bar(&m), } } ```` To a single call to bar, using only a single stack slot. It still fails to eliminate some of checks. ````gas .Ltmp5: .cfi_def_cfa_offset 16 movb (%rdi), %al testb %al, %al je .LBB3_5 movzbl %al, %eax cmpl $1, %eax je .LBB3_5 cmpl $2, %eax .LBB3_5: movq 8(%rdi), %rax movq %rax, (%rsp) leaq (%rsp), %rdi callq _ZN3bar20hcb7a0d8be8e17e37daaE@PLT popq %rax retq ````
-
由 bors 提交于
1. Removed obsolete comment regarding recursive/iteration implementations of tree_find_with/tree_find_mut_with 2. Replaced easy breakable find_with example with simpler one (which only removes redundant allocation during search)
-
由 bors 提交于
-
由 bors 提交于
This removes the special casing for `float`s where it was not necessary, as `-0.0 == 0.0`.
-
由 Valerii Hiora 提交于
1. Removed obsolete comment regarding recursive/iteration implementations of tree_find_with/tree_find_mut_with 2. Replaced easy breakable find_with example with simpler one (which only removes redundant allocation during search)
-
由 bors 提交于
The removed code caused confusion because it is not clear that the type of `y` is actually `()`
-
由 Steven Fackler 提交于
-
由 Cole Mickens 提交于
-
由 bors 提交于
I found these things to be ambiguous, or at least worth stating explicitly to reduce the amount a user/developer needs to think about the API.
-
由 Brian Anderson 提交于
This reverts commit 87334fb0. Conflicts: mk/install.mk
-
由 bors 提交于
Fixes #13041.
-