| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
r? @catamorphism
|
|
This makes the `trim` and `substr` functions return a slice instead of an `~str`, and removes the unnecessary `Trimmable` trait (`StrSlice` already contains the same functionality).
Also moves the `ToStr` implementations for the three str types into the str module in anticipation of further untangling.
|
|
|
|
|
|
contain non-Owned fields. r=nmatsakis
|
|
Adds an assert_eq! macro that asserts that its two arguments are equal. Error messages can therefore be somewhat more informative than a simple assert, because the error message includes "expected" and "given" values.
|
|
|
|
temporary renamed them to better track use-sites
|
|
slice_unique
|
|
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method -> slice_V_DBG_BRWD
|
|
|
|
|
|
the assert_eq! macro compares its arguments and fails if they're not
equal. It's more informative than fail_unless!, because it explicitly
writes the given and expected arguments on failure.
|
|
This is the first step in refactoring the deriving code in libsyntax. No code is changed, just rearranged.
|
|
and the fn_ctxt doesn't need any self_info field at all.
Step towards fixing `fn(&self)` (cc #4846) to have a distinct
lifetime.
|
|
Removes a lot of instances of `/*bad*/ copy` throughout libsyntax/librustc. On the plus side, this shaves about 2s off of the runtime when compiling `librustc` with optimizations.
Ideally I would have run a profiler to figure out which copies are the most critical to remove, but in reality there was a liberal amount of `git grep`s along with some spot checking and removing the easy ones.
|
|
r? @graydon
|
|
|
|
|
|
|
|
This would close #2761. I figured that if you're supplying your own custom message, you probably don't mind the stringification of the condition to not be in the message.
|
|
|
|
|
|
|
|
This starts moving a bunch of privacy checks into the privacy
checking phase and out of resolve.
|
|
r=pcwalton
(this will be needed for snapshotting at some point)
r? @pcwalton
|
|
|
|
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399
|
|
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399
Signed-off-by: Luca Bruno <lucab@debian.org>
|
|
|
|
|
|
|
|
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.
There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
|
|
declarations.
|
|
notation. rs=delifetiming
|
|
(this will be needed for snapshotting at some point).
|
|
|
|
|
|
Continuation of #5317. Actually use operands properly now, including any number of output operands.
Which means you can do things like call printf:
```Rust
fn main() {
unsafe {
do str::as_c_str(~"The answer is %d.\n") |c| {
let a = 42;
asm!("mov $0, %rdi\n\t\
mov $1, %rsi\n\t\
xorl %eax, %eax\n\t\
call _printf"
:
: "r"(c), "r"(a)
: "rdi", "rsi", "eax"
: "volatile","alignstack"
);
}
}
}
```
```
% rustc foo.rs
% ./foo
The answer is 42.
```
Or just add 2 numbers:
```Rust
fn add(a: int, b: int) -> int {
let mut c = 0;
unsafe {
asm!("add $2, $0"
: "=r"(c)
: "0"(a), "r"(b)
);
}
c
}
fn main() {
io::println(fmt!("%d", add(1, 2)));
}
```
```
% rustc foo.rs
% ./foo
3
```
Multiple outputs!
```Rust
fn addsub(a: int, b: int) -> (int, int) {
let mut c = 0;
let mut d = 0;
unsafe {
asm!("add $4, $0\n\t\
sub $4, $1"
: "=r"(c), "=r"(d)
: "0"(a), "1"(a), "r"(b)
);
}
(c, d)
}
fn main() {
io::println(fmt!("%?", addsub(5, 1)));
}
```
```
% rustc foo.rs
% ./foo
(6, 4)
```
This also classifies inline asm as RvalueStmtExpr instead of the somewhat arbitrary kind I made it initially. There are a few XXX's regarding what to do in the liveness and move passes.
|
|
Also turn `copy` into `.clone()` in much of run-pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Before this change, encoding an object containing a codemap::span
using the JSON encodeng produced invalid JSON, for instance:
[{"span":,"global":false,"idents":["abc"]}]
Since the decoder for codemap::span's ignores its argument, I
conjecture that this will not damage decoding, and should improve
it for many decoders.
|